/* Original Omok UI + Jangi's player cards. Only Baduk-specific states live here. */
/* Approved broadcast header: three calm rows, slightly smaller than player names. */
.forest-ui .match[data-playing] .match-status { grid-template-rows:auto auto;min-height:104px;height:auto;gap:10px 8px;margin:0 0 8px;padding:4px 0; }
.forest-ui .match[data-playing] .match-status-copy { grid-column:2;grid-row:1;display:grid;gap:12px;align-content:center;min-height:58px;color:#fff4d9;text-align:center; }
.forest-ui .match[data-playing] .match-status h1 { margin:0;font-size:13px;font-weight:400;line-height:1.4;letter-spacing:0; }
.forest-ui .match[data-playing] .match-status>.jangi-header-button { grid-row:1;align-self:start; }
.forest-ui .match[data-playing] :is(#leave-match,#watch-back) { grid-column:1; }
.forest-ui .match[data-playing] #match-options { grid-column:3; }
.match-captures { display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;font-weight:400;line-height:1.4;font-variant-numeric:tabular-nums; }
.capture-side { display:flex;align-items:center;justify-content:center;gap:8px;min-width:42px; }
.match-captures .stone { position:static;flex:none;width:18px;height:18px;transform:none; }
.forest-ui .match[data-playing] .match-evaluation { position:relative;grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;min-height:30px;min-width:0;padding:2px 10px;border:1px solid #a8ab94;border-radius:3px;background:#f5ecd5;overflow:hidden;isolation:isolate;font-size:13px;font-weight:400;line-height:1.4;font-variant-numeric:tabular-nums; }
.evaluation-fill { position:absolute;inset:0 auto 0 0;width:var(--black-winrate,0%);background:linear-gradient(#242625,#101211);z-index:-1; }
.winrate-black { color:#fff4d9;justify-self:start; }
.winrate-white { color:#193d2d;justify-self:end; }
/* Endpoint labels stay legible even when a 0%/100% fill passes underneath them. */
.match-evaluation[data-state="ready"] :is(.winrate-black,.winrate-white) { color:#fff;mix-blend-mode:difference; }
.position-lead { justify-self:center;max-width:100%;padding:1px 7px;border-radius:2px;background:#fff4dc;color:#193d2d;text-align:center;overflow-wrap:anywhere; }
.match-evaluation:not([data-state="ready"]) { background:#ffffff12!important; }
.match-evaluation:not([data-state="ready"]) .evaluation-fill { display:none; }
.match-evaluation:not([data-state="ready"]) :is(.winrate-black,.winrate-white) { color:#e4e6d4; }
.match-evaluation:not([data-state="ready"]) .position-lead { background:transparent;color:#e4e6d4; }
.forest-ui .match[data-playing] .match-player .captures { display:none; }
.in-review :is(.match-captures,.match-evaluation) { display:none; }
@media (max-height:520px) {
  .forest-ui .match[data-playing] { --match-gap:4px; }
  .forest-ui .match[data-playing] .match-status { min-height:58px;grid-template-rows:16px 18px 20px;gap:2px 8px;padding:0;margin:0; }
  .forest-ui .match[data-playing] .match-status-copy { display:contents; }
  .forest-ui .match[data-playing] .match-status h1 { grid-column:2;grid-row:1;line-height:16px;text-align:center; }
  .forest-ui .match[data-playing] .match-captures { grid-column:2;grid-row:2;justify-content:center;gap:20px; }
  .forest-ui .match[data-playing] .match-status>.jangi-header-button { grid-row:1/4;align-self:center; }
  .forest-ui .match[data-playing] .match-evaluation { grid-column:2;grid-row:3;min-height:20px;padding-block:0;line-height:18px; }
  .forest-ui .match[data-playing] .position-lead { padding-block:0; }
  .forest-ui .match[data-together][data-compact-board] .together-controls { gap:4px; }
  .forest-ui .match[data-together] .together-info { min-height:22px; }
  .forest-ui .match[data-together] .together-actions .match-art-action { min-height:44px;padding-block:4px; }
}
/* Lobby mode row from matjjangjangi@9a2088f5226e54bd30c2a53c216ed55b552c41fa:ai-match.css. */
#lobby-stage { grid-template-rows: minmax(0, 40fr) 80px minmax(0, 29fr) 130px minmax(0, 82fr) 457px minmax(0, 82fr) 238px minmax(0, 48fr) 155px minmax(0, 104fr) 132px minmax(0, 55fr); }
#lobby-stage #lobby-championship-slot { height:238px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:86px 130px;gap:22px; }
#lobby-stage #show-tournament { grid-column:1;grid-row:1; }
#lobby-mode-slot { display:grid;grid-row:2;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;min-width:0; }
#lobby-stage #lobby-mode-slot>button { position:relative;grid-column:auto;display:flex;align-items:center;justify-content:center;gap:19px;width:451px;height:130px;min-width:0;min-height:0;padding:16px 32px 16px 15px;border:3px solid #c6b176;border-radius:26px;background:linear-gradient(#fff7dc,#e9dcb7);box-shadow:inset 0 3px #fff8,0 5px 8px #00160799;color:#285130;text-align:left; }
#lobby-stage #lobby-mode-slot strong { min-width:0;font-size:38px;line-height:1.2;white-space:normal;overflow-wrap:anywhere;font-weight:850; }
#lobby-stage #lobby-mode-slot:lang(en) strong { font-size:34px; }
#lobby-stage #lobby-mode-slot .together-entry-chevron { position:absolute;right:12px;top:34px;font-size:53px;line-height:1;color:#7d8a59; }
#lobby-stage .ai-entry-mark { display:grid;place-items:center;flex:none;width:83px;height:83px;background:url('./assets/forest-ui/board/stone_white.webp') center/contain no-repeat;color:#295e39;font-size:38px;font-weight:850;letter-spacing:-1px;text-shadow:0 1px #fff8; }
#lobby-stage .together-entry-pair { display:block;flex:none;width:83px;height:87px; }
#lobby-stage .together-entry-pair img { width:100%;height:100%;object-fit:contain; }
#lobby-stage #lobby-mode-slot>button::after { content:"";position:absolute;left:50%;top:50%;width:max(100%,calc(44px / var(--lobby-scale)));height:max(100%,calc(44px / var(--lobby-scale)));transform:translate(-50%,-50%); }
#options input[type="range"] {width:120px;max-width:45%;min-width:80px;accent-color:#386d3d;}
#options .audio-credits {font-size:12px;line-height:1.5;color:#66705b;}
#options .audio-credits p {white-space:normal;overflow-wrap:anywhere;}
#options #komi-option-help {margin:0 0 8px;font-size:12px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;}
#lobby-stage #lobby-entry { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px; }
#lobby-stage #lobby-entry .board-start { position: relative; display: block; width: 100%; height: 155px; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; isolation: isolate; }
#lobby-stage #lobby-entry .start-surface { filter: drop-shadow(0 13px 9px #001006b3); }
#lobby-stage #lobby-entry .start-content { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px; transform: translate(-5px,-6px); pointer-events: none; }
#lobby-stage #lobby-entry .start-stones { position: relative; inset: auto; width: 60px; height: 52px; flex: none; order: 0; }
#lobby-stage #lobby-entry .board-start[data-resuming] .start-stones { display: none; }
#lobby-stage #lobby-entry [data-i18n] { position: relative; order: 1; transform: translateY(-4px); font-size: 56px; line-height: 1.1; font-weight: 800; letter-spacing: .1px; color: #382605; text-shadow: 0 1px 1px #fff3ad; white-space: nowrap; }
#lobby-stage #lobby-entry:lang(en) [data-i18n] { font-size: 50px; transform: translateY(-8px); }
#board[data-size="19"] .cell .move-number { font-size: 1.6cqi; }
.shared-review #review-header { padding-bottom: 50px; }
.shared-review .review-result { max-width: 100%; flex-wrap: wrap; justify-content: center; }
.shared-review .review-footer { grid-template-columns: minmax(0,1fr); grid-auto-flow: row; }
#board .board-grid {
  grid-template-rows: repeat(9, minmax(0, 1fr));
}

#board .board-row {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

#board .cell[data-stone="0"]:not(.selected) .stone {
  display: none;
}

#board .cell .move-number {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 3.7cqi;
  font-weight: 750;
  color: #fffaf2;
}

#board .cell[data-stone="2"] .move-number {
  color: #272018;
}

#board .cell[data-dead] .stone {
  opacity: .33;
}

#board .cell[data-dead]::after {
  content: "×";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #b32620;
  font-size: 7cqi;
  font-weight: 800;
  pointer-events: none;
}

#board .cell[data-owner]:not([data-dead])::after {
  content: "";
  position: absolute;
  inset: 37%;
  z-index: 3;
  border: 1px solid #ead8b0;
  border-radius: 2px;
  background: #1e2421;
  pointer-events: none;
}

#board .cell[data-owner="2"]:not([data-dead])::after {
  background: #fff8e7;
  border-color: #7e6d53;
}

.match-player .captures {
  font-size: inherit;
  white-space: nowrap;
}

.match[data-scoring] #round {
  display: block;
  color: #e1c6aa;
  white-space: pre-line;
  line-height: 1.35;
}

.match[data-playing] { grid-template-rows: auto auto [board-start] auto [board-end] auto auto; }
.forest-ui .match[data-playing] { --board-area-width: 100%; }
.forest-ui .match-player .seat { flex-wrap: wrap; }
.forest-ui .match-player .color { display: none; }
.forest-ui #live-actions { flex-wrap: nowrap; }
.forest-ui #live-actions #request-score { flex: none; width: auto; max-width: 36%; min-height: 44px; padding: 5px 10px; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.forest-ui #live-actions #place {
  flex: 1; width: auto; min-width: 0; min-height: 44px; padding: 5px 12px;
  border: 1px solid #c1a875; border-radius: 999px;
  color: #1c3d22; background: linear-gradient(#fff8e9, #e4d4b3);
  box-shadow: 0 2px 4px #001a0d40; cursor: pointer;
}
.forest-ui #live-actions #place[data-placement-state="ready"]:not(:disabled) {
  color: #22472a; border-color: #edcf7c; background: linear-gradient(#ffe9a0, #e4be5f);
}
.forest-ui #live-actions #place:disabled { cursor: default; }
.forest-ui #live-actions .placement-copy { flex: initial; gap: 2px; }
.forest-ui #live-actions #place-state { color: inherit; font-size: 10px; }
.forest-ui #live-actions :is(#pass-turn, #resume-play) { flex: none; min-height: 44px; }
.jangi-pass-notice { font-family: inherit; }
.live-actions #pass-turn { width: auto; padding-inline: 16px; }
/* Same-device play: the existing board and actions, facing each player. */
.forest-ui .together-controls { display:grid;gap:8px;min-width:0;width:100%; }
.forest-ui .together-controls[hidden] { display:none; }
.forest-ui #together-top { transform:rotate(180deg); }
.forest-ui .together-info { display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;padding-inline:3px; }
.forest-ui .together-color { display:flex;align-items:center;gap:6px;min-width:0;color:#d8ddc4;font-size:12px;line-height:1.3; }
.forest-ui .together-color .stone { flex:none;width:19px;height:19px; }
.forest-ui .together-turn { font-size:12px;font-weight:750; }
.forest-ui .together-color .captures { margin-left:3px;font-size:11px;white-space:nowrap;color:#d2d7be; }
.forest-ui .together-controls[data-active="true"] .together-color { color:#fff0b6; }
.forest-ui .together-time { display:flex;align-items:center;gap:6px;flex:none;color:#cbd6bd; }
.forest-ui .together-time .player-clock { font-size:20px;line-height:1;font-weight:800;letter-spacing:-.4px;font-variant-numeric:tabular-nums;color:inherit; }
.forest-ui .together-controls[data-active="true"] .together-time { color:#ffe5a0; }
.forest-ui .together-time .player-clock[data-urgent] { color:#ffaf9e; }
.forest-ui .together-time .jangi-refills { color:#dbc27d; }
.forest-ui .match[data-together] .together-time .jangi-refills svg { width:6px;height:8px; }
.forest-ui .together-actions { display:flex;gap:8px;min-width:0; }
.forest-ui .together-actions .match-art-action { flex:1;min-width:0;min-height:46px;padding:8px 4px;font-size:14px;font-weight:750;line-height:1.2;white-space:normal;overflow-wrap:anywhere; }
.forest-ui .together-actions .together-place { flex:1.32;border-radius:999px; }
.forest-ui .together-actions .together-place[data-placement-state="ready"]:not(:disabled) { color:#22472a;border-color:#edcf7c;background:linear-gradient(#ffe9a0,#e4be5f); }
.forest-ui .together-actions .together-place:not(:disabled):is([data-placement-state="inactive"]) { color:#22472a;border-color:#edcf7c;background:linear-gradient(#ffe9a0,#e4be5f); }
.forest-ui .together-actions .match-art-action:disabled { opacity:.46; }
.forest-ui .match[data-together] { grid-template-rows:auto auto [board-start] auto [board-end] auto auto; }
.forest-ui .match[data-together][data-compact-board] .together-controls { gap:6px; }
body.in-match:has(#match[data-together][data-together-turn="top"]) :is(#confirm-dialog,#score-request-dialog) { rotate:180deg; }
.in-review #review-room-action { min-width: 0; }
.in-review .review-own-status .review-result { text-align: end; }

.match[data-scoring] #match-error {
  position: static;
  grid-area: auto / 1 / auto / -1;
  width: auto;
  max-width: 100%;
  margin: 0;
  text-align: center;
  font-size: .74rem;
}

.live-actions #resume-play {
  width: auto;
  padding-inline: 11px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  text-align: right;
}

.score-table td,
.score-table th {
  padding: 7px 5px;
  border-bottom: 1px solid #e8dfce;
}

.score-table td:first-child,
.score-table th:first-child {
  text-align: start;
}

.score-table tr:last-child {
  font-weight: 800;
}

#result-subtitle {
  text-align: center;
  font-size: .86rem;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

#practice-dialog > .primary,
#tutorial-dialog > .primary {
  margin-top: 12px;
}

#practice-dialog {
  inset: var(--ncq-top) var(--ncq-right) var(--ncq-bottom) var(--ncq-left);
  width:420px;max-width:min(420px,calc(100% - var(--ncq-left) - var(--ncq-right) - 24px));
  max-height: calc(100dvh - var(--ncq-top) - var(--ncq-bottom) - 16px);
  padding:0;border:1px solid #d1b579;border-radius:20px;background:#fff9ec;overflow:hidden;color:#234631;
}
#practice-dialog .practice-frame { display:flex;flex-direction:column;gap:18px;min-height:0;max-height:calc(100dvh - var(--ncq-top) - var(--ncq-bottom) - 20px);padding:24px;box-sizing:border-box; }
#practice-dialog .practice-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex:none;margin:0; }
.practice-heading-copy { min-width:0; }
#practice-dialog h2 { margin:0;font-size:26px;font-weight:800;line-height:1.25;overflow-wrap:anywhere; }
#practice-subtitle { margin:8px 0 0;font-size:14px;line-height:1.45;color:#65745e;overflow-wrap:anywhere; }
#practice-dialog .practice-close { flex:none;display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;border:1px solid #d6cfbb;border-radius:12px;background:#fffdf5;color:#33563e;font-size:20px; }
.practice-body { display:grid;gap:20px;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px; }
.practice-difficulty { display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;font-size:18px;font-weight:700; }
#practice-dialog #difficulty { flex:0 1 62%;min-width:90px;min-height:48px;padding:8px 12px;border:1px solid #c7c4af;border-radius:12px;background:#faf5e6;color:#20452e;font-family:inherit;font-size:20px;font-weight:700;line-height:1.3; }
.practice-group { min-width:0;margin:0;padding:0;border:0; }
.practice-group legend { padding:0;margin-bottom:10px;font-size:18px;font-weight:700;line-height:1.35; }
.practice-choices { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.practice-choice { position:relative;display:flex;align-items:center;justify-content:center;gap:10px;min-width:0;min-height:62px;padding:8px 12px;border:2px solid #d3cfbc;border-radius:13px;background:#fffaf0;color:#153e29;font-size:21px;font-weight:700;line-height:1.3;cursor:pointer;box-sizing:border-box; }
.practice-choice input { position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;clip-path:inset(50%);overflow:hidden; }
.practice-choice:has(input:checked) { border-color:#1a603b;background:#e7efd7; }
.practice-choice:has(input:focus-visible) { outline:3px solid #ba8917;outline-offset:2px; }
.practice-choice-tick { flex:none;width:18px;font-size:19px;font-weight:800;color:#0a6330;visibility:hidden; }
.practice-choice:has(input:checked) .practice-choice-tick { visibility:visible; }
.practice-choice .stone { position:static;flex:none;width:28px;height:28px;transform:none; }
.practice-footer { flex:none;min-width:0; }
#practice-dialog .practice-start { position:relative;display:grid;place-items:center;isolation:isolate;width:100%;min-height:56px;padding:0;border:0;border-radius:999px;background:transparent;color:#163c22;font-size:23px;font-weight:800;line-height:1.2; }
#practice-dialog .practice-start-surface { display:block;position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;filter:drop-shadow(0 3px 3px #60481755); }
.practice-start-text { position:relative;padding:10px 24px;overflow-wrap:anywhere;text-shadow:0 1px #fff19a; }
#practice-dialog .practice-start:focus-visible { outline:3px solid #285e37;outline-offset:3px; }
@media (max-width:360px) {
  .practice-choice { padding-inline:8px;gap:7px;font-size:18px; }
  .practice-choice-tick { width:16px;font-size:17px; }
}
@media (max-height:720px) {
  #practice-dialog .practice-frame { padding:16px;gap:14px; }
  .practice-body { gap:14px; }
  .practice-group legend { margin-bottom:8px; }
  .practice-choice { min-height:56px; }
}
@media (max-height:540px) and (min-width:600px) {
  #practice-dialog { width:560px;max-width:min(560px,calc(100% - var(--ncq-left) - var(--ncq-right) - 24px)); }
  #practice-dialog .practice-frame { padding:12px;gap:8px; }
  #practice-dialog h2 { font-size:23px; }
  #practice-subtitle { margin-top:3px; }
  #practice-dialog .practice-body { grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
  #practice-dialog[data-setup-mode="local"] .practice-body { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .practice-difficulty { display:grid;gap:4px;align-content:start;font-size:17px; }
  #practice-dialog #difficulty { width:100%;min-width:0;min-height:48px; }
  .practice-group legend { margin-bottom:4px;font-size:17px; }
  .practice-choices { gap:6px; }
  .practice-choice { min-height:48px;padding:5px;font-size:18px;gap:5px; }
  .practice-choice .stone { width:22px;height:22px; }
  .practice-choice-tick { display:none; }
  #practice-dialog .practice-start { min-height:48px; }
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.dialog-actions > button {
  flex: 1;
}

.tutorial-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  aspect-ratio: 1;
  width: min(100%, 240px);
  margin: 16px auto;
  padding: 8px;
  border-radius: 8px;
  background: #ffce72 url("./assets/omok-board-surface.webp") center / cover;
}

.tutorial-cell {
  position: relative;
  border: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), #785332 0 calc(50% + .5px), transparent 0),
    linear-gradient(transparent calc(50% - .5px), #785332 0 calc(50% + .5px), transparent 0);
  padding: 5px;
  aspect-ratio: 1;
  min-height: 0;
}

.tutorial-cell .stone {
  display: block;
  width: 100%;
  box-shadow: 1px 2px 2px #48281060;
}

.tutorial-cell.target {
  outline: 2px solid #e2a13a;
  outline-offset: -5px;
  border-radius: 50%;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--ncq-bottom) + 24px);
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  background: #283d2e;
  color: #fff9e8;
  border-radius: 12px;
  font-size: .83rem;
  pointer-events: none;
}

.captured-stone { position: absolute; z-index: 20; pointer-events: none; transform-origin: center; }
.captured-stone .stone { position: absolute; left: 50%; top: 50%; width: var(--captured-size, 84%); transform: translate(-50%, -50%); z-index: 2; }
.captured-stone-shadow { position: absolute; left: 56%; top: 57%; width: 103%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 1; opacity: .65; }

/* The academy extends Omok's dialogs, buttons, stones and board skins. */
#tutorial-dialog.academy-dialog {
  --academy-height: min(760px, calc(100dvh - var(--ncq-top, 0px) - var(--ncq-bottom, 0px)));
  inset-block: var(--ncq-top, 0px) var(--ncq-bottom, 0px);
  inset-inline: var(--ncq-left, 0px) var(--ncq-right, 0px);
  width: min(430px, calc(100vw - var(--ncq-left, 0px) - var(--ncq-right, 0px)));
  height: var(--academy-height);
  max-height: var(--academy-height);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(140deg, #fffaf2, #f1e5cf);
}
.academy-frame { display: flex; flex-direction: column; height: 100%; }
.academy-header { display: flex; align-items: center; flex: none; gap: 7px; padding: 8px 12px; min-height: 62px; border-bottom: 1px solid #e8e4dc; }
.academy-header h2 { flex: 1; min-width: 0; margin: 0; font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; }
.academy-header small, .academy-note { color: var(--muted); font-size: .75rem; line-height: 1.45; }
.academy-header .quiet { min-width: 38px; padding-inline: 8px; }
#academy-close { min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 1.65rem; box-shadow: none; }
#academy-grade { min-height: 40px; border: 0; border-radius: 9px; background: #e7edda; color: #426224; font-size: .75rem; font-weight: 700; }
.academy-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 14px 0; }
.academy-content h3 { margin: 7px 0 12px; font-size: 1.15rem; }
.academy-content p { margin: 10px 0; }
.academy-footer { flex: none; display: flex; gap: 9px; padding: 12px 14px 16px; }
.academy-footer > button { flex: 1; min-height: 46px; padding: 8px 12px; font-size: .84rem; }
.academy-footer > .primary { flex: 2; border: 1px solid #c6ae48; border-radius: 99px; color: #fff9df; background: linear-gradient(#497c25, #24531c); box-shadow: inset 0 1px #bdd08b80, 0 2px 5px #00210f44; font-size: .97rem; font-weight: 750; text-shadow: 0 1px 1px #37511a; }
.academy-footer > .secondary { flex: 0 1 auto; border: 1px solid #d0d8c2; border-radius: 13px; background: linear-gradient(#fffefb, #f0f2e9); box-shadow: 0 2px 2px #435c2220; color: #4e6e2a; }
.academy-footer > .primary:disabled { opacity: 1; background: #dfe4d6; border-color: #d4dbcb; color: #8b947e; text-shadow: none; box-shadow: inset 0 1px 0 #fff8; }
.academy-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; border: 1px solid #d7d5b4; border-radius: 14px; padding: 14px; background: linear-gradient(135deg, #fffdf6, #edf0db); }
.academy-hero > div { display: grid; gap: 3px; }
.academy-hero strong { font-size: 1.6rem; color: #44612b; }
.academy-hero small { font-size: .88rem; color: #786036; }
.academy-hero > p { grid-column: 1 / -1; margin: 5px 0 0; font-size: .78rem; }
.academy-medal { display: grid; place-items: center; width: 60px; height: 60px; border: 3px double #b6842e; border-radius: 50%; color: #916015; font-size: 2rem; background: radial-gradient(circle at 35% 25%, #fff2bd, #e1b85f); box-shadow: 0 3px 7px #81643430; }
#academy-review { width: 100%; margin: 4px 0 10px; font-size: .86rem; }
.academy-path, .academy-lesson-list { display: grid; gap: 9px; }
.academy-chapter { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; text-align: start; padding: 13px 10px; min-height: 75px; border: 1px solid var(--border); border-radius: 12px; background: #fffefa; box-shadow: 0 2px 4px #44361b10; }
.academy-chapter > span:nth-child(2) { display: grid; gap: 5px; }
.academy-chapter strong { font-size: .88rem; }
.academy-chapter small { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.academy-chapter-number { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: #eff1e1; border: 1px solid #ccd5ae; color: #607d30; font-weight: 800; }
.academy-chapter-rank { font-size: .7rem; color: #6a713d; white-space: nowrap; }
.academy-chapter[data-completed] { border-color: #a4bd84; background: #f1f6e9; }
.academy-chapter:disabled { opacity: .58; }
.academy-theory { font-size: .98rem; line-height: 1.8; word-break: keep-all; }
.academy-callout { padding: 12px; border-radius: 10px; border: 1px solid #e0d5b9; background: #f8f0df; line-height: 1.6; font-size: .85rem; }
.academy-eyebrow { color: #72814a; font-weight: 800; }
.academy-lesson-list > button { text-align: start; font-size: .83rem; line-height: 1.5; padding: 10px; }
.academy-dialog[data-view="question"] .academy-content { display: flex; overflow: hidden; }
.academy-question { display: grid; grid-template-rows: auto auto minmax(0, 1fr) 64px; gap: 9px; width: 100%; height: 100%; min-height: 0; }
.academy-question-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #537330; font-size: .76rem; }
.academy-question-heading > strong { min-width: 0; }
.academy-step-track { flex: none; display: flex; gap: 4px; }
.academy-step-track span { width: 12px; height: 5px; border-radius: 3px; background: #e5e5dc; }
.academy-step-track .done { background: #71914c; }
.academy-step-track .current { background: #a5b984; }
.academy-prompt { display: grid; gap: 3px; }
.academy-prompt > small { color: var(--muted); font-size: .75rem; }
.academy-question .academy-goal { margin: 0; font-size: 1.1rem; font-weight: 750; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.academy-board-stage { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; isolation: isolate; }
.academy-board-viewport { position: relative; overflow: hidden; border-radius: 8px; }
.academy-question .academy-board { position: absolute; margin: 0; max-width: none; }
.academy-board .cell[data-target]::after, .academy-board .cell[data-hint]::after { content: ""; position: absolute; inset: 2%; border: 2px solid #d79a29; border-radius: 50%; pointer-events: none; z-index: 4; box-shadow: 0 0 3px #fff3c9; }
.academy-board .cell[data-hint]::after { inset: 14%; border-style: dashed; background: #fff39d65; }
.academy-board .cell[data-dead] .stone { opacity: .3; }
.academy-board .cell:disabled { opacity: 1; }
.academy-feedback { min-height: 0; overflow: auto; display: grid; align-content: center; gap: 3px; padding: 8px 11px; border: 1px solid #e4e5d9; border-radius: 12px; background: #f3f2e9; font-size: .78rem; line-height: 1.45; color: var(--muted); word-break: keep-all; overflow-wrap: anywhere; }
.academy-feedback[data-result="correct"] { background: #edf3e4; border-color: #ccdcba; color: #426224; }
.academy-feedback[data-result="wrong"] { color: #8c5636; }
.academy-question .academy-totals { margin: 0; text-align: center; font-size: .78rem; color: #705d40; }
.academy-celebration { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 24px 10px; }
.academy-celebration .academy-medal { width: 92px; height: 92px; font-size: 3rem; }
.academy-celebration > strong { font-size: 1.7rem; color: #527337; }
#academy-play { width: 100%; margin-top: 14px; }
@media (min-width: 0px) {
  .academy-celebration .academy-medal { animation: academy-award .4s ease-out; }
  @keyframes academy-award { from { transform: scale(.65) rotate(-12deg); opacity: .1; } to { transform: none; opacity: 1; } }
}
/* Go uses the live board renderer inside Jangi's puzzle frame. */
#daily-puzzle { font-family:inherit; }
#daily-puzzle #puzzle-board-slot { position:relative;isolation:isolate; }
#daily-puzzle #puzzle-board {position:absolute;max-width:none;aspect-ratio:1;margin:0;}
#daily-puzzle #puzzle-grid {grid-template-columns:1fr;grid-template-rows:repeat(9,minmax(0,1fr));}
#daily-puzzle .cell:disabled {opacity:1;}
#daily-puzzle .cell[data-target]::after {content:'';position:absolute;inset:2%;border:2px solid #d79a29;border-radius:50%;pointer-events:none;z-index:4;box-shadow:0 0 3px #fff3c9;}
#daily-puzzle .cell.puzzle-hint::before {border-radius:50%;}
#tournament-entry {flex:none;padding:8px 0 0;}
#tournament-entry .primary {width:100%;}
#tournament-entry[hidden] {display:none!important;}
.server-wallet {font-size:11px;line-height:1.4;color:#fff4c2;display:flex;align-items:center;gap:5px;}
.server-wallet .shop-coin {width:17px;height:17px;}
#lobby-stage .server-wallet {position:absolute;top:62px;right:0;width:260px;display:block;text-align:right;font-size:24px;line-height:1.35;white-space:nowrap;}
#rankings-dialog .tournament-entry-safety {font-size:20px;line-height:28px;color:#e9ebc2;margin:6px 0;}

/* Player card states and small hourglasses from matjjangjangi@6e31ac55561daa7f89908a92cd2633e2ee53f6da:jangi.css. */
.forest-ui .match-player {
  grid-template-columns:34px minmax(0,1fr) 74px;grid-template-rows:minmax(39px,auto) 6px;column-gap:9px;row-gap:8px;
  min-height:0;padding:10px 12px 9px;border-radius:16px;
  color:#f0ead5;background:linear-gradient(135deg,#f4f0db24,#e5edda14);border-color:#d9e1bf33;box-shadow:0 2px 5px #00180d18;
}
.forest-ui .match-player[data-active="true"] {
  color:#24432d;background:linear-gradient(135deg,#fffbed,#f1e5cb);border-color:#f1d073;box-shadow:0 0 0 1px #edcf7c,0 2px 9px #f1cf7240;
}
.forest-ui .match-player .match-identity .seat { gap:5px;font-size:11px;line-height:1.2;color:#e5e7d1; }
.forest-ui .match-player[data-active="true"] .seat { color:#65705b; }
.forest-ui .jangi-player-time .player-clock { font-size:24px;line-height:1;font-weight:800;letter-spacing:-.5px;color:#f4eed8; }
.forest-ui .match-player[data-active="true"] .player-clock { color:#29462e; }
.forest-ui .match-player[data-active="true"] .jangi-refills { color:#927019; }
.forest-ui .match-player[data-active="true"] .player-clock:is([data-byoyomi],[data-urgent]) { color:#b43228; }
.forest-ui .match-player:not([data-active="true"]) .jangi-time-track { background:#123a2280; }
.forest-ui .match-player[data-active="true"] .jangi-time-track { background:#d4cdb8; }
.forest-ui .match-player[data-active="true"] .jangi-time-fill { background:linear-gradient(90deg,#58944d,#2e6837); }
.forest-ui .match-player[data-active="true"][data-low] .jangi-time-fill { background:#cf5946; }
.forest-ui .match[data-playing] .match-player .jangi-refills svg { width:6px;height:8px; }

/* Practice engine guidance shares the existing popup frame and safe area. */
.ai-engine-info { margin:6px 4px 10px;font-size:12px;line-height:1.4;color:#52654e; }
