/* 행성X 웹 화면. 밝은/어두운 테마는 html[data-theme] (theme.tsx, 기본은 어두운 화면). 휴대폰 세로 우선. */
:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --fg: #1b2132;
  --muted: #687089;
  --card: #ffffff;
  --line: #d8dce8;
  --accent: #3b5bdb;
  --accent-fg: #ffffff;
  --ok: #2b8a3e;
  --warn: #c92a2a;
  --sky-vis: #dfe9ff;
  --sky-hid: #3a4257;
  --time: #eef0f6;
  --token: #2a3042;
  --sun: #ffb347;
  --hl: #f59f00;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1420;
  --fg: #e6e9f2;
  --muted: #8f97ad;
  --card: #182032;
  --line: #2b3550;
  --accent: #748ffc;
  --accent-fg: #0f1420;
  --ok: #69db7c;
  --warn: #ff8787;
  --sky-vis: #24365e;
  --sky-hid: #0b0f19;
  --time: #141b2b;
  --token: #0b0f19;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 15px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 64px; }
a { color: var(--accent); }
code { font-size: 12px; word-break: break-all; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 0 0 6px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.who { font-size: 14px; }

.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.panel { margin-top: 8px; }
.status.my-turn { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.banner { background: var(--warn); color: #fff; padding: 6px 10px; border-radius: 8px; margin: 8px 0; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.row.spread { justify-content: space-between; }
.form p { margin: 6px 0; }

button, select, input, textarea { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
button { cursor: pointer; min-height: 36px; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.link { border: 0; background: none; color: var(--accent); padding: 0 6px; min-height: 0; }
button.danger { color: var(--warn); border-color: var(--warn); }
.host-menu { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip { border-radius: 999px; }
.chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; margin-top: 8px; }

.badge { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); margin-left: 6px; }
.badge.turn { background: var(--ok); color: var(--card); border-color: var(--ok); font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.game-item { display: flex; flex-direction: column; color: inherit; text-decoration: none; }

.players { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.players li.active .pname { font-weight: 700; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { flex: 1 1 auto; border-radius: 8px; }
.tabs button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.tab-body { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 70vh; overflow-y: auto; }

.topics { display: grid; gap: 6px; }
.topics button { text-align: left; }
.topics button.done { opacity: .75; }
.topics button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); opacity: 1; }

.game { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) {
  .game { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
}

/* 보드: 실물처럼 네 계절 풍경(위 봄 · 오른쪽 여름 · 아래 가을 · 왼쪽 겨울) 위의 원형 하늘 */
.board-wrap { width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.board-box { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }
.board {
  width: 100%; display: block; user-select: none; border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, .25) 75%),
    conic-gradient(from var(--board-rot, 0deg), #2f8f6b 0deg, #6d9b3a 45deg, #c2553f 100deg, #b8433a 135deg, #d9822b 180deg, #e0a03a 225deg, #3a78b5 270deg, #2d5f9a 315deg, #2f8f6b 360deg);
}
.board-wrap.zoom .board-box { width: 190%; max-width: none; }
@media (max-width: 600px) { .board-wrap { width: calc(100% + 32px); margin: 0 -16px; border-radius: 0; } .board { border-radius: 0; } }
.board text { text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.board .season circle { fill: rgba(10, 17, 36, .75); stroke-width: 1.2; }
.board .season.clickable { cursor: pointer; }
.board .season.mine circle { fill: #fab005; stroke: #fff; }
.board .season .season-icon, .board .season .season-icon circle { fill: none; stroke: #fff; stroke-width: .8; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.board .season .season-icon .fillc { fill: #fff; stroke: none; }
.board .season.mine .season-icon, .board .season.mine .season-icon circle { stroke: #1b2132; }
.board .season.mine .season-icon .fillc { fill: #1b2132; }
.board .time-ring { fill: rgba(8, 12, 24, .55); stroke: rgba(255, 255, 255, .25); stroke-width: .5; }
.board .time-num { font-size: 6.4px; font-weight: 700; fill: #ffd43b; }
.board .time-num.dim { fill: #b9a65a; }
.board .star { pointer-events: none; }
.board .wedge { fill: transparent; stroke: none; }
.board .wedge.hid { fill: rgba(3, 6, 14, .62); }
.board .wedge.vis { fill: rgba(120, 170, 255, .07); }
.board .wedge.clickable { cursor: pointer; }
.board .wedge.clickable:hover { fill: rgba(250, 176, 5, .14); }
.board .track-hit { fill: transparent; stroke: none; }
.board .track-hit.clickable { cursor: pointer; }
.board .track-hit.clickable:hover { fill: rgba(250, 176, 5, .14); }
.board .sector-line { stroke: rgba(116, 192, 252, .45); stroke-width: .45; pointer-events: none; }
.board .sky-edge { fill: none; stroke: #4dabf7; stroke-width: 1; pointer-events: none; }
.board .sel { fill: rgba(255, 255, 255, .1); stroke: #fff; stroke-width: .9; stroke-dasharray: 2 1.2; pointer-events: none; }
.board .hl { fill: rgba(250, 176, 5, .2); stroke: #fab005; stroke-width: 1.3; pointer-events: none; }
.board .arrow { fill: #fab005; stroke: #fff3bf; stroke-width: .4; }
.board .icon-theory { fill: #fab005; pointer-events: none; }
.board .icon-conf { fill: #0a1124; stroke: #fab005; stroke-width: 1; pointer-events: none; }
.board .icon-conf.done { fill: #fab005; }

/* 노트 아이콘: 선 그림, 누르면 마커 */
.board .obj-icon, .strip .obj-icon { fill: none; stroke: #dfe6f5; stroke-width: .7; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.board .obj-icon .fillc, .strip .obj-icon .fillc { fill: #dfe6f5; stroke: none; }
.board .note .hit { fill: transparent; }
.board .note.clickable { cursor: pointer; }
.board .note.clickable:hover .hit { fill: rgba(255, 255, 255, .14); }
.board .note.mk-x .obj-icon, .strip .note.mk-x .obj-icon { opacity: .35; }
.board .note.mk-q .obj-icon, .strip .note.mk-q .obj-icon { opacity: .6; }
.board .note.mk-o .obj-icon, .strip .note.mk-o .obj-icon { stroke: #fff; stroke-width: .9; }
.board .mark-x, .strip .mark-x { stroke: #ff6b6b; stroke-width: 1.3; stroke-linecap: round; pointer-events: none; }
.board .mark-o, .strip .mark-o { fill: none; stroke: #69db7c; stroke-width: 1.2; pointer-events: none; }
.board .mark-q, .strip .mark-q { font-size: 6px; font-weight: 800; fill: #ffd43b; }
.board .note.auto .mark-x, .board .note.auto .mark-o, .strip .note.auto .mark-x, .strip .note.auto .mark-o { opacity: .45; stroke-dasharray: 1.2 .8; }
.board .note.auto .mark-q, .strip .note.auto .mark-q { opacity: .5; }
.board .known, .strip .known { opacity: .55; pointer-events: none; }
.board .truth, .strip .truth { opacity: .35; stroke: #fff; stroke-width: .6; stroke-dasharray: 1.2 .8; pointer-events: none; }

/* 동료 평가 트랙 */
.board .box { fill: none; stroke-width: .55; stroke-dasharray: 1.1 .8; pointer-events: none; }
.board .box.sp0 { stroke: #8ce99a; }
.board .box.sp1, .board .box.sp2 { stroke: #e9ecef; }
.board .box.sp3 { stroke: #ff6b6b; }
.board .token { pointer-events: auto; }
.board .tok-up { stroke: #fff; }
.board .tok-mine { stroke: #adb5bd; }
.board .tok-q { font-size: 4.2px; font-weight: 700; fill: #adb5bd; }
.board .preview { opacity: .75; stroke: #fff; stroke-dasharray: 1.2 .8; pointer-events: none; }
.board .pawn { stroke: #fff; stroke-width: .8; }
.board .pawn.me { stroke: #ffd43b; stroke-width: 1.4; }
.board .pawn-season *, .board .pawn-season circle { fill: none; stroke: #fff; stroke-width: 1.15; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.board .pawn-season .fillc { fill: #fff; stroke: none; }
.board .sun { pointer-events: none; }
/* 원판 보기 탭 */
.layer-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.layer-tabs button { min-height: 32px; padding: 2px 14px; font-size: 14px; border-radius: 999px; }
.layer-tabs button.on { background: #1c7ed6; border-color: #1c7ed6; color: #fff; font-weight: 700; }
.layer-tabs .muted { margin-left: 6px; }
.board .pip { pointer-events: none; }
.board .confirmed-big { pointer-events: none; }
.board .token.dim { opacity: .3; }

/* 플레이어 기록 강조 */
.board .focus { pointer-events: none; }
.board .focus-glow { animation: glow-pulse 2.2s ease-in-out infinite; }
.board .focus-target { opacity: .32; stroke-linecap: round; }
.board .note.lit .obj-icon { stroke: #fff; stroke-width: .95; }
.board .focus-topics-label { font-size: 5px; font-weight: 700; fill: #fff; text-anchor: start; }
.board .focus-topic { font-size: 5.2px; font-weight: 800; fill: #fff; }
@keyframes glow-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }
@media (prefers-reduced-motion: reduce) { .board .focus-glow { animation: none; } }
.players li.pick { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; }
.players li.pick:hover { background: rgba(255, 255, 255, .06); }
.players li.pick.focused { outline: 2px solid var(--focus-color); background: rgba(255, 255, 255, .06); }
.history { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--focus-color); background: rgba(255, 255, 255, .03); }
.history-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.history-head button { margin-left: auto; min-height: 26px; padding: 0 9px; }
.history ol { margin: 0; padding-left: 22px; font-size: 13px; }
.history li { padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.history li:hover { background: rgba(255, 255, 255, .06); }
.history li.on { background: rgba(255, 255, 255, .12); font-weight: 600; }
.history .topic { display: inline-block; min-width: 18px; text-align: center; border-radius: 9px; color: #fff; font-weight: 800; margin-right: 4px; }

/* 고른 섹터 아이콘 한 줄 팝업 */
.strip {
  position: absolute; z-index: 5; width: 300px; padding: 6px 8px 8px; border-radius: 12px;
  background: rgba(13, 19, 38, .94); border: 1px solid #4dabf7; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); color: #e9ecef;
}
.strip-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.strip-head .muted { font-size: 12px; }
.strip-close { margin-left: auto; min-height: 26px; padding: 0 9px; font-size: 16px; line-height: 1; }
.strip-row { display: flex; justify-content: center; gap: 3px; }
.strip-btn { width: 46px; min-height: 0; padding: 3px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; color: #dfe6f5; }
.strip-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.strip-btn svg { width: 34px; height: 34px; display: block; overflow: visible; }
.strip-btn span { font-size: 10px; white-space: nowrap; }
.strip text { text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.legend { justify-content: space-between; font-size: 12px; margin: 6px 0; }
.zoom-btn { min-height: 30px; padding: 2px 10px; font-size: 13px; }
@media (min-width: 900px) { .zoom-btn { display: none; } }

/* 노트 시트 */
.grid { border-collapse: collapse; width: 100%; table-layout: fixed; }
.grid th, .grid td { border: 1px solid var(--line); text-align: center; padding: 0; height: 30px; }
.grid td { cursor: pointer; font-weight: 700; }
.grid tr.vis th { background: var(--sky-vis); }
.grid td.m-x { color: var(--warn); }
.grid td.m-o { color: var(--ok); }
.grid td.m-q { color: var(--hl); }
.grid td.auto { opacity: .35; }
.grid td.na { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--line) 4px 5px); cursor: default; }
.small { font-size: 12px; margin: 2px 0 6px; }

.scores { width: 100%; border-collapse: collapse; }
.scores th, .scores td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.scores tr.me { font-weight: 700; }
.log li.k-theoryPhase, .log li.k-gameEnd { font-weight: 700; }
.clues li { display: grid; gap: 2px; }
.clue-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clue-key { display: inline-grid; place-items: center; min-width: 2em; height: 1.6em; padding: 0 4px; border-radius: 6px; background: var(--accent); color: var(--accent-fg); font-size: .9em; }
.clues li.blank .clue-key { background: none; color: var(--muted); border: 1px solid var(--line); }
.clue-text { min-height: 1.5em; }
.clues li.blank .clue-text { border-bottom: 1px dashed var(--line); margin: 2px 0 4px; }

.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: calc(100vw - 32px); z-index: 10; }

/* 글 사이 아이콘 (천체·계절) */
.ico { width: 1.3em; height: 1.3em; vertical-align: -.3em; flex: none; }
.ico .ico-line { fill: none; stroke: currentColor; stroke-width: .75; stroke-linejoin: round; stroke-linecap: round; }
.ico .fillc { fill: currentColor; stroke: none; }
.obj-label { white-space: nowrap; }
.obj-label .ico { margin-right: .15em; }
.season-ico .ico-line { stroke-width: .85; }
.season-ico.s-A { color: #2f9e44; }
.season-ico.s-B { color: #e8590c; }
.season-ico.s-C { color: #c92a2a; }
.season-ico.s-D { color: #1971c2; }
[data-theme="dark"] .season-ico.s-A { color: #8ce99a; }
[data-theme="dark"] .season-ico.s-B { color: #ffa94d; }
[data-theme="dark"] .season-ico.s-C { color: #ff8787; }
[data-theme="dark"] .season-ico.s-D { color: #74c0fc; }
.chip.on .season-ico { color: inherit; }
.grid th .ico { width: 1.5em; height: 1.5em; }
.seat-label { white-space: nowrap; }
.seat-label .ico { margin-right: .2em; }

/* 플레이어 이름: 말 색 (로그는 굵게, 상단 줄은 차례인 사람만 굵게). 어두운 테마에선 밝게 */
.who-name { font-weight: 700; }
[data-theme="dark"] .who-name, [data-theme="dark"] .players .pname { filter: brightness(1.45); }
.start-facts { margin: 4px 0 0; padding-left: 20px; }
.start-facts li { padding: 2px 0; border-bottom: 0; }

/* 로그인 */
.login .login-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.login .login-buttons button { min-width: 180px; padding: 10px 14px; }
.login button.login-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.login h3 { margin-top: 18px; font-size: 15px; }
.who a { margin-right: 6px; }
.theme-btn { margin-left: 6px; min-width: 2.2em; }

/* 결과 보기: 정답만 */
.board .solution { pointer-events: none; }
.board .solution .sol-bg { stroke: #fff; stroke-width: .8; }
.board .solution.empty .obj-icon { opacity: .55; }
.board .solution-name { fill: #e9ecef; text-anchor: middle; dominant-baseline: central; font-weight: 600; paint-order: stroke; stroke: #0a1124; stroke-width: 1.2; }
