/* Shared soft desktop interface. */
:root {
    color-scheme:light;
    --c-page2:#F5F6F8;
    --surface:#fff;
    --surface-soft:#F8F9FB;
    --surface-muted:#F2F5F9;
    --surface-hover:#F1F5FA;
    --t-strong:#252932;
    --t-body:#3E4550;
    --t-normal:#505A68;
    --t-mid:#586475;
    --t-muted:#626E7E;
    --t-faint:#687383;
    --t-on-color:#fff;
    --ln-soft:#E8EBEF;
    --ln-strong:#D9DFE7;
    --ln-faint:#F0F2F5;
    --a-accent:#3478B7;
    --a-accent-hover:#2C6CA6;
    --a-accent-ink:#316FA8;
    --blue-soft:#EDF5FE;
    --mint-soft:#EDF8F0;
    --mint-ink:#397856;
    --lilac-soft:#F4EFFA;
    --lilac-ink:#8564A5;
    --yellow-soft:#FCF5E6;
    --yellow-ink:#896C2C;
    --rose-soft:#FBF1F1;
    --rose-ink:#A65A60;
    --s-ok:#397856;
    --s-warn:#896C2C;
    --s-off:#626E7E;
    --lime:#4388C9;
    --lime-ink:#fff;
    --shadow-panel:0 3px 16px rgba(31,44,66,.025);
    --shadow-popover:0 10px 32px rgba(31,44,66,.09)
}

html.dark-theme {
    color-scheme:dark;
    --c-page2:#191D24;
    --surface:#222730;
    --surface-soft:#272D37;
    --surface-muted:#2C3340;
    --surface-hover:#303948;
    --t-strong:#EDF0F6;
    --t-body:#D4DAE4;
    --t-normal:#C0C9D6;
    --t-mid:#B1BED0;
    --t-muted:#A0ACBD;
    --t-faint:#99A6B9;
    --ln-soft:#343C49;
    --ln-strong:#49566B;
    --ln-faint:#2D3540;
    --a-accent:#80B4E1;
    --a-accent-hover:#9CC7EB;
    --a-accent-ink:#A1CCEF;
    --blue-soft:#283C50;
    --mint-soft:#273E35;
    --mint-ink:#94CCAA;
    --lilac-soft:#3A304A;
    --lilac-ink:#C6ACDF;
    --yellow-soft:#443C2C;
    --yellow-ink:#E0C88E;
    --rose-soft:#443137;
    --rose-ink:#DCA5AC;
    --s-ok:#94CCAA;
    --s-warn:#E0C88E;
    --s-off:#A0ACBD;
    --lime:#80B4E1;
    --lime-ink:#1D2B3A;
    --t-on-color:#1D2B3A;
    --shadow-panel:0 3px 16px rgba(0,0,0,.05);
    --shadow-popover:0 10px 32px rgba(0,0,0,.18)
}

* {
    box-sizing:border-box
}

html {
    background:var(--c-page2);
    scrollbar-gutter:stable
}

body {
    margin:0;
    min-width:320px;
    color:var(--t-body);
    background:var(--c-page2);
    font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
    -webkit-font-smoothing:antialiased
}

h1,h2,h3,p {
    margin:0
}

h1,h2,h3 {
    color:var(--t-strong)
}

a {
    color:inherit;
    text-decoration:none
}

button,input,select {
    font:inherit
}

button,a,input,select,summary {
    -webkit-tap-highlight-color:transparent
}

button {
    cursor:pointer;
    touch-action:manipulation
}

button,a,input,select {
    transition:color .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease
}

button:disabled,input:disabled,select:disabled {
    opacity:.48;
    cursor:not-allowed
}

button:not(:disabled):active,.mode-tabs a:active {
    translate:0 1px
}

:where(button,a,summary,[tabindex]):focus-visible {
    outline:2px solid var(--a-accent-ink);
    outline-offset:3px
}

input:focus-visible,select:focus-visible {
    outline:2px solid var(--a-accent-ink);
    outline-offset:2px;
    border-color:var(--a-accent);
    box-shadow:none
}

::selection { background:var(--blue-soft); color:var(--t-strong); }
input,textarea { caret-color:var(--a-accent-ink); }

[hidden] {
    display:none!important
}

.ui-icon {
    width:19px;
    height:19px;
    flex:0 0 auto;
    vertical-align:middle
}

.top-header-bar {
    position:relative;
    z-index:80;
    background:var(--surface);
    border-bottom:1px solid var(--ln-soft)
}

/* Floating music stays draggable over navigation; an open settings panel stays above it. */
.top-header-bar:has(.preferences-panel:not([hidden])) {
    z-index:100
}

.header-inner {
    max-width:1264px;
    min-height:74px;
    padding:14px 32px;
    margin:auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px
}

.header-left {
    display:inline-flex;
    align-items:center;
    gap:11px;
    flex:0 0 auto
}

.brand-icon {
    width:36px;
    height:36px;
    border-radius:11px;
    display:grid;
    place-items:center;
    color:var(--a-accent);
    background:var(--blue-soft)
}

.brand-icon .ui-icon {
    width:23px;
    height:23px
}

.header-title {
    display:flex;
    align-items:baseline;
    gap:11px;
    font-size:19px;
    font-weight:750;
    color:var(--t-strong);
    letter-spacing:.3px
}

.brand-caption {
    color:var(--t-muted);
    font-size:10px;
    font-weight:500;
    letter-spacing:1.2px
}

.header-right,.site-nav {
    display:flex;
    align-items:center;
    gap:8px
}

.header-right {
    gap:22px
}

.nav-btn-capsule {
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:8px 13px;
    border-radius:8px;
    color:var(--t-muted);
    font-size:13px;
    font-weight:550;
    min-height:40px
}

.nav-btn-capsule:hover {
    background:var(--surface-soft);
    color:var(--t-strong)
}

.nav-btn-capsule.is-current {
    background:var(--blue-soft);
    color:var(--a-accent-ink)
}

.nav-btn-capsule .ui-icon {
    width:17px;
    height:17px
}

.app-main {
    width:min(100%,1264px);
    padding:36px 32px 24px;
    margin:auto
}

.page-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    margin-bottom:27px
}

.eyebrow {
    color:var(--t-muted);
    font-size:12px;
    margin-bottom:6px;
    letter-spacing:.5px
}

h1 {
    font-size:28px;
    font-weight:650;
    line-height:1.4;
    letter-spacing:-.6px
}

.page-subtitle {
    margin-top:7px;
    font-size:14px;
    color:var(--t-muted)
}

.mode-tabs {
    padding:4px;
    border:1px solid var(--ln-soft);
    border-radius:10px;
    background:var(--surface-muted);
    display:inline-flex;
    flex:0 0 auto;
    gap:3px
}

.mode-tabs a {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:8px 14px;
    border:1px solid transparent;
    border-radius:7px;
    font-size:13px;
    color:var(--t-muted)
}

.mode-tabs .ui-icon {
    width:16px;
    height:16px
}

.mode-tabs a:hover {
    color:var(--t-strong)
}

.mode-tabs a.is-active {
    color:var(--a-accent-ink);
    background:var(--surface);
    border-color:var(--ln-soft);
    box-shadow:0 1px 3px rgba(31,44,66,.04)
}

.game-layout {
    display:grid;
    grid-template-columns:minmax(0,1fr) 248px;
    gap:28px;
    align-items:start
}

.game-panel,.search-panel,.data-panel {
    min-width:0;
    background:var(--surface);
    border:1px solid var(--ln-soft);
    border-radius:16px;
    box-shadow:var(--shadow-panel)
}

.panel-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:19px 24px;
    border-bottom:1px solid var(--ln-soft)
}

.panel-title {
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:15px;
    font-weight:600;
    color:var(--t-strong)
}

.panel-title .ui-icon {
    color:var(--a-accent)
}

.round-tag {
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:11px;
    color:var(--t-muted)
}

.round-tag>span {
    width:6px;
    height:6px;
    border-radius:50%;
    background:#8BAF98
}

.stats-strip {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    padding:23px 24px
}

.stat-item {
    display:flex;
    align-items:center;
    gap:11px;
    padding-left:18px;
    border-left:1px solid var(--ln-soft)
}

.stat-item:first-child {
    padding-left:0;
    border-left:0
}

.stat-icon {
    display:grid;
    place-items:center;
    width:38px;
    height:38px;
    border-radius:11px;
    flex:0 0 auto
}

.blue {
    color:var(--a-accent-ink);
    background:var(--blue-soft)
}

.mint {
    color:var(--mint-ink);
    background:var(--mint-soft)
}

.lilac {
    color:var(--lilac-ink);
    background:var(--lilac-soft)
}

.stat-label {
    display:block;
    color:var(--t-muted);
    font-size:12px
}

.stat-value {
    display:block;
    color:var(--t-strong);
    font-size:24px;
    line-height:1.35;
    font-variant-numeric:tabular-nums
}

.stat-value strong {
    font-weight:650
}

.stat-denominator {
    font-size:14px;
    color:var(--t-muted);
    font-weight:400
}

.board-area {
    padding:0 24px 23px;
    min-width:0
}

.board-toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:15px 0 10px;
    border-top:1px solid var(--ln-soft)
}

.board-toolbar h2 {
    font-size:13px;
    font-weight:550;
    color:var(--t-mid)
}

.color-legend {
    display:inline-flex;
    align-items:center;
    gap:15px;
    font-size:11px;
    color:var(--t-muted)
}

.color-legend span {
    display:flex;
    align-items:center;
    gap:5px
}

.legend-dot {
    display:inline-block;
    width:7px;
    height:7px;
    border-radius:50%;
    flex:0 0 auto
}

.green-dot {
    background:#80AF91
}

.yellow-dot {
    background:#D5B96D
}

.grey-dot {
    background:#B8C0CB
}

.blue-dot {
    background:var(--a-accent)
}

.game-empty {
    padding:13px 8px 20px;
    text-align:center
}

.game-empty h3 {
    font-size:16px;
    font-weight:550;
    margin-top:5px
}

.game-empty>p {
    color:var(--t-muted);
    font-size:13px;
    margin-top:7px
}

.clue-illustration {
    position:relative;
    width:240px;
    height:148px;
    margin:0 auto 10px
}

.mystery-card {
    position:absolute;
    z-index:1;
    top:14px;
    left:79px;
    display:flex;
    align-items:center;
    flex-direction:column;
    width:84px;
    height:114px;
    padding-top:13px;
    border:1px solid var(--ln-strong);
    background:var(--surface);
    border-radius:13px;
    box-shadow:0 5px 12px rgba(50,78,110,.045);
    rotate:-5deg
}

.mystery-avatar {
    display:grid;
    place-items:center;
    width:39px;
    height:39px;
    border-radius:50%;
    background:var(--blue-soft);
    color:#9EB7D1
}

.mystery-avatar .ui-icon {
    width:24px;
    height:24px
}

.mystery-id {
    margin-top:8px;
    color:var(--a-accent);
    font-weight:650;
    font-size:14px;
    letter-spacing:4px
}

.mystery-line {
    width:35px;
    height:3px;
    margin-top:7px;
    border-radius:2px;
    background:var(--ln-soft)
}

.clue-tile {
    position:absolute;
    display:grid;
    place-items:center;
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--ln-soft)
}

.tile-left {
    left:33px;
    top:55px;
    color:var(--mint-ink);
    background:var(--mint-soft);
    rotate:-12deg
}

.tile-right {
    right:28px;
    top:39px;
    color:var(--lilac-ink);
    background:var(--lilac-soft);
    rotate:10deg
}

.clue-orbit {
    position:absolute;
    width:180px;
    height:108px;
    border:1px dashed var(--ln-strong);
    border-radius:50%;
    left:30px;
    top:24px;
    rotate:-17deg
}

.orbit-two {
    width:112px;
    height:112px;
    left:65px;
    top:14px;
    rotate:26deg;
    border-color:var(--ln-soft)
}

.illustration-dot {
    position:absolute;
    width:5px;
    height:5px;
    border-radius:50%
}

.dot-one {
    left:64px;
    top:17px;
    background:#BDD1E6
}

.dot-two {
    right:48px;
    bottom:21px;
    background:#C9B9DF
}

.history-scroll {
    overflow-x:auto;
    border-radius:8px;
    scrollbar-width:thin;
    scrollbar-color:var(--ln-strong) transparent
}

.history-scroll:has(#history-container:empty) {
    display:none
}

#history-container {
    min-width:680px;
    padding:2px
}

.history-header,.guess-row {
    display:grid;
    grid-template-columns:minmax(96px,1.2fr) repeat(4,minmax(60px,1fr)) minmax(90px,1.1fr) minmax(70px,1fr) minmax(90px,1.1fr);
    gap:6px;
    align-items:stretch
}

.history-header {
    margin:4px 0 8px
}

.header-col {
    padding:8px 2px;
    font-size:12px;
    text-align:center;
    color:var(--t-muted);
    white-space:nowrap
}

.guess-row {
    margin-bottom:8px
}

.attr-card {
    display:flex;
    align-items:center;
    justify-content:center;
    padding:15px 5px;
    min-height:52px;
    border:1px solid transparent;
    border-radius:8px;
    font-size:13px;
    font-weight:550;
    text-align:center;
    overflow-wrap:anywhere
}

.green {
    background:var(--mint-soft);
    color:var(--mint-ink);
    border-color:color-mix(in srgb,var(--mint-ink) 12%,transparent)
}

.yellow {
    background:var(--yellow-soft);
    color:var(--yellow-ink);
    border-color:color-mix(in srgb,var(--yellow-ink) 12%,transparent)
}

.grey {
    background:var(--surface-muted);
    color:var(--t-mid);
    border-color:var(--ln-soft)
}

.player-id-card {
    background:var(--surface);
    color:var(--t-strong);
    border-color:var(--ln-strong);
    font-weight:650
}

.mobile-scroll-hint {
    display:none;
    font-size:11px;
    color:var(--t-muted);
    padding-top:8px
}

.guess-composer {
    padding:20px 24px 18px;
    border-top:1px solid var(--ln-soft)
}

.guess-composer>label,.field-label {
    display:block;
    font-size:14px;
    color:var(--t-strong);
    font-weight:550;
    margin-bottom:10px
}

.input-area {
    display:flex;
    align-items:stretch;
    gap:10px
}

.input-wrapper {
    position:relative;
    flex:1;
    min-width:0
}

.input-icon {
    position:absolute;
    left:14px;
    top:50%;
    translate:0 -50%;
    color:var(--t-muted);
    display:flex;
    pointer-events:none
}

#player-input,#search-input,.kd-search,.kd-select {
    width:100%;
    min-height:46px;
    padding:11px 14px 11px 42px;
    border:1px solid var(--ln-strong);
    border-radius:9px;
    color:var(--t-strong);
    background:var(--surface);
    font-size:14px;
    line-height:1.6;
    outline:none
}

input::placeholder {
    color:var(--t-muted);
    opacity:1
}

#player-input:hover:not(:disabled),#search-input:hover:not(:disabled) {
    border-color:#B4C7D9
}

.primary-button,#submit-btn,#search-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    flex:0 0 auto;
    min-height:46px;
    padding:11px 20px;
    border:1px solid transparent;
    border-radius:9px;
    background:var(--a-accent);
    color:var(--t-on-color);
    font-size:14px;
    font-weight:550;
    line-height:1.6
}

.primary-button:hover:not(:disabled),#submit-btn:hover:not(:disabled),#search-btn:hover:not(:disabled) {
    background:var(--a-accent-hover)
}

.composer-meta {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:10px;
    font-size:11px;
    color:var(--t-muted)
}

kbd {
    padding:1px 5px;
    border:1px solid var(--ln-strong);
    border-radius:4px;
    background:var(--surface-soft);
    font-family:inherit;
    font-size:10px
}

.game-status {
    margin-top:12px;
    font-size:12px;
    color:var(--t-mid);
    line-height:1.7
}

.autocomplete-items {
    position:absolute;
    z-index:50;
    top:calc(100% + 7px);
    left:0;
    right:0;
    max-height:264px;
    overflow-y:auto;
    padding:5px;
    border:1px solid var(--ln-soft);
    border-radius:10px;
    background:var(--surface);
    box-shadow:var(--shadow-popover)
}

.autocomplete-item {
    min-height:44px;
    padding:11px 10px;
    border-radius:6px;
    cursor:pointer;
    color:var(--t-body);
    font-size:13px;
    line-height:1.6
}

.autocomplete-item:hover,.autocomplete-item.active {
    background:var(--blue-soft);
    color:var(--a-accent-ink)
}

.autocomplete-item strong {
    font-weight:600
}

.autocomplete-meta {
    margin-left:5px;
    font-size:12px;
    color:var(--t-muted)
}

/* Supporting information, player cards, dialogs and statistics. */
.game-sidebar {
    min-width:0;
    padding-top:15px
}

.guide-section>h2 {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    font-weight:600
}

.guide-section>h2 .ui-icon {
    color:var(--t-muted);
    width:17px;
    height:17px
}

.guide-steps {
    list-style:none;
    padding:0;
    margin:25px 0 21px
}

.guide-steps li {
    display:flex;
    align-items:flex-start;
    gap:11px;
    margin-bottom:23px
}

.step-number {
    display:grid;
    place-items:center;
    width:25px;
    height:25px;
    flex:0 0 auto;
    border:1px solid var(--ln-strong);
    border-radius:8px;
    color:var(--t-muted);
    font-size:10px;
    font-variant-numeric:tabular-nums
}

.guide-steps h3 {
    margin:1px 0 6px;
    font-size:13px;
    font-weight:550
}

.guide-steps p {
    font-size:12px;
    color:var(--t-muted);
    line-height:1.85
}

.guide-steps strong {
    color:var(--t-mid)
}

.rules-detail {
    border-top:1px solid var(--ln-strong);
    font-size:12px
}

.rules-detail summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:44px;
    cursor:pointer;
    color:var(--t-mid);
    list-style:none
}

.rules-detail summary::-webkit-details-marker {
    display:none
}

.rules-detail summary .ui-icon {
    width:14px;
    height:14px;
    transition:rotate .16s ease
}

.rules-detail[open] summary .ui-icon {
    rotate:90deg
}

.rules-detail>div {
    color:var(--t-mid);
    font-size:12px;
    padding:0 0 12px;
    line-height:1.8
}

.rules-detail p+p {
    margin-top:8px
}

.session-actions {
    display:flex;
    flex-direction:column;
    gap:10px;
    padding-top:20px;
    margin-top:14px;
    border-top:1px solid var(--ln-strong)
}

.action-btn,.kd-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:42px;
    padding:9px 15px;
    border:1px solid var(--ln-strong);
    border-radius:9px;
    background:var(--surface);
    color:var(--t-mid);
    font-size:13px;
    font-weight:500;
    line-height:1.6
}

.action-btn:hover:not(:disabled),.kd-btn:hover:not(:disabled) {
    background:var(--surface-hover);
    border-color:#B4C7D9
}

.action-btn .ui-icon {
    width:16px;
    height:16px
}

.action-btn.reveal {
    color:var(--rose-ink);
    border-color:color-mix(in srgb,var(--rose-ink) 18%,var(--ln-soft));
    background:var(--rose-soft)
}

.action-btn.reveal:hover:not(:disabled) {
    background:color-mix(in srgb,var(--rose-ink) 10%,var(--rose-soft))
}

.session-actions>p {
    text-align:center;
    color:var(--t-muted);
    font-size:11px
}

.app-footer {
    max-width:1264px;
    padding:5px 32px 30px;
    margin:auto;
    display:flex;
    justify-content:space-between;
    gap:20px;
    color:var(--t-muted);
    font-size:11px
}

.credit-link {
    color:var(--t-mid);
    text-decoration:underline;
    text-decoration-color:var(--ln-strong);
    text-underline-offset:3px
}

.credit-link:hover {
    color:var(--a-accent-ink)
}

.text-link {
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:var(--t-muted);
    font-size:13px
}

.text-link:hover {
    color:var(--a-accent)
}

.text-link .ui-icon {
    width:15px;
    height:15px
}

.search-panel {
    min-height:450px
}

.bottom-search-area {
    position:relative;
    padding:24px;
    border-bottom:1px solid var(--ln-soft)
}

.search-status {
    font-size:12px;
    color:var(--t-muted);
    margin-top:12px
}

.placeholder-box {
    padding:65px 20px 74px;
    text-align:center
}

.placeholder-icon {
    display:grid;
    place-items:center;
    margin:0 auto 16px;
    width:54px;
    height:54px;
    border:1px solid var(--ln-soft);
    border-radius:16px;
    background:var(--blue-soft);
    color:var(--a-accent)
}

.placeholder-icon .ui-icon {
    width:26px;
    height:26px
}

.placeholder-box h2 {
    font-size:17px;
    font-weight:550
}

.placeholder-box p {
    margin-top:9px;
    font-size:13px;
    color:var(--t-muted)
}

.search-example {
    display:inline-block;
    margin-top:19px;
    font-size:12px;
    color:var(--t-muted)
}

code {
    font-size:12px;
    padding:2px 6px;
    border:1px solid var(--ln-soft);
    border-radius:5px;
    background:var(--surface-soft);
    color:var(--t-mid)
}

#search-result-container {
    padding:24px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px
}

#search-result-container:empty {
    padding:0
}

.cs-card {
    min-width:0;
    background:var(--surface);
    border:1px solid var(--ln-soft);
    border-radius:12px;
    overflow:hidden
}

.cs-card-bar {
    height:3px;
    background:var(--blue-soft)
}

.cs-card-header {
    padding:17px 19px 13px;
    border-bottom:1px solid var(--ln-faint)
}

.cs-header-left {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:7px
}

.cs-avatar-icon {
    display:inline-flex;
    color:var(--a-accent)
}

.cs-avatar-icon svg {
    width:17px;
    height:17px
}

.cs-player-id {
    font-size:19px;
    font-weight:650;
    line-height:1.4;
    color:var(--t-strong);
    overflow-wrap:anywhere
}

.cs-player-meta {
    margin-left:auto;
    color:var(--t-muted);
    font-size:11px
}

.cs-card-body {
    display:flex;
    gap:19px;
    padding:19px
}

.cs-body-left {
    width:120px;
    flex:0 0 auto
}

.cs-player-img-box {
    width:100%;
    height:155px;
    background:var(--surface-soft);
    border:1px solid var(--ln-soft);
    border-radius:9px;
    overflow:hidden
}

.cs-player-img-box img {
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center bottom
}

.cs-body-right {
    flex:1;
    min-width:0
}

.cs-info-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:8px 0;
    border-bottom:1px solid var(--ln-faint);
    line-height:1.5
}

.cs-info-row:first-child {
    padding-top:0
}

.cs-info-row:last-child {
    border:0;
    padding-bottom:0
}

.cs-info-label {
    color:var(--t-muted);
    font-size:11px
}

.cs-info-value {
    color:var(--t-strong);
    font-size:12px;
    font-weight:550;
    text-align:right;
    overflow-wrap:anywhere
}

.modal {
    display:none;
    position:fixed;
    z-index:1000;
    inset:0;
    padding:20px;
    overflow-y:auto;
    background:rgba(32,40,54,.32)
}

.modal.show {
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:1
}

.modal-box {
    width:min(100%,540px);
    max-height:calc(100dvh - 40px);
    overflow-y:auto;
    margin:auto;
    padding:28px;
    border:1px solid var(--ln-soft);
    border-radius:16px;
    background:var(--surface);
    text-align:center;
    box-shadow:var(--shadow-popover)
}

.modal-emblem {
    display:grid;
    place-items:center;
    margin:0 auto 13px;
    width:46px;
    height:46px;
    border-radius:14px;
    background:var(--blue-soft);
    color:var(--a-accent)
}

.modal-emblem .ui-icon {
    width:25px;
    height:25px
}

.modal h2 {
    font-size:23px;
    font-weight:600
}

.modal h2.win {
    color:var(--s-ok)
}

.modal-text {
    margin-top:7px;
    font-size:14px;
    color:var(--t-mid)
}

.modal-embedded-card {
    margin:22px 0;
    text-align:left;
    border:0;
    background:var(--surface-soft)
}

.modal-embedded-card .cs-card-bar {
    display:none
}

.modal-embedded-card .cs-player-img-box {
    background:var(--surface)
}

.modal .primary-button {
    width:100%
}

/* Winning results arrive in two beats: the dialog, then the player card. */
.modal.result-entering {
    animation: result-backdrop-enter 200ms ease-out both;
}
.modal.result-entering .modal-box {
    transform-origin: 50% 25%;
    animation: result-panel-enter 300ms cubic-bezier(.22, 1, .36, 1) both;
}
.modal.result-entering .modal-embedded-card {
    transform-origin: 50% 45%;
    backface-visibility: hidden;
    animation: result-card-enter 620ms cubic-bezier(.22, 1, .36, 1) 130ms both;
}
@keyframes result-backdrop-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes result-panel-enter {
    from { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(2px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes result-card-enter {
    0% {
        opacity: 0;
        filter: blur(3px);
        transform: perspective(1000px) translateY(18px) rotateY(-9deg) rotateZ(-2deg) scale(.94);
    }
    70% {
        opacity: 1;
        filter: blur(0);
        transform: perspective(1000px) translateY(-2px) rotateY(1.2deg) rotateZ(.35deg) scale(1.015);
    }
    100% { opacity: 1; filter: blur(0); transform: none; }
}

.data-panel-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:22px 24px 0
}

.data-panel-heading h2 {
    font-size:16px;
    font-weight:600
}

.data-panel-heading p {
    color:var(--t-muted);
    font-size:12px;
    margin-top:5px
}

.data-badge {
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:5px 10px;
    border-radius:7px;
    background:var(--lilac-soft);
    color:var(--lilac-ink);
    font-size:12px;
    white-space:nowrap
}

.data-badge .ui-icon {
    width:16px;
    height:16px
}

.kd-toolbar {
    display:flex;
    align-items:center;
    gap:10px;
    padding:22px 24px;
    flex-wrap:wrap
}

.kd-search-wrap {
    display:block;
    width:260px;
    position:relative;
    min-width:0
}

.kd-search,.kd-select {
    min-height:40px;
    font-size:13px;
    padding-top:8px;
    padding-bottom:8px
}

.kd-select {
    width:160px;
    padding-left:12px
}

.kd-count {
    margin-left:auto;
    color:var(--t-muted);
    font-size:12px
}

.kd-btn {
    min-height:40px
}

.kd-btn .ui-icon {
    width:15px;
    height:15px
}

.stat-wrap {
    overflow-x:auto;
    width:100%;
    scrollbar-width:thin;
    scrollbar-color:var(--ln-strong) transparent
}

.kd-table {
    table-layout:fixed;
    border-collapse:collapse;
    width:100%;
    min-width:830px;
    color:var(--t-body);
    font-size:13px;
    font-variant-numeric:tabular-nums
}

.kd-table th {
    padding:0;
    border-top:1px solid var(--ln-soft);
    border-bottom:1px solid var(--ln-soft);
    background:var(--surface-soft);
    color:var(--t-mid);
    font-size:12px;
    font-weight:550;
    text-align:left;
    white-space:nowrap
}

.kd-table th button {
    display:inline-flex;
    align-items:center;
    gap:7px;
    border:0;
    background:transparent;
    color:inherit;
    font:inherit;
    width:100%;
    padding:13px 16px;
    text-align:inherit;
    min-height:44px
}

.kd-table th.num button {
    justify-content:flex-end
}

.kd-table th button:hover {
    background:var(--surface-hover)
}

.kd-table td {
    padding:14px 16px;
    border-bottom:1px solid var(--ln-faint);
    white-space:nowrap;
    font-size:13px
}

.kd-table .num {
    text-align:right
}

/* Reserve the same indicator and badge space regardless of sort direction or logo. */
.kd-table .sort-indicator { display:inline-block; flex:0 0 12px; width:12px; text-align:center; }
.kd-table .team-pill { display:inline-flex; align-items:center; min-height:32px; }

.kd-table tbody tr:hover {
    background:var(--blue-soft)
}

.kd-table tbody tr:last-child td {
    border-bottom:0
}

.id-main {
    color:var(--t-strong);
    font-weight:600
}

.team-pill {
    display:inline-block;
    min-width:35px;
    padding:2px 8px;
    border-radius:5px;
    background:var(--surface-muted);
    color:var(--t-mid);
    font-size:11px
}

.fire-top .kd-metric {
    color:var(--a-accent-ink);
    font-weight:600
}

.kd-empty {
    padding:45px 20px;
    text-align:center;
    color:var(--t-muted)
}

.kd-empty button {
    margin-left:12px
}

.data-footnote {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:15px 24px;
    border-top:1px solid var(--ln-soft);
    color:var(--t-muted);
    font-size:11px
}

.data-footnote>span:first-child {
    display:flex;
    align-items:center;
    gap:6px
}

.fire-legend {
    color:var(--a-accent-ink)
}

.data-definition {
    margin-top:20px;
    border-top-color:var(--ln-soft)
}

.data-definition summary {
    justify-content:flex-start
}

/* Preferences preserve independent switches and contained ripple feedback. */
.preferences {
    position:relative
}

.theme-toggle-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:8px 11px;
    min-height:40px;
    border:1px solid var(--ln-soft);
    border-radius:8px;
    background:var(--surface);
    color:var(--t-mid);
    font-size:12px;
    font-weight:500
}

.theme-toggle-btn:hover {
    background:var(--surface-soft);
    border-color:var(--ln-strong)
}

.preferences-trigger[aria-expanded="true"] {
    border-color:#B8D0E7;
    color:var(--a-accent-ink);
    background:var(--blue-soft)
}

.preferences-trigger svg {
    width:16px;
    height:16px
}

.preferences-panel {
    position:absolute;
    top:calc(100% + 10px);
    right:0;
    width:340px;
    max-width:calc(100vw - 24px);
    max-height:calc(100dvh - 100px);
    overflow-y:auto;
    padding:18px 12px 12px;
    border:1px solid var(--ln-soft);
    border-radius:14px;
    background:var(--surface);
    box-shadow:var(--shadow-popover);
    text-align:left;
    isolation:isolate
}

.preferences-heading {
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 8px 15px
}

.preferences-mark {
    display:flex;
    color:var(--a-accent)
}

.preferences-mark svg {
    width:23px;
    height:23px
}

.preferences-heading h2 {
    font-size:15px;
    font-weight:600
}

.preferences-heading p {
    margin-top:4px;
    font-size:11px;
    color:var(--t-muted)
}

.preferences-badge {
    margin-left:auto;
    padding:3px 8px;
    color:var(--lilac-ink);
    background:var(--lilac-soft);
    font-size:10px;
    border-radius:5px
}

.preferences-options {
    overflow:hidden;
    padding:4px;
    border-radius:10px;
    background:var(--surface-soft)
}

.preference-row {
    appearance:none;
    position:relative;
    isolation:isolate;
    display:flex;
    align-items:center;
    gap:11px;
    width:100%;
    min-height:76px;
    padding:13px 10px;
    border:0;
    border-radius:8px;
    background:transparent;
    text-align:left;
    color:var(--t-strong);
    overflow:hidden
}

.preference-row+.preference-row {
    border-top:1px solid var(--ln-soft)
}

.preference-row:hover {
    background:var(--surface-hover)
}

.preference-row:focus-visible {
    outline:2px solid var(--a-accent);
    outline-offset:-2px
}

.preference-icon {
    display:grid;
    place-items:center;
    width:32px;
    height:32px;
    flex:0 0 auto;
    border-radius:9px;
    background:var(--surface);
    border:1px solid var(--ln-soft);
    color:var(--a-accent)
}

.preference-icon svg {
    width:18px;
    height:18px
}

.preference-copy {
    display:flex;
    flex:1;
    flex-direction:column;
    gap:4px;
    min-width:0
}

.preference-label {
    font-size:13px;
    font-weight:550
}

.preference-description {
    font-size:11px;
    line-height:1.5;
    color:var(--t-muted)
}

.preference-track {
    position:relative;
    flex:0 0 38px;
    height:22px;
    border:1px solid var(--ln-strong);
    border-radius:20px;
    background:var(--ln-strong);
    transition:background-color .18s ease,border-color .18s ease
}

.preference-thumb {
    position:absolute;
    top:2px;
    left:2px;
    width:16px;
    height:16px;
    background:var(--surface);
    border-radius:50%;
    box-shadow:0 1px 2px rgba(31,44,66,.12);
    transition:transform .18s ease
}

.preference-row[aria-checked="true"] .preference-track {
    background:var(--a-accent);
    border-color:var(--a-accent)
}

.preference-row[aria-checked="true"] .preference-thumb {
    transform:translateX(16px);
    background:var(--t-on-color)
}

.preference-wave {
    position:absolute;
    z-index:-1;
    pointer-events:none;
    inset:0;
    background:linear-gradient(90deg,transparent,var(--a-accent),transparent);
    opacity:0;
    transform-origin:center
}

.preferences-footnote {
    margin-top:11px;
    text-align:center;
    color:var(--t-muted);
    font-size:10px
}

.preferences-footnote span {
    color:var(--a-accent);
    margin-right:3px
}

/* Responsive layouts keep the game readable instead of shrinking its board. */
@media(max-width:1100px) {
    .header-title {
        gap:6px
    }
    .brand-caption {
        display:none
    }
    .header-right {
        gap:14px
    }
    .game-layout {
        grid-template-columns:minmax(0,1fr) 220px;
        gap:22px
    }
    .stats-strip {
        padding-left:20px;
        padding-right:20px
    }
    .stat-item {
        padding-left:12px;
        gap:8px
    }
    .stat-icon {
        width:32px;
        height:32px;
        border-radius:9px
    }
    .cs-card-body {
        flex-direction:column
    }
    .cs-body-left {
        width:100%
    }
    .cs-player-img-box {
        height:170px
    }
}

@media(max-width:900px) {
    .game-layout {
        grid-template-columns:minmax(0,1fr)
    }
    .game-sidebar {
        display:grid;
        grid-template-columns:minmax(0,1fr) 220px;
        gap:28px;
        padding-top:4px
    }
    .session-actions {
        align-self:start;
        margin-top:0
    }
    .page-heading {
        align-items:flex-start
    }
    .mode-tabs a {
        padding:8px 11px
    }
    .header-inner {
        padding-left:24px;
        padding-right:24px;
        gap:14px
    }
    .app-main {
        padding-left:24px;
        padding-right:24px
    }
    .app-footer {
        padding-left:24px;
        padding-right:24px
    }
    .data-footnote {
        flex-direction:column;
        align-items:flex-start;
        gap:7px
    }
    .kd-count {
        width:100%;
        margin:2px 0 0
    }
    .cs-card-body {
        flex-direction:row
    }
}

@media(max-width:768px) {
    .header-inner {
        min-height:0;
        padding:13px 16px 11px;
        display:block
    }
    .header-left {
        margin-bottom:13px
    }
    .header-title {
        display:inline-flex
    }
    .brand-caption {
        display:inline;
        font-size:9px
    }
    .header-right {
        justify-content:space-between;
        gap:8px
    }
    .site-nav {
        gap:2px;
        flex:1
    }
    .nav-btn-capsule {
        padding:8px 9px;
        min-height:42px;
        font-size:12px;
        gap:5px
    }
    .nav-btn-capsule .ui-icon {
        width:15px;
        height:15px
    }
    .preferences {
        position:static;
        flex:0 0 auto
    }
    .theme-toggle-btn {
        min-height:42px;
        padding:8px;
        font-size:11px;
        gap:5px
    }
    .preferences-panel {
        top:calc(100% + 5px);
        left:auto;
        right:12px;
        max-height:calc(100dvh - 132px)
    }
    .app-main {
        padding:25px 16px 20px
    }
    .page-heading {
        flex-direction:column;
        gap:20px;
        margin-bottom:20px
    }
    h1 {
        font-size:24px;
        letter-spacing:-.5px
    }
    .eyebrow {
        font-size:11px
    }
    .page-subtitle {
        font-size:13px;
        margin-top:7px
    }
    .mode-tabs {
        width:100%
    }
    .mode-tabs a {
        flex:1;
        min-height:40px;
        font-size:13px
    }
    .game-layout {
        gap:23px
    }
    .game-panel,.search-panel,.data-panel {
        border-radius:13px
    }
    .panel-heading {
        padding:16px;
        flex-wrap:wrap;
        gap:8px
    }
    .panel-title {
        font-size:14px
    }
    .round-tag {
        font-size:10px
    }
    .stats-strip {
        padding:20px 16px
    }
    .stat-item {
        padding-left:12px;
        display:block;
        border-left:1px solid var(--ln-soft)
    }
    .stat-icon {
        display:none
    }
    .stat-label {
        font-size:11px
    }
    .stat-value {
        font-size:25px;
        margin-top:2px
    }
    .stat-denominator {
        font-size:12px
    }
    .board-area {
        padding:0 16px 17px
    }
    .board-toolbar {
        padding-top:14px
    }
    .color-legend {
        gap:10px;
        font-size:10px
    }
    .game-empty {
        padding:7px 0 20px
    }
    .clue-illustration {
        scale:.93;
        margin-bottom:0
    }
    .game-empty h3 {
        font-size:14px
    }
    .game-empty>p {
        font-size:12px;
        max-width:250px;
        margin-left:auto;
        margin-right:auto
    }
    .board-area:has(#history-container:not(:empty)) .mobile-scroll-hint {
        display:block
    }
    .guess-composer {
        padding:18px 16px 16px
    }
    .guess-composer>label {
        font-size:13px
    }
    .input-area {
        gap:8px;
        flex-wrap:wrap
    }
    #player-input,#search-input {
        min-height:48px;
        font-size:14px
    }
    #submit-btn {
        width:100%;
        min-height:46px
    }
    .game-page .input-wrapper {
        flex-basis:100%
    }
    .composer-meta {
        font-size:10px;
        gap:8px
    }
    .game-status {
        font-size:11px
    }
    .game-sidebar {
        display:flex;
        flex-direction:column;
        gap:0;
        padding:0 2px
    }
    .guide-steps {
        margin-top:20px;
        margin-bottom:14px
    }
    .guide-steps li {
        margin-bottom:17px
    }
    .guide-steps h3 {
        font-size:13px
    }
    .guide-steps p {
        font-size:12px
    }
    .session-actions {
        display:grid;
        grid-template-columns:1fr 1fr;
        width:100%;
        margin-top:8px;
        padding-top:18px;
        gap:10px
    }
    .session-actions>p {
        grid-column:1/-1
    }
    .action-btn {
        min-height:46px;
        font-size:13px
    }
    .app-footer {
        padding:0 18px 25px;
        flex-direction:column;
        gap:5px;
        font-size:10px
    }
    .bottom-search-area {
        padding:19px 16px
    }
    .search-page .input-wrapper {
        flex-basis:100%
    }
    #search-btn {
        width:100%;
        min-height:46px
    }
    .placeholder-box {
        padding:45px 16px 50px
    }
    .placeholder-box h2 {
        font-size:16px
    }
    .placeholder-box p {
        font-size:12px
    }
    #search-result-container {
        padding:16px;
        grid-template-columns:minmax(0,1fr);
        gap:15px
    }
    .cs-card-body {
        flex-direction:row;
        padding:16px;
        gap:14px
    }
    .cs-body-left {
        width:100px
    }
    .cs-player-img-box {
        height:145px
    }
    .cs-card-header {
        padding:15px 16px 12px
    }
    .cs-player-id {
        font-size:18px
    }
    .cs-player-meta {
        font-size:10px
    }
    .cs-info-row {
        gap:7px;
        padding:8px 0
    }
    .cs-info-label {
        font-size:10px
    }
    .cs-info-value {
        font-size:11px
    }
    .modal {
        padding:14px
    }
    .modal-box {
        max-height:calc(100dvh - 28px);
        padding:23px 18px;
        border-radius:14px
    }
    .modal h2 {
        font-size:20px
    }
    .modal-text {
        font-size:13px
    }
    .modal-embedded-card .cs-card-body {
        padding:16px 10px;
        gap:12px
    }
    .data-panel-heading {
        padding:19px 16px 0
    }
    .data-panel-heading h2 {
        font-size:15px
    }
    .data-panel-heading p {
        font-size:11px
    }
    .data-badge {
        font-size:10px;
        padding:4px 7px
    }
    .data-badge .ui-icon {
        width:13px;
        height:13px
    }
    .kd-toolbar {
        gap:9px;
        padding:18px 16px
    }
    .kd-search-wrap {
        width:100%
    }
    .kd-search,.kd-select,.kd-btn {
        min-height:44px
    }
    .kd-select {
        flex:1;
        width:auto;
        min-width:0
    }
    .kd-count {
        font-size:11px
    }
    .data-footnote {
        padding:14px 16px;
        font-size:10px
    }
    .data-definition summary {
        font-size:12px;
        min-height:44px
    }
}

@media(max-width:370px) {
    .nav-btn-capsule {
        padding:8px 7px;
        gap:4px;
        font-size:11px
    }
    .nav-btn-capsule .ui-icon {
        display:none
    }
    .theme-toggle-btn {
        padding:8px
    }
    .preferences-panel {
        right:10px;
        max-width:calc(100vw - 20px)
    }
    .round-tag {
        font-size:9px
    }
    .modal-embedded-card .cs-body-left,.cs-body-left {
        width:80px
    }
    .cs-player-img-box {
        height:132px
    }
    .cs-player-meta {
        margin-left:0
    }
}

@media(prefers-reduced-motion:reduce) {
    *,*::before,*::after {
        animation:none!important;
        transition:none!important;
        scroll-behavior:auto!important
    }
}

html.motion-disabled *,html.motion-disabled *::before,html.motion-disabled *::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important
}

/* Readable supporting text across screen sizes. */
.guide-steps p,.rules-detail>div {
    font-size:13px
}

.guide-steps h3 {
    font-size:14px
}

.rules-detail summary {
    font-size:13px
}

.color-legend {
    font-size:12px
}

.cs-info-label {
    font-size:12px
}

.cs-info-value {
    font-size:13px
}

@media(max-width:768px) {
    .game-status,.game-empty>p {
        font-size:12px
    }
    .cs-info-label {
        font-size:12px
    }
    .cs-info-value {
        font-size:13px
    }
    .cs-card-body {
        gap:12px
    }
}

.sort-indicator {
    color:var(--t-muted);
    opacity:.6
}

.kd-table th.asc .sort-indicator,.kd-table th.desc .sort-indicator {
    color:var(--a-accent);
    opacity:1
}

/* Keep mobile suggestions clear of the primary action. */
@media(max-width:768px) {
    .input-wrapper .autocomplete-items {
        top:auto;
        bottom:calc(100% + 7px);
        max-height:min(240px,40dvh)
    }
    .session-actions {
        order:-1;
        margin:0 0 23px;
        padding-top:0;
        border-top:0
    }
}

/* A single player result receives space without an empty second column. */
#search-result-container:has(>.cs-card:only-child) {
    grid-template-columns:minmax(0,1fr)
}

#search-result-container>.cs-card:only-child {
    max-width:760px;
    width:100%;
    justify-self:center
}

#search-result-container>.cs-card:only-child .cs-body-left {
    width:160px
}

#search-result-container>.cs-card:only-child .cs-player-img-box {
    height:210px
}

@media(max-width:768px) {
    #search-result-container>.cs-card:only-child .cs-body-left {
        width:100px
    }
    #search-result-container>.cs-card:only-child .cs-player-img-box {
        height:145px
    }
}

@media(max-width:370px) {
    #search-result-container>.cs-card:only-child .cs-body-left {
        width:80px
    }
}


/* Narrow dialogs stack portrait and details so country names remain readable. */
@media (max-width: 370px) {
    .modal-embedded-card .cs-card-body {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 15px;
    }
    .modal-embedded-card .cs-body-left {
        width: 112px;
    }
    .modal-embedded-card .cs-player-img-box {
        height: 140px;
    }
    .modal-embedded-card .cs-body-right {
        width: 100%;
    }
    .modal-embedded-card .cs-info-value {
        white-space: nowrap;
    }
}

/* Interface style selector; each choice remains separate from appearance switches. */
.style-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 4px 16px;
}
.style-picker-label {
    grid-column: 1 / -1;
    color: var(--t-mid);
    font-size: 12px;
    font-weight: 550;
    margin-bottom: 1px;
}
.style-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--ln-soft);
    border-radius: 9px;
    background: var(--surface);
    color: var(--t-mid);
    font-size: 12px;
    text-align: left;
}
.style-option:hover {
    background: var(--surface-hover);
    border-color: var(--ln-strong);
}
.style-option[aria-checked="true"] {
    border-color: var(--a-accent);
    background: var(--blue-soft);
    color: var(--a-accent-ink);
}
.style-preview {
    display: grid;
    grid-template-columns: 1fr 22px;
    grid-template-rows: 9px 1fr;
    gap: 4px;
    padding: 6px;
    width: 100%;
    height: 44px;
    border: 1px solid rgba(120, 130, 145, .18);
    border-radius: 5px;
}
.style-preview i {
    border-radius: 2px;
}
.style-preview i:first-child {
    grid-column: 1 / -1;
}
.preview-soft {
    background: #F5F6F8;
}
.preview-soft i {
    background: #FFFFFF;
    border: 1px solid #E8EBEF;
}
.preview-soft i:nth-child(2) {
    background: #EDF5FE;
}
.preview-immersive {
    background: #000000;
}
.preview-immersive i {
    background: #202020;
}
.preview-immersive i:nth-child(2) {
    background: linear-gradient(110deg, #284435, #121212);
    box-shadow: inset 14px 0 0 #1ED760;
}

/* Read-only preference descriptions stay legible; only the switch track fades. */
.preference-row:disabled {
    opacity: 1;
    cursor: default;
}
.preference-row:disabled .preference-track {
    opacity: .6;
}
.preference-row:disabled:hover {
    background: transparent;
}

/* Shared team identity: keep the name readable even when artwork is unavailable. */
.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: inherit;
    gap: 6px;
    max-width: 100%;
    vertical-align: middle;
}
.team-logo-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 3px;
    box-sizing: border-box;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    background: #edf0f4;
}
.team-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 .6px rgba(25, 32, 43, .5));
}
.team-name {
    min-width: 0;
    overflow-wrap: anywhere;
}
.autocomplete-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    vertical-align: middle;
}
.autocomplete-meta .team-logo-frame {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    padding: 2px;
}
.team-pill {
    vertical-align: middle;
    padding: 3px 6px;
}
.team-pill .team-logo-frame {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
}
.cs-info-value .team-badge {
    justify-content: flex-end;
    text-align: left;
}
.attr-card .team-badge {
    justify-content: center;
    gap: 4px;
}
.attr-card .team-logo-frame {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
    padding: 2px;
}

/* Personal tournament summaries share the same data as the event table. */
.cs-card.elite-card {
    position: relative;
    isolation: isolate;
    overflow: visible;
    --honor-gold: #946510;
    --honor-surface: #fcf4df;
}
.cs-card.elite-card::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border: 1px solid rgba(213, 163, 56, .8);
    border-radius: inherit;
    box-shadow: 0 0 7px rgba(225, 173, 58, .35),
        0 0 22px 3px rgba(225, 173, 58, .2),
        inset 0 0 14px rgba(225, 173, 58, .08);
    pointer-events: none;
    opacity: .7;
    animation: player-gold-glow 3.6s ease-in-out infinite;
}
.elite-card .cs-card-bar {
    border-radius: 12px 12px 0 0;
}
.player-honors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}
.player-honors[hidden] {
    display: none;
}
.player-honor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--honor-surface);
    color: var(--honor-gold);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
html.dark-theme .cs-card.elite-card {
    --honor-gold: #eccb7d;
    --honor-surface: #39301d;
}
@keyframes player-gold-glow {
    0%, 100% { opacity: .4; }
    50% { opacity: 1; }
}
.player-event-stats {
    padding: 19px;
    border-top: 1px solid var(--ln-soft);
    text-align: left;
}
.event-stats-heading, .event-metric-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.event-stats-heading {
    margin-bottom: 14px;
}
.event-stats-heading h3 {
    margin: 0;
    color: var(--t-strong);
    font-size: 14px;
    font-weight: 650;
}
.event-data-link, .event-retry {
    color: var(--a-accent-ink);
    font-size: 12px;
    border-radius: 5px;
    text-decoration: none;
}
.event-data-link {
    padding: 6px 0 6px 6px;
}
.event-data-link:hover, .event-retry:hover {
    text-decoration: underline;
}
.event-data-link:focus-visible, .event-retry:focus-visible {
    outline: 2px solid var(--a-accent);
    outline-offset: 4px;
}
.event-retry {
    padding: 6px 10px;
    margin-left: 4px;
    background: var(--blue-soft);
    border: 1px solid var(--ln-soft);
    cursor: pointer;
}
.event-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.event-metric {
    min-width: 0;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--ln-soft);
    border-radius: 12px;
    --metric-accent: var(--a-accent);
}
.event-metric-intDmgPer {
    --metric-accent: var(--mint-ink);
}
.event-metric h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--t-mid);
}
.event-percentile {
    padding: 3px 7px;
    border-radius: 5px;
    background: var(--blue-soft);
    color: var(--a-accent-ink);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}
.event-metric-intDmgPer .event-percentile {
    color: var(--mint-ink);
    background: var(--mint-soft);
}
.event-metric-value {
    display: block;
    margin: 10px 0 4px;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.15;
    letter-spacing: -.8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--t-strong);
}
.event-comparison {
    margin: 8px 0 18px;
    color: var(--t-mid);
    font-size: 12px;
    line-height: 1.6;
}
.event-comparison.above {
    color: var(--mint-ink);
}
.event-rank-track {
    height: 5px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--ln-soft);
}
.event-rank-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--metric-accent);
}
.event-metric-note {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 9px 0 0;
    color: var(--t-muted);
    font-size: 11px;
    line-height: 1.6;
}
.event-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 12px;
}
.event-totals div {
    min-width: 0;
}
.event-totals dt {
    color: var(--t-muted);
    font-size: 11px;
}
.event-totals dd {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--t-strong);
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
.event-stats-footnote, .event-stats-empty {
    margin: 0;
    color: var(--t-muted);
    font-size: 11px;
    line-height: 1.8;
}
.event-stats-empty {
    font-size: 13px;
}
@media (max-width: 600px) {
    .player-event-stats {
        padding: 15px;
    }
    .event-metrics {
        gap: 9px;
    }
    .event-metric {
        padding: 12px;
    }
    .event-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
