:root {
  color-scheme: dark;
  --red: #ef2838; --red-dark: #a50d19; --navy: #06395f; --navy-deep: #021d3d; --sky: #079ce5; --yellow: #ffda4c; --muted: #b6deed; --glass: rgba(3, 42, 74, .9);
  --app-safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --app-safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px));
  --app-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  --app-safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--sky); font-family: Arial, Helvetica, sans-serif; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
button, textarea { font: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
button:focus-visible, textarea:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
button:disabled { cursor: progress; }
#app { position: fixed; top: 0; left: 0; width: var(--app-width, 100%); height: var(--app-height, 100%); min-width: 280px; overflow: hidden; isolation: isolate; touch-action: pan-y; }
#game { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: none; touch-action: none; }
.hidden { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

.hud { position: absolute; z-index: 5; top: calc(var(--app-safe-top) + 12px); left: calc(var(--app-safe-left) + 12px); display: grid; grid-template-columns: 61px minmax(54px, auto) 62px minmax(86px, 1fr); grid-template-rows: 40px 15px; column-gap: 13px; align-items: center; width: min(405px, calc(100% - var(--app-safe-left) - var(--app-safe-right) - 174px)); min-height: 73px; padding: 8px 13px 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: linear-gradient(135deg, rgba(6,65,103,.96), var(--glass)); color: #fff; box-shadow: 0 8px 25px rgba(0,35,65,.14), inset 0 1px 0 rgba(255,255,255,.13); backdrop-filter: blur(10px); pointer-events: none; }
.brand { grid-row: 1 / 3; transform: rotate(-3deg); }
.brand img, .start-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 5px 8px rgba(0,20,50,.25)); }
.score-stat { align-self: start; }
.score-stat small { display: block; margin: 0 0 1px; color: #a5dced; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.score-stat strong { display: block; font-size: 28px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.lives { display: flex; gap: 4px; justify-content: center; padding-top: 1px; }
.lives i { width: 17px; height: 21px; font-style: normal; }
.lives i::before { content: '♥'; color: #ff5362; font-size: 24px; line-height: 1; text-shadow: 0 2px 1px #a71630; }
.lives i.lost::before { color: #52809c; opacity: .48; text-shadow: none; }
.lives.last-life i:not(.lost) { animation: heart-pulse 1s ease-in-out infinite; }
.hud.last-life { border-color: rgba(255,92,105,.7); }
.hud-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta-label { color: #b4d9e9; font-size: 10px; }
.hud-meta b { margin-left: 3px; font-size: 13px; }
.trophy, .gold { color: var(--yellow); }
.record-goal { grid-row: 2; grid-column: 2 / 5; color: #a6d7e9; font-size: 9px; line-height: 1.2; letter-spacing: .01em; }
.record-goal.reached { color: var(--yellow); }
.actions { position: absolute; z-index: 8; top: calc(var(--app-safe-top) + 17px); right: calc(var(--app-safe-right) + 12px); display: flex; gap: 7px; }
.round-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: #fff; border: 1px solid rgba(255,255,255,.23); border-radius: 15px; background: linear-gradient(150deg, rgba(8,69,108,.97), rgba(2,36,67,.96)); box-shadow: 0 5px 15px rgba(0,34,60,.2), inset 0 1px 0 rgba(255,255,255,.1); font-size: 21px; font-weight: 900; }
.round-button:active { transform: translateY(2px); }
.round-button.muted { color: #a3c4d7; }
.round-button.muted::after { position: absolute; content: ''; width: 24px; height: 2px; transform: rotate(-45deg); background: #ff7180; }
.standalone #fullscreenBtn { display: none; }
.combo { position: absolute; z-index: 7; top: calc(var(--app-safe-top) + 92px); left: calc(var(--app-safe-left) + 16px); width: min(286px, calc(100% - var(--app-safe-left) - var(--app-safe-right) - 32px)); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 150ms ease, transform 150ms ease, visibility 150ms; pointer-events: none; }
.combo.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.combo-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 5px; color: #fff; text-shadow: 0 1px 4px rgba(0,25,60,.75); }
.combo-heading strong { color: var(--yellow); font-size: 13px; font-weight: 900; letter-spacing: .015em; white-space: nowrap; }
.combo-heading span { font-size: 10px; white-space: nowrap; }
.combo-track { height: 4px; overflow: hidden; border-radius: 20px; background: rgba(0,35,65,.3); }
.combo-track span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; border-radius: inherit; background: var(--yellow); will-change: transform; }
.combo.expiring .combo-track span { background: #ff8692; }
.combo.max-combo strong { color: #fff3b4; }
.notice { position: absolute; z-index: 9; left: 50%; top: calc(var(--app-safe-top) + 136px); width: max-content; max-width: calc(100% - var(--app-safe-left) - var(--app-safe-right) - 30px); padding: 9px 15px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.2); border-radius: 30px; background: rgba(2,39,70,.89); color: #fff; font-size: 13px; font-weight: 800; text-align: center; pointer-events: none; box-shadow: 0 4px 16px rgba(0,25,60,.16); }
.notice[data-kind="record"], .notice[data-kind="milestone"] { color: var(--yellow); border-color: rgba(255,218,76,.6); }
.notice[data-kind="danger"], .notice[data-kind="error"] { background: #85223d; }
.effects { position: absolute; z-index: 7; right: calc(var(--app-safe-right) + 12px); bottom: calc(var(--app-safe-bottom) + 12px); display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.effect { display: flex; align-items: baseline; gap: 8px; min-width: 94px; padding: 9px 12px; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 13px; box-shadow: 0 5px 16px rgba(0,31,55,.2); font-size: 10px; font-weight: 900; backdrop-filter: blur(8px); }
.effect b { margin-left: auto; font-size: 16px; font-variant-numeric: tabular-nums; }
.magnet-effect { background: linear-gradient(130deg, rgba(219,31,63,.95), rgba(123,22,59,.95)); }
.ice-effect { background: linear-gradient(130deg, rgba(35,142,205,.95), rgba(14,74,137,.95)); }
.effect.expiring { animation: effect-pulse .75s ease-in-out infinite; border-color: #fff; }
.tutorial { position: absolute; z-index: 10; left: 50%; bottom: calc(var(--app-safe-bottom) + 22px); width: min(370px, calc(100% - var(--app-safe-left) - var(--app-safe-right) - 28px)); padding: 10px 16px 15px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.35); border-radius: 19px; background: rgba(2,33,64,.94); box-shadow: 0 8px 26px rgba(0,25,55,.25); color: #fff; pointer-events: none; }
.tutorial-top { display: flex; align-items: center; justify-content: space-between; color: var(--yellow); font-size: 11px; font-weight: 900; }
.tutorial .text-button { min-height: 34px; padding: 5px 0 5px 12px; color: #b1d6e9; font-size: 11px; pointer-events: auto; }
.tutorial p { margin: 3px 0 0; font-size: 16px; line-height: 1.35; font-weight: 700; }

.overlay { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--app-safe-top) + 16px) calc(var(--app-safe-right) + 16px) calc(var(--app-safe-bottom) + 16px) calc(var(--app-safe-left) + 16px); visibility: hidden; opacity: 0; background: rgba(0,38,73,.25); backdrop-filter: blur(6px); transition: opacity 160ms ease, visibility 160ms; pointer-events: none; touch-action: pan-y; }
.overlay.visible { visibility: visible; opacity: 1; pointer-events: auto; }
.card { width: min(100%, 450px); max-height: 100%; padding: 27px 28px 24px; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; color: #fff; border: 1px solid rgba(255,255,255,.26); border-radius: 28px; background: linear-gradient(150deg, rgba(8,68,108,.98), rgba(2,29,62,.98)); box-shadow: 0 24px 80px rgba(0,25,48,.4), inset 0 1px 0 rgba(255,255,255,.14); text-align: center; scrollbar-width: thin; scrollbar-color: rgba(153,210,238,.5) transparent; }
.card :not(button):not(textarea) { touch-action: pan-y; }
.card h1, .card h2, .card h3, .card p { margin-top: 0; }
.start-logo { width: 128px; margin: 0 auto 13px; transform: rotate(-3deg); }
.card h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.08; letter-spacing: -.04em; }
.lead { max-width: 335px; margin: 0 auto 16px; color: #d3eaf5; font-size: 14px; line-height: 1.4; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 0 11px; text-align: left; }
.rule { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 57px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.055); }
.rule > img { flex: 0 0 45px; width: 45px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,18,48,.18)); }
.rule > span { font-size: 11px; line-height: 1.3; }
.rule b { display: block; font-size: 13px; }
.danger-rule { grid-column: 1 / 3; padding: 6px 12px; min-height: 51px; background: rgba(225,74,84,.09); }
.danger-rule > img { margin-right: 4px; }
.danger-rule b { color: #ffbcc3; font-size: 12px; }
.danger-rule small { display: block; margin-top: 2px; color: #c7dcea; font-size: 11px; }
.combo-explainer { display: flex; justify-content: center; gap: 5px; margin-bottom: 17px; color: #afcfdf; font-size: 10px; line-height: 1.3; white-space: nowrap; }
.combo-explainer b { color: var(--yellow); font-weight: 700; }
.primary { width: 100%; min-height: 54px; padding: 13px 17px; color: #fff; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; background: linear-gradient(#ff4455, #e51e34); box-shadow: 0 5px 0 var(--red-dark), 0 10px 24px rgba(0,0,0,.2); font-size: 20px; font-weight: 900; letter-spacing: .02em; }
.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dark), 0 6px 14px rgba(0,0,0,.2); }
.primary:disabled { filter: saturate(.4); opacity: .65; }
.secondary { width: 100%; min-height: 44px; padding: 10px 13px; color: #e4f4fc; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 700; }
.secondary:active { background: rgba(255,255,255,.12); }
.text-button { min-height: 44px; padding: 10px; color: #b7deef; border: 0; background: none; font-size: 12px; font-weight: 700; }
.text-button:active { color: #fff; }
.load-message { margin: 15px 0 2px; color: #c3e3f1; font-size: 11px; line-height: 1.35; }
.load-message.load-error { color: #ffbdc6; }
.retry-button { margin: 10px 0 0; }
.start-options { display: flex; justify-content: space-between; gap: 10px; margin: 8px -6px 0; }
.controls-hint { margin: 1px 0 0; color: #b9dbe9; font-size: 11px; line-height: 1.4; }
.controls-hint span { display: block; margin-top: 3px; color: #84b3ce; font-size: 10px; }
.eyebrow { margin-bottom: 8px; color: #98d9f0; font-size: 10px; line-height: 1.4; font-weight: 800; letter-spacing: .14em; }
.pause-overlay { z-index: 18; background: rgba(0,29,57,.48); }
.pause-card { width: min(100%, 340px); padding-block: 33px 21px; }
.pause-card h2 { margin-bottom: 12px; font-size: 46px; letter-spacing: -.04em; }
.pause-note { margin-bottom: 24px; color: #c2dfec; font-size: 14px; line-height: 1.4; }
.pause-card .sound-preference { margin-top: 16px; }
.ios-fullscreen-help { z-index: 30; background: rgba(0,29,57,.58); }
.ios-help-card { width: min(100%, 410px); }
.ios-help-card h2 { margin-bottom: 14px; font-size: 31px; line-height: 1.06; letter-spacing: -.04em; }
.ios-help-lead, .ios-help-note { color: #cde5f1; font-size: 14px; line-height: 1.45; }
.ios-help-steps { display: grid; gap: 8px; margin: 18px 0; padding: 0; list-style: none; text-align: left; }
.ios-help-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; min-height: 62px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.06); font-size: 13px; line-height: 1.4; }
.ios-help-steps li > b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red); }
.ios-help-steps i { color: #9ee3ff; font-size: 20px; font-style: normal; }
.ios-help-note { margin-bottom: 21px; font-size: 12px; }
.result-card { width: min(100%, 430px); }
.result-card h2 { margin-bottom: 20px; font-size: 29px; line-height: 1.1; letter-spacing: -.04em; }
.score-caption { margin-bottom: 0; color: #a9cfdf; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.final-score { margin: 3px 0 4px; color: #fff; font-size: 72px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.055em; line-height: 1; }
.best-line { margin: 9px 0 16px; color: var(--yellow); font-size: 13px; font-weight: 800; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 18px; }
.result-stats > div { display: flex; flex-direction: column; gap: 5px; }
.result-stats span { color: #a8cddd; font-size: 10px; }
.result-stats b { font-size: 19px; font-variant-numeric: tabular-nums; }
.result-stats > div + div { border-left: 1px solid rgba(255,255,255,.1); }
.leaderboard { padding: 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(0,19,43,.28); }
.leaderboard h3 { margin-bottom: 5px; color: #c9e2ef; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.record-row { display: grid; grid-template-columns: 28px 1fr 1fr; align-items: center; min-height: 26px; padding: 5px 8px; border-radius: 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.record-row.current { background: rgba(241,44,66,.9); font-weight: 800; }
.record-head { min-height: 23px; color: #88b5cf; font-size: 9px; font-weight: 800; }
.local-note { margin: 9px 0 0; color: #8bb6cf; font-size: 9px; }
.result-message { margin: 15px 0 12px; color: #d2e8f3; font-size: 13px; line-height: 1.4; }
.share-button { margin-top: 15px; }
.share-status { margin: 10px 0 0; color: #bfdfee; font-size: 12px; line-height: 1.4; }
.share-fallback { display: block; width: 100%; margin-top: 10px; resize: vertical; padding: 10px; border: 1px solid #77b9db; border-radius: 10px; color: #f1f9ff; background: rgba(0,15,40,.6); font-size: 13px; line-height: 1.4; -webkit-user-select: text; user-select: text; touch-action: auto; }
noscript { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 30px; color: #fff; background: #073c66; text-align: center; }
@keyframes heart-pulse { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.22); } }
@keyframes effect-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@media (max-width: 600px) {
  .hud { right: calc(var(--app-safe-right) + 10px); left: calc(var(--app-safe-left) + 10px); top: calc(var(--app-safe-top) + 10px); width: auto; grid-template-columns: 49px minmax(45px, auto) 65px minmax(79px, 1fr); column-gap: 11px; grid-template-rows: 35px 13px; min-height: 65px; padding: 7px 12px 7px 8px; border-radius: 18px; }
  .score-stat strong { font-size: 25px; } .score-stat small { font-size: 8px; } .hud-meta { font-size: 10px; } .hud-meta b { font-size: 12px; } .record-goal { font-size: 9px; }
  .actions { top: calc(var(--app-safe-top) + 82px); right: calc(var(--app-safe-right) + 10px); gap: 5px; }
  .round-button { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }
  .combo { top: calc(var(--app-safe-top) + 87px); left: calc(var(--app-safe-left) + 13px); width: calc(100% - var(--app-safe-left) - var(--app-safe-right) - 172px); }
  .combo-heading { flex-wrap: wrap; gap: 2px 5px; padding-bottom: 6px; } .combo-heading strong { font-size: 11px; } .combo-heading span { font-size: 9px; }
  .notice { top: calc(var(--app-safe-top) + 130px); font-size: 12px; }
  .card { padding: 22px; border-radius: 24px; } .start-logo { width: 118px; margin-bottom: 11px; } .card h1 { font-size: 28px; } .result-card h2 { font-size: 27px; }
}
@media (max-width: 360px) {
  .overlay { padding: calc(var(--app-safe-top) + 10px) calc(var(--app-safe-right) + 10px) calc(var(--app-safe-bottom) + 10px) calc(var(--app-safe-left) + 10px); }
  .card { padding: 18px 17px; border-radius: 21px; } .start-logo { width: 99px; margin-bottom: 10px; } .card h1 { font-size: 25px; } .lead { margin-bottom: 13px; font-size: 13px; }
  .rule { gap: 3px; padding-inline: 4px; min-height: 51px; } .rule > img { flex-basis: 39px; width: 39px; height: 36px; } .rule > span { font-size: 10px; } .rule b { font-size: 12px; }
  .danger-rule { padding-left: 7px; min-height: 48px; } .danger-rule b, .danger-rule small { font-size: 10px; }
  .combo-explainer { gap: 3px; font-size: 9px; } .hud { grid-template-columns: 41px minmax(44px, auto) 57px minmax(77px, 1fr); column-gap: 9px; } .lives { gap: 2px; } .lives i { width: 17px; }
  .combo-heading { flex-wrap: wrap; gap: 0 6px; } .combo-heading span { font-size: 8px; } .primary { min-height: 51px; font-size: 18px; } .result-card h2 { margin-bottom: 15px; } .final-score { font-size: 62px; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .card { padding-block: 18px; } .start-logo { width: 92px; margin-bottom: 10px; } .start-card h1 { font-size: 25px; } .lead { margin-bottom: 13px; }
  .rules { gap: 5px; margin-bottom: 8px; } .rule { min-height: 49px; } .combo-explainer { margin-bottom: 14px; } .start-options { margin-top: 3px; }
  .result-card h2 { margin-bottom: 13px; } .final-score { font-size: 60px; } .result-stats { margin-bottom: 13px; padding-block: 10px; } .result-message { margin-top: 12px; }
}
@media (orientation: landscape) and (max-height: 550px) {
  .overlay { padding-top: calc(var(--app-safe-top) + 12px); padding-bottom: calc(var(--app-safe-bottom) + 12px); } .card { padding: 20px 24px; }
  .start-card, .result-card { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: center; width: min(100%, 760px); }
  .start-logo { width: 115px; margin-bottom: 15px; } .start-card h1 { font-size: 27px; } .lead { margin-bottom: 0; font-size: 13px; } .rules { gap: 5px; } .rule { min-height: 45px; } .rule > img { height: 33px; }
  .combo-explainer { margin-bottom: 12px; } .primary { min-height: 47px; padding-block: 11px; font-size: 18px; } .load-message { margin-top: 12px; } .start-options { margin-top: 0; } .controls-hint { display: none; }
  .result-card h2 { margin-bottom: 14px; font-size: 27px; } .final-score { font-size: 68px; } .result-stats { margin-bottom: 0; } .result-message { margin-block: 11px; } .leaderboard { padding: 8px; } .share-button { margin-top: 12px; }
  .hud { top: calc(var(--app-safe-top) + 8px); min-height: 65px; grid-template-rows: 35px 13px; } .actions { top: calc(var(--app-safe-top) + 10px); } .combo { top: calc(var(--app-safe-top) + 80px); } .notice { top: calc(var(--app-safe-top) + 115px); }
  .tutorial { width: min(400px, 70%); bottom: calc(var(--app-safe-bottom) + 12px); padding-block: 6px 10px; } .tutorial p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (orientation: landscape) and (max-width: 600px) {
  .actions { top: calc(var(--app-safe-top) + 82px); }
  .combo { top: calc(var(--app-safe-top) + 87px); }
  .notice { top: calc(var(--app-safe-top) + 135px); }
}
