/* Roman's Animal Jungle */
[hidden] { display: none !important; }
:root {
  --jungle-900: #0f2a0c;
  --jungle-800: #173c12;
  --jungle-700: #1f5418;
  --leaf: #3f8f2a;
  --leaf-light: #7cc142;
  --lime: #b5e15a;
  --parchment: #f6ead0;
  --parchment-dark: #e8d5aa;
  --bark: #6b3f1f;
  --bark-dark: #4a2a13;
  --bark-light: #9a6236;
  --monkey: #a0582a;
  --elephant: #8e97a6;
  --ear: #ea8f9a;
  --sun: #ffc93c;
  --red: #e5483b;
  --blue: #2f7fe0;
  --ink: #2a1a0c;
  --white: #fffdf7;
  --radius: 22px;
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --pixel: "Press Start 2P", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--jungle-800);
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(181, 225, 90, .22), transparent 55%),
    radial-gradient(ellipse at 100% 110%, rgba(63, 143, 42, .35), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23ffffff' fill-opacity='.035'%3E%3Cpath d='M30 20c18 4 30 20 26 40-18-4-30-20-26-40z'/%3E%3Cpath d='M118 90c-20 0-34 14-34 34 20 0 34-14 34-34z'/%3E%3Cpath d='M120 10c6 12 2 26-10 32-6-12-2-26 10-32z'/%3E%3Cpath d='M20 110c14 2 22 14 20 28-14-2-22-14-20-28z'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; user-select: text; -webkit-user-select: text; }
img { max-width: 100%; display: block; }

#app { min-height: 100vh; padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 28px); max-width: 1100px; margin: 0 auto; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back {
  width: 58px; height: 58px; flex: none; border: none; border-radius: 18px;
  background: var(--bark); color: var(--parchment); font-size: 28px;
  box-shadow: inset 0 -5px 0 var(--bark-dark), 0 4px 0 rgba(0,0,0,.25);
  display: grid; place-items: center;
}
.back:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--bark-dark); }
.page-title {
  margin: 0; color: var(--parchment); font-weight: 700; font-size: clamp(26px, 5vw, 40px);
  text-shadow: 0 3px 0 var(--jungle-900); letter-spacing: .3px; line-height: 1.05; flex: 1;
}
.page-title small { display: block; font-size: .45em; font-weight: 500; color: var(--lime); text-shadow: none; letter-spacing: .5px; margin-top: 2px; }

/* ---------- Home ---------- */
.home-hero { display: flex; align-items: center; gap: 20px; margin: 6px 0 22px; }
.home-hero img { width: clamp(96px, 20vw, 150px); border-radius: 28%; box-shadow: 0 10px 24px rgba(0,0,0,.4); animation: bob 4s ease-in-out infinite; }
.home-hero h1 { margin: 0; color: var(--parchment); font-size: clamp(32px, 7vw, 60px); line-height: .95; text-shadow: 0 4px 0 var(--jungle-900); }
.home-hero h1 span { color: var(--lime); display: block; font-size: .58em; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }

.magic {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  background: rgba(0,0,0,.25); color: var(--parchment); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 15px; font-weight: 500;
}
.magic-bar { width: 90px; height: 10px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.magic-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--lime)); border-radius: 6px; transition: width .6s; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tiles .tile:last-child { grid-column: 1 / -1; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  position: relative; border: none; text-align: left; padding: 22px 22px 20px 128px; min-height: 140px;
  border-radius: var(--radius); color: var(--parchment);
  background: linear-gradient(180deg, var(--bark-light), var(--bark) 55%);
  box-shadow: inset 0 -8px 0 var(--bark-dark), inset 0 2px 0 rgba(255,255,255,.25), 0 8px 0 rgba(0,0,0,.25);
  transition: transform .12s;
  overflow: hidden;
}
.tile::before { /* wood grain */
  content: ""; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background: repeating-linear-gradient(175deg, transparent 0 18px, rgba(0,0,0,.5) 18px 20px, transparent 20px 34px);
}
.tile::after { /* vine */
  content: "🌿"; position: absolute; right: -6px; top: -10px; font-size: 44px; transform: rotate(160deg); opacity: .9;
}
.tile:active { transform: translateY(5px) scale(.99); box-shadow: inset 0 -3px 0 var(--bark-dark), 0 3px 0 rgba(0,0,0,.25); }
.tile .ico {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 94px; height: 94px; border-radius: 26px; display: grid; place-items: center; font-size: 56px;
  background: var(--parchment); box-shadow: inset 0 -5px 0 var(--parchment-dark);
}
.tile h2 { margin: 4px 0 6px; font-size: 27px; font-weight: 700; text-shadow: 0 2px 0 var(--bark-dark); position: relative; }
.tile p { margin: 0; font-size: 18px; line-height: 1.3; color: #f9e7c4; position: relative; max-width: 30ch; }
.tile.t-games .ico { background: #2c2c54; box-shadow: inset 0 -5px 0 #1b1b38; }
.tile.t-battle .ico { background: linear-gradient(90deg, #ffb3aa 50%, #a9cdfb 50%); }

/* ---------- Panels ---------- */
.panel {
  background: var(--parchment); border-radius: var(--radius); padding: 20px;
  box-shadow: inset 0 -6px 0 var(--parchment-dark), 0 8px 0 rgba(0,0,0,.22);
}
.panel + .panel { margin-top: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 22px; }
.muted { color: #7a6448; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 18px; padding: 14px 22px; font-size: 21px; font-weight: 600; min-height: 58px;
  background: var(--leaf); color: white;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.25), 0 4px 0 rgba(0,0,0,.2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .5; }
.btn.big { font-size: 26px; padding: 18px 30px; min-height: 72px; border-radius: 22px; }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.bark { background: var(--bark); color: var(--parchment); }
.btn.red { background: var(--red); }
.btn.blue { background: var(--blue); }
.btn.ghost { background: rgba(0,0,0,.08); color: var(--ink); box-shadow: none; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; justify-content: center; }

.speak {
  border: none; width: 48px; height: 48px; border-radius: 50%; flex: none; font-size: 22px;
  background: var(--sun); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); display: inline-grid; place-items: center; vertical-align: middle;
}
.speak:active { transform: scale(.94); }
.speak.speaking { animation: pulse .8s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: none; border-radius: 999px; padding: 10px 16px; font-size: 18px; font-weight: 500;
  background: white; box-shadow: inset 0 -3px 0 rgba(0,0,0,.1), 0 2px 0 rgba(0,0,0,.08);
}
.chip.on { background: var(--leaf); color: white; }

.bigtext {
  width: 100%; border: 4px solid var(--parchment-dark); border-radius: 18px; padding: 16px; font-size: 22px;
  background: white; resize: none; outline: none; color: var(--ink);
}
.bigtext:focus { border-color: var(--leaf); }

/* ---------- Loading ---------- */
.loading { text-align: center; padding: 40px 10px; color: var(--parchment); }
.loading .critters { font-size: 64px; display: inline-flex; gap: 10px; }
.loading .critters span { display: inline-block; animation: hop .9s ease-in-out infinite; }
.loading .critters span:nth-child(2) { animation-delay: .15s; }
.loading .critters span:nth-child(3) { animation-delay: .3s; }
.loading p { font-size: 24px; font-weight: 600; margin: 10px 0 0; }
@keyframes hop { 50% { transform: translateY(-22px) rotate(-8deg); } }
.panel .loading { color: var(--ink); }

.shimmer {
  background: linear-gradient(100deg, #e9dcbc 30%, #f8efda 50%, #e9dcbc 70%); background-size: 300% 100%;
  animation: shim 1.4s linear infinite;
}
@keyframes shim { to { background-position: -150% 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 20px); transform: translate(-50%, 140%);
  background: var(--ink); color: var(--parchment); padding: 14px 22px; border-radius: 16px; font-size: 19px; font-weight: 500;
  transition: transform .3s, visibility .3s; visibility: hidden; z-index: 1000; max-width: 92vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Games ---------- */
.arcade {
  background: #1a1a2e; border-radius: 28px; padding: 16px;
  box-shadow: inset 0 -8px 0 #0e0e1c, 0 8px 0 rgba(0,0,0,.3);
}
.screen-wrap { position: relative; background: #000; border-radius: 14px; overflow: hidden; border: 6px solid #0b0b14; }
.screen-wrap canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; }
.screen-wrap::after { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
}
.pad { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 12px; }
.dpad { display: grid; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(3, 62px); gap: 4px; }
.dpad button, .abtn {
  border: none; background: #3a3a5c; color: #d8d8f0; font-size: 26px; border-radius: 14px;
  box-shadow: inset 0 -5px 0 #24243c; touch-action: none;
}
.dpad button:active, .abtn:active, .dpad button.held, .abtn.held { transform: translateY(3px); box-shadow: inset 0 -2px 0 #24243c; background: #4b4b75; }
.dpad .u { grid-area: 1 / 2; } .dpad .l { grid-area: 2 / 1; } .dpad .r { grid-area: 2 / 3; } .dpad .d { grid-area: 3 / 2; }
.dpad .hub { grid-area: 2 / 2; background: #2b2b45; box-shadow: none; border-radius: 10px; }
.abtn { width: 96px; height: 96px; border-radius: 50%; background: var(--red); color: white; font-family: var(--pixel); font-size: 22px; box-shadow: inset 0 -7px 0 #9a2b22; }
.abtn:active, .abtn.held { background: #f0645a; box-shadow: inset 0 -3px 0 #9a2b22; }
.pad .mid { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pill { border: none; font-family: var(--pixel); font-size: 10px; color: #b9b9d8; background: #2b2b45; border-radius: 999px; padding: 10px 14px; box-shadow: inset 0 -3px 0 #1b1b30; }
.cartridges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cart {
  border: none; border-radius: 12px 12px 6px 6px; padding: 10px 10px 14px; text-align: center; color: white;
  background: #2f2f2f; box-shadow: inset 0 -6px 0 #1a1a1a, 0 5px 0 rgba(0,0,0,.25); position: relative;
}
.cart .label { border-radius: 6px; padding: 12px 6px 10px; min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.cart .label .e { font-size: 40px; }
.cart .label b { font-family: var(--pixel); font-size: 9px; line-height: 1.5; text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.cart .del { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--red); color: white; font-size: 16px; }
.idea-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.idea-row textarea { flex: 1 1 320px; }

/* ---------- Creatures ---------- */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.pick {
  border: none; background: white; border-radius: 18px; padding: 8px 4px; font-size: 40px; line-height: 1;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pick small { font-size: 13px; font-weight: 500; color: #6d5a43; }
.pick.on { background: var(--lime); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 0 0 4px var(--leaf); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 54px; height: 54px; border-radius: 50%; border: 4px solid white; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.swatch.on { outline: 5px solid var(--leaf); }
.step-label { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.step-label .n { width: 38px; height: 38px; border-radius: 50%; background: var(--bark); color: var(--parchment); display: grid; place-items: center; font-size: 20px; }

.card {
  background: white; border-radius: 26px; overflow: hidden;
  box-shadow: 0 0 0 8px var(--sun), 0 12px 0 8px rgba(0,0,0,.2);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.card .art { aspect-ratio: 1; background: #e9dcbc; position: relative; }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art .wait { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 20px; font-weight: 600; color: #7a6448; padding: 20px; }
.card .info { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; font-size: 34px; line-height: 1; }
.card .tag { font-size: 19px; color: #6d5a43; margin: 0; }
.facts { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.35; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 18px; }
.kv b { color: var(--bark); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.bar .track { height: 16px; background: #efe4c9; border-radius: 10px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--leaf-light), var(--leaf)); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.zoo { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.zoo button { border: none; padding: 0; border-radius: 18px; overflow: hidden; background: white; box-shadow: 0 5px 0 rgba(0,0,0,.2); text-align: center; }
.zoo img { aspect-ratio: 1; object-fit: cover; width: 100%; background: #e9dcbc; }
.zoo span { display: block; padding: 8px 6px 10px; font-weight: 600; font-size: 16px; }

/* ---------- Trivia ---------- */
.quiz { text-align: center; }
.quiz .qemoji { font-size: 96px; line-height: 1; margin: 6px 0 10px; }
.quiz .q { font-size: clamp(24px, 4.4vw, 34px); font-weight: 700; margin: 0 0 18px; line-height: 1.2; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.answers button {
  border: none; border-radius: 20px; padding: 18px 12px; font-size: 22px; font-weight: 600; color: white; min-height: 84px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.22), 0 4px 0 rgba(0,0,0,.15);
}
.answers button:nth-child(1) { background: #e5483b; }
.answers button:nth-child(2) { background: #2f7fe0; }
.answers button:nth-child(3) { background: #e9a21a; }
.answers button:nth-child(4) { background: #3f8f2a; }
.answers button.dim { opacity: .3; }
.answers button.right { outline: 6px solid #1b5e10; transform: scale(1.03); }
.answers button.wrong { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: #dcc9a0; }
.dots i.ok { background: var(--leaf); } .dots i.no { background: var(--red); } .dots i.now { background: var(--sun); transform: scale(1.3); }
.factbox { margin-top: 18px; background: white; border-radius: 18px; padding: 16px 18px; font-size: 21px; line-height: 1.35; text-align: left; display: flex; gap: 12px; align-items: flex-start; }
.factbox b { display: block; font-size: 24px; margin-bottom: 4px; }
.stars { font-size: 56px; letter-spacing: 6px; }
.streak { display: inline-flex; align-items: center; gap: 8px; background: var(--sun); border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: 20px; }

/* ---------- Coloring ---------- */
.book { display: flex; align-items: center; gap: 12px; }
.book .flip { flex: none; width: 64px; height: 64px; border-radius: 50%; border: none; font-size: 30px; background: var(--sun); box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); }
.spread {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0; perspective: 1600px;
  background: var(--bark); padding: 14px; border-radius: 16px; box-shadow: 0 10px 0 rgba(0,0,0,.25);
}
.leaf {
  background: white; aspect-ratio: 3/4; border: none; padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  position: relative; transition: transform .5s; transform-origin: left center;
}
.leaf:first-child { border-radius: 8px 2px 2px 8px; box-shadow: inset -18px 0 24px -16px rgba(0,0,0,.35); transform-origin: right center; }
.leaf:last-child { border-radius: 2px 8px 8px 2px; box-shadow: inset 18px 0 24px -16px rgba(0,0,0,.35); }
.leaf img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.leaf .pg { font-size: 20px; font-weight: 600; text-transform: capitalize; }
.leaf .num { position: absolute; bottom: 8px; font-size: 13px; color: #9a8c74; }
.leaf.turn-next { animation: turnNext .45s ease-in; }
.leaf.turn-prev { animation: turnPrev .45s ease-in; }
@keyframes turnNext { to { transform: rotateY(-90deg); } }
@keyframes turnPrev { to { transform: rotateY(90deg); } }
.leaf.new { background: repeating-linear-gradient(45deg, #fffbe9, #fffbe9 12px, #fff3c7 12px, #fff3c7 24px); }
.leaf.new .plus { font-size: 70px; }

/* MS Paint window */
.paint { background: #c0c0c0; border: 3px solid; border-color: #fff #404040 #404040 #fff; box-shadow: 0 10px 0 rgba(0,0,0,.25); font-family: var(--font); }
.paint .titlebar { background: linear-gradient(90deg, #000080, #1084d0); color: white; font-weight: 700; padding: 6px 8px; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.paint .titlebar .x { margin-left: auto; width: 34px; height: 30px; border: 2px solid; border-color: #fff #404040 #404040 #fff; background: #c0c0c0; color: black; font-weight: 700; font-size: 16px; }
.paint .menubar { display: flex; gap: 4px; padding: 4px 6px; font-size: 16px; flex-wrap: wrap; }
.paint .menubar button { border: none; background: none; padding: 6px 10px; font-size: 16px; }
.paint .menubar button:active { background: #000080; color: white; }
.paint .body { display: flex; gap: 6px; padding: 6px; }
.toolbox { display: grid; grid-template-columns: repeat(2, 52px); gap: 3px; align-content: start; }
.tool { width: 52px; height: 52px; border: 2px solid; border-color: #fff #404040 #404040 #fff; background: #c0c0c0; font-size: 24px; padding: 0; display: grid; place-items: center; }
.tool.on { border-color: #404040 #fff #fff #404040; background: #e0e0e0 repeating-conic-gradient(#fff 0 25%, #e0e0e0 0 50%) 0 0 / 4px 4px; }
.sizes { grid-column: span 2; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 4px; display: grid; gap: 4px; margin-top: 4px; }
.sizes button { border: none; background: none; height: 26px; display: grid; place-items: center; padding: 0; }
.sizes button.on { background: #000080; }
.sizes button i { display: block; background: black; border-radius: 50%; }
.sizes button.on i { background: white; }
.stickers { grid-column: span 2; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; margin-top: 4px; }
.stickers button { border: 2px solid transparent; background: none; font-size: 26px; padding: 2px; }
.stickers button.on { border: 2px dashed #000080; }
.canvas-area { flex: 1; background: #808080; border: 2px solid; border-color: #404040 #fff #fff #404040; padding: 8px; display: grid; place-items: center; min-width: 0; }
.canvas-stack { position: relative; width: 100%; max-width: min(100%, calc(100vh - 290px)); aspect-ratio: 1; background: white; box-shadow: 2px 2px 0 #000; }
.canvas-stack canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.canvas-stack canvas.lines { pointer-events: none; }
.palette { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; }
.current { width: 60px; height: 60px; flex: none; border: 2px solid; border-color: #808080 #fff #fff #808080; position: relative; background: #c0c0c0; }
.current i { position: absolute; width: 34px; height: 34px; left: 6px; top: 6px; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.colors { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; flex: 1; max-width: 640px; }
.colors button { aspect-ratio: 1; min-height: 28px; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 0; }
.colors button.rainbow { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); }
.statusbar { border-top: 2px solid #808080; padding: 4px 8px; font-size: 14px; display: flex; justify-content: space-between; }

/* ---------- Who Would Win ---------- */
.corners { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.corner { border-radius: var(--radius); padding: 16px; color: white; text-align: center; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: none; font-size: 18px; }
.corner.red { background: linear-gradient(180deg, #f05b4f, #b9281e); box-shadow: inset 0 -7px 0 #861b13, 0 6px 0 rgba(0,0,0,.25); }
.corner.blue { background: linear-gradient(180deg, #4a95f0, #1e5fb9); box-shadow: inset 0 -7px 0 #143f7e, 0 6px 0 rgba(0,0,0,.25); }
.corner .ce { font-size: 72px; line-height: 1; }
.corner b { font-size: 26px; text-transform: capitalize; }
.corner.waiting .ce { opacity: .5; }
.vs { font-family: var(--pixel); color: var(--sun); font-size: 28px; align-self: center; text-shadow: 3px 3px 0 var(--red); }
.zoo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.zoo-pick button { border: none; background: white; border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.zoo-pick button span { font-size: 42px; line-height: 1; }
.zoo-pick button small { font-size: 14px; font-weight: 600; color: #5b4935; text-transform: capitalize; }
.zoo-pick button.a { box-shadow: 0 0 0 4px var(--red); } .zoo-pick button.b { box-shadow: 0 0 0 4px var(--blue); }
.classic { display: flex; flex-wrap: wrap; gap: 10px; }

.bk { background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 0 rgba(0,0,0,.25); }
.bk-cover { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #111; }
.bk-cover .side { position: relative; aspect-ratio: 1; overflow: hidden; }
.bk-cover .side img { width: 100%; height: 100%; object-fit: cover; }
.bk-cover .side.b img { transform: scaleX(-1); }
.bk-cover .side .wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; }
.bk-cover .side.a { box-shadow: inset 0 -10px 0 var(--red); } .bk-cover .side.b { box-shadow: inset 0 -10px 0 var(--blue); }
.bk-cover .vsbadge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); background: var(--sun); color: var(--red); font-family: var(--pixel); font-size: clamp(18px, 4vw, 34px); padding: 16px 18px; border-radius: 12px; border: 5px solid white; box-shadow: 0 6px 0 rgba(0,0,0,.4); }
.bk-cover h2 { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; margin: 0; color: white; font-size: clamp(26px, 5vw, 44px); text-shadow: 0 3px 0 #000, 0 0 20px #000; padding: 0 10px; }
.bk-section { padding: 22px; border-top: 3px dashed #e8dcc1; }
.bk-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 26px; }
.tape { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tape .fc { border-radius: 16px; padding: 14px; font-size: 18px; line-height: 1.35; }
.tape .fc.a { background: #fde3e0; } .tape .fc.b { background: #dfeafc; }
.tape .fc h4 { margin: 0 0 6px; font-size: 24px; text-transform: capitalize; }
.tape .fc .sci { font-style: italic; color: #6d5a43; font-size: 15px; margin: -4px 0 8px; }
.tape .fc p { margin: 4px 0; }
.vsbars { display: grid; gap: 12px; }
.vsbar { display: grid; grid-template-columns: 1fr 90px 1fr; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.vsbar .l, .vsbar .r { height: 22px; background: #efe4c9; border-radius: 12px; overflow: hidden; display: flex; }
.vsbar .l { justify-content: flex-end; }
.vsbar .l i { background: var(--red); } .vsbar .r i { background: var(--blue); }
.vsbar i { display: block; height: 100%; width: 0; border-radius: 12px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.vsbar span { text-align: center; }
.rounds { display: grid; gap: 14px; }
.round { background: #fff7e2; border: 4px solid var(--ink); border-radius: 16px; padding: 14px 16px; font-size: 20px; line-height: 1.4; box-shadow: 5px 5px 0 var(--ink); }
.round b { display: block; font-size: 21px; margin-bottom: 4px; color: var(--red); }
.winner { text-align: center; }
.winner .crown { font-size: 80px; animation: bob 2s ease-in-out infinite; }
.winner h3 { justify-content: center; font-size: 34px; text-transform: capitalize; }
.winner p { font-size: 21px; line-height: 1.4; text-align: left; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti i { position: absolute; top: -40px; font-size: 32px; font-style: normal; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .card { grid-template-columns: 1fr; }
  .tape { grid-template-columns: 1fr; }
  .corners { grid-template-columns: 1fr 1fr; }
  .corners .vs { display: none; }
  .answers button { font-size: 19px; min-height: 76px; }
  .dpad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); }
  .abtn { width: 84px; height: 84px; }
  .spread { grid-template-columns: 1fr; }
  .spread .leaf { border-radius: 8px !important; box-shadow: none !important; }
  .book { gap: 6px; }
  .book .flip { width: 48px; height: 48px; font-size: 22px; }
  .spread { padding: 10px; }
  .tile { padding-left: 116px; }
  .tile .ico { width: 82px; height: 82px; font-size: 48px; }
  .colors { grid-template-columns: repeat(7, 1fr); }
  .paint .body { flex-direction: column; }
  .toolbox { grid-template-columns: repeat(auto-fill, 46px); grid-auto-flow: row; }
  .tool { width: 46px; height: 46px; font-size: 21px; }
  .sizes, .stickers { grid-column: auto; display: flex; }
  .canvas-stack { max-width: 100%; }
}
