/* ───────────────────────────────────────────────────────────────
   game.css — layout for play.html
   ─────────────────────────────────────────────────────────────── */
.game-page { min-height: 100vh; }

.game-top { position: relative; z-index: 2; padding: 14px 24px 0; }
.logo {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 90px;
}
.logo-mark { height: 2.2em; width: auto; filter: drop-shadow(0 0 10px rgba(220, 224, 232, .18)); }
.logo:hover { color: var(--orange); }

.table {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 250px) auto minmax(180px, 250px);
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  padding: 0 24px 24px;
  min-height: calc(100vh - 70px);
  margin-top: -6px;
}

.side { display: flex; flex-direction: column; gap: 28px; align-items: stretch; }
.side-left { align-items: flex-start; }

.board-area { --size: min(calc(100vh - 240px), 56vw, 700px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.board-frame {
  width: var(--size);
  padding: 2% 2% 6% 7%;
}

.player-tag {
  width: var(--size);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 7%;
  min-height: 40px;
  font-size: 1.15rem;
}
.player-tag small { opacity: .65; }
.tag-name { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid; }
.dot.sunny { background: #d6d8dd; border-color: #f4f5f7; }
.dot.inky { background: #2b2e34; border-color: #b9bdc6; }

.captured { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.captured .cap { width: 30px; height: 30px; margin-left: -6px; }
.captured .cap svg { width: 100%; height: 100%; }
.captured .adv { margin-left: 6px; font-weight: 700; color: var(--green); align-self: center; }

.status {
  margin: 4px 0 0;
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 3.4vmin, 2.3rem);
  font-weight: 700;
  color: var(--red);
  position: relative;
  padding: 0 0.4em;
  min-height: 1.2em;
  text-align: center;
}
.status::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: currentColor;
  border-radius: 3px;
  transform: rotate(-1deg);
  filter: url(#wobble-sm);
}
.status.thinking { color: var(--ink); }
.status.thinking::before { content: '✎ '; display: inline-block; animation: write .6s ease-in-out infinite alternate; }
@keyframes write { to { transform: translate(6px, -2px) rotate(8deg); } }

/* moves note */
.moves-note { width: 100%; max-height: 52vh; display: flex; flex-direction: column; }
.move-log {
  margin: 0; padding: 0 0 0 2.2em;
  overflow-y: auto;
  font-size: 1.15rem;
  columns: 1;
  scrollbar-width: thin;
}
.move-log li { padding: 1px 0; }
.move-log li::marker { color: var(--red); font-weight: 700; }
.move-log .w { display: inline-block; min-width: 4.2em; }
.move-log .b { color: var(--violet); }
.move-log:empty::before { content: 'no moves yet…'; opacity: .55; margin-left: -2.2em; }

/* difficulty */
.stars { display: flex; gap: 4px; margin: 6px 0 2px; }
.star-btn { width: 40px; height: 40px; padding: 0; border: 0; background: none; transition: transform .15s; }
.star-btn:hover { transform: scale(1.18) rotate(-8deg); }
.star-btn svg { width: 100%; height: 100%; }
.star-btn.off svg path { fill: transparent; stroke: #4a4e57; }
.level-name { margin: 2px 0 0; font-size: 1.15rem; }

.tools { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.tools .sketch-btn[disabled] { opacity: .45; pointer-events: none; }

/* modals */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
  animation: fade .2s ease;
}
.modal[hidden] { display: none; }
.modal-card { text-align: center; min-width: min(360px, 90vw); padding: 1.4rem 1.6rem 1.6rem; animation: drop .35s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-30px) rotate(-4deg); opacity: 0; } }

.promo-choices { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.promo-choices button { width: 78px; height: 78px; border: 2px dashed transparent; border-radius: 16px; background: none; padding: 4px; }
.promo-choices button:hover { border-color: var(--orange); transform: translateY(-3px); }

.end-card h2 { font-size: 2.2rem; color: var(--red); }
.end-card p { margin: .3rem 0 1rem; font-size: 1.25rem; }
.end-art { width: 110px; height: 110px; margin: -4px auto 0; }
.end-art svg { width: 100%; height: 100%; }
.end-actions { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .table { grid-template-columns: 1fr; gap: 18px; padding: 0 16px 32px; min-height: 0; }
  .board-area { order: 1; }
  .side-left { order: 2; flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .side-right { order: 3; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .board-area { --size: min(94vw, 70vh); }
  .game-top { padding-top: 22px; padding-bottom: 8px; }
  .table { margin-top: 0; }
  .doodle[data-doodle="garland"] { display: none; }
  .moves-note { max-height: 200px; flex: 1; min-width: 220px; }
  .tools { flex-direction: row; flex-wrap: wrap; }
  .logo { margin-left: 70px; font-size: 1.15rem; }
  .doodle[data-doodle="cloud"], .doodle[data-doodle="stain"], .doodle[data-doodle="plane"], .doodle[data-doodle="flower"] { display: none; }
}
@media (max-width: 520px) {
  .doodle[data-doodle="sun"] { width: 70px !important; }
  .doodle[data-doodle="moon"] { width: 60px !important; }
  .logo { margin-left: 60px; }
  .player-tag { font-size: 1rem; }
  .captured .cap { width: 22px; height: 22px; }
}
