:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-strong: #eef2f6;
  --ink: #18212b;
  --muted: #657280;
  --line: #d8e0e8;
  --teal: #0f9488;
  --blue: #2f6fbd;
  --coral: #e85d4f;
  --gold: #d59a1b;
  --shadow: 0 18px 44px rgba(24, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 245, 247, 0.98)),
    var(--bg);
  color: var(--ink);
  font-family:
    Pretendard,
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.4rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.sync-panel {
  display: grid;
  min-width: 126px;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(24, 33, 43, 0.07);
}

.sync-panel span,
.score-box span,
.round-box span,
.pick-card span,
.history-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.sync-panel strong {
  color: var(--blue);
  font-size: 0.98rem;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr minmax(110px, 0.6fr) 1fr;
  gap: 12px;
  margin-top: 24px;
}

.score-box,
.round-box,
.result-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.score-box,
.round-box {
  display: grid;
  place-items: center;
  min-height: 112px;
  padding: 18px;
}

.score-box strong,
.round-box strong {
  font-size: 3rem;
  line-height: 1;
}

.score-box:first-child strong {
  color: var(--teal);
}

.score-box:last-child strong {
  color: var(--coral);
}

.round-box strong {
  color: var(--blue);
}

.play-area {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 18px;
  margin-top: 18px;
}

.choice-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.choice-button {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  min-height: 116px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 10px 24px rgba(24, 33, 43, 0.08);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.choice-button:hover {
  border-color: rgba(15, 148, 136, 0.55);
  box-shadow: 0 16px 32px rgba(24, 33, 43, 0.13);
  transform: translateY(-2px);
}

.choice-button:focus-visible,
.reset-button:focus-visible {
  outline: 3px solid rgba(47, 111, 189, 0.32);
  outline-offset: 3px;
}

.choice-button.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 148, 136, 0.14);
}

.choice-button svg {
  width: 58px;
  height: 58px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.choice-button span {
  font-size: 1.65rem;
  letter-spacing: 0;
}

.choice-button[data-choice="scissors"] {
  color: var(--blue);
}

.choice-button[data-choice="rock"] {
  color: var(--coral);
}

.choice-button[data-choice="paper"] {
  color: var(--gold);
}

.result-panel {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 372px;
  padding: 18px;
}

.pick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pick-card {
  display: grid;
  min-height: 150px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.pick-card strong {
  min-height: 42px;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1.2;
  text-align: center;
}

.result-text {
  display: grid;
  place-items: center;
  min-height: 86px;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #18212b;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
}

.result-text.is-win {
  background: var(--teal);
}

.result-text.is-lose {
  background: var(--coral);
}

.result-text.is-draw {
  background: var(--blue);
}

.reset-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(24, 33, 43, 0.18);
}

.reset-button:hover {
  background: #293541;
}

.history-panel {
  margin-top: 18px;
  padding: 16px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-head h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-list strong {
  color: var(--ink);
}

.history-list .empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding: 18px 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2rem;
  }

  .scoreboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .score-box,
  .round-box {
    min-height: 92px;
    padding: 12px 8px;
  }

  .score-box strong,
  .round-box strong {
    font-size: 2.3rem;
  }

  .play-area {
    grid-template-columns: 1fr;
  }

  .choice-button {
    grid-template-columns: 62px 1fr;
    min-height: 92px;
  }

  .choice-button svg {
    width: 48px;
    height: 48px;
  }

  .choice-button span {
    font-size: 1.35rem;
  }

  .pick-row {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 0;
  }

  .history-list li {
    grid-template-columns: 52px 1fr;
  }

  .history-list li span:last-child {
    grid-column: 1 / -1;
  }
}
