:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8fbff;
  background: #02040d;
  font-synthesis: none;
  --cyan: #6cf3ff;
  --violet: #8d6cff;
  --pink: #ff4f9b;
  --amber: #ffd166;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 13% -8%, rgba(34, 210, 255, .18), transparent 32rem),
    radial-gradient(circle at 88% 6%, rgba(143, 88, 255, .2), transparent 35rem),
    linear-gradient(145deg, #030715 0%, #090c21 54%, #02040b 100%);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(111, 232, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 232, 255, .025) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
button { font: inherit; }
.game-shell { width: min(1280px, 100%); margin: 0 auto; padding: clamp(14px, 2.7vw, 30px); }
.game-header, .score-strip, footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(130, 237, 255, .8);
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, rgba(112, 244, 255, .22), transparent 43%), linear-gradient(135deg, #101d4a, #30106b 72%, #0a1028);
  box-shadow: 0 0 0 5px rgba(124, 83, 255, .08), 0 12px 34px rgba(27, 196, 255, .2), inset 0 1px 0 rgba(255,255,255,.28);
  font-family: Georgia, serif;
  font-size: 1.42rem;
  font-style: italic;
  font-weight: 900;
  transform: rotate(-4deg);
}
.brand-mark::after { position: absolute; inset: 5px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; content: ""; }
.brand-lockup h1 { margin: -1px 0 0; font-size: clamp(1.35rem, 4vw, 2.05rem); font-style: italic; letter-spacing: .14em; line-height: 1; }
.eyebrow, .panel-tag { color: var(--cyan); font-size: .62rem; font-weight: 900; letter-spacing: .2em; }
.brand-subline { display: block; margin-top: 5px; color: #697a98; font-size: .52rem; font-weight: 850; letter-spacing: .17em; }
.utility-button {
  position: relative;
  padding: 10px 14px 10px 29px;
  border: 1px solid rgba(113, 222, 255, .3);
  border-radius: 10px;
  color: #d9faff;
  background: linear-gradient(180deg, rgba(18, 32, 65, .88), rgba(7, 13, 30, .88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 22px rgba(0,0,0,.18);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .09em;
  cursor: pointer;
}
.utility-button::before { position: absolute; left: 13px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #54f0c0; box-shadow: 0 0 10px #54f0c0; content: ""; transform: translateY(-50%); }
.utility-button[aria-pressed="false"] { color: #7e899f; border-color: rgba(126, 137, 159, .22); }
.utility-button[aria-pressed="false"]::before { background: #5e687e; box-shadow: none; }

.score-strip {
  position: relative;
  margin: 19px 0 12px;
  padding: 13px clamp(10px, 2vw, 24px);
  overflow: hidden;
  border: 1px solid rgba(106, 222, 255, .19);
  border-radius: 14px;
  background: linear-gradient(105deg, rgba(8, 18, 41, .94), rgba(10, 12, 35, .9) 56%, rgba(25, 11, 51, .88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 15px 40px rgba(0, 0, 0, .2);
}
.score-strip::after { position: absolute; right: -8%; bottom: -25px; width: 42%; height: 42px; background: linear-gradient(90deg, transparent, rgba(112, 239, 255, .08), transparent); content: ""; transform: skewX(-24deg); }
.score-strip div { position: relative; z-index: 1; display: grid; min-width: 76px; text-align: center; }
.score-strip span { color: #7889a7; font-size: .56rem; font-weight: 850; letter-spacing: .17em; }
.score-strip strong { margin-top: 3px; font-size: clamp(1.05rem, 3vw, 1.7rem); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(110, 237, 255, .13); }
#health { color: var(--cyan); letter-spacing: .1em; }
#health.danger { color: #ff568e; animation: warningPulse .65s ease-in-out infinite alternate; }

.runner-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(89, 217, 255, .31);
  border-radius: 22px;
  background: #050919;
  box-shadow: 0 30px 95px rgba(0,0,0,.52), 0 0 65px rgba(35, 185, 255, .075), inset 0 0 0 1px rgba(255,255,255,.025);
  isolation: isolate;
}
.runner-wrap::before { position: absolute; z-index: 2; inset: 0; border-radius: inherit; background: linear-gradient(105deg, rgba(100, 235, 255, .07), transparent 17%, transparent 82%, rgba(145, 78, 255, .08)); box-shadow: inset 0 0 45px rgba(1, 3, 12, .44); content: ""; pointer-events: none; }
.runner-wrap::after { position: absolute; z-index: 3; inset: 0; opacity: .17; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(3, 8, 23, .26) 3px 4px); content: ""; pointer-events: none; }
canvas { position: relative; z-index: 1; display: block; width: 100%; max-width: 100%; height: auto; touch-action: none; user-select: none; }
.game-panel {
  position: absolute;
  z-index: 6;
  inset: 50% auto auto 50%;
  width: min(610px, calc(100% - 30px));
  transform: translate(-50%, -50%);
  padding: clamp(24px, 5vw, 43px);
  overflow: hidden;
  border: 1px solid rgba(103, 218, 255, .34);
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(140deg, rgba(13, 27, 56, .97), rgba(6, 10, 28, .96) 56%, rgba(29, 10, 54, .95));
  box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(10,16,38,.8);
  backdrop-filter: blur(18px);
}
.game-panel::before { position: absolute; top: 0; left: 13%; width: 74%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), #b58aff, transparent); box-shadow: 0 0 18px var(--cyan); content: ""; }
.game-panel::after { position: absolute; right: -50px; top: -65px; width: 190px; height: 190px; border: 1px solid rgba(139, 100, 255, .12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(139,100,255,.025), 0 0 0 56px rgba(97,231,255,.018); content: ""; pointer-events: none; }
.game-panel > * { position: relative; z-index: 1; }
.game-panel h2 { margin: 10px 0 12px; font-size: clamp(1.55rem, 5vw, 2.75rem); line-height: 1.03; letter-spacing: -.045em; text-wrap: balance; }
.game-panel h2 em { color: var(--cyan); font-style: normal; text-shadow: 0 0 28px rgba(85, 230, 255, .25); }
.game-panel > p { max-width: 480px; margin: 0 auto 21px; color: #afbdd2; font-size: .89rem; line-height: 1.58; }
.panel-tag { display: inline-flex; align-items: center; gap: 8px; }
.panel-tag::before { width: 20px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; content: ""; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 21px; margin: 0 0 23px; color: #d3dced; font-size: .71rem; font-weight: 760; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { position: relative; display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; font-size: .66rem; font-style: normal; font-weight: 950; box-shadow: inset 0 1px 0 rgba(255,255,255,.28); }
.clip-icon { color: #06151e; background: linear-gradient(145deg, #86f8ff, #36bfe9); }
.boost-icon { border: 1px solid #ffe69b; background: linear-gradient(145deg, #ffd96c, #df8e24); }
.boost-icon::before { position: absolute; width: 5px; height: 16px; background: #241303; content: ""; transform: skewX(-22deg); }
.boost-icon::after { position: absolute; width: 13px; height: 3px; background: #241303; content: ""; transform: rotate(-48deg); }
.danger-icon { color: #fff; background: linear-gradient(145deg, #ff6a9e, #c52264); }
.primary-button {
  min-width: 190px;
  padding: 15px 23px;
  border: 0;
  border-radius: 12px;
  color: #031118;
  background: linear-gradient(105deg, #6bf4a0, #62eef0 50%, #71a1ff);
  box-shadow: 0 13px 36px rgba(65, 208, 239, .23), inset 0 1px 0 rgba(255,255,255,.6);
  font-size: .75rem;
  font-weight: 950;
  letter-spacing: .1em;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 17px 42px rgba(65, 208, 239, .3), inset 0 1px 0 rgba(255,255,255,.65); }
.primary-button:focus-visible, .utility-button:focus-visible, .jump-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.game-panel small { display: block; margin-top: 13px; color: #71809a; font-size: .63rem; letter-spacing: .02em; }
.hidden { display: none; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0 0 23px; }
.result-grid div { display: grid; gap: 3px; padding: 12px 6px; border: 1px solid rgba(104, 218, 255, .15); border-radius: 11px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)); }
.result-grid strong { color: var(--cyan); font-size: 1.38rem; font-variant-numeric: tabular-nums; }
.result-grid span { color: #8492aa; font-size: .6rem; font-weight: 700; letter-spacing: .02em; }
.callout {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 15%;
  opacity: 0;
  transform: translate(-50%, -8px) scale(.94);
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--callout, #59e9ff) 46%, transparent);
  border-radius: 8px;
  color: #fff;
  background: rgba(4, 8, 22, .72);
  box-shadow: 0 9px 27px rgba(0,0,0,.32), 0 0 20px color-mix(in srgb, var(--callout, #59e9ff) 24%, transparent);
  font-size: clamp(.92rem, 3.3vw, 1.5rem);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: .07em;
  text-shadow: 0 0 15px var(--callout, #59e9ff);
  pointer-events: none;
  transition: opacity .14s ease, transform .18s ease;
}
.callout.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.jump-button {
  position: absolute;
  z-index: 7;
  right: 18px;
  bottom: 18px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(116, 238, 255, .7);
  border-radius: 24px;
  color: #efffff;
  background: linear-gradient(145deg, rgba(43, 145, 186, .9), rgba(48, 53, 145, .88));
  box-shadow: 0 10px 32px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.23), inset 0 0 22px rgba(77, 225, 255, .15);
  font-size: .65rem;
  font-weight: 950;
  letter-spacing: .11em;
  cursor: pointer;
  touch-action: manipulation;
}
.jump-button::before { display: block; width: 14px; height: 14px; margin: 0 auto 5px; border-top: 3px solid currentColor; border-left: 3px solid currentColor; content: ""; transform: rotate(45deg); }
.jump-button:active { transform: scale(.94); }

.how-to { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.how-to div { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; overflow: hidden; border: 1px solid rgba(105, 220, 255, .11); border-radius: 12px; background: linear-gradient(115deg, rgba(10, 20, 43, .8), rgba(9, 11, 29, .73)); }
.how-to div::after { position: absolute; right: -16px; width: 44px; height: 44px; border: 1px solid rgba(96, 230, 255, .08); border-radius: 50%; content: ""; }
.how-to strong { color: var(--cyan); font-size: .77rem; }
.how-to span { color: #8d9ab0; font-size: .68rem; }
footer { padding: 15px 3px 0; color: #697891; font-size: .68rem; }
footer p { margin: 0; }
footer strong { color: #b5c2d4; }

@keyframes warningPulse { to { text-shadow: 0 0 16px rgba(255, 66, 129, .9); } }

@media (max-width: 680px) {
  .game-shell { padding: 10px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 14px; font-size: 1.08rem; }
  .game-header { gap: 8px; }
  .brand-subline { display: none; }
  .utility-button { padding: 8px 9px 8px 23px; font-size: .58rem; }
  .utility-button::before { left: 10px; width: 6px; height: 6px; }
  .score-strip { gap: 2px; margin-top: 12px; padding-inline: 7px; }
  .score-strip div { min-width: 0; }
  .score-strip span { font-size: .46rem; letter-spacing: .07em; }
  .score-strip strong { font-size: .96rem; }
  .runner-wrap { height: min(500px, calc(100vh - 215px)); min-height: 390px; border-radius: 17px; }
  canvas { width: 100%; height: 100%; object-fit: cover; object-position: left center; }
  .game-panel { width: calc(100% - 18px); padding: 17px 14px; border-radius: 17px; }
  .game-panel h2 { margin: 7px 0 9px; font-size: 1.45rem; }
  .game-panel > p { margin-bottom: 13px; font-size: .71rem; line-height: 1.4; }
  .panel-tag { font-size: .5rem; letter-spacing: .15em; }
  .legend { gap: 7px 12px; margin-bottom: 14px; font-size: .6rem; }
  .legend i { width: 23px; height: 23px; }
  .primary-button { min-width: 165px; padding: 11px 15px; font-size: .65rem; }
  .game-panel small { margin-top: 9px; font-size: .51rem; }
  .jump-button { right: 10px; bottom: 10px; width: 61px; height: 61px; border-radius: 19px; font-size: .5rem; }
  .jump-button::before { width: 11px; height: 11px; margin-bottom: 3px; }
  .result-grid strong { font-size: 1.08rem; }
  .result-grid span { font-size: .53rem; }
  .how-to { grid-template-columns: 1fr; gap: 5px; }
  .how-to div { padding: 8px 11px; }
  footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}

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