@font-face {
  font-family: "Seogung";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2601-4@1.1/Suhgung12.woff2")
    format("woff2");
  font-weight: normal;
  font-display: swap;
}

:root {
  --mint: #4fd1c5;
  --mint-soft: #c7f3ef;

  --bg1: #f4fffd;
  --bg2: #e6fffa;

  --panel: rgba(255, 255, 255, 0.82);
  --panel2: rgba(255, 255, 255, 0.65);
  --line: rgba(0, 60, 60, 0.12);

  --text: rgba(0, 40, 40, 0.92);
  --muted: rgba(0, 40, 40, 0.6);

  --good: #14b8a6;
  --bad: #e11d48;

  --shadow: 0 20px 60px rgba(0, 60, 60, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family:
    "Seogung",
    system-ui,
    -apple-system,
    "Noto Sans KR",
    sans-serif;

  background: radial-gradient(
    1200px 700px at 50% -20%,
    var(--bg2) 0%,
    var(--bg1) 55%,
    #ffffff 100%
  );
  color: var(--text);

  display: grid;
  place-items: center;
  font-size: 16px;
}

/* 게임판 크게 */
.game {
  width: min(1100px, 96vw);
  padding: 26px;
}

.top {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.title {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.5px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.seg {
  display: inline-flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
  box-shadow: 0 10px 26px rgba(0, 60, 60, 0.05);
}

/* 버튼 크게 */
.btn {
  border: 1px solid var(--line);
  background: white;

  padding: 14px 22px;
  border-radius: 14px;

  font-size: 16px;
  font-weight: 900;

  cursor: pointer;
}

.btn:hover {
  background: var(--mint-soft);
}

.btn.primary {
  background: var(--mint-soft);
  border-color: var(--mint);
}

.btn.active {
  outline: 3px solid rgba(79, 209, 197, 0.35);
}

.btn.small {
  padding: 10px 16px;
  font-size: 13px;
}

.seg .btn {
  min-width: 64px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: white;
}

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

.value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 900;
}

.word {
  margin: 14px 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* 입력창 폰트 강제 */
.input {
  width: min(720px, 96vw);
  padding: 14px;
  font-size: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;

  font-family:
    "Seogung",
    system-ui,
    -apple-system,
    "Noto Sans KR",
    sans-serif;
  font-weight: normal;
}

.input::placeholder {
  font-family:
    "Seogung",
    system-ui,
    -apple-system,
    "Noto Sans KR",
    sans-serif;
  color: var(--muted);
}

.input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.25);
}

/* 오타 */
.input.error {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15);
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}

.input.shake {
  animation: shake 0.25s;
}

.hint {
  margin: 12px 0;
  color: var(--muted);
}

.result.hit {
  color: var(--good);
}
.result.end {
  color: var(--muted);
}

/* ===== 모달 ===== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 40, 40, 0.25);
  display: none;
  place-items: center;
}

.modal.show {
  display: grid;
}

.modal-box {
  background: white;
  border-radius: 18px;
  padding: 18px;
  width: min(980px, 96vw);
  box-shadow: var(--shadow);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.mcard {
  border: 1px solid var(--line);
  background: #f0fffd;
  border-radius: 16px;
  padding: 12px;
}

.mvalue {
  font-size: 22px;
  font-weight: 900;
}

.badge {
  background: var(--mint-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
}

.history {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.hrow {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr 0.6fr 0.6fr;
  gap: 8px;
  padding: 10px;
  background: #ecfffc;
  border-radius: 12px;
  margin-bottom: 6px;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* 반응형 */

@media (max-width: 900px) {
  .modal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
