/* WittyWit Arcade: the "Mango Lassi" look shared with the homepage (mango stripes, black outlines,
   hard shadows, Lilita One + Rubik). Every arcade page uses this one file. */
:root {
  --bg: #FFA94D; --ink: #111; --cream: #FFF4E0; --paper: #FFFBF2; --lemon: #FFE066; --pink: #FF8FB1; --teal: #5FD4C4; --violet: #B79CFF; --red: #FF5D73;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif; --body: 'Rubik', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 400 16px/1.45 var(--body); color: var(--ink); overflow-x: hidden;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 14px, transparent 14px 28px), var(--bg);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  padding: 12px 20px; border: 3px solid var(--ink); border-radius: 16px; background: var(--lemon);
  font: 400 20px var(--display); letter-spacing: .02em; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover, .btn:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); outline: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.alt { background: var(--cream); }
.btn.pink { background: var(--pink); }
.btn.teal { background: var(--teal); }
.btn.small { font-size: 16px; padding: 8px 14px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* Header bar on every game page */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px max(14px, env(safe-area-inset-left)); position: relative; z-index: 5; }
.bar .brand { font: 400 15px var(--display); text-decoration: none; background: var(--ink); color: var(--lemon); padding: 6px 11px; border-radius: 10px; transform: rotate(-3deg); white-space: nowrap; }
.bar h1 { font-size: clamp(22px, 5vw, 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 3px 3px 0 var(--cream); }
.bar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--cream); font: 600 14px var(--body); white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); }
.chip b { font: 400 18px var(--display); }
.icon-btn { width: 40px; height: 38px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); font-size: 18px; box-shadow: 2px 2px 0 var(--ink); padding: 0; flex: none; }
.icon-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
@media (max-width: 560px) { .bar { gap: 6px; padding: 8px 10px; } .bar .brand { display: none; } .chip { padding: 0 8px; font-size: 12px; } .chip b { font-size: 16px; } .icon-btn { width: 36px; } }

/* The play area: a canvas that keeps its shape and fills the space under the bar */
.stage { position: relative; height: calc(100dvh - 60px); display: grid; place-items: center; padding: 0 10px 12px; }
.screen { position: relative; height: 100%; max-height: 100%; aspect-ratio: 9 / 16; max-width: 100%; border: 4px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 7px 7px 0 var(--ink); background: #BFF0FF; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.screen canvas { display: block; width: 100%; height: 100%; }
@supports not (aspect-ratio: 1) { .screen { width: min(100%, 56vh); } }
.hud { position: absolute; top: 12px; left: 0; right: 0; text-align: center; pointer-events: none; font: 400 54px var(--display); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.hud small { display: block; font: 600 13px var(--body); -webkit-text-stroke: 0; text-shadow: none; color: var(--ink); background: var(--cream); width: max-content; margin: 2px auto 0; padding: 2px 10px; border-radius: 99px; border: 2px solid var(--ink); }
.toast { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); font: 400 34px var(--display); color: var(--lemon); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); pointer-events: none; white-space: nowrap; opacity: 0; }
.toast.on { animation: toast 1s ease-out; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }

/* Start and game-over card over the canvas */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(17,17,17,.28); }
.overlay[hidden] { display: none; }
.card { width: min(100%, 330px); background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; padding: 20px 18px; text-align: center; box-shadow: 6px 6px 0 var(--ink); animation: pop .28s ease-out; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.card h2 { font-size: 34px; line-height: 1.05; }
.card .big { font: 400 64px/1 var(--display); margin: 6px 0 2px; }
.card p { margin: 8px 0; font-size: 15px; }
.card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.card .stats { display: flex; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.card .stats span { flex: 1; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); padding: 6px 4px; font-size: 12px; font-weight: 600; }
.card .stats b { display: block; font: 400 22px var(--display); }
.badge { display: inline-block; background: var(--pink); border: 2.5px solid var(--ink); border-radius: 99px; padding: 3px 12px; font: 400 16px var(--display); transform: rotate(-4deg); box-shadow: 2px 2px 0 var(--ink); }
.badge.gold { background: var(--lemon); animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(4deg) scale(1.06); } }
.note { font-size: 13px; opacity: .8; }
.note a { font-weight: 600; }
.keys { font-size: 13px; opacity: .75; margin-top: 10px; }

/* Leaderboard dialog */
dialog.board { border: 4px solid var(--ink); border-radius: 22px; padding: 18px; width: min(94vw, 460px); background: var(--cream); color: var(--ink); box-shadow: 7px 7px 0 var(--ink); }
dialog.board::backdrop { background: rgba(17,17,17,.45); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-head h2 { font-size: 30px; }
.tabs { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.tabs button { border: 2.5px solid var(--ink); border-radius: 99px; background: var(--paper); padding: 6px 13px; font-weight: 600; font-size: 13px; }
.tabs button.on { background: var(--ink); color: var(--lemon); }
.board table { width: 100%; border-collapse: collapse; }
.board td, .board th { padding: 8px 6px; text-align: left; border-bottom: 2px dashed rgba(17,17,17,.15); font-size: 15px; }
.board th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.board td:last-child, .board th:last-child { text-align: right; font: 400 18px var(--display); }
.board tr.me td { background: var(--lemon); }
.board .empty { text-align: center; padding: 24px 8px; opacity: .75; }
.board .list { max-height: min(55vh, 440px); overflow: auto; }

/* Hide the floating extras while a game is running so they never cover the play area */
body.playing #ww-coffee-root, body.playing #ww-insta-root, body.playing .ww-music { display: none !important; }

/* Two-player mode card (duel.js) */
.modes { display: grid; gap: 10px; margin-top: 12px; }
.modes .btn { width: 100%; }
.levels { display: flex; gap: 6px; justify-content: center; margin: -2px 0 4px; }
.levels button { border: 2.5px solid var(--ink); border-radius: 99px; background: var(--paper); padding: 4px 12px; font-weight: 600; font-size: 13px; }
.levels button.on { background: var(--ink); color: var(--lemon); }
.code-box { font: 400 44px var(--display); letter-spacing: .18em; background: var(--paper); border: 3px dashed var(--ink); border-radius: 16px; padding: 6px; margin: 10px 0; }
.field { display: grid; gap: 6px; text-align: left; margin: 14px 0 4px; font-weight: 600; font-size: 13px; }
.field input { padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); font-size: 17px; }
.screen.wide { aspect-ratio: 16 / 10; height: auto; width: min(100%, 980px); max-height: 100%; }
