:root { color-scheme: light; --ink: #253037; --muted: #747970; --line: #e0e2d9; --paper: #f4f3ed; --card: #fffefa; --blue: #2865bf; --red: #c65347; --green: #436456; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, select, input[type=range], summary { cursor: pointer; }
button, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #8aaee9; outline-offset: 3px; }
button:disabled { opacity: .42; cursor: default; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.app { max-width: 1280px; padding: 32px 40px 22px; margin: 0 auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 45px; height: 45px; flex-shrink: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 32px; line-height: 1.05; font-weight: 500; letter-spacing: -.8px; }
.brand-period { color: var(--green); }
.brand p { color: var(--muted); margin-top: 5px; font-size: 12px; }
.local-tag { display: flex; align-items: center; gap: 8px; color: #667165; font-size: 12px; }
.local-tag > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #6b8b73; }
.tag-divider { opacity: .45; padding: 0 3px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; align-items: start; gap: 28px; }
.board-panel { min-width: 0; }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 60px; padding: 0 9px 17px; }
.turn-info { display: flex; align-items: center; gap: 13px; }
.turn-info strong { font-size: 16px; font-weight: 600; }
.turn-info p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.turn-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 5px #ffffff90; flex-shrink: 0; }
.blue { background: var(--blue); }
.red { background: var(--red); }
.thinking .turn-dot { animation: pulse 1.1s ease-in-out infinite; }
.move-counter { color: #626961; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.move-counter span { color: #a0a499; font-size: 12px; }
.board-wrap { background: #fbf9f1; border: 1px solid #dedccd; border-radius: 15px; box-shadow: 0 6px 22px #383b2605, 0 1px 1px #383b2610; }
#board { display: block; width: 100%; border-radius: 14px; touch-action: manipulation; outline-offset: 4px; }
#board:focus-visible { outline: 2px solid #8aaee9; }
#board .grid-line { stroke: #d5d3c6; stroke-width: .7; }
#board .grid-line.major { stroke: #c5c3b6; stroke-width: 1; }
#board .coordinate { fill: #939587; font-size: 10px; font-family: inherit; text-anchor: middle; dominant-baseline: middle; }
#territories, #lines, #nodes, #legal-markers, #preview, #keyboard-marker { pointer-events: none; }
#hit-targets circle { cursor: crosshair; }
.board-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); padding: 15px 4px; font-size: 11px; min-height: 49px; }
.board-legend { display: flex; gap: 15px; flex-shrink: 0; }
.board-legend > span { display: flex; align-items: center; gap: 6px; }
.legend-fill { width: 10px; height: 10px; border-radius: 2px; border: 1px solid #95b3d7; background: #dce5ef; }
.legend-protected { position: relative; width: 20px; height: 3px; background: #798777; }
.legend-protected:after { content: ""; position: absolute; left: 7px; top: -2px; width: 7px; height: 7px; border: 1.5px solid #798777; border-radius: 50%; background: #fbf9f1; }
.board-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 0 2px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; padding: 9px 14px; white-space: nowrap; font-weight: 500; font-size: 12px; transition: background .12s, border-color .12s; }
.button.primary { background: var(--green); color: white; border-color: var(--green); }
.button.primary:hover:not(:disabled) { background: #345044; }
.button.secondary { background: var(--card); color: #596258; border-color: #dbded3; }
.button.secondary:hover:not(:disabled) { background: #eaede3; border-color: #bdc4b4; }
.button.secondary > span { font-size: 17px; line-height: 1; }
.hint-label { color: var(--green); font-size: 12px; padding-left: 4px; }
.coach-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #eaf0e5; color: #536a4b; border: 1px solid #ccd9c3; border-radius: 8px; padding: 12px 15px; margin-bottom: 20px; font-size: 12px; }
.coach-notice a { color: #436456; flex-shrink: 0; text-underline-offset: 3px; }
.coach-connected #hit-targets circle { cursor: default; }
.external-coach-unsynced #hint-label, .external-coach-unsynced #legal-markers,
.external-coach-unsynced #search-stats, .external-coach-unsynced #search-line,
.external-coach-unsynced #play-suggestion { visibility: hidden; }
.sidebar { display: grid; gap: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 18px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
h2 { font-size: 13px; font-weight: 650; }
.quiet-label { font-size: 10px; color: #91978b; }
.player-card { border: 1px solid transparent; border-radius: 7px; padding: 12px 13px 9px; margin-bottom: 9px; transition: border-color .2s; }
.blue-player { background: #f0f4f9; }
.red-player { background: #faf1ed; }
.blue-player.active { border-color: #9cb7db; }
.red-player.active { border-color: #dab0a5; }
.player-name { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.player-name > strong { font-weight: 600; }
.player-dot { width: 7px; height: 7px; border-radius: 50%; }
.blue-player .player-name { color: var(--blue); }
.red-player .player-name { color: var(--red); }
.role { margin-left: auto; color: #8390a0; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.red-player .role { color: #ad9189; }
.score-row { display: flex; align-items: baseline; gap: 7px; margin: 4px 0 8px; }
.score { font-size: 29px; letter-spacing: -1px; line-height: 1.3; font-weight: 550; font-variant-numeric: tabular-nums; }
.score-row > span { font-size: 10px; color: #8d968f; }
.area-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #77889a18; padding-top: 7px; font-size: 10px; color: #8a9489; }
.area-row strong { color: #6b796e; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.score-note { color: #8e958a; font-size: 10px; line-height: 1.5; margin-top: 10px; }
.field-label { display: block; font-size: 11px; color: #747d70; margin-bottom: 6px; }
.mode-select { margin-bottom: 11px; }
.coach-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; margin: 0 0 17px; padding: 10px; border: 1px solid #e0e6d9; border-radius: 7px; background: #f5f8f0; }
.coach-toggle input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--green); cursor: pointer; }
.coach-toggle span { display: flex; flex-direction: column; gap: 2px; }
.coach-toggle strong { color: #526c4c; font-size: 11px; font-weight: 550; }
.coach-toggle small { color: #88957f; font-size: 9px; }
.coach-setup-link { display: inline-block; color: #627e58; font-size: 10px; text-underline-offset: 3px; margin-top: 10px; }
select:disabled { opacity: .55; cursor: default; }
.new-game-row { display: flex; gap: 7px; margin-bottom: 17px; }
select { width: 100%; min-width: 0; border: 1px solid #dcdfd4; padding: 8px; border-radius: 6px; background: white; color: #515e53; font-size: 11px; }
.new-game-row .button { font-size: 11px; padding: 8px 11px; }
.budget-heading { display: flex; align-items: baseline; justify-content: space-between; }
.budget-heading output { color: var(--green); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
input[type=range] { display: block; width: 100%; margin: 6px 0 8px; height: 5px; accent-color: var(--green); }
.range-labels { display: flex; justify-content: space-between; color: #969c91; font-size: 9px; }
.settings-note { color: #92998e; font-size: 10px; margin-top: 11px; line-height: 1.6; }
.search-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #ebede5; padding-top: 13px; margin-top: 13px; }
.search-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid #ebede5; }
.search-stats > div:last-child { border: 0; }
.search-stats strong { font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; }
.search-stats span { font-size: 9px; color: #939b8e; }
.search-line { margin-top: 10px; color: #8b9587; font-size: 9px; line-height: 1.7; overflow-wrap: anywhere; }
.history { padding-bottom: 6px; }
.history .section-heading { margin-bottom: 9px; }
#history-list { padding: 0; margin: 0; list-style: none; max-height: 157px; overflow-y: auto; scrollbar-width: thin; }
#history-list li { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-top: 1px solid #eeefe8; font-size: 11px; }
#history-list .empty-history { border: 0; color: #a0a699; padding: 9px 0 13px; font-size: 10px; }
.history-number { min-width: 19px; color: #a0a698; font-size: 10px; font-variant-numeric: tabular-nums; }
.history-move { letter-spacing: .4px; color: #626f60; font-variant-numeric: tabular-nums; }
.history-actor { margin-left: auto; color: #a0a698; font-size: 9px; }
.file-actions { display: flex; justify-content: space-between; border-top: 1px solid #e5e8dd; padding-top: 4px; margin-top: 7px; }
.text-button { background: none; color: #798570; padding: 8px 2px; font-size: 10px; }
.text-button:hover { color: #344c39; }
.error-banner { border: 1px solid #dfb5a7; border-radius: 8px; background: #fff4ed; color: #934b38; padding: 11px 15px; font-size: 12px; margin-bottom: 18px; }
.app-footer { display: flex; align-items: start; justify-content: space-between; gap: 24px; color: #989e92; font-size: 10px; border-top: 1px solid #e0e3d8; margin-top: 25px; padding-top: 15px; }
.app-footer > span { white-space: nowrap; }
.app-footer summary { color: #74816e; }
.app-footer details p { max-width: 740px; margin-top: 10px; line-height: 1.8; }
.footer-separator { padding: 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes pulse { 50% { opacity: .3; box-shadow: 0 0 0 8px #d9dfd44d; } }
@media (min-width: 1400px) { .app { max-width: 1320px; } .layout { grid-template-columns: minmax(0, 1fr) 314px; gap: 34px; } }
@media (max-width: 900px) { .app { padding: 22px; } .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; } .card { padding: 14px; } .board-footer { flex-direction: column; align-items: start; padding-top: 11px; gap: 7px; } .new-game-row { flex-direction: column; } }
@media (max-width: 690px) { .app { padding: 20px 14px; } .app-header { margin-bottom: 20px; } h1 { font-size: 28px; } .brand p { font-size: 10px; } .brand-mark { width: 38px; height: 38px; } .local-tag { display: none; } .layout { display: flex; flex-direction: column; gap: 24px; } .board-panel, .sidebar { width: 100%; } .sidebar { grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; } .scoreboard { grid-row: span 2; } .history { grid-column: 2; } .board-toolbar { padding: 0 6px 13px; } .turn-info strong { font-size: 14px; } .turn-info p { font-size: 11px; } .board-footer { flex-direction: row; align-items: center; padding-bottom: 12px; font-size: 10px; } .board-legend { gap: 9px; font-size: 9px; } .app-footer { margin-top: 22px; } .coach-notice { flex-direction: column; align-items: start; gap: 5px; font-size: 11px; } }
@media (max-width: 430px) { .sidebar { grid-template-columns: 1fr; } .scoreboard { grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; } .scoreboard .section-heading, .score-note { grid-column: 1 / -1; } .history { grid-column: 1; } .new-game-row { flex-direction: row; } .board-legend { display: none; } .app-footer > span { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
