@font-face {
  font-family: Arcade;
  src: local('Arial Black');
  font-weight: 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #080e0c;
  --panel: #101a16;
  --line: #2b4035;
  --lime: #b5ff46;
  --soft: #afc3b7;
  --gold: #ffcf5a;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  background: var(--bg);
  color: #f4f8f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
button {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.game-app {
  height: 100vh;
  height: 100dvh;
  max-width: 1600px;
  margin: auto;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-rows: 68px minmax(0, 1fr);
  column-gap: 30px;
}
.app-header {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.brand {
  font-weight: 900;
  font-size: 21px;
  color: var(--lime);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.app-header h1 {
  margin: 0;
  font-family: Arcade, system-ui, sans-serif;
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 900;
}
.app-header h1 em {
  font-style: normal;
  color: var(--lime);
}
.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.icon-button {
  background: #15231c;
  border: 1px solid #314a3c;
  border-radius: 12px;
  min-width: 46px;
  min-height: 44px;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
}
.play-shell {
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr) 104px;
  min-height: 0;
  min-width: 0;
}
.scorebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  gap: 12px;
}
.scorebar > div {
  display: flex;
  gap: 7px;
  align-items: baseline;
}
.scorebar small {
  font-size: 12px;
  color: var(--soft);
  font-weight: 650;
  letter-spacing: 0.6px;
}
.scorebar strong {
  font-variant-numeric: tabular-nums;
  font-size: 23px;
}
.gold {
  color: var(--gold);
}
.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.board {
  border: 2px solid #58ce89;
  border-radius: 14px;
  overflow: hidden;
  background: #0b2016;
  max-width: 100%;
  max-height: 100%;
}
canvas {
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #07110cd9;
  z-index: 3;
  padding: 12px;
}
.start-card {
  text-align: center;
  max-width: 350px;
}
.eyebrow {
  font-size: 12px;
  color: var(--lime);
  letter-spacing: 2px;
  font-weight: 700;
}
.start-card h2 {
  font-size: clamp(24px, 4vw, 42px);
  margin: 10px 0 12px;
  line-height: 1.1;
}
.start-card p {
  font-size: 16px;
  line-height: 1.45;
  color: var(--soft);
  margin: 0 0 18px;
}
.primary,
.pause-button {
  background: var(--lime);
  color: #102004;
  border: 0;
  border-radius: 13px;
  padding: 15px 24px;
  font-weight: 850;
  min-height: 50px;
}
.primary {
  min-width: 200px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--soft);
  text-decoration: underline;
  min-height: 44px;
  padding: 10px 12px;
}
.start-card .text-button {
  display: block;
  margin: 4px auto 0;
}
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 8px 0;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 43px);
  gap: 5px;
}
.pad button {
  border-radius: 10px;
  background: #182b21;
  border: 1px solid #42654f;
  font-size: 25px;
  font-weight: 700;
  min-width: 44px;
  min-height: 44px;
  touch-action: none;
}
.pad button:active {
  background: var(--lime);
  color: #14220d;
  transform: scale(0.96);
}
.pad button:first-child {
  grid-column: 2;
}
.pad button:nth-child(2) {
  grid-column: 1;
}
.control-hint {
  font-size: 12px;
  color: var(--soft);
  line-height: 1.6;
  letter-spacing: 0.5px;
}
.touch-hint {
  display: none;
}
.pause-button {
  min-width: 120px;
  background: #17281f;
  color: var(--lime);
  border: 1px solid #537143;
}
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 4;
  font-size: 76px;
  font-weight: 900;
  background: #05100899;
  color: var(--lime);
  pointer-events: none;
}
.reward {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 30px;
  color: #122100;
  background: var(--lime);
  font-weight: 800;
  pointer-events: none;
  z-index: 2;
}
.desktop-aside {
  align-self: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(#14241b, #0e1812);
}
.desktop-aside h2 {
  font-size: 30px;
  line-height: 1.12;
  margin: 15px 0;
}
.desktop-aside p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--soft);
}
.side-tip {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 22px;
}
.side-tip b {
  color: var(--gold);
}
.secondary {
  background: #16251c;
  border: 1px solid #476039;
  padding: 12px 16px;
  border-radius: 12px;
  min-height: 46px;
  color: var(--lime);
  width: 100%;
  margin: 6px 0;
  font-weight: 650;
}
.local-note {
  font-size: 13px !important;
  color: #9aafa1 !important;
  line-height: 1.5;
}
.desktop-aside .local-note {
  margin-bottom: 0;
}
dialog {
  background: #101a16;
  color: #eef7f0;
  border: 1px solid #43604a;
  border-radius: 20px;
  padding: 24px;
  max-width: min(620px, calc(100vw - 24px));
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 90px #0008;
}
dialog::backdrop {
  background: #000b;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: -24px;
  background: #101a16;
  z-index: 2;
  padding: 8px 0;
}
.dialog-head h2 {
  font-size: 25px;
  margin: 0;
}
.dialog-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1b2b21;
  font-size: 28px;
  flex-shrink: 0;
}
dialog p,
dialog li {
  font-size: 16px;
  line-height: 1.5;
  color: #bdcec3;
}
dialog ul {
  padding-left: 22px;
}
dialog li {
  margin: 14px 0;
}
.items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.item {
  border: 1px solid #34513e;
  background: #0a140f;
  border-radius: 12px;
  padding: 10px 5px;
  color: #edf6ef;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 160px;
}
.item.active {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px var(--lime);
}
.item img {
  width: 75px;
  height: 86px;
  object-fit: contain;
  image-rendering: auto;
}
.item span {
  font-size: 13px;
  margin: 8px 0 5px;
}
.item b {
  font-size: 13px;
  color: var(--gold);
  margin-top: auto;
}
.item.active b {
  color: var(--lime);
}
#shop-status {
  min-height: 24px;
  color: var(--lime);
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.setting input {
  accent-color: var(--lime);
  width: 24px;
  height: 24px;
}
.update-banner,
.toast {
  position: fixed;
  z-index: 20;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #253b2c;
  color: #fff;
  padding: 12px 18px;
  border: 1px solid #78994b;
  border-radius: 14px;
  width: max-content;
  max-width: calc(100% - 24px);
  font-size: 14px;
}
.update-banner {
  display: flex;
  gap: 12px;
  align-items: center;
}
.update-banner button {
  padding: 10px;
  border-radius: 8px;
  background: var(--lime);
  border: 0;
  color: #152009;
  font-weight: 700;
}
.noscript {
  position: fixed;
  inset: 0;
  background: #080e0c;
  z-index: 30;
  padding: 40px;
  text-align: center;
}
@media (max-width: 999px) {
  .game-app {
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(0, 1fr);
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .desktop-aside {
    display: none;
  }
  .app-header {
    gap: 12px;
  }
  .brand {
    font-size: 17px;
  }
  .app-header h1 {
    font-size: 23px;
  }
  .icon-button {
    padding: 6px 10px;
  }
  .icon-button span {
    display: none;
  }
  .play-shell {
    grid-template-rows: 58px minmax(0, 1fr) 122px;
  }
  .controls {
    padding: 10px 6px 2px;
  }
  .pad {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 48px);
    gap: 6px;
  }
  .control-hint {
    display: none;
  }
  .pause-button {
    min-width: 104px;
    padding: 14px 16px;
  }
  .scorebar {
    padding: 4px 8px;
  }
  .scorebar > div {
    display: block;
  }
  .scorebar small {
    font-size: 11px;
    display: block;
  }
  .scorebar strong {
    font-size: 21px;
  }
  .desktop-hint {
    display: none;
  }
  .touch-hint {
    display: inline;
  }
  .board {
    border-radius: 12px;
  }
}
@media (max-width: 380px) {
  .brand span {
    display: none;
  }
  .app-header h1 {
    font-size: 21px;
  }
  .header-actions {
    gap: 6px;
  }
  .icon-button {
    min-width: 44px;
    padding: 7px;
  }
  .controls {
    gap: 10px;
  }
  .pad {
    grid-template-columns: repeat(3, 48px);
  }
  .pause-button {
    min-width: 94px;
    font-size: 14px;
    padding: 12px;
  }
  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  dialog {
    padding: 18px;
  }
  .dialog-head {
    top: -18px;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .game-app {
    grid-template-rows: 46px minmax(0, 1fr);
    grid-template-columns: 1fr;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .desktop-aside {
    display: none;
  }
  .app-header h1 {
    font-size: 22px;
  }
  .app-header {
    gap: 16px;
  }
  .icon-button {
    min-height: 40px;
  }
  .play-shell {
    grid-template-columns: minmax(0, 1fr) 175px;
    grid-template-rows: 44px minmax(0, 1fr);
    column-gap: 14px;
  }
  .scorebar {
    grid-column: 1;
    grid-row: 1;
    justify-content: space-around;
  }
  .scorebar > div {
    display: flex;
    gap: 7px;
    align-items: baseline;
  }
  .scorebar strong {
    font-size: 18px;
  }
  .stage {
    grid-column: 1;
    grid-row: 2;
  }
  .controls {
    grid-column: 2;
    grid-row: 1/-1;
    flex-direction: column;
    justify-content: center;
    padding: 4px;
    gap: 14px;
  }
  .pad {
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(2, 44px);
    gap: 5px;
  }
  .control-hint {
    display: none;
  }
  .pause-button {
    width: 100%;
    min-height: 44px;
    padding: 10px;
  }
  .start-card h2 {
    font-size: 25px;
    margin: 5px 0;
  }
  .start-card p {
    font-size: 14px;
    margin: 6px 0;
  }
  .primary {
    padding: 10px 20px;
    min-height: 44px;
  }
  .start-card .text-button {
    margin: 0;
    display: inline-block;
    font-size: 13px;
  }
  .eyebrow {
    font-size: 11px;
  }
  .countdown {
    font-size: 48px;
  }
}
@media (max-width: 600px) {
  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand span {
    display: none;
  }
  .app-header h1 {
    white-space: nowrap;
    font-size: 21px;
  }
  .app-header {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
