:root {
  --game-navy: #082f61;
  --game-blue: #0b4f9c;
  --game-cyan: #72d9e7;
  --game-ink: #10223a;
  --game-muted: #65738a;
  --game-line: #d9e5ee;
  --game-success: #14805e;
  --game-error: #c94b47;
}

.coordinate-game-body {
  background:
    radial-gradient(circle at 12% 14%, rgba(114, 217, 231, 0.13), transparent 28%),
    #f8fafb;
}

.coordinate-game-page {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 22px;
}

.game-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 22px;
  margin-bottom: 14px;
}

.game-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--game-blue);
  font-weight: 850;
  text-decoration: none;
}

.game-kicker {
  margin: 0 0 9px;
  color: var(--game-blue);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.game-intro h1 {
  margin: 0;
  color: var(--game-navy);
  font-size: clamp(1.85rem, 3.1vw, 3.15rem);
  line-height: 1;
}

.game-intro p:last-child {
  max-width: none;
  margin: 9px 0 0;
  color: var(--game-muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.game-intro-mark {
  position: relative;
  grid-row: 1;
  width: 82px;
  height: 82px;
  justify-self: start;
  border: 1px solid var(--game-line);
  border-radius: 22px;
  background:
    linear-gradient(rgba(11, 79, 156, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 79, 156, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 16px 16px;
  box-shadow: 0 12px 28px rgba(8, 47, 97, 0.08);
}

.game-intro-mark::before,
.game-intro-mark::after {
  content: "";
  position: absolute;
  background: var(--game-blue);
}

.game-intro-mark::before {
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 2px;
}

.game-intro-mark::after {
  top: 50%;
  right: 10px;
  left: 10px;
  height: 2px;
}

.game-intro-mark i {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 52px;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--game-cyan);
  box-shadow: 0 0 0 2px var(--game-blue);
}

.game-intro-mark span,
.game-intro-mark b {
  position: absolute;
  z-index: 2;
  color: var(--game-blue);
  font-family: Georgia, serif;
}

.game-intro-mark span { top: 2px; left: 36px; }
.game-intro-mark b { right: 3px; top: 35px; }

.coordinate-game {
  overflow: hidden;
  border: 1px solid var(--game-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(8, 47, 97, 0.09);
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--game-line);
  background: #fbfdfe;
}

.game-hud > div {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 10px 18px;
  border-left: 1px solid var(--game-line);
}

.game-hud > div:last-child { border-left: 0; }

.game-hud span {
  color: var(--game-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.game-hud strong {
  color: var(--game-navy);
  font-size: 1rem;
}

.game-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.65fr);
  grid-template-areas:
    "prompt board"
    "choices board"
    "feedback board"
    "actions board";
  gap: 12px 24px;
  align-items: center;
  min-height: 0;
  padding: 18px 22px;
}

.game-prompt {
  display: grid;
  grid-area: prompt;
  justify-items: center;
  text-align: center;
}

.game-prompt p,
.game-prompt small {
  margin: 0;
  color: var(--game-muted);
  font-weight: 800;
}

.game-prompt h2 {
  margin: 2px 0 3px;
  color: var(--game-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4vw, 3.7rem);
  font-weight: 700;
}

.coordinate-board {
  grid-area: board;
  overflow: hidden;
  width: min(100%, calc((100svh - 390px) * 760 / 590));
  max-height: calc(100svh - 390px);
  margin: 0 auto;
  border: 1px solid var(--game-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 0 8px #f6f9fb;
}

[data-coordinate-canvas] {
  display: block;
  width: 100%;
  aspect-ratio: 760 / 590;
  cursor: crosshair;
  touch-action: manipulation;
}

.point-choice-area {
  display: grid;
  grid-area: choices;
  gap: 8px;
  justify-items: center;
}

.point-choice-area > p {
  margin: 0;
  color: var(--game-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.point-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

.point-choice {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--game-line);
  border-radius: 999px;
  color: var(--game-navy);
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: 160ms ease;
}

.point-choice:hover,
.point-choice:focus-visible {
  border-color: var(--game-blue);
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 8px 20px rgba(8, 47, 97, 0.09);
}

.point-choice.wrong {
  color: var(--game-error);
  border-color: rgba(201, 75, 71, 0.4);
  background: #fff6f5;
}

.point-choice.correct {
  color: #fff;
  border-color: var(--game-success);
  background: var(--game-success);
}

.point-choice:disabled {
  cursor: default;
  transform: none;
}

.game-feedback {
  grid-area: feedback;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  width: 100%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 15px;
  color: var(--game-muted);
  background: #f5f8fa;
}

.game-feedback p { margin: 0; font-weight: 850; }

.feedback-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #a8b5c3;
  font-weight: 950;
}

.game-feedback[data-state="success"] { color: var(--game-success); background: #eef9f5; }
.game-feedback[data-state="success"] .feedback-icon { background: var(--game-success); }
.game-feedback[data-state="error"] { color: var(--game-error); background: #fff5f4; }
.game-feedback[data-state="error"] .feedback-icon { background: var(--game-error); }

.game-actions {
  grid-area: actions;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
}

.game-actions .button { min-width: 150px; }

.game-finish {
  padding: clamp(46px, 9vw, 100px) 24px;
  text-align: center;
}

.game-finish h2 {
  margin: 0;
  color: var(--game-navy);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.game-finish > p:not(.game-kicker) { color: var(--game-muted); }

.finish-score {
  display: grid;
  gap: 3px;
  width: 190px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 24px;
  color: #fff;
  background: var(--game-blue);
  box-shadow: 0 18px 40px rgba(11, 79, 156, 0.22);
}

.finish-score span { font-size: 0.8rem; font-weight: 800; opacity: 0.78; }
.finish-score strong { font-size: 2.6rem; }

.game-learning-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 16px;
  border: 1px solid var(--game-line);
  border-radius: 22px;
  background: #fff;
}

.game-learning-note > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 16px;
  color: var(--game-blue);
  background: #eaf5f8;
  font-weight: 950;
}

.game-learning-note strong { color: var(--game-navy); font-size: 0.9rem; }
.game-learning-note p { margin: 1px 0 0; color: var(--game-muted); font-size: 0.82rem; line-height: 1.4; }

.coordinate-game-body > .footer {
  display: none;
}

@media (min-width: 761px) {
  .game-intro .game-kicker,
  .game-intro p:last-child,
  .game-learning-note {
    display: none;
  }
}

@media (max-width: 760px) {
  .coordinate-game-page { width: min(100% - 24px, 1180px); padding-top: 32px; }
  .game-intro { grid-template-columns: 1fr; }
  .game-intro-mark { display: none; }
  .game-hud { grid-template-columns: repeat(2, 1fr); }
  .game-hud > div {
    min-height: 70px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--game-line);
  }
  .game-stage {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "prompt"
      "board"
      "choices"
      "feedback"
      "actions";
    padding: 16px 12px 20px;
  }
  .coordinate-game { border-radius: 22px; }
  .coordinate-board {
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }
  .point-choice { min-width: 82px; padding-inline: 14px; }
  .game-actions { flex-direction: column; }
  .game-actions .button { width: 100%; }
  .game-learning-note { grid-template-columns: 42px minmax(0, 1fr); padding: 20px; }
  .game-learning-note > span { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .point-choice { transition: none; }
}
