:root { color-scheme: light; font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif; color: #283d35; background: #f5f2e9; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 12% 0, #e9ecdf70, transparent 48%), #f5f2e9; }
button { font: inherit; }
.app { max-width: 760px; margin: auto; padding: 34px 16px 54px; }
header { text-align: center; margin-bottom: 25px; }
.eyebrow { color: #8d947e; letter-spacing: .25em; font-size: 11px; margin: 0 0 8px; }
h1 { font-family: "STSong", "SimSun", serif; font-size: clamp(38px, 7vw, 56px); letter-spacing: .12em; margin: 0; font-weight: 700; }
.subtitle { color: #8b9185; margin: 9px 0 0; font-size: 14px; }
.game, .rules { background: #fffdf8; border: 1px solid #e7e6da; border-radius: 22px; box-shadow: 0 14px 40px #45523b0b; }
.game { padding: 20px 23px 24px; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round { color: #75856e; background: #f6f8ef; border: 1px solid #dfe7d9; border-radius: 6px; padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.players { display: flex; gap: 24px; font-weight: 700; }
.player { display: inline-flex; align-items: center; gap: 8px; }
.sample { width: 20px; height: 20px; border-radius: 50%; display: inline-block; box-shadow: 0 2px 4px #25372c20; }
.player.black .sample { background: radial-gradient(circle at 32% 24%, #565b53, #252d27 70%); border: 1px solid #273028; }
.player.white .sample { background: radial-gradient(circle at 30% 24%, #fffffd, #eeeade 75%); border: 1px solid #d4d1c5; }
.turn-panel { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 12px 16px; min-height: 64px; background: #edf3ea; border-radius: 12px; }
.turn-piece { width: 28px; height: 28px; border-radius: 50%; flex: none; box-shadow: 0 2px 3px #273c3025; }
.turn-piece.black { background: radial-gradient(circle at 35% 25%, #4a514a, #222b25 68%); border: 1px solid #303930; }
.turn-piece.white { background: linear-gradient(145deg, #fffefb 15%, #e5e4d9); border: 1px solid #d4d8c9; }
.turn { font-size: 16px; color: #283d35; }
.turn-panel p { margin: 4px 0 0; font-size: 11px; color: #8a9982; }
.game-settings { display: grid; gap: 10px; padding: 13px 16px; background: #fcfbf5; border: 1px solid #ecebdf; border-radius: 11px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: #70806f; }
.setting-row[hidden], .history-empty[hidden] { display: none; }
.segmented { display: flex; gap: 4px; padding: 4px; background: #f1f2e9; border: 1px solid #e9eade; border-radius: 9px; }
.segmented button { min-height: 34px; padding: 5px 12px; border: 0; border-radius: 7px; background: transparent; color: #8d9683; font-size: 12px; cursor: pointer; }
.segmented button.active { background: #fffdf8; color: #375b3a; box-shadow: 0 2px 5px #35462d0c; font-weight: 700; }
.segmented button:focus-visible { outline: 2px solid #98bda2; outline-offset: 2px; }
.board { position: relative; width: min(100%, 600px); aspect-ratio: 600 / 560; margin: 18px auto 0; overflow: hidden; border: 1px solid #d1af7e; border-radius: 17px; background: repeating-linear-gradient(3deg, transparent 0 11px, #c59e6810 12px, transparent 13px 25px), radial-gradient(ellipse at 25% 20%, #f3dbb6c0, transparent 67%), linear-gradient(135deg, #e9cca1, #dfbd88); box-shadow: inset 0 1px 2px #ffefcf, 0 6px 12px #70471610; isolation: isolate; }
.board::after { content: ""; position: absolute; inset: 3%; border: 1px solid #ac885145; border-radius: 15px; pointer-events: none; }
.board-label { position: absolute; left: 50%; transform: translateX(-50%); color: #9b815c; font-family: Georgia, "Times New Roman", serif; font-size: clamp(11px, 2vw, 15px); letter-spacing: .25em; white-space: nowrap; pointer-events: none; }
.top-label { top: 1.6%; }.bottom-label { bottom: 4.5%; }
.lines { position: absolute; width: 100%; height: 100%; }
.lines path { fill: none; stroke: #897041; stroke-width: 1.7; stroke-linecap: round; }
.lines .pocket { fill: none; stroke: #897041; stroke-width: 1.7; }
.point { position: absolute; z-index: 1; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 16%; min-width: 44px; aspect-ratio: 1; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; touch-action: manipulation; transition: box-shadow .15s, scale .15s; }
.point::after { content: ""; width: 5px; aspect-ratio: 1; border-radius: 50%; background: #8b7147; }
.point.bottom:not(.black):not(.white)::after { opacity: .65; }
.point.black::after, .point.white::after { width: 72%; box-sizing: border-box; }
.point.black::after { background: radial-gradient(ellipse at 34% 24%, #596157 0%, #424a40 21%, #272f27 58%, #1d251d 91%); box-shadow: inset 0 1px 2px #9aaf8c42, inset 0 -3px 5px #0008, 0 4px 5px #3f2b1d50, 0 1px 1px #382b2360; border: 1px solid #252e24; }
.point.white::after { background: radial-gradient(ellipse at 34% 22%, #fffffb 0%, #fffdf4 27%, #eeead9 75%, #d2c8aa 100%); box-shadow: inset 0 1px 2px #ffffff, inset 0 -2px 3px #baac882d, 0 4px 5px #5b432b3d, 0 1px 1px #6a51332b; border: 1px solid #eee8d8; }
.point.movable:hover, .point.selected { box-shadow: 0 0 0 2px #476f49, 0 0 0 5px #f8e5bb72; }
.point.target::after { width: 15%; min-width: 9px; background: #597f4b; box-shadow: 0 0 0 7px #6b8c4d20; }
.point.last-move:not(.selected) { box-shadow: 0 0 0 2px #56774c75; }
.point:focus-visible { outline: 3px solid #98bda2; outline-offset: 3px; }
.status { min-height: 48px; display: grid; place-items: center; text-align: center; margin: 7px 0 13px; color: #8a9982; }
.actions { display: flex; gap: 10px; }
.actions button { flex: 1; border: 1px solid #dfe3d4; border-radius: 10px; min-height: 44px; font-weight: 700; cursor: pointer; background: #fffef9; color: #738369; }
.actions button:last-child { background: #2b5a46; border-color: #2b5a46; color: #fffdf6; }
.actions button:hover:not(:disabled) { filter: brightness(1.1); }
.actions button:disabled { opacity: .4; cursor: default; }
.history { margin-top: 18px; padding: 20px 24px; background: #fffdf8; border: 1px solid #e7e6da; border-radius: 22px; box-shadow: 0 14px 40px #45523b0b; }
.history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #eceddf; }
.history-heading h2 { margin: 0; font-size: 18px; }
.history-heading span { font-size: 12px; color: #9a9f8e; }
.history-empty { color: #9a9f8e; text-align: center; font-size: 13px; padding: 20px 0 4px; }
#move-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
#move-list li { display: flex; align-items: center; gap: 10px; min-height: 42px; border-bottom: 1px solid #f0f0e7; font-size: 13px; color: #75856b; }
#move-list li:last-child { border-bottom: 0; }
#move-list li strong { margin-left: auto; color: #536a49; font-weight: 600; }
.move-number { width: 28px; color: #acb29e; }
.move-stone { display: inline-block; width: 17px; height: 17px; border-radius: 50%; flex: none; }
.move-stone.black { background: radial-gradient(circle at 32% 24%, #565b53, #252d27 70%); border: 1px solid #273028; }
.move-stone.white { background: radial-gradient(circle at 30% 24%, #fffffd, #eeeade 75%); border: 1px solid #d4d1c5; }
.rules { margin-top: 18px; padding: 20px 24px; }
.rules h2 { font-size: 19px; margin: 0 0 8px; }
.rules ol { margin: 0; padding-left: 22px; line-height: 1.9; color: #68775d; }
.rules strong { color: #375b3a; }
@media (max-width: 480px) { .app { padding: 20px 10px 40px; } .game { padding: 12px; } .players { gap: 12px; font-size: 13px; } .point { width: 16%; } .setting-row { font-size: 11px; } .segmented button { font-size: 11px; padding: 5px 7px; } .history, .rules { padding: 16px; font-size: 14px; } }
