:root {
  --bg: #14201c;
  --panel: #1c2e28;
  --ink: #eef6f1;
  --muted: #8aa899;
  --accent: #e8c36a;
  --ok: #4caf7a;
  --bad: #c45c5c;
  --line: rgba(255, 255, 255, 0.08);
  --board: #0b1512;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #060b09;
  color: var(--ink);
}

.phone-frame {
  width: min(390px, 100%);
  margin: 16px auto;
  background: #111;
  border: 10px solid #1a1f1c;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 780px;
  max-height: 844px;
  background:
    radial-gradient(480px 260px at 80% -8%, #274338 0%, transparent 55%),
    var(--bg);
  padding: 10px 10px 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.hud {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.goal-hint-bar {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  flex-shrink: 0;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.board-wrap {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}

.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 100%;
}

.side-top,
.current-pic-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.current-pic-block {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.side-label {
  font-size: 10px;
  color: var(--muted);
}

.word-pic {
  border-radius: 8px;
  background: linear-gradient(160deg, #f3e6c8 0%, #d9c49a 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.next-pic {
  width: 64px;
  height: 64px;
  font-size: 30px;
}

.current-pic {
  width: 72px;
  height: 72px;
  font-size: 38px;
}

.pic-word {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pic-word.current {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}

#game {
  width: 100%;
  height: auto;
  display: block;
  background: var(--board);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls {
  margin-top: 8px;
  flex-shrink: 0;
}

.touch-pad {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 6px;
}

.pad-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #243830;
  color: var(--ink);
  border-radius: 10px;
  min-height: 48px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.pad-btn:active {
  background: #2f4a3e;
}

.pad-btn.down {
  background: #2a4036;
  color: var(--accent);
}

.help {
  margin-top: 6px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}

.overlay[hidden] {
  display: none;
}

.card {
  width: min(320px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.card button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #1a1408;
  font-weight: 800;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

@media (max-width: 420px) {
  .phone-frame {
    margin: 0;
    border: 0;
    border-radius: 0;
    width: 100%;
    min-height: 100dvh;
  }

  #app {
    min-height: 100dvh;
    max-height: none;
  }

  .desktop-only {
    display: none;
  }
}
