@import url('willow-scrollbar.css');
body.share-themed:has(#ws-play) {
    background: linear-gradient(140deg, #e0f2fe 0%, #ecfccb 32%, #fce7f3 62%, #e0e7ff 100%);
    background-size: 260% 260%;
    animation: wsWash 18s ease-in-out infinite;
}
@keyframes wsWash {
    0% { background-position: 0% 30%; }
    50% { background-position: 100% 70%; }
    100% { background-position: 0% 30%; }
}
.ws-kicker { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #001A72; font-weight: 700; margin: 0 0 0.35rem; }
.ws-preview-back {
    display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.4rem;
    color: #001A72; font-weight: 800; font-size: 0.9rem; text-decoration: none;
}
.ws-preview-back:hover { text-decoration: underline; }
.ws-play-meta {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e5e7eb; border-radius: 1rem; padding: 0.75rem 0.85rem 0.8rem;
    box-shadow: 0 10px 24px rgba(0, 26, 114, 0.06);
}
.ws-meta-stats { display: flex; align-items: baseline; gap: 0.75rem; margin: 0 0 0.3rem; }
.ws-stat { font-size: 1.5rem; font-weight: 800; color: #001A72; font-variant-numeric: tabular-nums; }
.ws-stat-timer:empty { display: none; }
.ws-side-body { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0.35rem; flex: 1 1 auto; min-height: 0; }
#ws-play[data-preview="1"] .ws-score-panel,
#ws-play[data-preview="1"] #ws-split-scores { display: none; }
#ws-play[data-preview="1"] .ws-words-panel { flex: 1 1 auto; }
.ws-join h2 { font-size: 1.6rem; margin: 0.3rem 0 0.8rem; }
.ws-join form { display: grid; gap: 0.45rem; }
.ws-join input, .ws-join button { border-radius: 0.7rem; padding: 0.75rem; font-size: 1rem; }
.ws-join input { border: 1px solid #d1d5db; }
.ws-join button, .ws-btn { background: #001A72; color: #fff; border: 0; font-weight: 600; }
.ws-error { color: #991b1b; background: #fef2f2; padding: 0.6rem 0.8rem; border-radius: 0.6rem; }
.ws-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; font-size: 0.9rem; }
.ws-hint { margin: 0 0 0.55rem; font-size: 0.85rem; color: #4b5563; }
.ws-zoom { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(255,255,255,0.82); border: 1px solid #dbe3f0; border-radius: 999px; padding: 0.2rem; }
.ws-zoom button {
    display: inline-flex; align-items: center; gap: 0.3rem; border: 0; border-radius: 999px;
    background: #001A72; color: #fff; font-size: 0.82rem; font-weight: 700; padding: 0.45rem 0.75rem; cursor: pointer;
}
.ws-zoom-label { min-width: 3.2rem; text-align: center; font-weight: 700; color: #001A72; font-size: 0.85rem; }
.ws-layout { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 1rem; flex: 1; min-height: 0; overflow: hidden; }
.ws-grid-scroll { flex: 1 1 auto; min-width: 10rem; overflow: auto; max-width: 100%; max-height: 100%; padding-bottom: 0.25rem; -webkit-overflow-scrolling: touch; align-self: stretch; }
.ws-grid-scroll.is-fit { overflow: hidden; display: grid; place-items: center; }
.ws-grid { display: grid; gap: 3px; touch-action: none; user-select: none; width: max-content; }
.ws-cell {
    aspect-ratio: 1; display: grid; place-items: center; font-weight: 800;
    width: var(--ws-cell, 2.75rem); font-size: calc(var(--ws-cell, 2.75rem) * 0.42);
    background: #fff; border: 1px solid #e5e7eb; border-radius: 0.35rem; color: #111;
    touch-action: none;
}
.ws-words { font-size: var(--ws-word, 1.15rem); line-height: 1.35; align-content: start; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-side { display: flex; flex-direction: column; gap: 0.55rem; flex: 0 0 var(--ws-side, 26rem); width: var(--ws-side, 26rem); max-width: 40%; min-width: 16rem; min-height: 0; height: 100%; }
.ws-words-panel, .ws-score-panel {
    flex: 1 1 0; min-width: 0; min-height: 0; height: 100%; max-height: 100%;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e5e7eb; border-radius: 1rem; padding: 0.75rem 0.8rem;
    box-shadow: 0 10px 24px rgba(0, 26, 114, 0.06);
    display: flex; flex-direction: column; overflow: hidden;
}
.ws-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin: 0 0 0.55rem; flex: 0 0 auto; }
.ws-words-panel h2, .ws-score-panel h2 {
    margin: 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #001A72;
}
#ws-scores-toggle {
    border: 0; background: #e0e7ff; color: #312e81; border-radius: 999px;
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.28rem 0.6rem; cursor: pointer;
}
.ws-side.is-scores-collapsed #ws-split-scores { display: none; }
.ws-side.is-scores-collapsed .ws-words-panel { flex: 1 1 auto; }
.ws-side.is-scores-collapsed .ws-score-panel { flex: 0 0 2.8rem; width: 2.8rem; min-width: 2.8rem; padding: 0.4rem 0.15rem; }
.ws-side.is-scores-collapsed .ws-score-panel h2,
.ws-side.is-scores-collapsed .ws-board { display: none; }
.ws-side.is-scores-collapsed .ws-panel-head { flex: 1; margin: 0; justify-content: center; }
.ws-side.is-scores-collapsed #ws-scores-toggle {
    writing-mode: vertical-rl; transform: rotate(180deg); height: 100%; background: transparent; padding: 0.4rem 0;
}
.ws-cell { transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease; }
.ws-cell.on { background: #dbeafe; border-color: #001A72; transform: scale(1.08); box-shadow: 0 0 0 2px rgba(0, 26, 114, 0.28); }
.ws-cell.found { background: #dcfce7; border-color: #166534; }
.ws-words, .ws-board { list-style: none; margin: 0; padding: 0; align-content: start; overflow: auto; flex: 1; min-height: 0; }
.ws-board { display: grid; gap: 0.4rem; }
.ws-words li.found { text-decoration: line-through; color: #166534; }
.ws-words li.ws-hit { animation: wsWordHit 0.45s ease; }
.ws-score-row {
    display: grid; grid-template-columns: 1.7rem 1fr auto; align-items: center; gap: 0.45rem;
    padding: 0.35rem 0.15rem; border-radius: 0.65rem;
}
.ws-score-row.is-you { background: #eef2ff; }
.ws-rank {
    width: 1.7rem; height: 1.7rem; border-radius: 999px; display: grid; place-items: center;
    background: #e2e8f0; color: #0f172a; font-size: 0.8rem; font-weight: 800;
}
.ws-score-row.rank-1 .ws-rank { background: #fde68a; color: #78350f; }
.ws-score-row.rank-2 .ws-rank { background: #e2e8f0; color: #334155; }
.ws-score-row.rank-3 .ws-rank { background: #fed7aa; color: #9a3412; }
.ws-score-name { font-weight: 700; min-width: 0; overflow: visible; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.ws-score-pts { font-variant-numeric: tabular-nums; font-weight: 800; color: #001A72; }
.ws-wait, .ws-msg { font-size: 0.95rem; }
.dark .ws-cell { background: #2f3646; color: #d3dbe8; border-color: #414a5c; }
@media (prefers-reduced-motion: no-preference) {
    .ws-cell.ws-pop { animation: wsPop 0.48s ease both; }
    .ws-cell.ws-miss { animation: wsMiss 0.32s ease; }
}
@keyframes wsPop {
    0% { transform: scale(0.72); }
    55% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
@keyframes wsMiss {
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}
@keyframes wsWordHit {
    0% { transform: scale(0.92); }
    60% { transform: scale(1.08); }
    100% { transform: none; }
}
.ws-lobby {
    position: fixed; top: 2vh; left: 50%; transform: translateX(-50%); margin: 0;
    width: min(96vw, 52rem); max-width: 96vw; max-height: 96dvh; height: auto; min-height: 0;
    border: 0; border-radius: 1.4rem; padding: 1.25rem 1.25rem 1rem;
    background: linear-gradient(180deg, #f8fafc, #eef2ff); text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    overflow: hidden; z-index: 80;
}
.ws-lobby:not([open]) { display: none; }
.ws-lobby-board { flex: 0 0 auto; width: 100%; }
.ws-lobby-actions { flex: 0 0 auto; }
.ws-lobby::backdrop { background: rgba(15, 23, 42, 0.55); }
.ws-lobby-label { margin: 0; font-size: clamp(1rem, 2.2vw, 1.45rem); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #334155; }
.ws-lobby-url { margin: 0.35rem 0 0.7rem; font-size: clamp(1.45rem, 3.8vw, 2.7rem); font-weight: 800; color: #001A72; line-height: 1.25; overflow-wrap: anywhere; max-width: 100%; }
.ws-url-bit { display: inline-block; white-space: nowrap; }
.ws-lobby-code {
    display: flex; align-items: center; justify-content: center; width: min(100%, 36rem);
    margin: 0.35rem auto 0.4rem; padding: 0.35rem 0.6rem 0.5rem; border-radius: 1rem; background: #fff;
    border: 5px solid #001A72; color: #001A72; font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(1.55rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: 0.1em; line-height: 1.15;
    box-shadow: 0 22px 48px rgba(0, 26, 114, 0.16); overflow: visible;
}
.ws-lobby-count { font-weight: 800; color: #001A72; font-size: 1.15rem; }
.ws-lobby-banner { margin: 0.6rem 0 0; font-weight: 800; color: #166534; font-size: 1.15rem; }
.ws-lobby-msg { margin: 0.4rem 0 0; color: #991b1b; font-weight: 700; min-height: 1.2rem; }
.ws-theme-btn {
    border: 0; border-radius: 999px; background: #fff; color: #001A72; font-weight: 800;
    padding: 0.45rem 0.8rem; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
html[data-ws-theme="dark"] { background: #1c212c; color-scheme: dark; }
html[data-ws-theme="dark"] .share-topbar { background: #151922; }
html[data-ws-theme="dark"] .ws-theme-btn,
html[data-ws-theme="dark"] .ws-restart { background: #323a4a; color: #d7deea; box-shadow: none; }
html[data-ws-theme="dark"] #ws-scores-toggle { background: #3a4254; color: #d7deea; }
html[data-ws-theme="dark"] .ws-side.is-scores-collapsed #ws-scores-toggle { background: transparent; color: #c5cddd; }
html[data-ws-theme="dark"] body.share-themed:has(#ws-play) footer { background: transparent; color: #9aa3b5; border-color: #3a4254; }
html[data-ws-theme="dark"] .ws-done { background: #262c3a; color: #d7deea; }
html[data-ws-theme="dark"] .ws-done h2 { color: #e8eef6; }
html[data-ws-theme="dark"] .ws-done p,
html[data-ws-theme="dark"] .ws-done-kicker { color: #b8c3d6; }
html[data-ws-theme="dark"] body.share-themed:has(#ws-play) {
    background: #1c212c;
    color: #d4dbe6;
    animation: none;
}
html[data-ws-theme="dark"] .ws-preview-back { color: #b8c8e0; background: transparent; }
html[data-ws-theme="dark"] .ws-play-meta { background: #262c3a; border-color: #3a4254; box-shadow: none; }
html[data-ws-theme="dark"] .ws-stat { color: #c5d4ea; }
html[data-ws-theme="dark"] .ws-kicker,
html[data-ws-theme="dark"] .ws-words-panel h2,
html[data-ws-theme="dark"] .ws-score-panel h2,
html[data-ws-theme="dark"] .ws-zoom-label,
html[data-ws-theme="dark"] .ws-score-pts { color: #c5d4ea; }
html[data-ws-theme="dark"] .ws-hint, html[data-ws-theme="dark"] .ws-wait { color: #a8b2c4; }
html[data-ws-theme="dark"] .ws-cell {
    background: #2f3646; color: #d3dbe8; border-color: #414a5c; font-weight: 700;
}
html[data-ws-theme="dark"] .ws-cell.on { background: #3e4d6b; color: #e8eef8; border-color: #7f93b8; }
html[data-ws-theme="dark"] .ws-cell.found,
html[data-ws-theme="dark"] .ws-cell.found-0 { background: #355246; color: #d7eadc; border-color: #4d7260; }
html[data-ws-theme="dark"] .ws-cell.found-1 { background: #33425c; color: #d5e2f5; border-color: #4d6284; }
html[data-ws-theme="dark"] .ws-cell.found-2 { background: #4a4330; color: #efe3c4; border-color: #6d6244; }
html[data-ws-theme="dark"] .ws-cell.found-3 { background: #4a3544; color: #f0d4e4; border-color: #6b4d60; }
html[data-ws-theme="dark"] .ws-cell.found-4 { background: #3c3554; color: #ddd4f5; border-color: #564d78; }
html[data-ws-theme="dark"] .ws-words-panel,
html[data-ws-theme="dark"] .ws-score-panel,
html[data-ws-theme="dark"] .ws-zoom { background: #262c3a; border-color: #3a4254; color: #d4dbe6; box-shadow: none; }
html[data-ws-theme="dark"] .ws-score-row.is-you { background: #323a4a; }
html[data-ws-theme="dark"] .ws-words li.found { color: inherit; }
html[data-ws-theme="dark"] .ws-lobby { background: #262c3a; color: #d4dbe6; }
html[data-ws-theme="dark"] .ws-lobby-label { color: #a8b2c4; }
html[data-ws-theme="dark"] .ws-lobby-url, html[data-ws-theme="dark"] .ws-lobby-count { color: #c5d4ea; }
html[data-ws-theme="dark"] .ws-lobby-code { background: #1c212c; color: #d7deea; border-color: #7f93b8; }
html[data-ws-theme="dark"] .ws-lobby-names li { background: #323a4a; color: #d7deea; }
.ws-done {
    width: min(94vw, 36rem); border: 0; border-radius: 1.4rem; padding: 1.6rem 1.4rem 1.4rem;
    text-align: center; background: #fff; overflow: auto;
}
.ws-done::backdrop { background: rgba(15, 23, 42, 0.55); }
.ws-done-kicker { margin: 0; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; color: #001A72; font-size: 0.85rem; }
.ws-done h2 { margin: 0.35rem 0 0.4rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.ws-done p { margin: 0; font-size: 1.15rem; color: #334155; }
.ws-done-actions { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.1rem; }
.ws-done-close { border: 0; border-radius: 0.8rem; background: #001A72; color: #fff; font-weight: 800; padding: 0.7rem 1.2rem; cursor: pointer; }
.ws-done-quiet { background: #e2e8f0; color: #0f172a; }
.ws-restart { border: 0; border-radius: 999px; background: #fff; color: #001A72; font-weight: 800; padding: 0.45rem 0.8rem; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,0.06); }
a.ws-pack-next {
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    border: 0; border-radius: 999px; background: #001A72; color: #fff; font-weight: 800;
    font-size: 0.9rem; line-height: 1.2; padding: 0.45rem 0.9rem; white-space: nowrap;
    position: sticky; bottom: 0.5rem; z-index: 5; flex: 0 0 auto; width: auto; max-width: 100%;
}
.ws-confetti { position: relative; height: 0; }
.ws-confetti span {
    position: absolute; top: -0.5rem; width: 0.45rem; height: 0.7rem; border-radius: 2px;
    animation: wsConfetti 1.1s ease-in forwards;
}
@keyframes wsPopIn { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wsConfetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(7.5rem) rotate(160deg); opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
    .ws-done[open] { animation: wsPopIn 0.35s ease; }
}
.ws-lobby-names { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 0.45rem; margin: 0.6rem 0 0; padding: 0.15rem; list-style: none; width: 100%; overflow: auto; flex: 1 1 auto; min-height: 0; max-height: 28vh; }
.ws-lobby-names li { background: #fff; border-radius: 999px; padding: 0.35rem 0.75rem; font-weight: 650; }
@media (prefers-reduced-motion: reduce) {
    .ws-cell.found, .ws-cell.ws-pop, .ws-cell.ws-miss, .ws-words li.ws-hit, body.share-themed:has(#ws-play), .ws-done, .ws-confetti span { animation: none; }
}
#ws-host-board { max-width: 28rem; }
#ws-start:disabled, #ws-lobby-start:disabled { opacity: 0.85; cursor: default; }
@media (max-width: 1180px) {
    .ws-side { flex-basis: min(22rem, 38%); width: min(22rem, 38%); max-width: 40%; min-width: 15rem; }
}
@media (max-width: 860px) {
    .ws-play-main { padding: 0.4rem 0.5rem; }
    .ws-layout { gap: 0.55rem; }
    .ws-side { flex-basis: min(18rem, 36%); width: min(18rem, 36%); min-width: 13.5rem; }
    .ws-play-meta { padding: 0.55rem 0.65rem; }
    .ws-stat { font-size: 1.2rem; }
    .ws-hint { font-size: 0.8rem; }
}
@media (max-width: 720px) {
    html:has(#ws-play),
    body.share-themed:has(#ws-play) { height: auto; min-height: 100dvh; max-height: none; overflow: auto; }
    .ws-play-main, #ws-play, .ws-layout { overflow: visible; height: auto; min-height: 0; max-height: none; }
    .ws-layout { display: flex; flex-direction: column; }
    .ws-grid-scroll { order: 2; }
    .ws-side { order: 1; }
    .ws-words-panel { margin-top: 0.6rem; }
    #ws-pack-next {
        position: fixed;
        z-index: 40;
        left: auto;
        right: 0.75rem;
        width: auto;
        max-width: calc(100vw - 1.5rem);
        bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
        justify-content: center;
        padding: 0.5rem 0.95rem;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    }
    body.share-themed:has(#ws-pack-next) .ws-play-main { padding-bottom: 4.25rem; }
    .ws-bar { flex-wrap: wrap; }
    .ws-zoom { flex-wrap: wrap; max-width: 100%; }
    .ws-zoom button { font-size: 0.75rem; padding: 0.4rem 0.55rem; }
    .ws-layout { flex-direction: column; }
    .ws-split { display: none; }
    .ws-grid-scroll { flex: 0 0 auto; max-height: none; width: 100%; min-width: 0; min-height: 14rem; overflow: auto; }
    .ws-grid-scroll.is-fit { overflow: auto; place-items: start center; }
    .ws-side { flex: 0 0 auto; width: 100%; max-width: none; min-width: 0; height: auto; flex-direction: column; }
    .ws-side-body { flex-direction: column; }
    .ws-words-panel, .ws-score-panel { flex: 0 0 auto; height: auto; max-height: none; min-width: 0; }
    .ws-words { max-height: none; flex: 0 0 auto; overflow: visible; min-height: auto; }
    .ws-lobby { top: 1vh; padding: 0.9rem 0.7rem 0.8rem; }
    .ws-lobby-code { letter-spacing: 0.06em; font-size: clamp(1.15rem, 4.5vw, 1.6rem); width: 100%; }
    .ws-lobby-url { font-size: clamp(1.15rem, 5vw, 1.8rem); }
    .ws-done { width: min(94vw, 32rem); padding: 1.2rem 1rem; }
}
.ws-split { flex: 0 0 0.7rem; cursor: col-resize; position: relative; touch-action: none; }
.ws-split::after { content: ''; position: absolute; top: 18%; bottom: 18%; left: 0.28rem; width: 0.22rem; border-radius: 999px; background: #cbd5e1; }
.ws-words li { border-radius: 0.75rem; padding: 0.35rem 0.6rem; font-weight: 750; width: auto; display: flex; align-items: center; gap: 0.45rem; }
.ws-clue-img, .ws-clue-thumb { width: 4.2rem; height: 4.2rem; object-fit: cover; border-radius: 0.55rem; background: #fff; }
.ws-list-note { background: transparent !important; color: #64748b; font-weight: 700; }
.ws-list-mode { border: 0; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; }
.ws-list-mode legend { font-weight: 750; width: 100%; margin-bottom: 0.15rem; }
.ws-clue-editor { display: grid; gap: 0.55rem; margin-top: 0.75rem; }
.ws-clue-row { display: grid; grid-template-columns: minmax(5rem, 8rem) minmax(0, 1fr); gap: 0.35rem 0.6rem; align-items: center; }
.ws-clue-row input[type="text"] { width: 100%; border: 1px solid #cbd5e1; border-radius: 0.55rem; padding: 0.4rem 0.55rem; background: #fff; color: #0f172a; }
.dark .ws-clue-row input[type="text"] { background: #0f172a; color: #e2e8f0; border-color: #334155; }
.ws-clue-row input[type="file"] { grid-column: 1 / -1; }
.ws-clue-clear { justify-self: start; border: 0; background: transparent; color: #b91c1c; font-weight: 750; cursor: pointer; }
@media (max-width: 640px) {
    .ws-clue-row { grid-template-columns: 1fr; }
}
.ws-words li.tone-0 { background: #e0e7ff; color: #312e81; }
.ws-words li.tone-1 { background: #fce7f3; color: #9d174d; }
.ws-words li.tone-2 { background: #d1fae5; color: #065f46; }
.ws-words li.tone-3 { background: #fef3c7; color: #92400e; }
.ws-words li.tone-4 { background: #cffafe; color: #155e75; }
.ws-words li.tone-5 { background: #ede9fe; color: #5b21b6; }
.ws-words li.found { text-decoration: line-through; opacity: 0.72; }
.ws-cell.found-0 { background: #bbf7d0; border-color: #166534; }
.ws-cell.found-1 { background: #bfdbfe; border-color: #1d4ed8; }
.ws-cell.found-2 { background: #fde68a; border-color: #b45309; }
.ws-cell.found-3 { background: #fbcfe8; border-color: #be185d; }
.ws-cell.found-4 { background: #ddd6fe; border-color: #6d28d9; }
.ws-score-panel { border-color: #c7d2fe; background: linear-gradient(180deg, #fff, #eef2ff); }
.ws-words-panel { border-color: #fbcfe8; background: linear-gradient(180deg, #fff, #fdf2f8); }
html[data-ws-theme="dark"] .ws-words li.tone-0 { background: #c7d2fe; color: #1e1b4b; }
html[data-ws-theme="dark"] .ws-words li.tone-1 { background: #fbcfe8; color: #831843; }
html[data-ws-theme="dark"] .ws-words li.tone-2 { background: #bbf7d0; color: #14532d; }
html[data-ws-theme="dark"] .ws-words li.tone-3 { background: #fde68a; color: #78350f; }
html[data-ws-theme="dark"] .ws-words li.tone-4 { background: #a5f3fc; color: #155e75; }
html[data-ws-theme="dark"] .ws-words li.tone-5 { background: #ddd6fe; color: #5b21b6; }
html[data-ws-theme="dark"] .ws-words li.found { opacity: 0.5; }
html[data-ws-theme="dark"] .ws-score-panel,
html[data-ws-theme="dark"] .ws-words-panel { background: #262c3a; }
@media (min-width: 721px) {
    body.share-themed:has(#ws-play) { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
    body.share-themed:has(#ws-play) footer { display: none; }
    body.share-themed:has(#ws-play) header { flex: 0 0 auto; }
    .ws-play-main { flex: 1; min-height: 0; width: 100%; max-width: none; overflow: hidden; display: flex; flex-direction: column; padding: 0.55rem 0.75rem 0.45rem; box-sizing: border-box; }
    #ws-play { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
}
.ws-play-main { width: 100%; max-width: none; box-sizing: border-box; }
#ws-play .ws-wait { flex: 1 1 auto; min-height: 0; align-content: center; overflow: auto; }
body:has(#ws-lobby[open]) { overflow: hidden; }
body:has(#ws-lobby[open]) #ws-host-board { display: none; }
.ws-menu { position: fixed; z-index: 90; background: #fff; color: #0f172a; border: 1px solid #e5e7eb; border-radius: 0.7rem; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18); padding: 0.25rem; }
.ws-menu[hidden] { display: none; }
.ws-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: #991b1b; font-weight: 700; padding: 0.45rem 0.7rem; border-radius: 0.5rem; cursor: pointer; }
.ws-menu button:hover { background: #fef2f2; }
dialog.ah-dialog { width: min(96vw, 42rem); max-width: min(96vw, 42rem); max-height: 92dvh; margin: auto; border: 0; border-radius: 1.2rem; padding: 0; background: transparent; overflow: hidden; }
dialog.ah-dialog[open] { display: block; }
.ah-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.ah-panel { background: #fff; border-radius: 1.2rem; padding: 1.1rem 1rem 1rem; max-height: 92dvh; overflow: auto; color: #0f172a; }
.ah-panel h3 { margin: 0; font-size: 1.25rem; }
.ah-lead, .ah-empty { color: #64748b; font-size: 0.92rem; }
.ah-tools { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.55rem; }
.ah-tools button, .ah-mini {
    border: 0; border-radius: 0.6rem; background: #e2e8f0; color: #0f172a;
    font-weight: 800; font-size: 0.78rem; padding: 0.35rem 0.55rem; cursor: pointer;
}
.ah-tools button[disabled] { opacity: 0.45; cursor: default; }
.ah-item { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.45rem; }
.ah-check { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.ah-row, .ah-score { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; text-align: left; border: 1px solid #e5e7eb; background: #fff; border-radius: 0.8rem; padding: 0.65rem 0.75rem; margin-top: 0; color: inherit; }
.ah-row { cursor: pointer; flex: 1; }
.ah-score { margin-top: 0.45rem; min-width: 0; }
.ah-score > span:first-child { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.ah-mark { flex: 0 0 auto; text-align: right; }
.ah-meta { display: block; color: #64748b; font-size: 0.8rem; }
.ah-count { color: #001A72; font-weight: 800; white-space: nowrap; }
.ah-score { padding-top: 0.7rem; padding-bottom: 0.7rem; }
.ah-rank-1 { border-color: #fcd34d; background: linear-gradient(90deg, #fffbeb, #fff); }
.ah-rank-2 { border-color: #cbd5e1; background: linear-gradient(90deg, #f8fafc, #fff); }
.ah-rank-3 { border-color: #fdba74; background: linear-gradient(90deg, #fff7ed, #fff); }
.ah-mark {
    display: inline-flex; align-items: center; justify-content: center; min-width: 5.2rem;
    padding: 0.4rem 0.75rem; border-radius: 999px; font-size: 1.05rem; font-weight: 800;
    font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.ah-mark.is-full { background: #bbf7d0; color: #14532d; }
.ah-mark.is-high { background: #bfdbfe; color: #1e3a8a; }
.ah-mark.is-mid { background: #fde68a; color: #78350f; }
.ah-mark.is-low { background: #fecaca; color: #7f1d1d; }
.ah-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.ah-actions button { border-radius: 0.7rem; padding: 0.55rem 0.8rem; border: 1px solid #d1d5db; background: #fff; font-weight: 700; }
.ah-export { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-right: auto; }
.ah-export a { display: inline-flex; align-items: center; border-radius: 0.7rem; padding: 0.5rem 0.75rem; border: 1px solid #c7d2fe; background: #eef2ff; color: #001A72; font-weight: 800; font-size: 0.82rem; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.ah-export a:hover { background: #e0e7ff; }
#ah-close { background: #001A72; color: #fff; border-color: #001A72; }
.ws-builder-grid { overflow: auto; max-width: 100%; padding-bottom: 0.35rem; }
.ws-builder-grid .ws-grid { width: max-content; }
.ws-builder-grid .ws-cell { width: 1.85rem; height: 1.85rem; font-size: 0.95rem; }
.ws-ai-box { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.ws-ai-box[hidden] { display: none !important; }
.ws-ai-box input { border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.45rem 0.6rem; background: #fff; color: #0f172a; }
.ws-join-solo { background: #fff; color: #001A72; border: 2px solid #001A72; }
html.dark .ws-editor,
html.dark .ws-editor input,
html.dark .ws-editor select,
html.dark .ws-editor textarea,
html.dark .ws-ai-box input,
html.dark .ws-join input {
    background: #111827; color: #f8fafc; border-color: #334155;
}
html.dark .ws-editor { border-color: #334155; }
html.dark .ws-cell { background: #111827; color: #f8fafc; border-color: #334155; }
html.dark .ws-score-name,
html.dark .ws-score-pts,
html.dark .ws-kicker { color: #e0e7ff; }
html.dark .ws-lobby { background: linear-gradient(180deg, #0f172a, #1e1b4b); color: #e5e7eb; }
html.dark .ws-lobby-label { color: #cbd5e1; }
html.dark .ws-lobby-url,
html.dark .ws-lobby-count,
html.dark .ws-lobby-banner { color: #e0e7ff; }
html.dark .ws-lobby-code { background: #020617; color: #e0e7ff; border-color: #93c5fd; }
html.dark .ws-lobby-names li { background: #1e293b; color: #f8fafc; }
html.dark .ws-done { background: #0f172a; color: #e5e7eb; }
html.dark .ws-done h2,
html.dark .ws-done p,
html.dark .ws-done-kicker { color: #e0e7ff; }
html.dark .ws-done-quiet { background: #1e293b; color: #e5e7eb; }
html.dark .ws-menu { background: #1e293b; color: #f8fafc; border-color: #334155; }
html.dark .ws-menu button:hover { background: #3f1d1d; }
html.dark .ah-panel { background: #111827; color: #f8fafc; }
html.dark .ah-lead,
html.dark .ah-empty,
html.dark .ah-meta { color: #cbd5e1; }
html.dark .ah-row,
html.dark .ah-score { background: #1e293b; border-color: #334155; color: #f8fafc; }
html.dark .ah-count { color: #bfdbfe; }
html.dark .ah-rank-1 { background: #78350f; color: #fef3c7; border-color: #fcd34d; }
html.dark .ah-rank-2 { background: #334155; color: #f8fafc; border-color: #cbd5e1; }
html.dark .ah-rank-3 { background: #9a3412; color: #ffedd5; border-color: #fdba74; }
html.dark .ah-actions button { background: #1e293b; color: #e5e7eb; border-color: #334155; }
html.dark .ah-export a,
html[data-ws-theme="dark"] .ah-export a { color: #93c5fd; background: #1e293b; border-color: #334155; }
html.dark #ah-close { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
body.ws-host-page {
    margin: 0; min-height: 100vh; color: #0f172a;
    background:
        radial-gradient(circle at 8% 18%, #dbeafe 0, transparent 26rem),
        radial-gradient(circle at 92% 8%, #fde68a 0, transparent 20rem),
        radial-gradient(circle at 70% 100%, #ddd6fe 0, transparent 24rem),
        #f8fafc;
    font-family: system-ui, sans-serif;
}
.ws-host-bar {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(0, 1.6fr) minmax(12rem, 1.4fr);
    align-items: center; gap: 0.75rem; min-height: 4.35rem;
    padding: 0.65rem 1rem; background: #001A72; color: #fff;
}
.ws-host-brand { display: flex; align-items: center; gap: 0.55rem; color: #fff; text-decoration: none; font-weight: 700; flex: 0 0 auto; }
.ws-host-brand img { width: 2.3rem; height: 2.3rem; border-radius: 999px; object-fit: cover; background: #fff; }
.ws-host-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; text-align: center; font-size: clamp(1rem, 2vw, 1.45rem); font-weight: 800; }
.ws-host-actions { position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.4rem; }
.ws-host-btn {
    appearance: none; -webkit-appearance: none; border: 1px solid rgba(255,255,255,0.28);
    border-radius: 0.7rem; padding: 0.55rem 0.9rem; font-weight: 800; font-size: 0.9rem;
    cursor: pointer; text-decoration: none; color: #fff; background: rgba(255,255,255,0.14);
    pointer-events: auto;
}
.ws-host-btn-start { background: #16a34a; }
.ws-host-btn-end { background: #dc2626; }
.ws-host-btn:disabled { opacity: 0.7; cursor: default; }
.ws-host-count { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 700; color: #e0e7ff; }
.ws-host-count input { width: 4.2rem; border: 0; border-radius: 0.5rem; padding: 0.35rem 0.45rem; color: #0f172a; background: #fff; }
.ws-host-timer-field {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.2rem 0.45rem 0.2rem 0.7rem; border-radius: 999px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28);
    color: #e0e7ff; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.ws-host-timer-field input {
    width: 4.4rem; border: 0; border-radius: 999px; padding: 0.4rem 0.35rem;
    text-align: center; font-size: 1.15rem; font-weight: 800; color: #001A72; background: #fff;
    font-variant-numeric: tabular-nums;
}
.ws-host-timer-field span { text-transform: lowercase; letter-spacing: 0; font-size: 0.8rem; }
.ws-host-clock { margin: 0.7rem 0 0.15rem; }
.ws-host-clock-kicker { margin: 0; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #334155; font-size: clamp(1rem, 2vw, 1.35rem); }
.ws-host-clock-time {
    margin: 0.15rem 0 0; color: #001A72; font-weight: 800; line-height: 0.95;
    font-size: clamp(4.2rem, 16vw, 9rem); font-variant-numeric: tabular-nums;
    font-family: ui-monospace, Consolas, monospace;
}
.ws-host-main {
    min-height: calc(100vh - 4.25rem); display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 1.5rem 1rem 2.5rem; box-sizing: border-box;
}
.ws-host-deck { margin: 0 0 0.85rem; font-size: clamp(1.05rem, 2.2vw, 1.45rem); font-weight: 800; color: #0f172a; }
.ws-host-label { margin: 0; font-size: clamp(1rem, 2.2vw, 1.55rem); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #334155; }
.ws-host-url { margin: 0.35rem 0 0.7rem; font-size: clamp(1.7rem, 4.4vw, 3.2rem); font-weight: 800; color: #001A72; line-height: 1.25; max-width: 96vw; overflow-wrap: anywhere; }
.ws-host-code {
    display: flex; align-items: center; justify-content: center; width: min(96vw, 36rem); box-sizing: border-box;
    margin: 0.35rem auto 1rem; padding: 0.55rem 0.9rem; border-radius: 0.9rem; background: #fff;
    border: 3px solid #001A72; color: #001A72; font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(1.5rem, 3.6vw, 2.45rem); font-weight: 800; letter-spacing: 0.1em; line-height: 1.2;
    box-shadow: 0 10px 24px rgba(0, 26, 114, 0.12);
}
.ws-host-main.is-live { justify-content: flex-start; }
.ws-host-main.is-live .ws-host-code { font-size: clamp(1.15rem, 3vw, 1.7rem); margin-bottom: 0.6rem; }
.ws-spotlight {
    width: min(36rem, 96vw); margin: 1.1rem auto 0; padding: 1.1rem 1.3rem 1.2rem;
    border-radius: 1.2rem; background: linear-gradient(135deg, #f59e0b, #fbbf24 45%, #fde68a);
    color: #431407; box-shadow: 0 18px 40px rgba(245, 158, 11, 0.35);
}
.ws-spotlight-kicker { margin: 0; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.ws-spotlight-name { margin: 0.2rem 0 0; font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; line-height: 1.05; }
.ws-spotlight-meta { margin: 0.25rem 0 0; font-weight: 700; }
.ws-host-board {
    list-style: none; width: min(40rem, 96vw); margin: 1rem auto 0; padding: 0;
    display: flex; flex-direction: column; gap: 0.45rem; text-align: left;
}
.ws-host-row {
    display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 0.7rem;
    background: #fff; color: #0f172a; border-radius: 0.9rem; padding: 0.7rem 0.9rem;
    font-weight: 800; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.ws-host-rank { color: #64748b; font-variant-numeric: tabular-nums; }
.ws-host-row-pts { font-variant-numeric: tabular-nums; color: #001A72; }
.ws-host-row.is-done { box-shadow: inset 0 0 0 2px #16a34a, 0 8px 18px rgba(15, 23, 42, 0.08); }
.ws-host-row.is-spotlight {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow: inset 0 0 0 2px #f59e0b, 0 10px 22px rgba(245, 158, 11, 0.2);
}
.ws-score-row.is-spotlight { box-shadow: inset 0 0 0 2px #f59e0b; }
.ws-host-wait { margin: 0.2rem 0 0; font-weight: 800; font-size: clamp(1.05rem, 2vw, 1.4rem); color: #001A72; }
.ws-host-banner { margin: 0.45rem 0 0; font-weight: 800; color: #166534; font-size: 1.15rem; }
.ws-host-msg { margin: 0.35rem 0 0; font-weight: 700; color: #991b1b; min-height: 0; }
.ws-host-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; list-style: none; margin: 1rem 0 0; padding: 0; max-width: 52rem; }
.ws-host-names li span { white-space: normal; overflow-wrap: anywhere; }
.ws-host-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; margin: 1.1rem 0 0; }
.ws-host-tools .ws-host-btn { color: #001A72; background: #fff; border-color: #001A72; min-width: 7.5rem; }
.ws-host-tools .ws-host-btn-start { background: #16a34a; color: #fff; border-color: #15803d; }
.ws-host-tools .ws-host-btn-end { background: #dc2626; color: #fff; border-color: #b91c1c; }
.willow-modal-backdrop {
    position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(15, 23, 42, 0.55);
}
.willow-modal-backdrop.hidden { display: none !important; }
.willow-modal-panel {
    width: min(28rem, 100%); background: #fff; color: #0f172a; border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden;
}
.willow-modal-header { padding: 1.25rem 1.5rem 0.4rem; }
.willow-modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.willow-modal-body { padding: 0.4rem 1.5rem 1rem; }
.willow-modal-body p { margin: 0; color: #475569; line-height: 1.5; }
.willow-modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.9rem 1.5rem 1.2rem; border-top: 1px solid #e5e7eb; }
.willow-modal-footer button { border: 0; border-radius: 0.7rem; padding: 0.65rem 1rem; font-weight: 800; cursor: pointer; }
#willow-confirm-cancel { background: #e2e8f0; color: #0f172a; }
#willow-confirm-ok { background: #001A72; color: #fff; }
#willow-confirm-ok.is-danger { background: #dc2626; }
html[data-ws-theme="dark"] .willow-modal-panel,
html.dark .willow-modal-panel { background: #111827; color: #f8fafc; }
html[data-ws-theme="dark"] .willow-modal-body p,
html.dark .willow-modal-body p { color: #cbd5e1; }
html[data-ws-theme="dark"] .willow-modal-footer,
html.dark .willow-modal-footer { border-color: #334155; }
html[data-ws-theme="dark"] #willow-confirm-cancel,
html.dark #willow-confirm-cancel { background: #1e293b; color: #e5e7eb; }
.ah-dialog:not([open]) { display: none; }
@media (max-width: 860px) {
    .ws-host-bar { grid-template-columns: 1fr; justify-items: center; }
    .ws-host-actions { justify-content: center; }
}
.ws-host-names li.is-in { box-shadow: inset 0 0 0 2px #16a34a, 0 6px 16px rgba(15, 23, 42, 0.08); }
html[data-ws-theme="dark"] body.ws-host-page {
    color: #e5e7eb;
    background:
        radial-gradient(circle at 8% 18%, #1e3a8a 0, transparent 26rem),
        radial-gradient(circle at 90% 12%, #4c1d95 0, transparent 22rem),
        #0b1224;
}
html[data-ws-theme="dark"] .ws-host-deck,
html[data-ws-theme="dark"] .ws-host-label { color: #cbd5e1; }
html[data-ws-theme="dark"] .ws-host-url,
html[data-ws-theme="dark"] .ws-host-wait { color: #e0e7ff; }
html[data-ws-theme="dark"] .ws-host-code { background: #020617; color: #f8fafc; border-color: #93c5fd; }
html[data-ws-theme="dark"] .ws-host-banner { color: #86efac; }
html[data-ws-theme="dark"] .ws-host-clock-kicker { color: #cbd5e1; }
html[data-ws-theme="dark"] .ws-host-clock-time { color: #93c5fd; }
html[data-ws-theme="dark"] .ws-host-msg { color: #fca5a5; }
html[data-ws-theme="dark"] .ws-host-names li { background: #1e293b; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-row { background: #1e293b; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-row-pts { color: #93c5fd; }
html[data-ws-theme="dark"] .ws-host-row.is-spotlight { background: #3b2a0b; color: #fde68a; }
html[data-ws-theme="dark"] .ws-spotlight { color: #431407; }
html[data-ws-theme="dark"] .ws-host-tools .ws-host-btn { background: #1e293b; color: #e0e7ff; border-color: #93c5fd; }
html[data-ws-theme="dark"] .ws-host-tools .ws-host-btn-start { background: #16a34a; color: #fff; border-color: #86efac; }
html[data-ws-theme="dark"] .ws-host-tools .ws-host-btn-end { background: #dc2626; color: #fff; border-color: #fca5a5; }
.ws-clock-ico { display: inline-block; vertical-align: -0.25em; flex: 0 0 auto; }
.ws-host-timer-field label { display: inline-flex; align-items: center; gap: 0.35rem; }
.ws-host-clock-kicker { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }
.ws-wait {
    display: grid; justify-items: center; align-content: center; gap: 0.85rem; text-align: center;
    font-weight: 800; font-size: clamp(1.05rem, 2.4vw, 1.4rem); color: #001A72;
}
.ws-joke-card {
    width: min(40rem, 100%); margin: 0.15rem 0 0; padding: 0.85rem 1.15rem 1rem;
    border-radius: 1rem; background: #fff; border: 1px solid #dbe3f0;
    box-shadow: 0 10px 24px rgba(0, 26, 114, 0.06);
}
.ws-joke-kicker {
    margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 800; color: #64748b;
}
.ws-joke {
    margin: 0; min-height: 2.8rem; font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    line-height: 1.4; color: #001A72; transition: opacity 0.24s ease;
}
.ws-joke.is-out { opacity: 0; }
.ws-wait-clock {
    display: inline-flex; align-items: center; gap: 0.55rem;
    font-size: clamp(2.6rem, 11vw, 4.8rem); font-weight: 800; color: #001A72;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.ws-wait-clock .ws-clock-ico { width: 2.4rem; height: 2.4rem; }
.ws-report { margin: 1.15rem 0 0; }
.ws-report-kicker { margin: 0; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: #001A72; font-size: 0.85rem; }
.ws-report-list { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 1.05rem; }
.ws-report-name { margin: 0; font-weight: 800; font-size: clamp(1.15rem, 3vw, 1.5rem); color: #0f172a; }
.ws-report-avg {
    margin: 0.1rem 0 0; font-weight: 800; line-height: 0.9;
    font-size: clamp(3.8rem, 15vw, 6.8rem); color: #001A72; font-variant-numeric: tabular-nums;
}
.ws-report-label { margin: 0.2rem 0 0; font-weight: 800; color: #64748b; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; }
.ws-link-box {
    margin-top: 0.4rem; padding: 0.95rem 1rem 1rem; border-radius: 0.95rem;
    border: 1px solid #dbe3f0; background: #f8fafc;
}
.ws-link-box h2 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.ws-link-box > p { margin: 0.35rem 0 0.8rem; font-size: 0.9rem; color: #475569; }
.ws-link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.ws-link-item {
    display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.7rem; border-radius: 0.75rem; background: #fff; border: 1px solid #e2e8f0;
}
.ws-link-item.is-start { background: #e0e7ff; border-color: #c7d2fe; }
.ws-link-num { font-weight: 800; color: #001A72; font-variant-numeric: tabular-nums; }
.ws-link-title { font-weight: 700; color: #0f172a; }
.ws-link-title em { font-style: normal; font-weight: 600; color: #475569; font-size: 0.82rem; }
.ws-link-tools { display: inline-flex; gap: 0.3rem; }
.ws-link-move, .ws-link-remove {
    border: 1px solid #cbd5e1; border-radius: 0.5rem; background: #fff; color: #0f172a;
    font-weight: 800; font-size: 0.78rem; padding: 0.25rem 0.5rem; cursor: pointer;
}
.ws-link-remove {
    width: 2rem; height: 2rem; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #dc2626; border-color: #fecaca;
}
.ws-link-remove svg { width: 1rem; height: 1rem; display: block; }
.ws-link-remove:hover { background: #fef2f2; }
.ws-link-empty { margin: 0.6rem 0 0; font-size: 0.88rem; color: #64748b; }
.ws-link-add { margin-top: 0.75rem; }
.ws-link-add label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.35rem; }
.ws-link-add-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ws-link-add-row select { flex: 1 1 14rem; border: 1px solid #cbd5e1; border-radius: 0.65rem; padding: 0.5rem 0.65rem; }
html.dark .ws-link-box { background: #111827; border-color: #334155; }
html.dark .ws-link-box h2, html.dark .ws-link-title { color: #e5e7eb; }
html.dark .ws-link-box > p, html.dark .ws-link-title em, html.dark .ws-link-empty { color: #94a3b8; }
html.dark .ws-link-item { background: #1e293b; border-color: #334155; }
html.dark .ws-link-item.is-start { background: #1e3a8a; border-color: #3b82f6; }
html.dark .ws-link-move, html.dark .ws-link-add-row select { background: #0f172a; color: #e5e7eb; border-color: #475569; }
html.dark .ws-link-remove { background: #0f172a; color: #fca5a5; border-color: #7f1d1d; }
html.dark .ws-link-remove:hover { background: #3f1d1d; }
html[data-ws-theme="dark"] .ws-wait,
html[data-ws-theme="dark"] .ws-wait-clock,
html[data-ws-theme="dark"] .ws-joke { color: #93c5fd; }
html[data-ws-theme="dark"] .ws-joke-card { background: #1e293b; border-color: #334155; }
html[data-ws-theme="dark"] .ws-joke-kicker { color: #cbd5e1; }
html[data-ws-theme="dark"] .ws-report-kicker,
html[data-ws-theme="dark"] .ws-report-avg { color: #93c5fd; }
html[data-ws-theme="dark"] .ws-report-name { color: #e8eef6; }
html[data-ws-theme="dark"] .ws-report-label { color: #94a3b8; }

#ws-host-board { max-width: none; width: 100%; }
.ws-host-race {
    width: min(64rem, 100%);
    margin: 0.35rem auto 0;
    overflow-x: auto;
}
.ws-host-race[hidden],
.ws-board-tools[hidden],
.ws-rename[hidden] { display: none !important; }
.ws-board-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.85rem 0 0.15rem;
}
.ws-board-tools button {
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}
.ws-board-tools button.is-on { background: #001A72; color: #fff; }
.ws-board-tools button:disabled { opacity: 0.4; cursor: default; }
.ws-board-tools span { font-weight: 800; min-width: 3rem; text-align: center; color: #0f172a; }
.ws-host-board {
    width: 100%;
    max-width: none;
    display: grid;
    gap: 0.45rem;
    zoom: var(--ws-board-zoom, 1);
}
.ws-lane {
    display: grid;
    grid-template-columns: minmax(9rem, max-content) minmax(5rem, 1fr) max-content;
    gap: 0.45rem 0.55rem;
    align-items: center;
    text-align: left;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.55rem 0.75rem;
}
.ws-lane-name { font-weight: 800; overflow: visible; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; max-width: 24rem; color: #0f172a; }
.ws-lane-meta { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-lane-rail {
    position: relative;
    height: 1.7rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.ws-lane-rail::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 3px;
    background: #001A72;
}
.ws-lane-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #001A72, #2563eb);
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding-right: 0.45rem;
    box-sizing: border-box;
}
.ws-lane.is-done .ws-lane-fill { background: linear-gradient(90deg, #166534, #22c55e); }
.ws-lane.is-spotlight { border-color: #f5d76e; box-shadow: inset 4px 0 0 #FFD700; }
.ws-lane.is-spotlight .ws-lane-rail { box-shadow: inset 0 0 0 2px #f59e0b; }
.ws-lane-meta { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: #001A72; }
.ws-lane-card { display: none; font-weight: 800; color: #001A72; }
.ws-lane, .ws-host-names li { cursor: context-menu; }
.ws-lane-actions { display: none !important; }
.ws-ctx {
    position: fixed; z-index: 80; min-width: 12.5rem; background: #fff; color: #0f172a;
    border-radius: 0.9rem; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2); padding: 0.35rem;
}
.ws-ctx[hidden] { display: none !important; }
.ws-ctx-name { margin: 0; padding: 0.45rem 0.6rem 0.2rem; font-weight: 800; }
.ws-ctx button {
    display: block; width: 100%; text-align: left; border: 0; background: transparent;
    border-radius: 0.6rem; padding: 0.5rem 0.6rem; font-weight: 700; cursor: pointer; color: #0f172a;
}
.ws-ctx button:hover { background: #eef2ff; }
.ws-ctx button.ws-ctx-danger { color: #b91c1c; }
.ws-lane-actions { grid-column: 1 / -1; display: none !important; flex-wrap: wrap; gap: 0.3rem; }
.ws-lane-actions button,
.ws-host-names .ws-lane-actions button {
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    cursor: pointer;
}
.ws-host-race[data-view="cards"] .ws-host-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.65rem;
}
.ws-host-race[data-view="cards"] .ws-lane {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.8rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.75rem 0.9rem;
}
.ws-host-race[data-view="cards"] .ws-lane-rail,
.ws-host-race[data-view="cards"] .ws-lane-meta { display: none; }
.ws-host-race[data-view="cards"] .ws-lane-card { display: inline; }
.ws-host-race[data-view="cards"] .ws-lane-actions { width: 100%; }
.ws-host-names li {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    max-width: 100%;
    border-radius: 1rem;
    background: #fff;
    color: #0f172a;
    padding: 0.4rem 0.85rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.ws-rename {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
}
.ws-rename-card {
    width: min(24rem, 100%);
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: #0f172a;
    border-radius: 1rem;
    padding: 1.2rem 1.15rem 1.1rem;
    text-align: left;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.ws-rename-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #001A72;
}
.ws-rename-card h2 { margin: 0 0 0.7rem; font-size: 1.25rem; }
.ws-rename-card input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 0.7rem;
    padding: 0.6rem 0.7rem;
    font: inherit;
}
.ws-rename-card button {
    margin-top: 0.7rem;
    border: 0;
    border-radius: 0.7rem;
    background: #001A72;
    color: #fff;
    font-weight: 800;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}
.ws-rename-error { margin: 0.45rem 0 0; color: #991b1b; font-weight: 700; }
html[data-ws-theme="dark"] .ws-board-tools button,
html.dark .ws-board-tools button { background: #1e293b; color: #e5e7eb; }
html[data-ws-theme="dark"] .ws-board-tools button.is-on,
html.dark .ws-board-tools button.is-on { background: #93c5fd; color: #0f172a; }
html[data-ws-theme="dark"] .ws-board-tools span,
html.dark .ws-board-tools span,
html[data-ws-theme="dark"] .ws-lane-meta,
html[data-ws-theme="dark"] .ws-lane-card { color: #93c5fd; }
html[data-ws-theme="dark"] .ws-lane-rail { background: #334155; }
html[data-ws-theme="dark"] .ws-lane,
html.dark .ws-lane { background: #1e293b; border-color: #334155; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-lane-name,
html.dark .ws-lane-name { color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-race[data-view="cards"] .ws-lane { background: #1e293b; border-color: #334155; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-lane-actions button,
html[data-ws-theme="dark"] .ws-host-names .ws-lane-actions button { background: #334155; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-ctx,
html.dark .ws-ctx { background: #1e293b; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-ctx button,
html.dark .ws-ctx button { color: #f8fafc; }
html[data-ws-theme="dark"] .ws-ctx button:hover,
html.dark .ws-ctx button:hover { background: #334155; }
html[data-ws-theme="dark"] .ws-ctx button.ws-ctx-danger,
html.dark .ws-ctx button.ws-ctx-danger { color: #fca5a5; }
html[data-ws-theme="dark"] .ws-rename-card { background: #1e293b; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-rename-card input { background: #0f172a; color: #f8fafc; border-color: #475569; }
@media (max-width: 720px) {
    .ws-host-names { width: min(100%, 28rem); }
    .ws-host-names li { width: 100%; justify-content: space-between; }
    .ws-lane { grid-template-columns: minmax(0, 1fr); }
    .ws-lane-name { white-space: normal; }
    .ws-lane-rail,
    .ws-lane-meta { grid-column: 1 / -1; }
    .ws-lane-meta { text-align: left; }
    .ws-host-race[data-view="cards"] .ws-host-board { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .ws-lane-fill { transition: none; }
}
.ws-lane .assess-teacher-retry,
.ws-host-names .assess-teacher-retry { display: none !important; }
.ws-host-board .ws-lane:nth-child(4n + 1) { background: #e7f0ff; border-color: #c5d7f6; }
.ws-host-board .ws-lane:nth-child(4n + 2) { background: #f3eefe; border-color: #ddd0f6; }
.ws-host-board .ws-lane:nth-child(4n + 3) { background: #e7f6ee; border-color: #c6e8d4; }
.ws-host-board .ws-lane:nth-child(4n + 4) { background: #fff1e4; border-color: #f3d7bc; }
.ws-host-board .ws-lane:nth-child(4n + 1) .ws-lane-rail { background: #d4e4fb; }
.ws-host-board .ws-lane:nth-child(4n + 2) .ws-lane-rail { background: #e4d9f8; }
.ws-host-board .ws-lane:nth-child(4n + 3) .ws-lane-rail { background: #d3eedf; }
.ws-host-board .ws-lane:nth-child(4n + 4) .ws-lane-rail { background: #f8e0c8; }
.ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 1) { background: #e7f0ff; }
.ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 2) { background: #f3eefe; }
.ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 3) { background: #e7f6ee; }
.ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 4) { background: #fff1e4; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 1),
html.dark .ws-host-board .ws-lane:nth-child(4n + 1) { background: #24344a; border-color: #3d5270; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 2),
html.dark .ws-host-board .ws-lane:nth-child(4n + 2) { background: #2c2840; border-color: #4a4368; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 3),
html.dark .ws-host-board .ws-lane:nth-child(4n + 3) { background: #1e332c; border-color: #345446; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 4),
html.dark .ws-host-board .ws-lane:nth-child(4n + 4) { background: #3a2e24; border-color: #5c4836; color: #f8fafc; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 1) .ws-lane-rail { background: #1a283c; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 2) .ws-lane-rail { background: #231f33; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 3) .ws-lane-rail { background: #162820; }
html[data-ws-theme="dark"] .ws-host-board .ws-lane:nth-child(4n + 4) .ws-lane-rail { background: #2c221b; }
html[data-ws-theme="dark"] .ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 1) { background: #24344a; }
html[data-ws-theme="dark"] .ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 2) { background: #2c2840; }
html[data-ws-theme="dark"] .ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 3) { background: #1e332c; }
html[data-ws-theme="dark"] .ws-host-race[data-view="cards"] .ws-host-board .ws-lane:nth-child(4n + 4) { background: #3a2e24; }
