:root {
  --ink: #f8f7ff;
  --muted: #a7abca;
  --panel: rgba(20, 25, 65, 0.82);
  --panel-border: rgba(255, 255, 255, 0.13);
  --violet: #a879ff;
  --pink: #ff8fc6;
  --cyan: #6de7e8;
  --night: #090d29;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 7%, rgba(104, 93, 218, 0.22), transparent 28rem),
    radial-gradient(circle at 90% 88%, rgba(225, 109, 175, 0.12), transparent 25rem),
    #090d29;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 201, 236, 0.42);
  border-radius: 14px;
  color: #ffd2ee;
  background: linear-gradient(135deg, rgba(171, 124, 255, 0.35), rgba(255, 143, 198, 0.23));
  box-shadow: 0 0 28px rgba(181, 117, 255, 0.25);
  font-size: 22px;
}

.eyebrow,
.screen-kicker,
.hud-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.3;
}

.brand-lockup h1 {
  margin: 2px 0 0;
  color: #fff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1;
}

.topbar-note {
  color: #8f94b7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.topbar-note span {
  padding: 0 7px;
  color: var(--pink);
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: rgba(15, 19, 51, 0.74);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.28) inset;
  backdrop-filter: blur(16px);
}

.hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  min-height: 67px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 17, 47, 0.77);
}

.hud-pill {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hud-pill-center {
  justify-content: center;
}

.hud-pill-right {
  justify-content: flex-end;
}

.hud-pill strong {
  min-width: 50px;
  color: #fff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  background: #24234f;
  isolation: isolate;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  touch-action: manipulation;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 26px;
  background: linear-gradient(90deg, rgba(7, 10, 35, 0.73), rgba(10, 13, 41, 0.26));
  transition: opacity 180ms ease, visibility 180ms ease;
}

.screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.screen-card {
  width: min(410px, 94%);
  padding: 34px 38px 29px;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(37, 38, 91, 0.94), rgba(19, 22, 62, 0.94));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
  text-align: center;
}

.compact-card {
  padding-top: 31px;
}

.pause-card {
  width: min(340px, 94%);
}

.sparkle-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 17px;
  color: #ffd1ef;
  font-size: 12px;
}

.sparkle-line i {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 174, 221, 0.8), transparent);
}

.screen-kicker {
  color: #c7b0ff;
}

.screen-card h2 {
  margin: 10px 0 14px;
  color: #fff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: clamp(39px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.screen-card h2 em {
  color: #ffb4db;
  font-style: normal;
}

.screen-copy,
.record-message,
.result-line {
  margin: 0 auto;
  max-width: 290px;
  color: #bdc1dd;
  font-size: 13px;
  line-height: 1.55;
}

.result-line strong {
  color: #fff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 18px;
  letter-spacing: 0.05em;
}

.record-message {
  min-height: 21px;
  margin-top: 5px;
  color: #8fe1dc;
  font-size: 12px;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 23px;
  padding: 16px 17px 16px 20px;
  border: 0;
  border-radius: 13px;
  color: #1c173b;
  background: linear-gradient(100deg, #ffc0e1, #bba2ff);
  box-shadow: 0 10px 25px rgba(191, 137, 255, 0.26);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-align: left;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 13px 30px rgba(191, 137, 255, 0.4);
  outline: none;
  transform: translateY(-2px);
}

.primary-button b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(35, 28, 79, 0.31);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.control-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
  color: #8489ad;
  font-size: 11px;
}

kbd {
  min-width: 43px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #e8e5ff;
  background: rgba(255, 255, 255, 0.08);
  font-family: 'Outfit', Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 0 22px 0 25px;
  background: rgba(13, 17, 47, 0.83);
}

.controls-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #898ead;
  font-size: 12px;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78e6d7;
  box-shadow: 0 0 0 4px rgba(120, 230, 215, 0.12), 0 0 13px rgba(120, 230, 215, 0.6);
}

.controls-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.jump-button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #c7cae6;
  background: rgba(255, 255, 255, 0.06);
  font-size: 17px;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(199, 170, 255, 0.6);
  background: rgba(185, 154, 255, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.jump-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px 0 13px;
  border-color: rgba(255, 180, 220, 0.32);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(100deg, rgba(167, 125, 255, 0.31), rgba(255, 143, 198, 0.22));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.jump-button:hover,
.jump-button:focus-visible {
  border-color: rgba(255, 180, 220, 0.62);
  background: linear-gradient(100deg, rgba(167, 125, 255, 0.5), rgba(255, 143, 198, 0.38));
  outline: none;
  transform: translateY(-2px);
}

.jump-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: #241b48;
  background: #ffd0ea;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.footer-note {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 19px;
  color: #70769c;
  font-size: 11px;
}

.footer-note strong {
  color: #aeb1ce;
  font-weight: 700;
}

.footer-separator {
  color: #c886c8;
}

@media (max-width: 680px) {
  .game-shell {
    width: min(100% - 18px, 1160px);
    padding-top: 19px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .topbar-note {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .game-card {
    border-radius: 20px;
  }

  .hud {
    min-height: 56px;
    padding: 0 13px;
  }

  .hud-pill {
    display: block;
  }

  .hud-pill-center {
    text-align: center;
  }

  .hud-pill-right {
    text-align: right;
  }

  .hud-pill strong {
    display: block;
    min-width: auto;
    margin-top: 2px;
    font-size: 17px;
  }

  .hud-label {
    font-size: 8px;
    letter-spacing: 0.15em;
  }

  .screen {
    padding: 12px;
  }

  .screen-card {
    padding: 23px 22px 20px;
    border-radius: 18px;
  }

  .screen-card h2 {
    margin-top: 8px;
    margin-bottom: 11px;
    font-size: clamp(34px, 10vw, 47px);
  }

  .screen-copy {
    font-size: 11px;
  }

  .primary-button {
    margin-top: 16px;
    padding: 13px 13px 13px 15px;
    font-size: 9px;
  }

  .primary-button b {
    width: 24px;
    height: 24px;
  }

  .control-hint {
    margin-top: 11px;
    font-size: 10px;
  }

  .game-controls {
    min-height: 68px;
    padding: 0 11px 0 14px;
  }

  .controls-copy {
    font-size: 10px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .jump-button {
    min-height: 36px;
    padding-right: 12px;
    font-size: 10px;
  }

  .jump-icon {
    width: 21px;
    height: 21px;
    font-size: 16px;
  }

  .footer-note {
    padding: 15px 4px 0;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .controls-copy {
    display: none;
  }

  .game-controls {
    justify-content: flex-end;
  }

  .controls-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .jump-button {
    flex: 1;
    justify-content: center;
    max-width: 160px;
  }
}

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