* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  line-height: 1.5;
  color: #221f1f;
  background:
    radial-gradient(circle at top left, rgba(255, 233, 168, 0.8), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 205, 112, 0.45), transparent 28%),
    linear-gradient(160deg, #fffaf0 0%, #ffe8bb 100%);
}

button,
input,
canvas {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 1.35rem;
  border: 1px solid rgba(34, 32, 42, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 40px rgba(120, 80, 0, 0.12);
}

.hero-copy h1 {
  margin: 0.15rem 0 0.4rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  color: #9a6200;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-text {
  margin: 0;
  max-width: 60ch;
  color: #5f4c26;
}

.hero-badge {
  width: 84px;
  height: 84px;
  padding: 0.75rem;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff8d8, #ffd975);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 28px rgba(127, 86, 0, 0.18);
}

.controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  color: #1d1200;
  background: linear-gradient(135deg, #ffd54a 0%, #ffb938 100%);
  box-shadow: 0 14px 28px rgba(255, 171, 0, 0.28);
}

.button-secondary {
  color: #2d2516;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 18px rgba(34, 32, 42, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 0.95fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.section-title {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.stat-card,
.info-card,
.arena-card {
  border: 1px solid rgba(34, 32, 42, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 32px rgba(101, 67, 10, 0.08);
}

.stat-card {
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-card strong {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.stat-label {
  color: #7b5c23;
  font-size: 0.85rem;
}

.arena-card {
  padding: 1rem;
}

.canvas-shell {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(61, 48, 18, 0.12);
  background: linear-gradient(180deg, #fffdf7 0%, #fff0c6 100%);
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: crosshair;
  touch-action: manipulation;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(24, 18, 10, 0.42);
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(420px, 100%);
  padding: 1.5rem;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 251, 236, 0.96);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.22);
}

.overlay-kicker {
  margin: 0;
  color: #9a6200;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.overlay-card h3 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.8rem;
}

.overlay-card p {
  margin: 0 0 1rem;
  color: #5c4a22;
}

.info-panel {
  display: grid;
  gap: 1rem;
}

.info-card {
  padding: 1.2rem;
}

.rules {
  margin: 0;
  padding-left: 1.15rem;
  color: #5a4720;
}

.rules li + li {
  margin-top: 0.5rem;
}

.legend {
  display: grid;
  gap: 0.85rem;
}

.legend-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
}

.legend-item h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.legend-item p {
  margin: 0;
  color: #5f4c26;
  font-size: 0.92rem;
}

.legend-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(34, 32, 42, 0.08);
}

.legend-normal {
  background: radial-gradient(circle at 35% 35%, #5e5a6a 0%, #22202a 70%);
}

.legend-gold {
  background: radial-gradient(circle at 35% 35%, #fff7a8 0%, #f1b800 72%);
}

.legend-fake {
  background: radial-gradient(circle at 35% 35%, #ff8d8d 0%, #d72f2f 72%);
}

.footer {
  padding: 1rem 0 0;
  color: #6c5320;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .controls {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1200px);
    padding-top: 0.5rem;
  }

  .hero,
  .arena-card,
  .info-card,
  .stat-card {
    border-radius: 18px;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .controls {
    width: 100%;
  }

  .hero-badge {
    width: 72px;
    height: 72px;
  }
}