/* ── 오목 게임 전용 스타일 ───────────────────────────── */

.wrap {
  width: min(980px, 96vw);
  margin: 0 auto 28px;
}

/* ── 게임 컨트롤 바 ──────────────────────────────────── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.brand .sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sound-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}
.sound-toggle:hover {
  background: rgba(0,0,0,0.05);
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--accent);
}

button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: #f8fafc; }

button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

button.primary:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* ── 게임 메인 영역 ───────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 보드 쉘 ─────────────────────────────────────────── */
.boardShell {
  display: flex;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
  padding: 12px 12px 16px;
  box-shadow: 0 8px 32px rgba(15,23,42,.10);
}

/* ── 오목판 (canvas) ──────────────────────────────────── */
.board {
  display: block;
  /* boardShell 패딩(24px) + 여유(4px) = 28px 빼기 */
  width: min(600px, calc(96vw - 28px));
  height: min(600px, calc(96vw - 28px));
  cursor: crosshair;
  border-radius: 10px;
  box-shadow:
    0 2px 0 rgba(120,80,20,.3),
    0 6px 24px rgba(15,23,42,.22);
}

/* ── 모달 ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.hidden { display: none; }

.modalCard {
  width: min(380px, 90%);
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15,23,42,.18);
  padding: 24px 20px 20px;
  text-align: center;
}

.modalTitle {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
}

.modalDesc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.modalBtns {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ── 상태 바 ─────────────────────────────────────────── */
.status-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-bar .status {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}

.status-bar .hint {
  font-size: 12px;
  color: var(--muted);
}

/* 아티클 패널 */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.panel h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.panel p {
  margin: 0 0 12px;
  color: #334155;
  line-height: 1.65;
}

.panel ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.panel li {
  margin-bottom: 6px;
  color: #334155;
}

details.faq {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px 14px;
  margin-top: 8px;
}

details.faq summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  list-style: none;
}

details.faq summary::-webkit-details-marker { display: none; }

details.faq p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ── 반응형 ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .wrap {
    width: 100vw;
    margin: 0 auto 20px;
  }

  .boardShell {
    padding: 4px 4px 6px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .board {
    width: calc(100vw - 12px);
    height: calc(100vw - 12px);
    border-radius: 6px;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
