:root { --ink: #1b1033; --cream: #fff6d6; --sun: #ffd166; --muted: #5b4a6b; --font: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--ink); font: 15px/1.4 var(--font);
  background-image: radial-gradient(#ffffff14 1.5px, transparent 1.5px); background-size: 18px 18px; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* home hero (from the hub) */
.hero { position: relative; overflow: hidden; height: 150px; padding: 26px 16px 0; text-align: center;
  background: linear-gradient(135deg, #ff5fa2, #7b2ff7);
  -webkit-mask: radial-gradient(14px at 50% calc(100% - 14px), #000 99%, #0000) 50% 100% / 40px 100% repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 14px) no-repeat;
          mask: radial-gradient(14px at 50% calc(100% - 14px), #000 99%, #0000) 50% 100% / 40px 100% repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 14px) no-repeat; }
.hero h1 { margin: 0; font: 900 44px/1 var(--font); color: var(--cream); letter-spacing: 1px; transform: rotate(-3deg);
  -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.hero p { margin: 14px 0 0; color: var(--sun); font-weight: 800; font-size: 14px; text-shadow: 2px 2px 0 var(--ink); }
.hero .float { position: absolute; font-size: 30px; opacity: .55; }
.hero .f1 { left: 6%; top: 18%; } .hero .f2 { right: 8%; top: 12%; } .hero .f3 { right: 22%; bottom: 22%; }

/* sticker cards: picture = play now, info = game page */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 12px 24px; max-width: 900px; margin: 0 auto; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--cream); border: 3px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.card a { display: block; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.card .pic { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; border-bottom: 3px solid var(--ink);
  background: radial-gradient(#ffffff40 2px, transparent 2.5px) 0 0 / 10px 10px, linear-gradient(135deg, var(--c1), var(--c2)); }
.emoji { font-size: 56px; line-height: 1; filter: drop-shadow(3px 4px 0 #1b103355); }
.card .emoji { transform: rotate(var(--tilt)); }
/* play + how-to in one pill */
.go { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 5px; padding: 2px 9px 2px 2px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-size: 10px; font-weight: 800; transform: rotate(2deg);
  box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go b { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding-left: 2px; border-radius: 50%; background: var(--sun); font-size: 11px; }
.info { padding: 8px 10px 10px; }
.info h2 { margin: 0 0 2px; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.info p { margin: 0; font-size: 12px; line-height: 1.3; color: var(--muted); }

/* inner pages */
.bar { padding: 12px 16px; background: linear-gradient(135deg, #ff5fa2, #7b2ff7); border-bottom: 3px solid var(--ink); }
.bar a { font: 900 20px var(--font); color: var(--cream); text-decoration: none; -webkit-text-stroke: 1px var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.page main { max-width: 640px; margin: 0 auto; padding: 14px 16px 8px; }
.box { background: var(--cream); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); padding: 12px 14px; margin: 0 0 14px; }
.box h2 { margin: 0 0 8px; font-size: 17px; }
.prose { max-width: 640px; margin: 14px auto !important; }
.prose h1 { margin: 0 0 8px; font-size: 26px; } .prose h2 { margin: 16px 0 4px; }
.stage { text-align: center; padding: 22px 14px 18px; margin: 0 0 14px; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink);
  background: radial-gradient(#ffffff40 2px, transparent 2.5px) 0 0 / 10px 10px, linear-gradient(135deg, var(--c1), var(--c2)); }
.stage .emoji { font-size: 72px; }
.stage h1 { margin: 6px 0 2px; font: 900 30px/1.1 var(--font); color: var(--cream); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); overflow-wrap: anywhere; }
.stage p { margin: 0 0 14px; font-weight: 800; color: var(--ink); }
.big-play, .btn { border: 3px solid var(--ink); border-radius: 999px; background: var(--sun); box-shadow: 0 4px 0 var(--ink); font-weight: 900; }
.big-play { padding: 14px 34px; font-size: 24px; }
.big-play:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn { padding: 8px 16px; font-size: 15px; }
.pill { margin: 0 0 14px; padding: 8px 14px; border: 3px solid var(--ink); border-radius: 999px; background: var(--sun); font-weight: 800; text-align: center; }
.about p { margin: 0 0 14px; color: var(--cream); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.tabs button { padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 800; font-size: 13px; }
.tabs button[aria-pressed="true"] { background: var(--sun); }
#friends { margin-left: auto; }
#board ol { margin: 0; padding: 0 0 0 26px; }
#board li { display: flex; gap: 8px; padding: 3px 0; }
#board li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board li .s { font-weight: 900; }
#board li.me { font-weight: 900; color: #7b2ff7; }
.msg { margin: 4px 0 0; color: var(--muted); } .msg:empty { display: none; }
#me p { margin: 0 0 10px; } .pname { font-weight: 900; overflow-wrap: anywhere; }
.edit { border: 0; background: none; padding: 0 4px; }
#me input { font: inherit; font-weight: 900; width: 12em; max-width: 60%; padding: 2px 6px; border: 2px solid var(--ink); border-radius: 8px; }
.gsi { margin-top: 10px; font-size: 13px; color: var(--muted); }
ul.next { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.next a { display: grid; place-items: center; gap: 4px; padding: 10px 4px; text-align: center; text-decoration: none; border: 3px solid var(--ink); border-radius: 16px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 3px 0 var(--ink); }
.next .emoji { font-size: 34px; }
.next b { font-size: 12px; line-height: 1.15; color: var(--ink); background: #fffd; border-radius: 8px; padding: 1px 5px; overflow-wrap: anywhere; }
.foot { padding: 10px 16px 28px; text-align: center; color: var(--cream); font-size: 13px; }

/* play layer: covers the viewport even where fullscreen is refused (iOS) */
.layer { position: fixed; inset: 0; z-index: 10; background: #15171c; }
.layer iframe { display: block; width: 100%; height: 100%; border: 0; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: #1b1033cc; overflow-y: auto; }
.sheet { width: 100%; max-width: 340px; padding: 16px; text-align: center; background: var(--cream); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); }
.sheet .score { margin: 0; font: 900 64px/1 var(--font); color: var(--cream); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.sheet .sub { margin: 6px 0 12px; font-weight: 800; }
.sheet .acts { display: flex; gap: 8px; justify-content: center; margin: 0 0 14px; }
.sheet .next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 16px;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--sun); font-weight: 800; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  .card .emoji { animation: bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * -0.2s); }
  .card .pic:active { animation: wobble .3s; }
  .hero .float { animation: drift 6s ease-in-out infinite alternate; }
  .hero .f2 { animation-delay: -2s; } .hero .f3 { animation-delay: -4s; }
}
@keyframes bob { 50% { transform: rotate(var(--tilt)) translateY(-6px); } }
@keyframes wobble { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
/* dev builds only (npm run dev): NEW/CLASSIC toggle, from the old hub */
.mode { display: inline-flex; margin-top: 10px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; transform: rotate(-2deg); box-shadow: 2px 3px 0 var(--ink); }
.mode button { border: 0; padding: 5px 12px; background: none; font-weight: 800; font-size: 12px; }
.mode button[aria-pressed="true"] { background: var(--sun); }
@keyframes drift { to { transform: translate(10px, -8px) rotate(12deg); } }
