:root {
  --bg-deep: #04151a;
  --bg-mid: #082832;
  --bg-panel: rgba(6, 28, 35, .76);
  --ink: #edf8f4;
  --muted: rgba(202, 235, 229, .55);
  --line: rgba(151, 218, 213, .15);
  --gold: #e4bd6a;
  --gold-bright: #f5d88c;
  --red: #d55f50;
  --blue: #6c9dc8;
  --board: #e9dcc4;
  --board-ink: #5d4a34;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink); min-height: 100vh; overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 18%, rgba(64, 152, 177, .15), transparent 30%),
    radial-gradient(circle at 18% 86%, rgba(226, 178, 82, .08), transparent 28%),
    linear-gradient(140deg, #04151a 0%, #082832 54%, #061a20 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(139, 213, 214, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 213, 214, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.76), transparent 88%);
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.xq-shell { position: relative; z-index: 1; width: min(1440px, 100%); margin: 0 auto; padding: 21px 27px 22px; }

/* top */
.xq-topbar { display: flex; align-items: center; gap: 18px; min-height: 38px; flex-wrap: wrap; }
.xq-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: .12em; }
.xq-brand b { font-weight: 700; }
.xq-brand i { font-style: normal; font-size: 8px; letter-spacing: .22em; color: rgba(191,232,227,.34); }
.xq-brand em { font-style: normal; font-size: 10px; letter-spacing: .12em; color: rgba(191,232,227,.40); padding-left: 10px; border-left: 1px solid var(--line); }
.xq-seal { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; color: #13251f; background: linear-gradient(145deg, #ffe7aa, #d6a43d); font-weight: 900; font-size: 14px; }
.xq-top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.xq-mode { border: 1px solid var(--line); border-radius: 6px; background: rgba(12,50,56,.56); padding: 7px 10px; font-size: 9px; color: rgba(198,234,228,.46); letter-spacing: .06em; }
.xq-top-btn { border: 1px solid var(--line); border-radius: 6px; background: rgba(10,42,48,.58); color: rgba(205,238,232,.62); padding: 7px 10px; font-size: 10px; cursor: pointer; }
.xq-top-btn:hover { color: var(--gold-bright); border-color: rgba(226,178,82,.28); }
#xq-music-btn { color: var(--gold-bright); }
#xq-music-btn:not(.is-on) { color: rgba(205,238,232,.35); }

/* layout */
.xq-main { display: grid; grid-template-columns: minmax(0, 820px) minmax(320px, 1fr); gap: 24px; align-items: start; padding: 20px 0 0; max-width: 1260px; margin: 0 auto; }
.xq-left { min-width: 0; }
.xq-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 11px; }
.xq-kicker { color: var(--gold); font-size: 9px; letter-spacing: .22em; margin-bottom: 5px; }
.xq-title-row h1 { margin: 0; font-size: 27px; line-height: 1.05; font-weight: 500; letter-spacing: .02em; }
.xq-title-row h1 span { display: inline-block; margin-left: 10px; font-size: 10px; font-weight: 400; letter-spacing: .08em; color: rgba(192,231,225,.38); vertical-align: middle; }
.xq-turn-badge { border: 1px solid rgba(226,178,82,.24); border-radius: 999px; background: rgba(226,178,82,.07); color: var(--gold-bright); font-size: 10px; padding: 7px 11px; white-space: nowrap; }

/* board */
.xq-board-frame { width: 100%; max-width: min(100%, calc((100vh - 395px) * .9)); margin: 0 auto; padding: 13px; border-radius: 22px; background: linear-gradient(160deg, rgba(15,62,67,.86), rgba(6,27,34,.92)); border: 1px solid rgba(171,224,213,.17); box-shadow: 0 26px 58px rgba(0,0,0,.23); }

/* 上下看板娘 */
.xq-duel { display: flex; align-items: center; gap: 11px; width: 100%; max-width: min(100%, calc((100vh - 395px) * .9)); min-height: 76px; margin: 7px auto; padding: 5px 11px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, rgba(10,42,48,.72), rgba(6,26,33,.82)); }
.xq-duel-black { border-color: rgba(155,179,186,.17); }
.xq-duel-red { flex-direction: row-reverse; border-color: rgba(201,89,71,.20); text-align: right; }
.xq-duel-avatar { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 38%, #f4e7d2, #dcc7a6); border: 2px solid rgba(228,189,106,.28); box-shadow: 0 5px 13px rgba(0,0,0,.25); }
.xq-duel-red .xq-duel-avatar { border-color: rgba(213,95,80,.42); }
.xq-duel-avatar img { width: 98%; height: 98%; object-fit: contain; transform-origin: 50% 78%; animation: xqBreathe 3.4s ease-in-out infinite; }
.xq-duel-copy { flex: 1; min-width: 0; }
.xq-duel-copy small { display: block; font-size: 8px; letter-spacing: .08em; color: rgba(190,228,222,.34); margin-bottom: 3px; }
.xq-duel-red .xq-duel-copy small { color: rgba(224,122,104,.58); }
.xq-duel-copy p { margin: 0; color: rgba(214,240,234,.68); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.xq-mood { flex: 0 0 auto; min-width: 44px; text-align: center; border: 1px solid rgba(151,218,213,.14); border-radius: 999px; padding: 4px 7px; font-size: 8px; letter-spacing: .05em; color: rgba(202,236,230,.45); }
.xq-duel-red .xq-mood { color: rgba(232,154,136,.62); border-color: rgba(213,95,80,.18); }
.xq-duel.happy .xq-mood { color: #f0d58e; border-color: rgba(228,189,106,.28); background: rgba(228,189,106,.07); }
.xq-duel.worried .xq-mood { color: #d99a88; border-color: rgba(197,107,90,.22); background: rgba(197,107,90,.07); }
.xq-duel.panic .xq-mood { color: #f08f77; border-color: rgba(221,89,68,.3); background: rgba(221,89,68,.1); }
.xq-duel.happy .xq-duel-avatar img { animation: xqHappy 1.25s ease-in-out infinite; }
.xq-duel.worried .xq-duel-avatar img { animation: xqWorry 2.1s ease-in-out infinite; }
.xq-duel.panic .xq-duel-avatar img { animation: xqPanic .55s ease-in-out infinite; }
@keyframes xqBreathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.02); } }
@keyframes xqHappy { 0%,100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-5px) rotate(-2deg); } 60% { transform: translateY(-1px) rotate(2deg); } }
@keyframes xqWorry { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px) rotate(-1deg); } 75% { transform: translateX(2px) rotate(1deg); } }
@keyframes xqPanic { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-2px,1px) rotate(-2deg); } 75% { transform: translate(2px,-1px) rotate(2deg); } }
.xq-board { position: relative; aspect-ratio: 9 / 10; border-radius: 13px; overflow: hidden; background: var(--board); box-shadow: inset 0 0 0 1px rgba(76,57,37,.35), inset 0 0 38px rgba(101,72,37,.10); }
.xq-field { position: absolute; inset: 5.4% 7.2%; }
.xq-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xq-grid path { fill: none; stroke: #70593f; stroke-width: 3; stroke-linecap: square; opacity: .84; vector-effect: non-scaling-stroke; }
.xq-grid .xq-palace { stroke-width: 2.4; opacity: .7; }
.xq-marks path { fill: none; stroke: #70593f; stroke-width: 2; opacity: .52; }
.xq-river { position: absolute; left: 1%; right: 1%; top: 45.1%; height: 9.8%; display: flex; justify-content: space-between; align-items: center; padding: 0 10%; pointer-events: none; color: rgba(93,74,52,.64); font-family: "STKaiti", "KaiTi", "Kaiti SC", serif; font-size: clamp(12px, 2.8vw, 23px); letter-spacing: .32em; }
.xq-river i { font-style: normal; width: 28px; height: 28px; border: 1px solid rgba(93,74,52,.22); border-radius: 50%; display: grid; place-items: center; font-size: 12px; letter-spacing: 0; color: rgba(93,74,52,.42); }
.xq-center-seal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 15%; aspect-ratio: 1; border: 1px solid rgba(93,74,52,.18); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(93,74,52,.20); font-family: "STKaiti", "KaiTi", serif; font-size: clamp(14px, 2.4vw, 24px); line-height: .9; pointer-events: none; }
.xq-center-seal small { font-size: 6px; letter-spacing: .2em; line-height: 1.4; margin-top: 4px; }
.xq-piece-layer { position: absolute; inset: 0; z-index: 4; }

.xq-piece {
  position: absolute; width: 9.3%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid; padding: 0; display: grid; place-items: center;
  font-family: "STKaiti", "KaiTi", "Kaiti SC", "Microsoft YaHei", serif;
  font-size: clamp(13px, 2.2vw, 25px); font-weight: 700; cursor: pointer;
  transition: transform .16s, box-shadow .16s, filter .16s; z-index: 2;
}
.xq-piece.red { color: #a83d32; border-color: rgba(157,57,46,.72); background: radial-gradient(circle at 35% 28%, #fff9ed, #f0dfc0 66%, #d9c09a); box-shadow: 0 4px 8px rgba(75,47,24,.25), inset 0 0 0 2px rgba(255,255,255,.55); }
.xq-piece.black { color: #26343a; border-color: rgba(37,50,55,.84); background: radial-gradient(circle at 35% 28%, #fff8eb, #ead8b8 66%, #cfb58e); box-shadow: 0 4px 8px rgba(75,47,24,.28), inset 0 0 0 2px rgba(255,255,255,.5); }
.xq-piece:hover { transform: translate(-50%, -50%) scale(1.05); }
.xq-piece.selected { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 3px rgba(228,189,106,.72), 0 0 22px rgba(240,213,141,.46), 0 5px 10px rgba(75,47,24,.28); z-index: 5; }
.xq-piece.last-from { box-shadow: 0 0 0 2px rgba(101,173,180,.55), 0 4px 8px rgba(75,47,24,.25); }
.xq-piece.last-to { box-shadow: 0 0 0 3px rgba(228,189,106,.56), 0 0 14px rgba(240,213,141,.34), 0 4px 8px rgba(75,47,24,.3); }
.xq-piece.hint-from { box-shadow: 0 0 0 3px rgba(143,224,211,.68), 0 0 16px rgba(143,224,211,.36), 0 4px 8px rgba(75,47,24,.28); }
.xq-piece.hint-to { box-shadow: 0 0 0 3px rgba(226,178,82,.72), 0 0 16px rgba(240,213,141,.38), 0 4px 8px rgba(75,47,24,.28); }
.xq-piece.in-check { animation: xqCheck 1s ease-in-out infinite; }
@keyframes xqCheck { 0%,100% { box-shadow: 0 0 0 2px rgba(199,65,51,.35), 0 4px 8px rgba(75,47,24,.3); } 50% { box-shadow: 0 0 0 4px rgba(199,65,51,.64), 0 0 18px rgba(199,65,51,.4); } }
.xq-move-dot {
  position: absolute; width: 3.1%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(34,112,104,.56); border: 1px solid rgba(255,255,255,.54);
  box-shadow: 0 0 8px rgba(34,112,104,.32); z-index: 3; cursor: pointer;
}
.xq-move-dot.capture { width: 8.7%; background: transparent; border: 2px solid rgba(179,63,48,.62); box-shadow: 0 0 0 3px rgba(179,63,48,.12); }
.xq-move-dot:hover { background: rgba(34,112,104,.84); }
.xq-move-dot.capture:hover { background: rgba(179,63,48,.16); }
.xq-move-dot.hint-to-dot { background: rgba(226,178,82,.86); border-color: rgba(255,255,255,.72); box-shadow: 0 0 12px rgba(240,213,141,.48); z-index: 7; }

.xq-board-foot { display: flex; justify-content: space-between; gap: 10px; padding: 9px 3px 0; color: rgba(189,228,222,.36); font-size: 9px; letter-spacing: .04em; }
.xq-replay-bar { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 8px auto 0; max-width: min(100%, calc((100vh - 395px) * .9)); border: 1px solid rgba(226,178,82,.2); border-radius: 9px; background: rgba(226,178,82,.05); padding: 6px 9px; color: rgba(240,213,141,.7); font-size: 9px; }
.xq-replay-bar[hidden] { display: none; }
.xq-replay-bar button { border: 1px solid rgba(226,178,82,.26); border-radius: 5px; background: rgba(226,178,82,.08); color: var(--gold-bright); padding: 4px 7px; font-size: 8px; cursor: pointer; }
.xq-replay-bar #xq-replay-exit { border-color: rgba(151,218,213,.14); background: rgba(255,255,255,.025); color: rgba(210,240,234,.5); }
.xq-replay-bar input { width: 110px; height: 23px; border: 1px solid rgba(151,218,213,.16); border-radius: 5px; background: rgba(3,19,24,.7); color: #eef8f4; padding: 0 6px; font-size: 8px; outline: none; }
.xq-replay-bar input:focus { border-color: rgba(226,178,82,.45); }
.xq-foot-mark { color: rgba(226,178,82,.38); white-space: nowrap; }

/* side */
.xq-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 3px; }
.xq-commentary { border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(11,47,53,.74), rgba(5,24,31,.82)); padding: 10px 12px; min-height: 64px; }
.xq-commentary-head { font-size: 8px; letter-spacing: .12em; color: rgba(226,178,82,.5); margin-bottom: 4px; }
#xq-speech { color: rgba(211,240,234,.68); font-size: 11px; line-height: 1.7; }
#xq-speech b { color: var(--gold-bright); font-weight: 500; }
.xq-music-panel { display: flex; align-items: center; gap: 7px; border: 1px solid rgba(151,218,213,.12); border-radius: 10px; background: rgba(6,28,35,.5); padding: 6px 8px; }
.xq-music-nav { width: 22px; height: 22px; border: 1px solid rgba(151,218,213,.14); border-radius: 5px; background: rgba(255,255,255,.03); color: rgba(210,240,234,.62); font-size: 14px; line-height: 1; cursor: pointer; }
.xq-music-nav:hover { color: var(--gold-bright); border-color: rgba(226,178,82,.28); }
.xq-music-nav:disabled { opacity: .3; cursor: default; }
.xq-music-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.xq-music-info small { font-size: 7px; letter-spacing: .1em; color: rgba(188,228,222,.35); }
.xq-music-info span { font-size: 9px; color: rgba(214,240,234,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#xq-music-volume { width: 72px; accent-color: #d8aa4e; cursor: pointer; }
.xq-hero { display: flex; align-items: center; gap: 4px; min-height: 155px; }
.xq-mascot { width: 150px; height: 150px; flex: 0 0 auto; position: relative; }
.xq-mascot::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle, rgba(78,177,205,.17), transparent 68%); }
.xq-mascot img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 13px 18px rgba(0,0,0,.26)); }
.xq-speech { position: relative; flex: 1; background: #f6f0e4; color: #192c39; border-radius: 13px 13px 13px 4px; padding: 10px 12px; font-size: 11px; line-height: 1.65; box-shadow: 0 9px 22px rgba(0,0,0,.14); }
.xq-speech::before { content: ""; position: absolute; left: -6px; bottom: 11px; border: 7px solid transparent; border-right-color: #f6f0e4; border-left: 0; }
.xq-speech b { color: #a83d32; }
.xq-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(150deg, rgba(12,55,61,.84), rgba(7,30,37,.92)); padding: 11px 13px; }
.xq-status-kicker { color: var(--gold); font-size: 8px; letter-spacing: .16em; margin-bottom: 3px; }
.xq-status-title { font-size: 17px; font-weight: 500; }
.xq-status-note { color: rgba(196,232,226,.4); font-size: 9px; margin-top: 3px; }
.xq-status-side { text-align: right; }
.xq-timer { color: rgba(226,178,82,.72); font-size: 11px; letter-spacing: .05em; margin-bottom: 6px; }
.xq-timer.danger { color: #f08f77; animation: xqTimerPulse .8s ease-in-out infinite; }
@keyframes xqTimerPulse { 0%,100% { opacity: 1; } 50% { opacity: .46; } }
.xq-mini-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.xq-mini-btn, .xq-new-btn { border: 1px solid rgba(226,178,82,.34); border-radius: 6px; background: rgba(226,178,82,.10); color: var(--gold-bright); padding: 6px 7px; font-size: 9px; cursor: pointer; white-space: nowrap; }
.xq-mini-btn { border-color: rgba(151,218,213,.2); background: rgba(255,255,255,.025); color: rgba(214,240,234,.62); }
.xq-mini-btn:hover, .xq-new-btn:hover { background: rgba(226,178,82,.16); }
.xq-mini-btn:disabled { opacity: .35; cursor: default; }
.xq-draw-prompt { display: flex; align-items: center; gap: 6px; border: 1px solid rgba(226,178,82,.22); background: rgba(226,178,82,.06); border-radius: 10px; padding: 7px 9px; font-size: 9px; color: rgba(240,213,141,.76); }
.xq-draw-prompt[hidden] { display: none; }
.xq-draw-prompt span { flex: 1; }
.xq-draw-prompt button { border: 1px solid rgba(226,178,82,.26); border-radius: 5px; background: rgba(226,178,82,.1); color: var(--gold-bright); padding: 4px 7px; font-size: 8px; cursor: pointer; }
.xq-draw-prompt button:last-child { border-color: rgba(151,218,213,.16); background: rgba(255,255,255,.03); color: rgba(210,240,234,.55); }
.xq-players { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.xq-player { border: 1px solid var(--line); border-radius: 11px; background: rgba(8,33,40,.6); padding: 8px 9px; min-width: 0; }
.xq-player.red { border-color: rgba(201,89,71,.22); }
.xq-player.black { border-color: rgba(126,177,202,.20); }
.xq-player-head { display: flex; justify-content: space-between; gap: 5px; align-items: baseline; margin-bottom: 4px; }
.xq-player-name { font-size: 10px; color: rgba(222,244,239,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xq-player-name em { font-style: normal; margin-left: 4px; color: rgba(226,178,82,.6); font-size: 8px; }
.xq-player-side { font-size: 8px; color: rgba(190,228,222,.35); letter-spacing: .08em; }
.xq-player.red .xq-player-side { color: rgba(224,122,104,.65); }
.xq-player.black .xq-player-side { color: rgba(142,192,216,.62); }
.xq-captured { min-height: 15px; color: rgba(215,239,233,.44); font-size: 10px; letter-spacing: .02em; overflow-wrap: anywhere; }
.xq-player.active { background: rgba(18,62,64,.62); box-shadow: inset 0 0 0 1px rgba(228,189,106,.14); }
.xq-log { border: 1px solid var(--line); border-radius: 13px; background: rgba(5,25,31,.56); padding: 9px 11px; min-height: 82px; }
.xq-log-head, .xq-chat-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 5px; }
.xq-log-head b, .xq-chat-head b { font-size: 9px; font-weight: 500; letter-spacing: .1em; color: rgba(220,244,239,.66); }
.xq-log-head span, .xq-chat-head span { font-size: 8px; color: rgba(185,225,220,.27); }
#xq-log-list { color: rgba(209,239,233,.52); font-size: 9px; line-height: 1.65; max-height: 70px; overflow-y: auto; }
#xq-log-list p { margin: 0; }
#xq-log-list p:first-child { color: rgba(238,218,164,.7); }
.xq-chat { border: 1px solid var(--line); border-radius: 13px; background: rgba(6,28,35,.62); padding: 9px 11px; }
.xq-chat[hidden] { display: none; }
.xq-chat-list { max-height: 70px; overflow-y: auto; }
.xq-chat-line { margin: 2px 0; font-size: 9px; line-height: 1.45; color: rgba(211,240,234,.6); overflow-wrap: anywhere; }
.xq-chat-line b { color: rgba(240,213,141,.76); font-weight: 500; margin-right: 4px; }
.xq-chat-line.system { color: rgba(144,213,205,.42); font-style: italic; }
.xq-chat-form { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 5px; margin-top: 5px; }
.xq-chat-form input { height: 25px; min-width: 0; border-radius: 5px; border: 1px solid rgba(151,218,213,.16); background: rgba(3,19,24,.7); color: #eef8f4; padding: 0 7px; font-size: 9px; outline: none; }
.xq-chat-form input:focus { border-color: rgba(228,189,106,.48); }
.xq-chat-form button { border: 1px solid rgba(151,218,213,.16); border-radius: 5px; background: rgba(255,255,255,.04); color: rgba(213,242,236,.68); font-size: 9px; cursor: pointer; }

/* footer */
.xq-mobile-info { display: none; }
.xq-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: rgba(177,222,218,.28); font-size: 8px; letter-spacing: .07em; }
.xq-foot a { color: rgba(226,178,82,.54); }

/* overlay */
.xq-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(1,12,17,.80); backdrop-filter: blur(9px); }
.xq-overlay[hidden] { display: none; }
.xq-overlay-card { width: min(470px, 94vw); max-height: 92vh; overflow-y: auto; border-radius: 20px; border: 1px solid rgba(171,224,213,.18); background: linear-gradient(160deg, #0b333b, #061b23); padding: 22px 24px 20px; text-align: center; box-shadow: 0 30px 70px rgba(0,0,0,.44); }
.xq-overlay-card .xq-kicker { margin-bottom: 8px; }
.xq-overlay-card h2 { margin: 0; font-size: 24px; font-weight: 500; }
.xq-overlay-card h2 span { display: block; margin-top: 6px; color: rgba(202,234,228,.38); font-size: 9px; font-weight: 400; letter-spacing: .12em; }
.xq-cast { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 7px 0 2px; }
.xq-cast > b { color: rgba(226,178,82,.48); font-size: 10px; letter-spacing: .12em; font-weight: 400; }
.xq-cast span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.xq-cast img { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.24)); }
.xq-cast em { font-style: normal; font-size: 8px; letter-spacing: .07em; color: rgba(205,236,230,.4); }
.xq-cast .red em { color: rgba(224,122,104,.68); }
.xq-cast .blue em { color: rgba(142,192,216,.7); }
.xq-overlay-card p { color: var(--muted); font-size: 11px; line-height: 1.75; margin: 8px auto 14px; max-width: 350px; }
.xq-setup { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; text-align: left; }
.xq-setup[hidden] { display: none; }
.xq-setup-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.xq-setup-row > span { width: 56px; flex: 0 0 auto; color: rgba(192,231,225,.4); font-size: 9px; letter-spacing: .04em; }
.xq-setup-row button { border: 1px solid rgba(151,218,213,.16); background: rgba(255,255,255,.025); color: rgba(210,240,234,.55); border-radius: 6px; padding: 5px 9px; font-size: 9px; cursor: pointer; }
.xq-setup-row button:hover { color: var(--gold-bright); border-color: rgba(226,178,82,.3); }
.xq-setup-row button.active { color: #17251f; background: linear-gradient(145deg, #f4dc9d, #d8aa4e); border-color: rgba(226,178,82,.45); font-weight: 700; }
.xq-primary-btn { width: 100%; border: 1px solid rgba(226,178,82,.45); background: linear-gradient(145deg, #f4dc9d, #d8aa4e); color: #17251f; border-radius: 9px; padding: 11px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.xq-primary-btn:hover { filter: brightness(1.07); }
.xq-primary-btn:disabled { opacity: .5; cursor: default; filter: none; }
.xq-secondary-btn { width: 100%; margin-top: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: rgba(210,240,234,.62); border-radius: 8px; padding: 8px 12px; font-size: 10px; cursor: pointer; }
.xq-secondary-btn:hover { color: var(--gold-bright); border-color: rgba(226,178,82,.28); }
.xq-online-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(151,218,213,.12); text-align: left; }
.xq-online-label { display: block; color: rgba(203,236,230,.5); font-size: 9px; letter-spacing: .08em; margin-bottom: 5px; }
.xq-online-label input, .xq-join-row input { width: 100%; height: 32px; margin-top: 4px; border-radius: 6px; border: 1px solid rgba(151,218,213,.2); background: rgba(4,25,31,.68); color: #eef8f4; padding: 0 9px; font-size: 12px; outline: none; }
.xq-online-label input:focus, .xq-join-row input:focus { border-color: rgba(228,189,106,.55); }
.xq-online-panel .xq-primary-btn { margin-top: 9px; }
.xq-or { display: flex; align-items: center; gap: 9px; margin: 9px 0 6px; color: rgba(188,228,222,.32); font-size: 8px; letter-spacing: .1em; }
.xq-or::before, .xq-or::after { content: ""; flex: 1; height: 1px; background: rgba(151,218,213,.10); }
.xq-join-row { display: grid; grid-template-columns: 1fr 72px; gap: 6px; }
.xq-join-row .xq-secondary-btn { margin-top: 4px; height: 32px; }
.xq-online-error { min-height: 14px; margin: 6px 0 0; color: #f0a99b; font-size: 9px; line-height: 1.4; }
.xq-online-error:empty { display: none; }
.xq-room-search { width: 100%; height: 30px; margin-top: 6px; border: 1px solid rgba(151,218,213,.16); border-radius: 6px; background: rgba(4,25,31,.68); color: #eef8f4; padding: 0 8px; font-size: 10px; outline: none; }
.xq-room-search:focus { border-color: rgba(228,189,106,.48); }
.xq-room-list { max-height: 160px; overflow-y: auto; margin-top: 6px; border: 1px solid rgba(151,218,213,.12); border-radius: 8px; }
.xq-room-list[hidden] { display: none; }
.xq-room-item { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-bottom: 1px solid rgba(151,218,213,.07); font-size: 9px; color: rgba(211,240,234,.6); }
.xq-room-item:last-child { border-bottom: 0; }
.xq-room-item b { color: var(--gold-bright); font-weight: 500; letter-spacing: .06em; }
.xq-room-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xq-room-item em { font-style: normal; color: rgba(180,225,220,.35); font-size: 8px; }
.xq-room-item button { border: 1px solid rgba(226,178,82,.3); border-radius: 5px; background: rgba(226,178,82,.1); color: var(--gold-bright); padding: 3px 6px; font-size: 8px; cursor: pointer; }
.xq-room-empty { padding: 9px; color: rgba(188,228,222,.35); font-size: 9px; text-align: center; }
#xq-result-list { margin: 6px 0 12px; }
.xq-result-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid rgba(151,218,213,.08); font-size: 10px; text-align: left; }
.xq-result-row:last-child { border-bottom: 0; }
.xq-result-rank { color: var(--gold); min-width: 20px; }
.xq-result-name { flex: 1; color: rgba(220,242,237,.76); }
.xq-result-score { color: rgba(185,225,220,.38); font-size: 9px; }
.xq-result-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #9adbd0); }

/* stats */
.xq-stats-modal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 20px; background: rgba(1,12,17,.78); backdrop-filter: blur(8px); }
.xq-stats-modal[hidden] { display: none; }
.xq-stats-card { width: min(500px, 94vw); max-height: 88vh; overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(160deg, #0c343b, #071d25); padding: 21px 22px; }
.xq-stats-card h2 { margin: 0 0 13px; font-size: 20px; font-weight: 500; }
.xq-stats-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 13px; }
.xq-stats-kpi { border: 1px solid rgba(151,218,213,.12); background: rgba(255,255,255,.025); border-radius: 9px; padding: 8px 10px; }
.xq-stats-kpi small { display: block; font-size: 9px; letter-spacing: .08em; color: rgba(188,228,222,.4); margin-bottom: 4px; }
.xq-stats-kpi b { font-size: 18px; color: var(--gold-bright); font-weight: 500; }
.xq-stats-section { margin-top: 11px; }
.xq-stats-section h3 { margin: 0 0 5px; font-size: 10px; font-weight: 500; letter-spacing: .1em; color: rgba(188,228,222,.46); }
.xq-stats-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(151,218,213,.07); font-size: 10px; color: rgba(210,239,233,.64); }
.xq-stats-row .rank { color: var(--gold); min-width: 23px; }
.xq-stats-row .name { flex: 1; }
.xq-stats-row .meta { color: rgba(180,225,220,.36); }
.xq-stats-empty { color: rgba(188,228,222,.4); font-size: 11px; line-height: 1.7; padding: 7px 0; }
.xq-stats-replay { border: 1px solid rgba(226,178,82,.26); border-radius: 4px; background: rgba(226,178,82,.08); color: var(--gold-bright); padding: 2px 5px; font-size: 8px; cursor: pointer; }

/* rules */
.xq-rules { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(1,12,17,.76); backdrop-filter: blur(8px); }
.xq-rules[hidden] { display: none; }
.xq-rules-card { width: min(520px, 94vw); max-height: 88vh; overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(160deg, #0c343b, #071d25); padding: 20px 22px; }
.xq-rules-card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 500; }
.xq-rules-card h3 { margin: 12px 0 4px; font-size: 10px; letter-spacing: .1em; color: var(--gold); font-weight: 500; }
.xq-rules-card p, .xq-rules-card li { color: rgba(207,237,231,.58); font-size: 11px; line-height: 1.75; }
.xq-rules-card ul { margin: 0; padding-left: 17px; }
.xq-rules-card li { margin: 3px 0; }
.xq-rules-card b { color: rgba(240,213,141,.8); font-weight: 500; }

@media (max-width: 1080px) {
  .xq-main { grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 14px; }
  .xq-side { padding-top: 0; }
  .xq-board-frame { max-width: min(100%, calc((100vh - 365px) * .9)); }
  .xq-duel { max-width: min(100%, calc((100vh - 365px) * .9)); }
}
@media (max-width: 820px) {
  .xq-brand em { display: none; }
  .xq-title-row h1 { font-size: 24px; }
  .xq-title-row h1 span { display: block; margin: 5px 0 0; }
}
@media (max-width: 560px) {
  .xq-shell { padding: 14px 11px 18px; }
  .xq-side { display: none; }
  .xq-side.is-open { display: flex; }
  .xq-mobile-info {
    display: flex; position: fixed; right: 13px; bottom: 14px; z-index: 35;
    align-items: center; justify-content: center; min-width: 76px; height: 34px;
    border: 1px solid rgba(226,178,82,.4); border-radius: 999px;
    background: rgba(8,36,42,.92); color: var(--gold-bright);
    box-shadow: 0 8px 22px rgba(0,0,0,.35); font-size: 10px; cursor: pointer;
    backdrop-filter: blur(8px);
  }
  .xq-topbar { gap: 8px; }
  .xq-brand { gap: 6px; font-size: 11px; }
  .xq-brand i { display: none; }
  .xq-mode { display: none; }
  .xq-top-btn { padding: 6px 7px; font-size: 9px; }
  .xq-main { padding-top: 13px; gap: 11px; }
  .xq-board-frame { padding: 7px; border-radius: 14px; max-width: 100%; }
  .xq-board { border-radius: 9px; }
  .xq-title-row h1 { font-size: 21px; }
  .xq-turn-badge { font-size: 8px; padding: 5px 7px; }
  .xq-river { font-size: 12px; letter-spacing: .18em; }
  .xq-river i { width: 19px; height: 19px; font-size: 8px; }
  .xq-piece { border-width: 1.5px; font-size: 13px; }
  .xq-board-foot { font-size: 8px; }
  .xq-duel { min-height: 56px; padding: 3px 7px; gap: 7px; margin: 5px auto; }
  .xq-duel-avatar { width: 52px; height: 52px; border-width: 1.5px; }
  .xq-duel-copy small { font-size: 7px; margin-bottom: 1px; }
  .xq-duel-copy p { font-size: 8.5px; line-height: 1.35; }
  .xq-mood { min-width: 34px; font-size: 7px; padding: 3px 4px; }
  .xq-music-panel { gap: 5px; padding: 5px 6px; }
  #xq-music-volume { width: 58px; }
  #xq-speech { font-size: 10px; }
  .xq-status-title { font-size: 15px; }
  .xq-players { grid-template-columns: 1fr 1fr; }
  .xq-overlay-card { padding: 17px 15px 16px; }
  .xq-cast img { width: 70px; height: 70px; }
}
