@font-face { font-family: 'Luckiest Guy'; src: url(/fonts/luckiest-guy-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 400; src: url(/fonts/rubik-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 600; src: url(/fonts/rubik-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 800; src: url(/fonts/rubik-latin-800-normal.woff2) format('woff2'); font-display: swap; }

:root {
  --bg: #dff3ff; --paper: #ffffff; --ink: #12304a; --muted: #5d7b92; --line: #b9dcf2;
  --aqua: #19b5e6; --aqua-dark: #0b7ea6; --orange: #ff8a3d; --orange-dark: #b9541a;
  --green: #23b67f; --red: #f0524f; --yellow: #ffd23f; --me: #19b5e6; --them: #ff8a3d;
  --display: 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.45 var(--body); overscroll-behavior: none; background: var(--bg);
  background-image: radial-gradient(circle at 14px 14px, rgba(25, 181, 230, .16) 4px, transparent 5px); background-size: 34px 34px;
}
#app { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
.screen { width: min(540px, 100%); display: flex; flex-direction: column; gap: 14px; flex: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }
p { margin: 0; } .muted { color: var(--muted); } .center { text-align: center; }

.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bar .sp { flex: 1; }
.logo { font: 22px/1 var(--display); color: var(--aqua-dark); letter-spacing: .4px; padding-top: 4px; text-decoration: none; }
.logo span { color: var(--orange); }
.chip { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); font-size: 18px; font-weight: 800; display: grid; place-items: center; }

.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; padding: 18px; box-shadow: 0 6px 0 rgba(18, 48, 74, .2); }
h1 { font: 42px/1 var(--display); margin: 2px 0 0; text-align: center; letter-spacing: .5px; }
h1 em { font-style: normal; color: var(--aqua-dark); }
h2 { font: 26px/1.08 var(--display); margin: 0; letter-spacing: .3px; }
.btn { border: 3px solid var(--ink); border-radius: 16px; padding: 14px 18px 10px; font: 22px/1 var(--display); letter-spacing: .5px; background: var(--paper); box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s; width: 100%; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.blue { background: var(--aqua); color: #fff; } .btn.orange { background: var(--orange); color: #fff; } .btn.yellow { background: var(--yellow); }
.btn.small { font-size: 17px; padding: 10px 14px 7px; width: auto; }
.btn[disabled] { opacity: .55; pointer-events: none; }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
input[type=text] { font: 600 18px var(--body); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 11px 14px; background: #fff; width: 100%; }
input[type=text]:focus { outline: 3px solid var(--yellow); }
.hero { width: min(100%, 420px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; border: 3px solid var(--ink); margin: 0 auto; display: block; box-shadow: 0 6px 0 rgba(18, 48, 74, .2); }
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cats img { width: 100%; aspect-ratio: 1; object-fit: contain; }

.code { font: 54px/1 var(--display); letter-spacing: 6px; text-align: center; color: var(--orange); padding-top: 8px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px dashed var(--line); border-radius: 14px; padding: 8px 8px 8px 12px; font-size: 14px; }
.linkbox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* the tug of war */
.tug { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.names { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 15px; }
.names span { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.names .me { color: var(--aqua-dark); } .names .them { color: var(--orange-dark); }
.names i { font-style: normal; font-weight: 600; color: var(--muted); }
.rope { position: relative; height: 74px; border-radius: 16px; background: linear-gradient(90deg, rgba(25,181,230,.28) 0 14%, #f2f8fc 14% 86%, rgba(255,138,61,.3) 86%); border: 3px solid var(--ink); overflow: hidden; }
.rope::before { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: repeating-linear-gradient(90deg, #c69a5b 0 10px, #a67c3d 10px 20px); }
.rope::after { content: ''; position: absolute; left: 50%; top: 6px; bottom: 6px; border-left: 3px dashed rgba(18,48,74,.25); }
.rope .cooler { position: absolute; top: 4px; width: 60px; height: 60px; margin-left: -30px; left: 50%; transition: left .7s cubic-bezier(.3,1.4,.5,1); z-index: 1; object-fit: contain; }
.rope .cooler.shake { animation: wob .5s; }
@keyframes wob { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }

/* question */
.qcard { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.cat { display: flex; align-items: center; gap: 10px; }
.cat img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.cat b { font: 20px/1 var(--display); letter-spacing: .3px; padding-top: 4px; color: var(--aqua-dark); }
.cat .sp { flex: 1; }
.qtext { font-size: 20px; font-weight: 800; line-height: 1.25; min-height: 50px; }
.timer { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; border: 2px solid var(--ink); }
.timer i { display: block; height: 100%; width: 100%; background: var(--aqua); transform-origin: left; }
.timer i.low { background: var(--red); }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 13px 14px; font-weight: 600; font-size: 17px; box-shadow: 0 4px 0 var(--ink); display: flex; align-items: center; gap: 10px; transition: transform .08s, box-shadow .08s; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.opt .tx { flex: 1; }
.opt .who { flex: none; display: flex; gap: 4px; }
.opt .who i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.opt .who i.me { background: var(--me); } .opt .who i.them { background: var(--them); }
.opt.mine { background: #e3f6fd; border-color: var(--aqua-dark); }
.opt.right { background: #d5f5e7; border-color: var(--green); }
.opt.wrong { background: #fde1e0; border-color: var(--red); }
.opt[disabled] { pointer-events: none; box-shadow: none; transform: translateY(3px); }
.double { display: flex; align-items: center; gap: 10px; border: 3px dashed var(--ink); border-radius: 14px; background: #fff8dc; padding: 8px 12px; font-weight: 800; }
.double img { width: 38px; height: 38px; object-fit: contain; }
.double small { display: block; font-weight: 600; color: var(--muted); }
.double.on { border-style: solid; background: var(--yellow); }
.double[disabled] { opacity: .45; pointer-events: none; }
.result { font-weight: 800; text-align: center; min-height: 24px; }
.result .up { color: var(--green); } .result .down { color: var(--red); }
.bigcat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; flex: 1; justify-content: center; }
.bigcat img { width: 150px; height: 150px; object-fit: contain; animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.bigcat b { font: 34px/1 var(--display); color: var(--aqua-dark); padding-top: 6px; }
@keyframes pop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.count { font: 96px/1 var(--display); text-align: center; color: var(--orange); text-shadow: 0 5px 0 var(--orange-dark); }
.banner { font: 36px/1.05 var(--display); text-align: center; color: var(--aqua-dark); padding-top: 6px; }
.prize { width: 170px; height: 170px; object-fit: contain; margin: 0 auto; display: block; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 600; padding: 10px 16px; border-radius: 999px; z-index: 9; }
dialog { border: 3px solid var(--ink); border-radius: 22px; background: var(--paper); color: var(--ink); padding: 22px 20px 18px; width: min(460px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(18, 48, 74, .55); }
dialog ol { margin: 8px 0 14px; padding-left: 22px; } dialog li { margin: 4px 0; }
@media (max-height: 700px) { h1 { font-size: 34px; } .rope { height: 62px; } .rope .cooler { width: 50px; height: 50px; margin-left: -25px; } .qtext { font-size: 18px; } .opt { padding: 10px 12px; } }
@media (prefers-reduced-motion: reduce) { .rope .cooler { transition: none; } .bigcat img, .rope .cooler.shake { animation: none; } }

/* keep everything inside a phone's width */
.screen { min-width: 0; max-width: 100%; }
.screen > *, .card > * { min-width: 0; max-width: 100%; }
.opts { grid-template-columns: minmax(0, 1fr); }
.names span, .meta span { min-width: 0; }
.chip { white-space: nowrap; }
.logo { white-space: nowrap; font-size: 20px; }
.qtext, .opt .tx { overflow-wrap: anywhere; }

/* ---------- Word Ladder: stationery palette and the ladder ---------- */
:root { --bg: #e8f1e4; --paper: #fffdf8; --ink: #24303a; --muted: #5f6f78; --line: #c5d8c0; --aqua: #2a9d8f; --aqua-dark: #1b6f65; --orange: #f08a24; --orange-dark: #a85a0c; --yellow: #ffd23f; --green: #23b67f; --red: #d83a34; --rail: #c99a5f; --rail-dark: #8e6332; }
body { background-image: linear-gradient(rgba(36, 48, 58, .05) 1px, transparent 1px); background-size: 100% 28px; }
[hidden] { display: none !important; }
.logo { font-size: 26px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.round { width: 44px; height: 44px; }
.chip { padding: 10px 12px; }

.today { display: flex; align-items: center; gap: 10px; padding: 14px; }
.today .mascot { width: 64px; height: 64px; object-fit: contain; flex: none; }
.todaytext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.todaytext b { font: 22px/1.1 var(--display); letter-spacing: .3px; padding-top: 4px; }
.streak { font-weight: 800; color: var(--aqua-dark); }

.phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.par { border: 3px solid var(--ink); background: var(--yellow); border-radius: 999px; padding: 5px 14px 3px; font: 18px/1.2 var(--display); white-space: nowrap; }
.game { display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; }

/* the ladder: two wooden rails, one word per rung */
.ladder { display: flex; flex-direction: column; gap: 8px; width: min(100%, 300px); margin: 0 auto; padding: 10px 8px; border-left: 8px solid var(--rail); border-right: 8px solid var(--rail); border-radius: 6px; background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 0 no-repeat; }
.rung { display: grid; grid-template-columns: 44px auto; align-items: center; justify-content: center; gap: 6px; padding-right: 20px; }
.lab { font-size: 12px; font-weight: 800; color: var(--muted); text-align: right; text-transform: uppercase; letter-spacing: .3px; }
.tiles { display: grid; grid-template-columns: repeat(4, 44px); gap: 5px; }
.tile { position: relative; height: 46px; display: grid; place-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 10px; font: 800 24px/1 var(--body); box-shadow: 0 3px 0 rgba(36, 48, 58, .25); }
.rung.start .tile { background: #dff1ee; }
.rung.goal .tile { background: #fff3cf; border-style: dashed; box-shadow: none; }
/* the letter you changed: yellow, and underlined so colour is not the only sign */
.tile.chg { background: var(--yellow); }
.tile.chg::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 4px; height: 4px; border-radius: 2px; background: var(--ink); }
/* goal letters you already have: solid border and a tick */
.rung.goal .tile.hit { border-style: solid; background: #d5f5e7; }
.rung.goal .tile.hit::before { content: '✓'; position: absolute; top: -9px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; border: 2px solid var(--ink); font: 800 11px/14px var(--body); text-align: center; }
.rung.reached .tile { background: #d5f5e7; border-style: solid; box-shadow: 0 3px 0 rgba(36, 48, 58, .25); }
.rung.reached .tile.chg { background: var(--yellow); }
.rung.gap { min-height: 18px; }
.dotsv { text-align: center; font-size: 22px; line-height: 18px; color: var(--muted); font-weight: 800; }

.playbox { display: flex; flex-direction: column; gap: 10px; }
.entry { display: flex; gap: 8px; align-items: stretch; width: min(100%, 300px); margin: 0 auto; }
input[type=text].word { flex: 1; min-width: 0; text-transform: uppercase; text-align: center; font: 800 26px/1 var(--body); letter-spacing: 10px; padding: 9px 4px 9px 14px; height: 54px; }
input[type=text].word::placeholder { color: #c9c9c9; letter-spacing: 10px; }
input[type=text].word.bad { border-color: var(--red); animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.entry .btn { flex: none; min-width: 84px; min-height: 48px; }
.msg { min-height: 22px; text-align: center; font-weight: 800; color: var(--red); }
.msg:not(:empty)::before { content: '✕ '; }
.hint { font-size: 14px; font-weight: 600; min-height: 20px; overflow-wrap: anywhere; }
.tools { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tools .btn { min-height: 46px; min-width: 110px; }

.result { display: flex; flex-direction: column; gap: 12px; }
.result .big { font-weight: 800; font-size: 20px; }
.prize { width: 120px; height: 120px; }
.sharetext { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; background: #fff; border: 2px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0 14px; user-select: all; -webkit-user-select: all; }
dialog .tools { margin-top: 4px; }
@media (max-width: 359px) { .tiles { grid-template-columns: repeat(4, 38px); } .tile { height: 42px; font-size: 21px; } .rung { grid-template-columns: 38px auto; padding-right: 10px; } }
@media (prefers-reduced-motion: reduce) { input[type=text].word.bad { animation: none; } .btn { transition: none; } }
