@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; }

/* ---------- the Break Tab house style (from Box Battle), with this game's palette ---------- */
:root {
  --bg: #e8f3ef; --paper: #fffdf8; --ink: #2b2a33; --muted: #6b7a78; --line: #c9e0d9;
  --aqua: #0f9d8a; --aqua-dark: #0a6c5f; --orange: #e8573f; --orange-dark: #a3301e;
  --green: #23a56b; --red: #e23b3b; --yellow: #ffd23f;
  --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: linear-gradient(rgba(45, 42, 50, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(45, 42, 50, .05) 1px, transparent 1px); background-size: 26px 26px;
}
#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%); min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.screen > *, .card > * { min-width: 0; max-width: 100%; }
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; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bar .sp { flex: 1; }
.logo { font: 26px/1 var(--display); color: var(--aqua-dark); letter-spacing: .4px; padding-top: 4px; text-decoration: none; white-space: nowrap; }
.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; white-space: nowrap; }
.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; flex: none; }

.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; padding: 16px; box-shadow: 0 6px 0 rgba(45, 42, 50, .2); }
h1 { font: 40px/1 var(--display); margin: 2px 0 0; text-align: center; letter-spacing: .5px; }
h1 em { font-style: normal; color: var(--aqua-dark); }
h2 { font: 24px/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: 16px; padding: 10px 12px 7px; width: auto; box-shadow: 0 4px 0 var(--ink); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.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(45, 42, 50, .2); }
.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: 30; max-width: calc(100vw - 28px); text-align: center; }
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(45, 42, 50, .55); }
dialog ol { margin: 8px 0 14px; padding-left: 22px; } dialog li { margin: 5px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.acct { text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.acct a { color: var(--aqua-dark); }
.today { display: flex; align-items: center; gap: 12px; }
.today > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mascot { width: 76px; height: 76px; object-fit: contain; flex: none; }
.prize { width: 130px; height: 130px; object-fit: contain; margin: 0 auto 6px; display: block; }
.fb { display: inline-grid; place-items: center; text-align: center; font-weight: 800; font-size: 11px; line-height: 1.05; border-radius: 10px; background: var(--line); color: var(--ink); overflow: hidden; }
.fb.mascot, .fb.prize { border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 15px; }
@media (max-height: 700px) { h1 { font-size: 32px; } }

/* ---------- Coffee Sort: the counters, the glasses, the level list ---------- */
.screen.wide { width: min(760px, 100%); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats.three { grid-template-columns: minmax(0, .7fr) minmax(0, 1.5fr) minmax(0, 1fr); }
.stat { background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 7px 6px 5px; text-align: center; min-width: 0; }
.stat small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { display: block; font: 22px/1.1 var(--display); padding-top: 3px; color: var(--aqua-dark); font-variant-numeric: tabular-nums; }
.goal { text-align: center; font-weight: 800; min-height: 46px; display: grid; place-items: center; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tools .btn { width: 100%; min-height: 46px; padding-left: 4px; padding-right: 4px; }
.btn.leave { align-self: center; font-size: 15px; min-height: 44px; }
.nudge:empty { display: none; }
.nudge { background: #fff7d1; border: 3px dashed var(--ink); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; text-align: center; font-weight: 600; }

/* the glasses: one row when it fits, two rows on a phone. Drawn with CSS, no pictures. */
.rack { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 62px)); justify-content: center; gap: 34px 8px; padding: 30px 0 8px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.glass { position: relative; width: 100%; aspect-ratio: 1 / 3.1; min-width: 0; padding: 0; margin: 0; border: 0; background: none; border-radius: 0 0 18px 18px; transition: transform .2s ease-out; transform-origin: 50% 20%; }
.glass.picked { transform: translateY(-16px); }
.glass.pouring { z-index: 5; }
.glass.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tube { position: absolute; inset: 0; border: 3px solid var(--ink); border-top-width: 0; border-radius: 0 0 16px 16px; overflow: hidden; background: rgba(255, 255, 255, .6); box-shadow: inset 6px 0 0 rgba(255, 255, 255, .35); }
.tube::before { content: ''; position: absolute; left: -3px; right: -3px; top: 0; border-top: 3px solid var(--ink); opacity: .35; }
.glass.picked .tube { box-shadow: inset 6px 0 0 rgba(255, 255, 255, .35), 0 0 0 4px var(--yellow); }
.glass.complete .tube { box-shadow: inset 6px 0 0 rgba(255, 255, 255, .35), 0 0 0 3px var(--green); }
.layer { position: absolute; left: 0; right: 0; height: 25.5%; display: grid; place-items: center; border-top: 2px solid rgba(0, 0, 0, .18); transform-origin: 50% 100%; }
.layer.fresh { animation: rise .26s ease-out; }
@keyframes rise { 0% { transform: scaleY(0); } }
.layer .sym { width: 58%; max-width: 24px; height: auto; display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.layer.mystery { background: repeating-linear-gradient(45deg, #8d8a96 0 6px, #7b7885 6px 12px); }
.layer.mystery b { font: 18px/1 var(--display); color: #fff; padding-top: 3px; }
.lid { position: absolute; left: -4px; right: -4px; top: -15px; height: 19px; border: 3px solid var(--ink); border-radius: 8px 8px 3px 3px; display: grid; place-items: center; z-index: 2; }
.lid .sym { height: 11px; width: 11px; display: block; }
.badge { position: absolute; left: 50%; top: -26px; width: 34px; height: 34px; margin-left: -17px; object-fit: contain; z-index: 3; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.fb.badge { border-radius: 50%; background: var(--green); color: #fff; border: 2px solid var(--ink); font-size: 16px; width: 26px; height: 26px; margin-left: -13px; top: -20px; }
@keyframes pop { 0% { transform: scale(.2) rotate(-25deg); } }
.stream { position: absolute; left: 50%; top: -24%; bottom: 8%; width: 6px; margin-left: -3px; border-radius: 3px; z-index: 4; pointer-events: none; animation: flow .26s linear; }
@keyframes flow { 0% { clip-path: inset(0 0 100% 0); } 40% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(70% 0 0 0); } }
.rack.two .sym { max-width: 20px; }

.stars { display: flex; justify-content: center; gap: 2px; }
.stars i { font-style: normal; color: #d3cabc; line-height: 1; }
.stars i.on { color: #f5b301; text-shadow: 0 1px 0 #a87400; }
.stars.big { font-size: 46px; gap: 6px; } .stars.tiny { font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; }
.pager .btn { min-height: 44px; }
.lvls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.lvl { border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); min-height: 58px; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 3px 0 var(--ink); }
.lvl b { font: 20px/1 var(--display); padding-top: 3px; }
.lvl small { font-size: 10px; font-weight: 600; color: var(--muted); }
.lvl.done { background: #e3f7ea; } .lvl.next { background: var(--yellow); }
.lvl.locked { opacity: .5; box-shadow: none; }
dialog .btn.orange { display: block; }

@media (max-width: 380px) { .logo { font-size: 22px; } .rack { gap: 34px 5px; } }
@media (prefers-reduced-motion: reduce) {
  .glass, .btn { transition: none; }
  .glass.shake, .layer.fresh, .badge, .stream { animation: none; }
}
