@import url('https://fonts.googleapis.com/css2?family=Jost:wght@500;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  --bg1: #111827;
  --bg2: #1f2937;
  --card: #f8fafc;
  --line: #dbeafe;
  --ink: #1e293b;
  --sub: #475569;
  --primary: #ef4444;
  --primary-2: #f97316;
  --success: #22c55e;
  --warn: #0ea5e9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Jost', 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #334155, transparent 35%), linear-gradient(140deg, var(--bg1), var(--bg2));
}

.wrap {
  width: min(1024px, 94vw);
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
}

h1 {
  margin: 0 0 0.25rem;
  color: #f8fafc;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: 0.04em;
}

.subtitle {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #e2e8f0;
  font-size: 1.02rem;
}

.card {
  background: rgba(248, 250, 252, 0.93);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 30px 65px rgba(2, 6, 23, 0.3);
  backdrop-filter: blur(2px);
}

.hidden {
  display: none;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 1rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

button.ghost {
  background: #475569;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.status {
  margin-top: 0.8rem;
  min-height: 2rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-weight: 600;
}

.muted {
  margin: 0.4rem 0 0;
  color: #94a3b8;
}

.lobby-actions {
  margin: 1rem 0;
}

#board-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.8rem 0 0;
}

#game-main {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 320px);
  gap: 1rem;
  align-items: start;
}

#dartboard {
  width: min(520px, 88vw);
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

.hud {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  color: #0f172a;
  flex-wrap: wrap;
}

.mobile-only {
  display: none;
}

.turn-info {
  margin-top: 0.65rem;
  color: #1d4ed8;
  font-size: 1.05rem;
}

#side-panel {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #e2e8f0;
}

#side-panel h2 {
  margin: 0 0 0.6rem;
  color: #f8fafc;
  font-size: 1.06rem;
}

.big-score-card {
  border: 1px solid #334155;
  border-radius: 12px;
  background: #020617;
  padding: 0.85rem;
}

#bigCurrentPlayer {
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#bigCurrentRemain {
  font-size: clamp(2.3rem, 5vw, 3.35rem);
  line-height: 1;
  margin-top: 0.4rem;
  color: #22d3ee;
  font-weight: 700;
}

#bigDartInfo {
  margin-top: 0.5rem;
  font-size: 0.98rem;
  color: #cbd5e1;
  font-weight: 700;
}

.big-event {
  margin-top: 0.8rem;
  border-radius: 10px;
  background: #0b1220;
  border: 1px solid #334155;
  min-height: 88px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.42;
  color: #f8fafc;
}

.turn-box {
  margin-top: 0.8rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  padding: 0.7rem;
}

.turn-box h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

.shot-list,
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shot-list li,
.history-list li {
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.32rem;
  background: #111827;
  border: 1px solid #1f2937;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
}

.history-list li {
  font-size: 0.84rem;
  line-height: 1.35;
  color: #e2e8f0;
}

#actionHint {
  color: #334155;
}

.tables {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(210px, 1fr);
  gap: 1rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

ul {
  margin: 0;
  padding-left: 1rem;
}

li {
  margin-bottom: 0.35rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid #d1d5db;
  white-space: nowrap;
}

.error {
  margin-top: 0.75rem;
  color: #b91c1c;
  min-height: 1.3rem;
  font-weight: 600;
}

@media (max-width: 860px) {
  #game-main {
    grid-template-columns: 1fr;
  }

  #side-panel {
    order: 2;
  }

  .mobile-only {
    display: flex;
    margin-top: 0.6rem;
  }

  #board-wrap .hud {
    display: none;
  }

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

  .top-bar,
  .hud,
  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
