@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --navy: #071b31;
  --navy-deep: #041322;
  --blue: #2bc4e6;
  --blue-bright: #73f4ff;
  --cyan: #0ca9ca;
  --ice: #b8d6e3;
  --ink: #f2fcff;
  --muted: #79a4b6;
  --coral: #ff755e;
  --yellow: #ffd363;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.36);
  --safe-top: 0px;
  --safe-right: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--navy);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow-x: hidden;
  color: var(--ink);
  background:
    repeating-linear-gradient(125deg, rgba(48, 136, 164, 0.05) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 34% 27%, rgba(22, 164, 200, 0.18), transparent 28rem),
    radial-gradient(circle at 95% 90%, rgba(255, 117, 94, 0.13), transparent 22rem),
    var(--navy);
  font-family: "Chakra Petch", "Microsoft YaHei", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

.screen-noise {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px);
  mix-blend-mode: screen;
}

.orientation-notice {
  position: relative;
  z-index: 12;
  display: none;
  margin: 0 auto 12px;
  width: min(calc(100% - 24px), 430px);
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px 8px 12px;
  color: #dffcff;
  border: 1px solid rgba(115, 244, 255, 0.42);
  border-radius: 14px;
  background: rgba(4, 30, 48, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), 0 0 20px rgba(43, 196, 230, 0.15);
  backdrop-filter: blur(9px);
}

.orientation-notice__icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue-bright);
  border: 1px solid rgba(115, 244, 255, 0.45);
  border-radius: 8px;
  font-family: "DM Mono", monospace;
  font-size: 17px;
}

.orientation-notice__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin-right: auto;
}

.orientation-notice__copy strong {
  color: var(--blue-bright);
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

.orientation-notice__copy small {
  overflow: hidden;
  color: #8eb9c7;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orientation-notice__action,
.orientation-notice__close {
  border: 0;
  cursor: pointer;
}

.orientation-notice__action {
  min-height: 30px;
  padding: 0 9px;
  color: #042032;
  border-radius: 7px;
  background: var(--blue-bright);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.orientation-notice__action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.orientation-notice__close {
  align-self: flex-start;
  padding: 0 2px;
  color: #78a9b9;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.orientation-notice__close:hover {
  color: var(--ink);
}

.orientation-notice.is-dismissed {
  display: none !important;
}

.app-shell {
  width: min(1240px, calc(100% - 42px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 20px;
}

.score-panel,
.board-cabinet,
.side-console {
  border: 6px solid var(--ice);
  box-shadow:
    inset 0 0 0 2px rgba(68, 125, 153, 0.72),
    inset 0 0 0 5px rgba(231, 249, 247, 0.34),
    var(--shadow);
}

.score-panel {
  position: relative;
  overflow: hidden;
  height: 104px;
  padding: 15px 25px;
  border-radius: 31px;
  background: linear-gradient(180deg, #a9cad8 0%, #87afc2 100%);
}

.score-panel__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 2fr) minmax(130px, 1fr);
  align-items: center;
  height: 100%;
  overflow: hidden;
  padding: 0 23px;
  border: 5px solid #345a76;
  border-radius: 17px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 219, 255, 0.04) 0 2px, transparent 2px 5px),
    #041a2a;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.68);
}

.score-panel__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 15%, rgba(115, 244, 255, 0.08) 48%, transparent 75%);
}

.game-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-title__icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--navy);
  border-radius: 8px 8px 8px 2px;
  background: var(--blue-bright);
  box-shadow: 0 0 17px rgba(115, 244, 255, 0.62);
  font-size: 16px;
}

.game-title__text {
  color: var(--blue-bright);
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.06em;
  text-shadow: 0 0 14px rgba(115, 244, 255, 0.45);
}

.game-title__sub {
  align-self: flex-end;
  margin: 0 0 1px -5px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.score-readout,
.best-readout {
  position: relative;
  z-index: 1;
}

.score-readout {
  text-align: center;
}

.best-readout {
  text-align: right;
}

.score-readout span,
.best-readout span {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.score-readout strong,
.best-readout strong {
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: clamp(21px, 3.7vw, 32px);
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 0 15px rgba(43, 196, 230, 0.7);
}

.arcade-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1.44fr) minmax(220px, 0.36fr);
  gap: 25px;
  align-items: stretch;
  margin-top: 0;
}

.left-console {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 26px 20px 20px;
  border: 6px solid var(--ice);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(242, 255, 254, 0.25), transparent 33%),
    linear-gradient(180deg, #adcbd6, #83aabd);
  box-shadow:
    inset 0 0 0 2px rgba(68, 125, 153, 0.72),
    inset 0 0 0 5px rgba(231, 249, 247, 0.34),
    var(--shadow);
}

.left-console__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #245b73;
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.left-console__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #e7ffff;
  border: 2px solid #387f99;
  border-radius: 8px 8px 8px 2px;
  background: #237f9c;
}

.left-console__display {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding: 9px 10px;
  border: 2px solid #6795a9;
  border-radius: 8px;
  background: rgba(232, 251, 250, 0.35);
  color: #3b7890;
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.left-console__display strong {
  color: #237f9c;
}

.mobile-d-pad {
  display: grid;
  grid-template: repeat(3, minmax(34px, 1fr)) / repeat(3, minmax(34px, 1fr));
  gap: 6px;
  width: min(100%, 170px);
  aspect-ratio: 1;
  margin: auto;
}

.mobile-d-pad .d-pad__button {
  width: 100%;
  height: auto;
  border-radius: 12px;
  font-size: 15px;
}

.mobile-d-pad .d-pad__up {
  grid-column: 2;
  grid-row: 1;
  border-radius: 16px 16px 10px 10px;
}

.mobile-d-pad .d-pad__left {
  grid-column: 1;
  grid-row: 2;
  border-radius: 16px 10px 10px 16px;
}

.mobile-d-pad .d-pad__down {
  grid-column: 2;
  grid-row: 3;
  border-radius: 10px 10px 16px 16px;
}

.mobile-d-pad .d-pad__right {
  grid-column: 3;
  grid-row: 2;
  border-radius: 10px 16px 16px 10px;
}

.mobile-pause {
  align-self: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
}

.board-cabinet {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 15px;
  border-radius: 32px;
  background: linear-gradient(145deg, #a9cbd8, #81aabd);
}

.board-cabinet .score-panel {
  flex: 0 0 auto;
  width: 100%;
  margin-bottom: 16px;
}

.board-frame {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 12px;
  isolation: isolate;
  border: 4px solid #d1ebeb;
  border-radius: 22px;
  background: #6dabbf;
  box-shadow: inset 0 0 0 3px #3d839d, 0 7px 0 rgba(43, 86, 106, 0.36);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 13 / 9;
  border: 2px solid rgba(112, 243, 255, 0.7);
  border-radius: 12px;
  background: #08a9c4;
  box-shadow: inset 0 0 30px rgba(0, 54, 89, 0.35), 0 0 23px rgba(0, 164, 200, 0.3);
  touch-action: none;
}

.screen-glass {
  position: absolute;
  z-index: 2;
  inset: 12px;
  border: 1px solid rgba(227, 255, 255, 0.25);
  border-radius: 12px;
  box-shadow: inset 0 0 65px rgba(0, 57, 91, 0.22);
  pointer-events: none;
}

.board-corner {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  border-color: #e4fbf9;
  border-style: solid;
  opacity: 0.85;
  pointer-events: none;
}

.board-corner--tl {
  top: 5px;
  left: 5px;
  border-width: 2px 0 0 2px;
}

.board-corner--tr {
  top: 5px;
  right: 5px;
  border-width: 2px 2px 0 0;
}

.board-corner--bl {
  bottom: 5px;
  left: 5px;
  border-width: 0 0 2px 2px;
}

.board-corner--br {
  right: 5px;
  bottom: 5px;
  border-width: 0 2px 2px 0;
}

.game-overlay {
  position: absolute;
  z-index: 3;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 22px;
  border-radius: 12px;
  background: rgba(3, 37, 56, 0.84);
  text-align: center;
  backdrop-filter: blur(5px);
}

.game-overlay--start {
  justify-content: center;
  padding: 22px;
}

.game-overlay--result {
  background: rgba(3, 28, 46, 0.93);
}

.hidden {
  display: none !important;
}

.overlay-kicker,
.modal-kicker {
  margin: 0 0 9px;
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.game-overlay h1,
.game-overlay h2,
.modal-card h2 {
  margin: 0;
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.06em;
}

.game-overlay h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.92;
}

.game-overlay--start h1 {
  margin-bottom: 24px;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.05;
}

.game-overlay h1 em {
  color: var(--blue-bright);
  font-style: normal;
}

.game-overlay h2 {
  margin-bottom: 21px;
  font-size: 29px;
}

.arcade-button,
.ghost-button,
.console-button,
.cabinet-pause,
.d-pad__button,
.modal-close,
.refresh-button,
.rank-tab {
  cursor: pointer;
}

.arcade-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 152px;
  min-height: 42px;
  padding: 0 16px;
  color: #042032;
  border: 2px solid #d8ffff;
  border-radius: 8px;
  background: var(--blue-bright);
  box-shadow: 0 4px 0 #1685a1, 0 0 18px rgba(115, 244, 255, 0.35);
  font-size: 12px;
  font-weight: 700;
  transition: transform 150ms ease, filter 150ms ease;
}

.arcade-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.arcade-button:active {
  box-shadow: 0 1px 0 #1685a1;
  transform: translateY(2px);
}

.arcade-button--small {
  min-height: 38px;
  font-size: 11px;
}

.ghost-button {
  min-height: 32px;
  color: var(--blue-bright);
  border: 1px solid rgba(115, 244, 255, 0.44);
  border-radius: 7px;
  background: rgba(115, 244, 255, 0.07);
  font-size: 11px;
}

.ghost-button:hover {
  background: rgba(115, 244, 255, 0.16);
}

.pause-symbol {
  margin-bottom: 13px;
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: 31px;
  letter-spacing: -6px;
}

.result-label {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.result-score {
  display: block;
  margin: 0 0 7px;
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: clamp(54px, 10vw, 86px);
  letter-spacing: 0.03em;
  line-height: 0.98;
  text-shadow: 0 0 23px rgba(115, 244, 255, 0.42);
}

.result-message {
  max-width: 240px;
  margin: 0 0 21px;
  color: var(--muted);
  font-size: 11px;
}

.result-actions {
  display: grid;
  gap: 8px;
  width: min(100%, 190px);
}

.cabinet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 73px;
  padding: 9px 13px 0;
}

.control-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #47788e;
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.control-hint__key {
  padding: 4px 5px;
  color: #20516a;
  border: 1px solid #548aa1;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(238, 255, 254, 0.38);
}

.d-pad {
  position: relative;
  display: grid;
  grid-template: repeat(3, 25px) / repeat(3, 25px);
  gap: 3px;
}

.d-pad::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 24%;
  height: 24%;
  border: 1px solid rgba(105, 211, 221, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4ed5df, #15789a 72%);
  box-shadow: 0 0 12px rgba(43, 196, 230, 0.45), inset 0 1px 2px rgba(235, 255, 255, 0.45);
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.d-pad__button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 25px;
  height: 25px;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  place-items: center;
  color: transparent;
  border: 2px solid #287da0;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(248, 255, 255, 0.9), rgba(178, 226, 231, 0.82)),
    #c0e5e8;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -3px 0 rgba(76, 151, 171, 0.28),
    0 3px 0 #4c8fa8,
    0 7px 13px rgba(32, 94, 116, 0.18);
  font-size: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 150ms ease, background 150ms ease, transform 100ms ease, box-shadow 100ms ease;
}

.d-pad__button::before {
  width: 43%;
  height: 43%;
  background: linear-gradient(145deg, #f9ffff, #78c6d2);
  clip-path: polygon(50% 0, 88% 37%, 68% 37%, 68% 100%, 32% 100%, 32% 37%, 12% 37%);
  content: "";
  filter: drop-shadow(0 1px 0 rgba(28, 103, 132, 0.42));
  transform: rotate(var(--arrow-angle, 0deg));
}

.d-pad__button:hover,
.d-pad__button:active {
  color: transparent;
  background:
    linear-gradient(145deg, #42c4d6, #237f9c),
    #2385a1;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 rgba(67, 119, 139, 0.75),
    0 5px 13px rgba(22, 126, 154, 0.3);
  transform: translateY(2px);
}

.d-pad__up {
  grid-column: 2;
  grid-row: 1;
  --arrow-angle: 0deg;
  border-radius: 16px 16px 10px 10px;
}

.d-pad__left {
  grid-column: 1;
  grid-row: 2;
  --arrow-angle: -90deg;
  border-radius: 16px 10px 10px 16px;
}

.d-pad__down {
  grid-column: 2;
  grid-row: 3;
  --arrow-angle: 180deg;
  border-radius: 10px 10px 16px 16px;
}

.d-pad__right {
  grid-column: 3;
  grid-row: 2;
  --arrow-angle: 90deg;
  border-radius: 10px 16px 16px 10px;
}

.cabinet-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 33px;
  height: 33px;
  color: #2f6a82;
  border: 1px solid #538ca3;
  border-radius: 50%;
  background: rgba(222, 247, 246, 0.43);
}

.cabinet-pause:hover {
  color: #eaffff;
  background: #2385a1;
}

.cabinet-pause span {
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
}

.side-console {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 27px 21px 21px;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(242, 255, 254, 0.25), transparent 33%),
    linear-gradient(180deg, #adcbd6, #83aabd);
}

.console-screw {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid #6190a4;
  border-radius: 50%;
  background: #b7d2dc;
  box-shadow: inset 0 0 0 2px #88acbb;
}

.console-screw--one {
  top: 17px;
  right: 19px;
}

.console-screw--two {
  bottom: 18px;
  left: 19px;
}

.console-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 11px;
  border: 2px solid #58829a;
  border-radius: 9px;
  background: rgba(21, 66, 86, 0.42);
  box-shadow: inset 0 0 13px rgba(24, 64, 84, 0.25);
}

.console-display__label,
.console-display__status {
  color: #245b73;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.console-display__status {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-display__status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}

.console-display__status i.is-online {
  background: #1de4b2;
  box-shadow: 0 0 8px #1de4b2;
}

.console-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.console-button {
  display: grid;
  grid-template-columns: 37px 1fr 18px;
  gap: 9px;
  align-items: center;
  min-height: 65px;
  padding: 0 12px;
  color: #1f526a;
  border: 2px solid #6795a9;
  border-radius: 12px;
  background: rgba(232, 251, 250, 0.35);
  text-align: left;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.console-button--plain {
  grid-template-columns: 37px minmax(0, 1fr);
}

.console-button:hover,
.console-button:active {
  border-color: #e0ffff;
  background: rgba(229, 255, 254, 0.65);
  transform: translateY(-2px);
}

.console-button__icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #d9ffff;
  border: 2px solid #387f99;
  border-radius: 9px;
  background: #237f9c;
  box-shadow: inset 0 0 0 2px rgba(185, 246, 248, 0.2);
}

.console-button__icon--rank {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.console-button__icon--sound {
  font-family: "DM Mono", monospace;
  font-size: 18px;
  font-weight: 700;
}

.console-button__icon--rotate {
  font-family: "DM Mono", monospace;
  font-size: 18px;
  font-weight: 700;
}

.console-button__label {
  min-width: 0;
  overflow: hidden;
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-button__arrow {
  color: #5e91a4;
  font-size: 18px;
}

.orientation-return-button {
  display: none;
}

.boost-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 0 9px;
  align-items: center;
  min-height: 142px;
  margin-top: auto;
  overflow: hidden;
  padding: 14px 14px 11px;
  color: #f1ffff;
  border: 3px solid #2d7e9b;
  border-radius: 17px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.2), transparent 35%),
    linear-gradient(180deg, #289fc0, #156b91);
  box-shadow:
    inset 0 0 0 2px rgba(171, 248, 251, 0.22),
    inset 0 -12px 24px rgba(2, 38, 65, 0.2),
    0 7px 0 #527f91,
    0 0 22px rgba(43, 196, 230, 0.22);
  cursor: pointer;
  text-align: left;
  touch-action: none;
  user-select: none;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.boost-button--mobile {
  display: none;
}

.boost-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.boost-button:active,
.boost-button.is-held {
  box-shadow:
    inset 0 0 0 2px rgba(232, 255, 255, 0.3),
    inset 0 0 26px rgba(2, 38, 65, 0.3),
    0 2px 0 #527f91,
    0 0 31px rgba(255, 117, 94, 0.42);
  filter: saturate(1.2) brightness(1.12);
  transform: translateY(4px);
}

.boost-button__shine {
  position: absolute;
  inset: -60% 20% 20% -30%;
  border-radius: 50%;
  background: rgba(218, 255, 255, 0.16);
  transform: rotate(-22deg);
  pointer-events: none;
}

.boost-button__key {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #17445d;
  border: 2px solid #c5f8f4;
  border-radius: 50%;
  background: #e6fbf1;
  box-shadow: 0 0 17px rgba(202, 255, 235, 0.38);
  font-family: "DM Mono", monospace;
  font-size: 16px;
  font-weight: 500;
}

.boost-button__label {
  position: relative;
  z-index: 1;
  align-self: end;
  font-family: "Space Grotesk", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.boost-button__hint {
  position: relative;
  z-index: 1;
  align-self: end;
  color: #b9e9ed;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.boost-button__label,
.boost-button__hint {
  grid-row: 1;
}

.boost-button__key {
  grid-row: 1;
}

.boost-button::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(223, 255, 250, 0.82);
  content: ">>";
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: -2px;
}

.boost-button.is-held .boost-button__hint {
  color: #fff0bb;
}

.console-button.is-muted .console-button__icon--sound {
  background: #7f9eab;
  border-color: #5d7e8d;
  color: #eefcff;
}

.console-button.is-muted .console-button__arrow {
  color: #6c8a96;
}

.console-tip {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: auto;
  padding: 25px 6px 33px;
  color: #47788e;
  font-size: 11px;
  line-height: 1.7;
}

.console-tip p {
  margin: 0;
}

.console-tip strong {
  color: #2c657c;
  font-size: 13px;
}

.console-tip__line {
  width: 3px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--coral);
  box-shadow: 0 0 9px rgba(255, 117, 94, 0.4);
}

.console-chevron {
  position: absolute;
  right: -34px;
  bottom: 54px;
  width: 114px;
  height: 114px;
  border: 16px solid rgba(234, 253, 252, 0.17);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.modal-backdrop {
  position: fixed;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 12, 24, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  max-height: min(90vh, 610px);
  overflow: auto;
  padding: 29px 26px 24px;
  border: 4px solid var(--ice);
  border-radius: 25px;
  background: linear-gradient(150deg, #12374d, #061b2e);
  box-shadow:
    inset 0 0 0 2px rgba(115, 244, 255, 0.35),
    0 23px 60px rgba(0, 0, 0, 0.5);
  animation: modal-in 180ms ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #8bb5c4;
  border: 1px solid rgba(115, 244, 255, 0.25);
  border-radius: 50%;
  background: rgba(115, 244, 255, 0.06);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--blue-bright);
  background: rgba(115, 244, 255, 0.17);
}

.modal-card h2 {
  margin-bottom: 7px;
  font-size: 27px;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.modal-status {
  min-height: 16px;
  margin: 17px 0 0;
  color: #6da9bd;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-right: 38px;
}

.refresh-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--blue-bright);
  border: 1px solid rgba(115, 244, 255, 0.28);
  border-radius: 8px;
  background: rgba(115, 244, 255, 0.07);
  font-size: 20px;
}

.refresh-button:hover {
  background: rgba(115, 244, 255, 0.18);
  transform: rotate(25deg);
}

.rank-tabs {
  display: flex;
  gap: 3px;
  margin-top: 21px;
  padding: 3px;
  border: 1px solid rgba(115, 244, 255, 0.22);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.15);
}

.rank-tab {
  flex: 1;
  min-height: 30px;
  color: #72a7b9;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 10px;
}

.rank-tab.is-active {
  color: #062036;
  background: var(--blue-bright);
  font-weight: 700;
}

.rank-list {
  min-height: 241px;
  padding-top: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 27px 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 45px;
  border-bottom: 1px solid rgba(115, 244, 255, 0.12);
}

.rank-number {
  color: #6394a5;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-align: center;
}

.rank-row:nth-child(1) .rank-number {
  color: var(--yellow);
}

.rank-row:nth-child(2) .rank-number {
  color: #c6e4e7;
}

.rank-row:nth-child(3) .rank-number {
  color: #e69d88;
}

.rank-avatar {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(115, 244, 255, 0.25);
  border-radius: 9px;
  background-position: center;
  background-size: cover;
}

.rank-avatar--fallback {
  background: linear-gradient(135deg, #b7f39f, #387e61);
}

.rank-name {
  overflow: hidden;
  color: #d8f4f4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.rank-loading {
  display: grid;
  gap: 13px;
  padding: 15px 0;
}

.rank-loading span {
  display: block;
  width: 100%;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(115, 244, 255, 0.05), rgba(115, 244, 255, 0.15), rgba(115, 244, 255, 0.05));
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.my-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid rgba(115, 244, 255, 0.23);
  border-radius: 8px;
  background: rgba(115, 244, 255, 0.07);
  color: #78a8b8;
  font-size: 10px;
}

.my-rank strong {
  color: var(--blue-bright);
  font-family: "DM Mono", monospace;
  font-size: 13px;
}

.rank-status {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  z-index: 15;
  bottom: 25px;
  left: 50%;
  max-width: calc(100% - 30px);
  padding: 11px 15px;
  color: var(--ink);
  border: 1px solid rgba(115, 244, 255, 0.35);
  border-radius: 9px;
  background: rgba(3, 25, 43, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 901px) {
  .cabinet-controls {
    display: none;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  .orientation-notice {
    display: flex;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(650px, calc(100% - 28px));
    padding-top: 16px;
  }

  .arcade-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .left-console {
    display: none;
  }

  .side-console {
    min-height: 0;
    padding: 17px;
  }

  .cabinet-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) auto minmax(94px, 0.9fr);
    gap: 7px;
    min-height: 98px;
    padding: 10px 4px 4px;
  }

  .cabinet-controls .control-hint {
    display: none;
  }

  .cabinet-controls .d-pad {
    justify-self: start;
    width: 100%;
    max-width: 190px;
    aspect-ratio: 1;
    grid-template: repeat(3, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .cabinet-controls .d-pad__button {
    width: 100%;
    height: 100%;
    border-radius: 11px;
    font-size: 15px;
  }

  .cabinet-controls .d-pad__up {
    border-radius: 16px 16px 10px 10px;
  }

  .cabinet-controls .d-pad__left {
    border-radius: 16px 10px 10px 16px;
  }

  .cabinet-controls .d-pad__down {
    border-radius: 10px 10px 16px 16px;
  }

  .cabinet-controls .d-pad__right {
    border-radius: 10px 16px 16px 10px;
  }

  .cabinet-controls .cabinet-pause {
    grid-column: 2;
    justify-self: center;
    width: 38px;
    height: 38px;
  }

  .boost-button--mobile {
    display: grid;
    grid-column: 3;
    justify-self: end;
    align-self: center;
    width: 100%;
    max-width: 150px;
    min-height: 78px;
    margin-top: 0;
    padding: 9px 8px;
    border-width: 2px;
    border-radius: 13px;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    gap: 0 6px;
  }

  .boost-button--mobile .boost-button__key {
    grid-column: 1;
    grid-row: 1;
    width: 29px;
    height: 29px;
    border-width: 1px;
    font-size: 11px;
  }

  .boost-button--mobile .boost-button__label {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    font-size: 16px;
  }

  .boost-button--mobile .boost-button__hint {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 7px;
  }

  .boost-button--mobile {
    grid-template-columns: 1fr;
  }

  .boost-button--mobile .boost-button__key,
  .boost-button--mobile .boost-button__hint {
    display: none;
  }

  .boost-button--mobile .boost-button__label {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    font-size: 17px;
  }

  .boost-button--mobile::after {
    right: 7px;
    bottom: 7px;
    font-size: 8px;
  }

  .side-console > .boost-button {
    display: none;
  }

  .console-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 11px;
  }

  .boost-button {
    margin-top: 11px;
  }

  .cabinet-controls .boost-button--mobile {
    margin-top: 0;
  }

  .console-tip,
  .console-chevron,
  .console-screw--two {
    display: none;
  }

  .console-display {
    min-height: 35px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 18px);
    padding-bottom: 12px;
  }

  .score-panel {
    height: 79px;
    padding: 10px;
    border-width: 4px;
    border-radius: 22px;
  }

  .score-panel__inner {
    grid-template-columns: minmax(95px, 1fr) minmax(85px, 1fr) minmax(90px, 1fr);
    padding: 0 10px;
    border-width: 3px;
    border-radius: 12px;
  }

  .game-title {
    gap: 6px;
  }

  .game-title__icon {
    width: 22px;
    height: 22px;
    border-radius: 6px 6px 6px 2px;
    font-size: 12px;
  }

  .game-title__text {
    font-size: 13px;
  }

  .game-title__sub {
    display: none;
  }

  .score-readout span,
  .best-readout span {
    font-size: 7px;
  }

  .score-readout strong,
  .best-readout strong {
    font-size: 18px;
    letter-spacing: 0.02em;
  }

  .arcade-layout {
    margin-top: 13px;
  }

  .board-cabinet {
    padding: 8px;
    border-width: 4px;
    border-radius: 23px;
  }

  .board-frame {
    padding: 7px;
    border-width: 3px;
    border-radius: 15px;
  }

  .screen-glass,
  .game-overlay {
    inset: 7px;
    border-radius: 8px;
  }

  .game-overlay--start {
    justify-content: center;
    padding: 22px;
  }

  .game-overlay h1 {
    margin-bottom: 22px;
    font-size: clamp(26px, 8vw, 34px);
    line-height: 1.08;
  }

  .arcade-button {
    min-width: 140px;
    min-height: 39px;
    font-size: 11px;
  }

  .cabinet-controls {
    min-height: 96px;
    padding: 8px 3px 3px;
  }

  .control-hint {
    display: none;
  }

  .cabinet-controls .d-pad {
    width: 100%;
    max-width: 170px;
    margin: 0;
  }

  .side-console {
    border-width: 4px;
    border-radius: 23px;
    padding: 12px;
  }

  .console-actions {
    gap: 8px;
  }

  .cabinet-controls .boost-button--mobile {
    margin-top: 0;
  }

  .console-button {
    grid-template-columns: 28px 1fr 12px;
    gap: 6px;
    min-height: 52px;
    padding: 0 8px;
    border-width: 1px;
    border-radius: 9px;
  }

  .console-button--plain {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .console-button__icon {
    width: 27px;
    height: 27px;
    border-width: 1px;
    border-radius: 7px;
  }

  .console-button__label {
    font-size: 11px;
  }

  .console-button__arrow {
    font-size: 14px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    padding: 24px 18px 18px;
    border-width: 3px;
    border-radius: 19px;
  }

  .modal-card h2 {
    font-size: 24px;
  }

}

@media (orientation: landscape) and (max-width: 900px) {
  html,
  body {
    min-height: 100dvh;
    height: 100dvh;
  }

  body {
    padding-top: min(var(--safe-top), 12px);
    padding-bottom: min(var(--safe-bottom), 8px);
    overflow: hidden;
  }

  .app-shell {
    width: calc(100% - 2px);
    height: 100%;
    min-height: 0;
    padding: 1px 0;
  }

  .arcade-layout {
    grid-template-columns: clamp(180px, 19dvw, 224px) minmax(0, 1fr) clamp(110px, 12dvw, 138px);
    gap: clamp(3px, 0.7dvw, 8px);
    width: 100%;
    height: calc(100dvh - 2px);
    margin: 0;
    align-content: start;
  }

  .left-console {
    display: flex;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    padding: 10px 10px 8px;
    border-width: 4px;
    border-radius: 20px;
  }

  .left-console__brand {
    gap: 6px;
    font-size: 11px;
  }

  .left-console__mark {
    width: 22px;
    height: 22px;
    border-width: 1px;
    border-radius: 6px 6px 6px 2px;
    font-size: 11px;
  }

  .left-console__display {
    min-height: 27px;
    margin-top: 10px;
    padding: 5px 6px;
    border-width: 1px;
    font-size: 7px;
  }

  .mobile-d-pad {
    grid-template: repeat(3, minmax(44px, 1fr)) / repeat(3, minmax(44px, 1fr));
    gap: 8px;
    width: min(100%, 220px);
    max-height: min(58dvh, 220px);
  }

  .mobile-d-pad .d-pad__button {
    min-width: 44px;
    min-height: 44px;
    border-width: 2px;
    border-radius: 13px;
    font-size: 0;
  }

  .mobile-d-pad .d-pad__button::before {
    width: 50%;
    height: 50%;
  }

  .mobile-pause {
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
  }

  .board-cabinet {
    height: 100%;
    min-height: 0;
    align-self: stretch;
    padding: 4px;
    border-width: 4px;
    border-radius: 20px;
  }

  .board-cabinet .score-panel {
    height: 60px;
    margin-bottom: 4px;
    padding: 5px 7px;
    border-width: 3px;
    border-radius: 13px;
  }

  .score-panel__inner {
    grid-template-columns: minmax(84px, 0.9fr) minmax(138px, 1.6fr) minmax(94px, 1fr);
    min-width: 0;
    padding: 0 8px;
    border-width: 3px;
    border-radius: 8px;
  }

  .score-readout,
  .best-readout {
    min-width: 0;
  }

  .game-title {
    gap: 5px;
  }

  .game-title__icon {
    width: 20px;
    height: 20px;
    border-radius: 6px 6px 6px 2px;
    font-size: 11px;
  }

  .game-title__text {
    font-size: 12px;
  }

  .game-title__sub {
    display: none;
  }

  .score-readout span,
  .best-readout span {
    font-size: 7px;
  }

  .score-readout strong,
  .best-readout strong {
    font-size: 17px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .board-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, calc((100dvh - 78px) * 13 / 9));
    height: auto;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 13 / 9;
    flex: 0 1 auto;
    align-self: center;
    padding: 5px;
    border-width: 3px;
    border-radius: 12px;
  }

  #gameCanvas {
    display: block;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 13 / 9;
  }

  .screen-glass,
  .game-overlay {
    inset: 5px;
    border-radius: 8px;
  }

  .game-overlay--start {
    justify-content: center;
    padding: 20px;
  }

  .game-overlay h1 {
    margin-bottom: 18px;
    font-size: clamp(24px, 5vw, 39px);
    line-height: 1.05;
  }

  .game-overlay--result {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 14px 12px 12px;
  }

  .game-overlay--result .overlay-kicker {
    margin-bottom: 4px;
    font-size: 8px;
  }

  .game-overlay--result .result-score {
    margin-bottom: 3px;
    font-size: clamp(34px, 6.2vw, 58px);
  }

  .game-overlay--result .result-message {
    margin-bottom: 8px;
    font-size: 9px;
  }

  .game-overlay--result .result-actions {
    gap: 4px;
    width: min(100%, 160px);
  }

  .arcade-button {
    min-width: 122px;
    min-height: 32px;
    padding: 0 11px;
    font-size: 10px;
  }

  .cabinet-controls {
    display: none;
  }

  .boost-button--mobile {
    display: none;
  }

  .side-console > .boost-button {
    display: grid;
  }

  .side-console {
    height: 100%;
    min-height: 0;
    align-self: stretch;
    padding: 10px 8px;
    border-width: 4px;
    border-radius: 20px;
  }

  .console-display {
    min-height: 29px;
    padding: 0 6px;
    border-width: 1px;
    border-radius: 6px;
  }

  .console-display__label,
  .console-display__status {
    font-size: 7px;
  }

  .console-actions {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 8px;
  }

  .orientation-return-button {
    display: grid;
  }

  .console-button {
    grid-template-columns: 25px 1fr 12px;
    gap: 5px;
    min-height: 44px;
    padding: 0 6px;
    border-width: 1px;
    border-radius: 8px;
  }

  .console-button--plain {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .console-button__icon {
    width: 24px;
    height: 24px;
    border-width: 1px;
    border-radius: 6px;
  }

  .console-button__label {
    font-size: 9px;
  }

  .console-button__arrow {
    font-size: 12px;
  }

  .boost-button {
    min-height: 86px;
    margin-top: auto;
    padding: 8px;
    border-width: 2px;
    border-radius: 11px;
    box-shadow:
      inset 0 0 0 1px rgba(171, 248, 251, 0.22),
      0 4px 0 #527f91,
      0 0 15px rgba(43, 196, 230, 0.22);
  }

  .side-console > .boost-button {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .side-console > .boost-button .boost-button__key,
  .side-console > .boost-button .boost-button__hint {
    display: none;
  }

  .side-console > .boost-button .boost-button__label {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    font-size: 18px;
    white-space: nowrap;
  }

  .boost-button__key {
    width: 26px;
    height: 26px;
    border-width: 1px;
    font-size: 10px;
  }

  .boost-button__label {
    font-size: 14px;
  }

  .boost-button__hint {
    font-size: 7px;
  }

  .console-tip,
  .console-chevron,
  .console-screw--two {
    display: none;
  }

  .modal-backdrop {
    padding: 10px;
  }
}

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