:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #f3f7ed;
  background: #102526;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --mint: #b7f36b;
  --muted: #94aaa1;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { min-width: 320px; }
button, a { font: inherit; }
button { color: inherit; }

.game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 49% 54%, rgba(41, 87, 71, .58) 0%, rgba(20, 54, 49, .46) 32%, transparent 68%),
    radial-gradient(ellipse at 12% 8%, rgba(39, 85, 71, .34), transparent 38%),
    #102526;
}

.game::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(200, 238, 194, .22) .7px, transparent .7px);
  background-size: 34px 34px;
  content: "";
  opacity: .12;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 83%);
}

.game::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1px solid rgba(221, 247, 205, .08);
  content: "";
  pointer-events: none;
}

.game__canvas { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.grain { position: absolute; z-index: 2; inset: 0; pointer-events: none; opacity: .13; }
.topbar, .hud, .speed-badge, .bottom-bar, .center-message { position: absolute; z-index: 3; }

.topbar {
  top: 0;
  left: 0;
  right: 0;
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6.1%;
  border-bottom: 1px solid rgba(215, 240, 215, .09);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: #f3f7ed; text-decoration: none; font: 700 21px "Trebuchet MS", "Segoe UI", sans-serif; letter-spacing: -1.1px; }
.brand__icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 10px 10px 10px 3px; background: var(--mint); color: #16342c; font: 700 23px "Trebuchet MS", "Segoe UI", sans-serif; transform: rotate(-6deg); }
.brand__dot { color: var(--mint); }
.topbar__tag { color: #92aaa0; font-size: 9px; font-weight: 700; letter-spacing: 1.75px; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin: 0 9px 1px 0; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(183, 243, 107, .7); }
.leaderboard-button { padding: 10px 13px; border: 1px solid rgba(183, 243, 107, .25); border-radius: 8px; background: rgba(183, 243, 107, .07); color: var(--mint); font-size: 9px; font-weight: 800; letter-spacing: .8px; cursor: pointer; transition: background .18s, border-color .18s; }
.leaderboard-button:hover { border-color: rgba(183, 243, 107, .55); background: rgba(183, 243, 107, .13); }
.leaderboard-button span { margin-right: 5px; }
.sound-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(213, 238, 215, .14); border-radius: 50%; background: rgba(255, 255, 255, .035); cursor: pointer; }
.sound-button svg { width: 17px; fill: none; stroke: #a7b9ad; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.sound-button.is-on svg { stroke: var(--mint); }

.hud { top: 130px; left: 6.1%; display: flex; align-items: flex-start; gap: 42px; pointer-events: none; }
.score-card { display: flex; min-width: 153px; flex-direction: column; }
.eyebrow { color: #91a99f; font-size: 9px; font-weight: 700; letter-spacing: 1.7px; }
.score-value { margin: 2px 0 0 -2px; color: #f3f7ed; font: 600 48px/.98 "Trebuchet MS", "Segoe UI", sans-serif; letter-spacing: -3px; font-variant-numeric: tabular-nums; }
.combo { margin-top: 8px; color: #97afa4; font-size: 10px; }
.thirst-card { width: 184px; padding-top: 5px; transition: filter .25s; }
.thirst-card.is-low { filter: drop-shadow(0 0 8px rgba(255, 130, 97, .24)); }
.thirst-card__top { display: flex; justify-content: space-between; align-items: center; }
.thirst-card__top strong { color: var(--mint); font: 600 12px "Trebuchet MS", "Segoe UI", sans-serif; }
.drop-icon { margin-right: 4px; color: #8adfd0; font-size: 9px; }
.water-track { position: relative; display: block; height: 5px; margin-top: 11px; overflow: hidden; border-radius: 8px; background: rgba(221, 244, 221, .12); }
.water-track__fill { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #78d8c1, #b7f36b); transition: width .16s linear, background .3s; }
.thirst-card.is-low .water-track__fill { background: linear-gradient(90deg, #fb9c68, #ff675d); }
.water-hint { display: block; margin-top: 8px; color: #7f998e; font-size: 9px; }

.speed-badge { top: 137px; right: 6.1%; display: flex; align-items: center; gap: 9px; color: var(--mint); }
.speed-badge__arrow { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(183, 243, 107, .3); border-radius: 50%; font-size: 16px; }
.speed-badge strong { display: block; font: 600 19px/1 "Trebuchet MS", "Segoe UI", sans-serif; }
.speed-badge small { display: block; margin-top: 3px; color: #8ca397; font-size: 8px; font-weight: 700; letter-spacing: 1.4px; }

.center-message { inset: 0; display: grid; place-items: center; pointer-events: none; }
.intro-card, .end-card { width: min(410px, calc(100vw - 40px)); max-height: calc(100% - 40px); overflow-y: auto; padding: 32px 35px 27px; border: 1px solid rgba(216, 247, 220, .13); border-radius: 19px; background: rgba(15, 37, 36, .88); box-shadow: 0 25px 90px rgba(3, 15, 16, .35); text-align: center; backdrop-filter: blur(15px); pointer-events: auto; animation: arrive .45s ease-out both; }
.intro-card__stamp { color: var(--mint); font-size: 8px; font-weight: 800; letter-spacing: 1.8px; }
.intro-card h1, .end-card h2 { margin: 14px 0 11px; color: #f2f6ea; font: 600 49px/.99 "Trebuchet MS", "Segoe UI", sans-serif; letter-spacing: -3px; }
.intro-card h1 span, .end-card h2 span { color: var(--mint); }
.intro-card p, .end-card p { margin: 0; color: #a1b5a7; font-size: 12px; line-height: 1.75; }
.play-button { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 24px; padding: 13px 15px 13px 18px; border: 0; border-radius: 9px; background: var(--mint); color: #18382c; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .18s, background .18s; }
.play-button:hover { transform: translateY(-2px); background: #c9ff83; }
.play-button:active { transform: translateY(0); }
.play-button__arrow { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 6px; background: rgba(29, 60, 42, .1); font-size: 16px; }
.how-to { margin-top: 19px; color: #779085; font-size: 7px; font-weight: 700; letter-spacing: 1px; }
.how-to span { color: #bdd0bd; }
.how-to i { margin: 0 7px; color: #48645a; font-style: normal; }
.end-card { padding-top: 27px; }
.end-card__icon { margin-bottom: 7px; color: #ff9972; font: 400 27px "Trebuchet MS", "Segoe UI", sans-serif; }
.end-card h2 { font-size: 43px; }
.end-card p strong { color: var(--mint); }
.score-form { margin-top: 17px; text-align: left; }
.score-form label { display: block; margin-bottom: 7px; color: #a1b5a7; font-size: 10px; }
.score-form__row { display: flex; gap: 7px; }
.score-form input { min-width: 0; flex: 1; padding: 11px 12px; border: 1px solid rgba(216, 247, 220, .17); border-radius: 8px; outline: none; background: rgba(4, 20, 19, .45); color: #f3f7ed; font-size: 12px; }
.score-form input:focus { border-color: rgba(183, 243, 107, .7); }
.score-form input::placeholder { color: #627a6e; }
.score-submit { padding: 0 13px; border: 0; border-radius: 8px; background: #b7f36b; color: #18382c; font-size: 10px; font-weight: 800; cursor: pointer; }
.score-submit:disabled { opacity: .6; cursor: wait; }
.score-form__message { display: block; min-height: 15px; margin-top: 7px; color: #a1b5a7; font-size: 9px; line-height: 1.5; }
.score-form__message.is-error { color: #ff9972; }
.leaderboard-overlay { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(4, 16, 16, .72); backdrop-filter: blur(8px); }
.leaderboard-dialog { width: min(430px, 100%); max-height: min(690px, calc(100vh - 40px)); overflow: auto; padding: 27px 29px 21px; border: 1px solid rgba(216, 247, 220, .15); border-radius: 17px; background: #122c29; box-shadow: 0 25px 90px rgba(3, 15, 16, .5); }
.leaderboard-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; }
.leaderboard-dialog__header h2 { margin: 7px 0 18px; color: #f2f6ea; font: 600 30px "Trebuchet MS", "Segoe UI", sans-serif; letter-spacing: -1.2px; }
.leaderboard-close { width: 34px; height: 34px; border: 1px solid rgba(216, 247, 220, .15); border-radius: 50%; background: transparent; color: #a1b5a7; font-size: 23px; line-height: 1; cursor: pointer; }
.leaderboard-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.leaderboard-entry { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid rgba(216, 247, 220, .07); border-radius: 9px; background: rgba(255, 255, 255, .025); }
.leaderboard-entry:first-child { border-color: rgba(183, 243, 107, .2); background: rgba(183, 243, 107, .06); }
.leaderboard-rank { color: #849b8f; font: 700 12px "Trebuchet MS", "Segoe UI", sans-serif; }
.leaderboard-entry:first-child .leaderboard-rank { color: var(--mint); }
.leaderboard-name { overflow: hidden; color: #e7efe3; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-date { display: block; margin-top: 3px; color: #789084; font-size: 8px; font-weight: 400; }
.leaderboard-score { color: var(--mint); font: 700 13px "Trebuchet MS", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.leaderboard-status { margin: 13px 0 0; color: #a1b5a7; font-size: 10px; text-align: center; }
.leaderboard-note { margin: 16px 0 0; color: #71877c; font-size: 9px; line-height: 1.6; text-align: center; }
[hidden] { display: none !important; }
.center-message.is-playing { display: none; }

.bottom-bar { right: 6.1%; bottom: 0; left: 6.1%; display: flex; height: 66px; align-items: center; justify-content: space-between; border-top: 1px solid rgba(215, 240, 215, .09); }
.bottom-tip { color: #91a89d; font-size: 8px; font-weight: 700; letter-spacing: 1.15px; }
.bottom-tip i { margin: 0 5px; color: var(--mint); font-size: 12px; font-style: normal; }
.tip-sparkle { margin-right: 7px; color: var(--mint); font-size: 12px; vertical-align: -1px; }
.hit-popups { position: absolute; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.hit-popup { position: absolute; color: var(--mint); font: 700 17px "Trebuchet MS", "Segoe UI", sans-serif; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); animation: pop-up .8s ease-out forwards; }

@keyframes arrive { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pop-up { from { opacity: 0; transform: translate(-50%, 3px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -3px) scale(1.05); } to { opacity: 0; transform: translate(-50%, -42px) scale(1); } }

@media (max-width: 640px) {
  .topbar { height: 72px; padding: 0 14px; }
  .brand { font-size: 19px; }
  .brand__icon { width: 27px; height: 27px; }
  .topbar__tag { display: none; }
  .leaderboard-button { padding: 9px 10px; font-size: 8px; }
  .leaderboard-button span { margin-right: 3px; }
  .live-dot { margin-right: 5px; }
  .sound-button { width: 35px; height: 35px; }
  .hud { top: 97px; left: 22px; gap: 17px; }
  .score-card { min-width: 105px; }
  .score-value { font-size: 40px; }
  .thirst-card { width: min(158px, 37vw); }
  .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
  .speed-badge { top: 103px; right: 22px; transform: translateY(58px); }
  .speed-badge__arrow { width: 26px; height: 26px; }
  .speed-badge strong { font-size: 16px; }
  .bottom-bar { right: 22px; bottom: 0; left: 22px; height: 54px; }
  .bottom-tip { font-size: 7px; letter-spacing: .6px; }
  .bottom-tip--right { text-align: right; }
  .intro-card { padding: 27px 24px 23px; }
  .intro-card h1 { font-size: 44px; }
  .leaderboard-dialog { padding: 23px 20px 17px; }
}

@media (max-height: 560px) {
  .topbar { height: 65px; }
  .hud { top: 83px; }
  .speed-badge { top: 89px; }
  .intro-card { padding: 19px 25px 17px; }
  .intro-card h1 { margin: 9px 0; font-size: 39px; }
  .intro-card p { font-size: 11px; }
  .play-button { margin-top: 14px; padding: 10px 13px 10px 16px; }
  .how-to { margin-top: 13px; }
  .bottom-bar { height: 47px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
