:root {
  color-scheme: light;
  --ink: #17392f;
  --ink-soft: #527166;
  --panel: rgba(247, 242, 230, 0.92);
  --border: rgba(30, 59, 48, 0.18);
  --shadow: 0 32px 80px rgba(10, 39, 30, 0.22);
  --gold: #d89933;
  --gold-soft: #f2d089;
  --screen-edge: rgba(243, 246, 233, 0.8);
  --game-shell-width: min(536px, calc(100vw - 20px), calc((100dvh - 24px) * 0.5625));
  font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  overflow: hidden;
  padding: env(safe-area-inset-top, 0) calc(6px + env(safe-area-inset-right, 0))
    env(safe-area-inset-bottom, 0) calc(6px + env(safe-area-inset-left, 0));
  background:
    radial-gradient(circle at top center, rgba(34, 76, 78, 0.26), transparent 26%),
    linear-gradient(180deg, #101919 0%, #0c1316 100%);
}

.shell {
  width: var(--game-shell-width);
  margin: 0 auto;
  padding: 8px 0;
}

.hero {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(27, 61, 49, 0.72);
}

.hero h1 {
  margin: 0;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "PingFang SC", serif;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 0.94;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 12px auto 0;
  max-width: 720px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.hero-chips span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(21, 59, 47, 0.08);
  border: 1px solid rgba(21, 59, 47, 0.08);
  color: rgba(18, 53, 41, 0.86);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phone-shell {
  position: relative;
  width: var(--game-shell-width);
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: #0b4e5b;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.audio-toggle {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  min-width: 76px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(242, 249, 241, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 82, 79, 0.96), rgba(16, 47, 46, 0.96));
  color: #f6f5e7;
  font: 700 13px/1 "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.audio-toggle.is-muted {
  background: linear-gradient(180deg, rgba(83, 92, 98, 0.94), rgba(43, 49, 54, 0.94));
  color: rgba(247, 244, 236, 0.88);
}

.phone-shell::before {
  content: none;
}

.phone-shell::after {
  content: none;
}

.phone-accent {
  pointer-events: none;
}

.phone-shell canvas {
  border-radius: 18px;
}

.phone-shell.is-menu canvas {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hud {
  display: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(255, 247, 195, 0.06), transparent 28%),
    rgba(5, 16, 20, 0.54);
}

#menu-overlay {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 241, 188, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(12, 84, 91, 0.98), rgba(8, 57, 65, 0.99));
}

.overlay-visible {
  display: flex;
}

.card {
  width: min(360px, 100%);
  padding: 26px 22px 22px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(249, 244, 233, 0.98), rgba(239, 230, 209, 0.92));
  border: 1px solid var(--border);
  box-shadow:
    0 18px 48px rgba(9, 31, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.card-tag {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(120, 75, 27, 0.9);
}

.card h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.06;
}

.card p {
  margin: 0;
  line-height: 1.6;
  color: var(--ink-soft);
}

.menu-card {
  position: relative;
  overflow: hidden;
  max-height: 100%;
  margin: 0;
  padding: 18px 16px 16px;
}

.menu-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 180px;
  background:
    radial-gradient(circle at 18% 20%, rgba(201, 245, 255, 0.72), transparent 34%),
    radial-gradient(circle at 90% 18%, rgba(255, 231, 168, 0.58), transparent 32%),
    linear-gradient(180deg, rgba(115, 191, 204, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.menu-brand {
  position: relative;
  z-index: 1;
  padding: 8px 10px 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 255, 255, 0.92), rgba(224, 246, 246, 0.92));
  border: 1px solid rgba(27, 88, 93, 0.14);
  box-shadow:
    0 8px 20px rgba(17, 67, 73, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.menu-brand-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.menu-brand-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(31, 90, 86, 0.22);
  box-shadow: 0 4px 12px rgba(16, 61, 53, 0.18);
}

.menu-brand-subtitle {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(45, 85, 72, 0.85);
}

.menu-brand .card-tag {
  margin-bottom: 4px;
  color: rgba(22, 92, 97, 0.85);
  letter-spacing: 0.1em;
}

.menu-brand h2 {
  margin: 0;
  font-size: clamp(24px, 5.4vw, 34px);
  color: #16595f;
  letter-spacing: 0.02em;
}

.menu-brand h2 + .menu-tagline {
  margin-top: 6px;
}

.menu-tagline {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(31, 90, 86, 0.9);
}

.start-btn-top {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #fffdf7;
  background: linear-gradient(180deg, #58df70, #2eb84d);
  box-shadow:
    0 12px 26px rgba(33, 125, 53, 0.24),
    inset 0 1px 0 rgba(223, 255, 227, 0.38);
}

.menu-rules-btn {
  width: 100%;
  margin: 0;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 90, 85, 0.36);
  background: linear-gradient(180deg, rgba(35, 127, 112, 0.94), rgba(21, 87, 80, 0.9));
  box-shadow:
    0 12px 24px rgba(16, 62, 52, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #f7fffb;
  font: 700 14px/1.2 "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.06em;
}

.menu-rules-text {
  font-size: 14px;
}

.menu-rules-arrow {
  transition: transform 180ms ease;
  font-weight: 700;
}

.menu-rules-btn.is-open {
  background: linear-gradient(180deg, rgba(27, 114, 102, 0.96), rgba(17, 76, 70, 0.94));
}

.menu-rules-btn.is-open .menu-rules-arrow {
  transform: rotate(180deg);
}

.menu-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0 0;
}

.menu-rules-panel {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(26, 62, 51, 0.12);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.42);
  opacity: 0;
  max-height: 0;
  transform: translateY(-4px);
  pointer-events: none;
  overflow: hidden;
  transition:
    opacity 180ms ease,
    max-height 220ms ease,
    transform 180ms ease,
    padding 180ms ease;
}

.menu-rules-panel.is-open {
  opacity: 1;
  max-height: 136px;
  transform: translateY(0);
  padding: 10px;
  pointer-events: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.menu-rules-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(35, 84, 71, 0.9);
}

.menu-rules-list {
  display: grid;
  gap: 8px;
}

.menu-rule-item {
  border: 1px solid rgba(24, 82, 73, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px;
}

.menu-rule-item summary {
  font-size: 13px;
  color: #175d54;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.menu-rule-item summary::-webkit-details-marker {
  display: none;
}

.menu-rule-item p {
  margin: 8px 0 0;
  color: rgba(49, 82, 70, 0.9);
  font-size: 12px;
  line-height: 1.45;
}

.menu-rule-item summary::after {
  content: "＋";
  font-weight: 700;
  color: rgba(35, 86, 75, 0.9);
  transform: rotate(0deg);
  transition: transform 170ms ease;
}

.menu-rule-item[open] summary::after {
  content: "－";
  transform: rotate(180deg);
}

.menu-brand-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.menu-brand-badges span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(22, 87, 74, 0.95);
  background: rgba(42, 162, 137, 0.14);
  border: 1px solid rgba(36, 131, 111, 0.2);
}

.menu-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 10px;
}

.menu-rule-card {
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(25, 60, 48, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.menu-rule-card h3 {
  margin: 0;
  font-size: 16px;
  color: #1b5f53;
  letter-spacing: 0.06em;
  text-align: center;
}

.menu-rule-card p {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(46, 86, 73, 0.9);
  text-align: center;
}

.menu-helper-line {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(45, 80, 68, 0.9);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(25, 60, 48, 0.08);
}

.menu-level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
}

.menu-level-head strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(35, 84, 71, 0.9);
}

.menu-level-head span {
  font-size: 10px;
  color: rgba(64, 101, 88, 0.78);
}

.menu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 14px;
}

.menu-badges span,
.menu-actions span {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.menu-badges span {
  background: rgba(226, 185, 101, 0.18);
  color: rgba(120, 75, 27, 0.95);
}

.result-card {
  position: relative;
  width: min(324px, 100%);
  padding: 0 18px 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(251, 240, 218, 0.99), rgba(245, 224, 192, 0.98));
  border: 1px solid rgba(188, 151, 93, 0.34);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.result-head {
  margin: 0 -18px;
  padding: 14px 24px 16px;
  background: linear-gradient(180deg, #8ad62f, #70c322);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -2px 0 rgba(66, 117, 17, 0.32);
}

.result-head .card-tag,
.result-head h2 {
  text-align: center;
  color: #fff8ef;
}

.result-head .card-tag {
  margin: 0 0 4px;
  letter-spacing: 0.08em;
  color: rgba(255, 248, 239, 0.82);
}

.result-head h2 {
  margin: 0;
  font-size: 28px;
  text-shadow: 0 2px 0 rgba(53, 102, 11, 0.22);
}

.result-mascot {
  position: absolute;
  left: -14px;
  top: 66px;
  width: 74px;
  height: 90px;
}

.result-mascot::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  width: 44px;
  height: 52px;
  border-radius: 24px 24px 20px 20px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.95) 0 14px, rgba(244, 238, 227, 0.95) 15px, transparent 16px),
    radial-gradient(circle at 38% 30%, #1f2524 0 4px, transparent 5px),
    radial-gradient(circle at 62% 30%, #1f2524 0 4px, transparent 5px),
    radial-gradient(circle at 50% 48%, #d89d2d 0 5px, transparent 6px),
    linear-gradient(180deg, #1f2524 0 18px, #f7f2e6 19px 100%);
  box-shadow:
    0 8px 14px rgba(42, 31, 10, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.result-mascot::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 58px;
  height: 82px;
  background:
    radial-gradient(circle at 50% 4px, rgba(245, 196, 75, 0.96) 0 10px, transparent 11px),
    radial-gradient(circle at 12px 40px, rgba(255, 248, 239, 0.9) 0 12px, transparent 13px),
    radial-gradient(circle at 46px 40px, rgba(255, 248, 239, 0.9) 0 12px, transparent 13px),
    linear-gradient(180deg, transparent 0 20px, rgba(233, 178, 66, 0.92) 21px 24px, transparent 25px 100%);
  pointer-events: none;
}

.result-panel {
  margin: 18px 8px 0 30px;
  padding: 20px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #efd7b8, #e9d0af);
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 237, 0.52),
    inset 0 -1px 0 rgba(184, 146, 98, 0.24);
}

.result-copy {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: #a1632f;
}

.result-star {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 126px;
  font-size: 64px;
  line-height: 1;
  color: #ffd741;
  text-shadow:
    0 3px 0 rgba(116, 83, 18, 0.24),
    0 0 18px rgba(255, 224, 105, 0.32);
}

.result-subcopy {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: #9d6d41;
}

.result-badges {
  display: flex;
  gap: 8px;
  margin: 16px 0 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-badges span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(176, 131, 68, 0.14);
  color: rgba(136, 89, 33, 0.96);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions button {
  flex: 1;
}

.tips {
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  line-height: 1.6;
  color: var(--ink);
}

.tips li {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(25, 60, 48, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
}

.menu-actions span {
  background: rgba(21, 59, 47, 0.08);
  color: rgba(18, 53, 41, 0.86);
}

.menu-progress {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(25, 60, 48, 0.08);
  color: rgba(45, 80, 68, 0.88);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.menu-start-hint {
  margin: 0 0 8px;
  padding: 0 6px;
  color: rgba(42, 80, 70, 0.8);
  font-size: 11px;
  line-height: 1.3;
}

.menu-action-row .menu-rules-btn,
.menu-action-row .menu-levels-btn {
  margin: 0;
}

.menu-level-summary {
  margin: 4px 0 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(250, 249, 243, 0.74);
  border: 1px solid rgba(25, 60, 48, 0.12);
  color: rgba(44, 80, 69, 0.9);
  font-size: 11px;
  line-height: 1.35;
}

.menu-level-summary strong {
  color: #174e45;
}

.menu-level-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.menu-levels-btn {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(16, 73, 64, 0.2);
  background: linear-gradient(180deg, rgba(33, 111, 98, 0.94), rgba(22, 80, 68, 0.9));
  color: #f6fffa;
  font: 700 13px/1.2 "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.06em;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.menu-levels-btn .menu-rules-arrow {
  transition: transform 180ms ease;
}

.menu-levels-btn.is-open .menu-rules-arrow {
  transform: rotate(180deg);
}

#start-btn,
.start-btn-top {
  position: relative;
  overflow: hidden;
}

#start-btn::before,
.start-btn-top::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.28));
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  animation: startPulse 2.4s ease-in-out infinite;
}

@keyframes startPulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.22;
  }
}

.menu-levels-panel {
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(24, 82, 73, 0.14);
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.45);
  opacity: 0;
  max-height: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateY(-4px);
  transition:
    opacity 180ms ease,
    max-height 220ms ease,
    transform 180ms ease,
    padding 180ms ease;
}

.menu-levels-panel.is-open {
  opacity: 1;
  max-height: 128px;
  pointer-events: auto;
  transform: translateY(0);
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.menu-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}

.menu-level-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(25, 60, 48, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 234, 215, 0.9));
  box-shadow:
    0 10px 24px rgba(20, 54, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.menu-level-btn.is-selected {
  border-color: rgba(213, 154, 52, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 244, 211, 0.98), rgba(245, 223, 171, 0.94));
  box-shadow:
    0 12px 28px rgba(186, 131, 33, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.menu-level-btn.is-locked {
  opacity: 0.62;
  filter: grayscale(0.15);
  cursor: not-allowed;
}

.menu-level-btn.is-compact {
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "badge";
  padding: 10px;
  min-height: 68px;
  text-align: center;
  gap: 4px;
}

.menu-level-btn.is-compact .menu-level-title {
  font-size: 14px;
}

.menu-level-btn.is-compact .menu-level-meta {
  justify-content: center;
  margin-top: 0;
}

.menu-level-btn.is-compact .menu-level-stars {
  background: rgba(255, 255, 255, 0.82);
}

.menu-level-btn.is-compact .menu-level-badge {
  min-width: 0;
}

.menu-level-main {
  display: grid;
  gap: 4px;
  text-align: left;
}

.menu-level-badge {
  grid-area: badge;
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  min-width: 60px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  background: rgba(26, 89, 74, 0.1);
  color: rgba(30, 80, 66, 0.95);
}

.menu-level-btn.is-compact .menu-level-badge {
  justify-self: center;
  min-width: 0;
  padding: 6px 12px;
}

.menu-level-btn.is-compact .menu-level-main {
  text-align: center;
}

.menu-level-title {
  font-size: 15px;
  font-weight: 800;
  color: #1a4034;
}

.menu-level-desc {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(57, 88, 75, 0.86);
}

.menu-level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0;
}

.menu-level-stars,
.menu-level-difficulty,
.menu-level-tag,
.menu-level-state {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.menu-level-stars {
  background: rgba(228, 177, 85, 0.16);
  color: rgba(124, 77, 27, 0.92);
}

.menu-level-difficulty {
  background: rgba(17, 104, 85, 0.12);
  color: rgba(24, 95, 80, 0.92);
}

.menu-level-tag {
  background: rgba(34, 111, 98, 0.14);
  color: rgba(18, 82, 71, 0.92);
}

.menu-level-state {
  background: rgba(88, 119, 156, 0.14);
  color: rgba(42, 86, 120, 0.94);
}

.menu-level-btn.is-selected .menu-level-badge {
  background: linear-gradient(180deg, #ffcb36, #f39a17);
  color: #fffdf7;
  box-shadow:
    0 8px 20px rgba(166, 105, 17, 0.16),
    inset 0 1px 0 rgba(255, 247, 214, 0.42);
}

.menu-level-btn.is-locked .menu-level-badge {
  background: rgba(78, 88, 92, 0.14);
  color: rgba(75, 83, 88, 0.9);
  box-shadow: none;
}

.menu-level-btn.is-locked .menu-level-stars,
.menu-level-btn.is-locked .menu-level-difficulty {
  background: rgba(85, 92, 97, 0.14);
  color: rgba(75, 83, 88, 0.88);
}

.menu-level-btn.is-gentle .menu-level-tag {
  background: rgba(40, 145, 113, 0.18);
  color: rgba(10, 93, 75, 0.92);
}

.menu-level-btn.is-difficult .menu-level-tag {
  background: rgba(230, 124, 40, 0.16);
  color: rgba(119, 63, 14, 0.95);
}

.menu-level-btn.is-difficult .menu-level-state,
.menu-level-btn.is-difficult .menu-level-stars {
  background: rgba(234, 169, 84, 0.18);
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  color: #fff8ef;
  background: linear-gradient(180deg, #d89535, #a95a1d);
  box-shadow:
    0 12px 28px rgba(117, 60, 19, 0.28),
    inset 0 1px 0 rgba(255, 240, 214, 0.28);
  cursor: pointer;
}

#result-secondary-btn.is-hidden {
  display: none;
}

.ghost-btn {
  color: #fffdf7;
  background: linear-gradient(180deg, #42a6ff, #2a75d7);
  box-shadow:
    0 10px 24px rgba(33, 87, 164, 0.24),
    inset 0 1px 0 rgba(235, 246, 255, 0.38);
}

.primary-btn {
  background: linear-gradient(180deg, #ffcb36, #f39a17);
  color: #fffdf7;
  box-shadow:
    0 10px 24px rgba(166, 105, 17, 0.24),
    inset 0 1px 0 rgba(255, 247, 214, 0.42);
}

#start-btn,
#restart-btn {
  min-width: 136px;
}

#start-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 0;
  font-size: 18px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #54d96c, #2eb44a);
  box-shadow:
    0 12px 26px rgba(33, 125, 53, 0.28),
    inset 0 1px 0 rgba(223, 255, 227, 0.36);
  position: relative;
}

#start-btn.menu-start-hidden {
  display: none !important;
}

#start-btn:hover {
  transform: none;
}

#start-btn:active {
  transform: none;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.shell-note {
  display: none;
}

body.touch-device .shell-note {
  display: none;
}

body.touch-device .phone-shell {
  border-radius: 14px;
}

body.touch-device button {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

body.touch-device .card {
  box-shadow:
    0 16px 42px rgba(9, 31, 24, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

body.touch-device button:hover {
  transform: none;
}

body.wechat-minigame {
  padding: 0;
}

body.wechat-minigame .shell {
  width: min(100vw, 392px);
  margin: 0 auto;
  padding: 0;
}

body.wechat-minigame .phone-shell {
  width: min(100vw, 392px);
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body.wechat-minigame .phone-shell canvas {
  border-radius: 0;
}

@media (max-height: 760px) {
  .menu-brand-badges {
    display: none;
  }

  .menu-level-head span {
    display: none;
  }
}

@media (max-width: 430px) {
  :root {
    --game-shell-width: min(392px, calc(100vw - 12px));
  }

  .shell {
    padding-top: 6px;
  }

  .card {
    padding: 22px 18px 18px;
  }

  .result-card {
    padding: 0 14px 14px;
  }

  .result-head {
    margin: 0 -14px;
  }

  .result-panel {
    margin-left: 24px;
  }

  .hero-chips {
    gap: 8px;
  }

  .hero-chips span {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* 2026 playable polish: premium stack-match phone menu. */
:root {
  --ink: #fff5df;
  --ink-soft: rgba(255, 245, 223, 0.72);
  --panel: rgba(9, 21, 26, 0.9);
  --border: rgba(255, 245, 223, 0.14);
  --gold: #ffd76a;
  --gold-soft: rgba(255, 215, 106, 0.18);
  --screen-edge: rgba(103, 232, 208, 0.18);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 8%, rgba(103, 232, 208, 0.2), transparent 26%),
    radial-gradient(circle at 90% 16%, rgba(255, 215, 106, 0.14), transparent 24%),
    linear-gradient(180deg, #050d12 0%, #0b1b23 55%, #120f1d 100%);
}

.phone-shell {
  border-color: rgba(103, 232, 208, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(103, 232, 208, 0.14), rgba(255, 215, 106, 0.045)),
    #07131a;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.58),
    0 0 0 8px rgba(103, 232, 208, 0.04),
    inset 0 1px 0 rgba(255, 245, 223, 0.08);
}

.audio-toggle {
  border-color: rgba(255, 245, 223, 0.18);
  background: rgba(7, 19, 26, 0.78);
  color: var(--ink);
}

#menu-overlay {
  background:
    radial-gradient(circle at 50% 0%, rgba(103, 232, 208, 0.24), transparent 32%),
    radial-gradient(circle at 12% 92%, rgba(255, 215, 106, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(7, 19, 26, 0.98), rgba(10, 22, 28, 0.99));
}

.card,
.menu-card {
  border-color: var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 245, 223, 0.1), rgba(255, 245, 223, 0.035)),
    var(--panel);
  color: var(--ink);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 245, 223, 0.08);
}

.menu-card {
  width: min(382px, 100%);
  padding: 18px;
}

.menu-card::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(103, 232, 208, 0.24), transparent 34%),
    radial-gradient(circle at 90% 18%, rgba(255, 215, 106, 0.18), transparent 32%);
}

.menu-brand {
  border-color: rgba(255, 245, 223, 0.13);
  border-radius: 20px;
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 215, 106, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(103, 232, 208, 0.14), rgba(255, 245, 223, 0.045)),
    rgba(5, 13, 18, 0.64);
}

.menu-brand .card-tag,
.menu-level-head strong,
.menu-progress strong {
  color: var(--gold);
}

.menu-brand-subtitle,
.menu-tagline,
.menu-start-hint,
.menu-level-head span,
.menu-level-summary,
.menu-progress {
  color: var(--ink-soft);
}

.menu-brand h2 {
  color: var(--ink);
  font-size: clamp(27px, 6vw, 38px);
}

.menu-brand-icon {
  border-color: rgba(255, 245, 223, 0.13);
  background: rgba(255, 245, 223, 0.12);
}

.start-btn-top {
  color: #1a1008;
  background: linear-gradient(180deg, #ffd76a, #ff934d);
  box-shadow: 0 14px 30px rgba(255, 147, 77, 0.24);
}

.menu-rules-btn,
.menu-levels-btn {
  border-color: rgba(255, 245, 223, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 245, 223, 0.11), rgba(255, 245, 223, 0.04)),
    rgba(5, 13, 18, 0.6);
  color: var(--ink);
}

.menu-brand-badges span,
.menu-progress,
.menu-level-summary {
  border: 1px solid rgba(255, 245, 223, 0.11);
  background: rgba(255, 245, 223, 0.07);
}

.menu-level-btn {
  border-color: rgba(255, 245, 223, 0.13);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 245, 223, 0.1), rgba(255, 245, 223, 0.035)),
    rgba(5, 13, 18, 0.56);
}

.menu-level-btn.is-selected {
  border-color: rgba(103, 232, 208, 0.72);
  box-shadow:
    0 0 0 3px rgba(103, 232, 208, 0.18),
    inset 0 1px 0 rgba(255, 245, 223, 0.08);
}

.menu-level-title,
.menu-level-badge {
  color: var(--ink);
}

.menu-level-tag,
.menu-level-state,
.menu-level-stars {
  color: #123222;
  background: rgba(103, 232, 208, 0.78);
}

.menu-level-btn.is-difficult .menu-level-tag,
.menu-level-btn.is-difficult .menu-level-state,
.menu-level-btn.is-difficult .menu-level-stars {
  color: #2b1704;
  background: rgba(255, 215, 106, 0.78);
}

.menu-rule-item,
.menu-rules-panel,
.menu-helper-line {
  border-color: rgba(255, 245, 223, 0.12);
  background: rgba(5, 13, 18, 0.58);
  color: var(--ink-soft);
}

.menu-rule-item summary,
.menu-rules-title,
.menu-rule-item p {
  color: var(--ink);
}
