:root {
  --ink: #111;
  --accent: #e03131;
  --paper: #fffdf7;
  --muted: #6b6b6b;
  --border: 6px;
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 900px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 32px; border-bottom: var(--border) solid var(--ink);
}
.topbar h1 { margin: 0; font-size: 28px; color: var(--accent); }
.badge {
  background: #ffe066; border: 3px solid var(--ink); border-radius: 999px;
  padding: 2px 12px; font-weight: 600;
}

main { max-width: 1100px; margin: 32px auto; padding: 0 32px; }

.row { display: flex; gap: 24px; margin-bottom: 24px; }
.row > * { flex: 1; }
.col { display: flex; flex-direction: column; }
.col > .row { flex: 0 0 auto; }
.grow { flex: 1; }

.box { border: var(--border) solid var(--ink); background: #fff; }

/* Form fields */
.field { display: flex; flex-direction: column; padding: 12px 16px; gap: 6px; }
.label { color: var(--accent); font-weight: 700; font-size: 20px; }
.hint { color: var(--muted); font-size: 14px; }
.center { text-align: center; }

input, select, textarea {
  font: inherit; font-size: 20px; border: none; outline: none; background: transparent;
  color: var(--ink); padding: 4px 0;
}
select { cursor: pointer; }
textarea { resize: none; flex: 1; min-height: 140px; }
.field:focus-within { outline: 4px solid var(--accent); outline-offset: 2px; }

/* Image box (square) */
.image-box {
  flex: 0 0 360px; width: 360px; height: 360px;
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  background-image:
    linear-gradient(45deg, #f1f1f1 25%, transparent 25%),
    linear-gradient(-45deg, #f1f1f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f1f1 75%),
    linear-gradient(-45deg, transparent 75%, #f1f1f1 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.image-box:focus-visible, .image-box.dragging { outline: 4px dashed var(--accent); outline-offset: 4px; }
.image-box.result { cursor: default; }
.image-box img {
  width: 288px; height: 288px; object-fit: contain;
  image-rendering: pixelated;   /* show the real 96x96 result, scaled up */
}
.drop-text {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 24px; pointer-events: none;
}
.drop-text strong { color: var(--accent); font-size: 26px; }
.drop-text span { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-size: 20px; font-weight: 700;
  padding: 12px 28px; border: var(--border) solid var(--ink); background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; box-shadow: 6px 6px 0 var(--ink);
  transition: transform .05s, box-shadow .05s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.small { font-size: 16px; padding: 6px 16px; box-shadow: 4px 4px 0 var(--ink); }

.error {
  color: var(--accent); font-weight: 600; background: #fff0f0;
  border: 3px solid var(--accent); padding: 10px 14px; margin: 0 0 24px;
}

/* Created view */
.fullname {
  padding: 20px 28px; margin-bottom: 24px; text-align: center;
  font-size: 40px; font-weight: 700; color: var(--accent);
}
.stats { padding: 20px 28px; }
.created-msg { font-size: 20px; margin-top: 0; }
.stats dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; font-size: 24px; }
.stats dt { color: var(--accent); font-weight: 700; }
.stats dd { margin: 0; }
.actions { display: flex; gap: 24px; }

/* Stream page */
.stream-wrap { max-width: 1280px; }
.player { aspect-ratio: 16 / 9; width: 100%; display: flex; align-items: center; justify-content: center; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player .error { margin: 24px; }

.draw-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  flex: 0 0 auto;
  width: fit-content;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  align-self: flex-start;
}

#draw-canvas {
  display: block;
  width: 288px;                 /* 3x the 96px canvas */
  height: 288px;
  max-width: 100%;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
  border-radius: 8px;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 288px;
  max-width: 100%;
}

/* Tool buttons: inherit your page's font and text color */
.draw-box .tool {
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  padding: 4px 10px;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: #f59919;
  cursor: pointer;
  flex: 1 0 auto;
  box-shadow: none;
  transition: background 0.1s, transform 0.05s;
}
.draw-box .tool:hover { background: rgba(0, 0, 0, 0.08); }
.draw-box .tool:active { transform: translateY(1px); }

/* Selected tool (Pen/Eraser) */
.draw-box .tool.primary {
  background: currentColor;
}
.draw-box .tool.primary {
  color: inherit;
}
.draw-box .tool.primary {
  background: #ffd54a;          /* highlight color: change to match your theme */
  color: #222;
}

.toolbar input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.toolbar input[type="range"] {
  flex: 1 1 80px;
  accent-color: currentColor;
}