@import url('/assets/roundmate-ui.css?v=20261010-1');
/* Compact settings index; use the same RoundMate tokens as the five tabs. */
#view-settings [hidden] { display:none !important; }
.settings-group { margin:22px 0; }
.settings-group > h3 { margin:0 8px 9px; font-size:14px; color:var(--gray); }
.settings-list { background:var(--surface); border:1px solid var(--line-soft); border-radius:16px; overflow:hidden; }
.settings-row { display:flex; align-items:center; gap:12px; width:100%; min-height:58px; padding:16px; text-align:left; text-decoration:none; border:0; background:var(--surface); color:var(--dark); font:inherit; cursor:pointer; }
.settings-list .settings-row + .settings-row { border-top:1px solid var(--line-soft); }
.settings-row > span:first-child { flex:1; }
.settings-row > span:last-child { color:var(--gray); }
.settings-row-value { color:var(--gray); font-size:13px; max-width:35%; overflow-wrap:anywhere; }
.settings-row:focus-visible,.settings-back:focus-visible,.settings-support:focus-visible { outline:2px solid var(--primary); outline-offset:-3px; }
.settings-end-row { color:var(--danger); border-radius:16px; border:1px solid var(--line-soft); margin-top:24px; }
.settings-back,.settings-support { border:0; background:none; color:var(--primary); font:inherit; cursor:pointer; padding:12px 4px; text-decoration:none; display:inline-block; }
.settings-support { font-size:13px; color:var(--gray); }
.settings-detail-title { margin:8px 0 20px; font-size:22px; }
.settings-note { font-size:13px; color:var(--gray); line-height:1.6; }
.settings-detail > .btn { margin-top:10px; }
.settings-file-label { display:block; margin-top:12px; color:var(--dark); }
.settings-file-label input { display:block; width:100%; margin-top:8px; }
#host-settings-live-operations:empty,#host-settings-result-reports:empty { display:none; }
#career-sort-bar[hidden] { display:none !important; }
#career-sort-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; }
#career-order { padding:10px; border:1px solid var(--line-soft); border-radius:10px; background:var(--surface); color:var(--dark); font:inherit; }
.result-announcement { margin:18px 0; padding:14px; background:var(--surface-muted); border-radius:12px; }
/* Production visual layer for the public app. */
.opponent-help-guide { border: 2px solid #e99b1b; background: #fff9e9; }
.opponent-help-guide small { display: block; margin-top: 8px; color: #60738a; }
.host-result-break-options { border:1px solid #dbe3ee;border-radius:12px;margin:12px 0;padding:8px 10px;display:grid;grid-template-columns:1fr 1fr;gap:8px; }
.host-result-break-options legend { padding:0 5px;font-weight:800; }
.host-result-break-options label { display:flex;gap:8px;align-items:center;min-height:44px;overflow-wrap:anywhere;cursor:pointer; }
.host-result-break-options input { width:22px;height:22px;flex:0 0 22px;accent-color:#304e70; }
.host-result-break-options small { grid-column:1/-1;color:#657689; }
:root {
    --primary: #1d4ed8;
    --primary-strong: #153eaf;
    --primary-soft: #dbeafe;
    --accent: #0f9f91;
    --accent-soft: #dff7f3;
    --success: #087f5b;
    --danger: #c9443e;
    --warning: #d99a22;
    --draw: #675c9f;
    --avoid: #c86b3e;
    --dark: #172033;
    --gray: #667085;
    --surface: #ffffff;
    --surface-muted: #f6f8f7;
    --line-soft: #d7e3f8;
    --line-strong: #b6c7e8;
    --student-bg: #ffffff;
    --adult-bg: #f1f5f3;
    --bg-waiting: #edf8f4;
    --bg-playing: #fff0ee;
    --bg-resting: #f5f7f6;
    --final-gold: #d99a22;
    --card-radius: 10px;
    --shadow-card: 0 8px 22px rgba(23, 35, 38, 0.08);
    --shadow-raised: 0 16px 34px rgba(23, 35, 38, 0.12);
    --control-height: 48px;
}

html {
    background: #edf4ff;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0) 260px),
        linear-gradient(180deg, #eaf2ff 0%, #f8fbff 42%, #edf4ff 100%);
    color: var(--dark);
    font-size: 17px;
    line-height: 1.45;
    letter-spacing: 0;
    padding-top: 76px;
}

.app-shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right));
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 8px 22px rgba(23, 35, 38, 0.07);
    backdrop-filter: blur(14px);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.app-brand > div:last-child { min-width: 0; }

.app-brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.22);
    font-size: 12px;
    overflow: hidden;
    background: #ffffff;
    padding: 2px;
}

.app-brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-brand-title {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-brand-subtitle {
    margin-top: 3px;
    color: var(--gray);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.app-status-panel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.app-header-actions { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.header-setup-link { min-height:36px; padding:7px 11px; border:1px solid #bfdbfe; border-radius:999px; background:#fff; color:var(--primary); font-size:12px; font-weight:900; text-decoration:none; white-space:nowrap; }
.header-qr-button { min-height:36px; padding:7px 12px; border:0; border-radius:999px; background:var(--primary); color:#fff; font:inherit; font-size:12px; font-weight:900; cursor:pointer; white-space:nowrap; }
.quick-qr-card { display:flex; align-items:center; justify-content:space-between; gap:12px; border:2px solid #8eb5ff; background:linear-gradient(120deg,#eef5ff,#fff); }
.quick-qr-card b,.quick-qr-card small { display:block; }
.quick-qr-card small { margin-top:4px; color:var(--gray); font-size:12px; }
.quick-qr-card .btn { flex:0 0 auto; width:auto; }

.app-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(22, 132, 91, 0.13);
}

.app-status-panel[data-save-state="syncing"] .app-status-dot,
.app-status-panel[data-save-state="pending"] .app-status-dot,
.app-status-panel[data-save-state="switched"] .app-status-dot {
    background: #d97706;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.app-status-panel[data-save-state="offline"] .app-status-dot,
.app-status-panel[data-save-state="error"] .app-status-dot {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.app-status-panel[data-save-state="syncing"],
.app-status-panel[data-save-state="pending"],
.app-status-panel[data-save-state="switched"] {
    border-color: #f4d58d;
    background: #fff8df;
    color: #72540d;
}

.app-status-panel[data-save-state="offline"],
.app-status-panel[data-save-state="error"] {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.container {
    width: 100%;
    max-width: 920px;
    padding: 16px;
}

.view-section {
    animation: app-fade-in 0.16s ease-out;
}

@keyframes app-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin: 2px 0 14px;
    padding: 0 2px;
    color: var(--dark);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-bottom: 14px;
    overflow: hidden;
}

.card h3 {
    margin-bottom: 14px;
    color: #334340 !important;
    font-size: 15px !important;
    font-weight: 900;
    letter-spacing: 0;
}

.list-header {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 20px 0 8px;
    color: #3a4c49;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
}

.list-header::after {
    content: "";
    height: 1px;
    flex: 1;
    margin-left: 10px;
    background: var(--line-soft);
}

.btn,
button {
    letter-spacing: 0;
}

.btn {
    min-height: var(--control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active {
    opacity: 1;
    transform: translateY(1px) scale(0.99);
}

.btn-primary,
.btn-success {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.btn-success {
    background: var(--success);
    box-shadow: 0 8px 18px rgba(22, 132, 91, 0.17);
}

.btn-dark {
    background: #233236;
    color: #ffffff;
}

.btn-danger {
    background: #fff1f0;
    color: var(--danger);
    border-color: #f2c6c3;
    box-shadow: none;
}

.btn-draw {
    background: var(--draw);
    color: #ffffff;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--line-strong);
    color: #485754;
    box-shadow: none;
}

input,
select,
textarea {
    min-height: var(--control-height);
    width: 100%;
    border: 1px solid var(--line-strong) !important;
    border-radius: 9px !important;
    background: #ffffff;
    color: var(--dark);
    font-size: 16px !important;
    line-height: 1.35;
    box-shadow: inset 0 1px 0 rgba(23, 35, 38, 0.03);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.14);
    border-color: var(--primary) !important;
}

input::placeholder,
textarea::placeholder {
    color: #93a19d;
}

.tag-selector {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.tag-opt,
.status-btn,
.rest-toggle {
    border-radius: 9px;
    border-color: var(--line-strong);
    background: #ffffff;
    color: #43514f;
}

.tag-opt {
    height: 48px;
    font-size: 17px;
    box-shadow: none;
}

.tag-opt.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 7px 16px rgba(15, 118, 110, 0.18);
}

#home-tournament-badge {
    background: var(--primary-soft) !important;
    color: var(--primary-strong) !important;
    border: 1px solid #cfe2dc;
    border-radius: 999px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
}

#home-stats {
    background: linear-gradient(180deg, #ffffff, #f8fbfa) !important;
    border-left: 4px solid var(--primary);
}

.host-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.host-status-card {
    min-width: 0;
    padding: 10px 6px;
    border-radius: 10px;
    text-align: center;
}

.host-status-label {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    white-space: nowrap;
}

#first-guide-area > div {
    background: #ffffff !important;
    color: var(--dark) !important;
    border: 1px solid var(--line-soft) !important;
    border-left: 4px solid var(--accent) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-card);
}

#first-guide-area > div > div:first-child {
    color: #8a5d0f !important;
}

#first-guide-area b {
    color: var(--primary-strong) !important;
}

#first-guide-area > div > div {
    color: #43514f !important;
    line-height: 1.75 !important;
}

.countdown-banner {
    background: #183136;
    border: 1px solid rgba(242, 184, 75, 0.45);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
}

.countdown-number {
    color: var(--accent);
}

.proposal-group {
    padding: 14px;
    background: #183136;
    border: 1px solid #29494d;
    border-radius: 10px;
    box-shadow: var(--shadow-raised);
}

.host-guide-priority {
    margin-bottom: 12px;
    padding: 10px;
    border: 2px solid #f0c14b;
    border-radius: 12px;
    background: #fffdf3;
}

.host-guide-heading {
    margin: 0 2px 8px;
    color: #7c4a03;
    font-size: 17px;
    font-weight: 1000;
}

.host-next-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    border: 2px solid #2563eb;
    border-radius: 11px;
    background: #eff6ff;
    color: #1e3a8a;
}

.host-next-action[hidden] { display: none; }
.host-next-action-copy { display: grid; gap: 3px; min-width: 0; }
.host-next-action-label { font-size: 12px; font-weight: 1000; color: #2563eb; }
.host-next-action-title { font-size: 16px; font-weight: 1000; overflow-wrap: anywhere; }
.host-next-action-detail { font-size: 12px; line-height: 1.45; color: #475569; }
.host-next-action .btn { min-height: 46px; margin: 0; white-space: nowrap; }

@media (max-width: 520px) {
    .host-next-action { grid-template-columns: 1fr; }
    .host-next-action .btn { width: 100%; }
}

.host-guide-primary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 10px;
    margin-bottom: 10px;
}

.host-guide-primary-actions .btn {
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 11px 12px;
    font-size: 16px;
    line-height: 1.25;
}

.host-guide-primary-actions #btn-batch-start {
    font-size: 18px;
}

.host-guide-action-title {
    margin: 4px 0 10px;
    color: #7c2d12;
    font-size: 15px;
    font-weight: 1000;
}

.host-voice-prompt {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 2px solid #f59e0b;
    border-radius: 10px;
    background: #fffbeb;
    color: #7c2d12;
    text-align: left;
}

.host-voice-prompt span {
    font-size: 12px;
    line-height: 1.55;
}

.result-entry-card.host-rematch-card {
    border: 3px solid #c2410c;
    background: #fff7ed;
    box-shadow: 0 10px 24px rgba(194, 65, 12, .18);
}

.host-rematch-alert {
    display: grid;
    gap: 4px;
    margin: 2px 0 12px;
    padding: 13px 14px;
    border-radius: 10px;
    background: #9a3412;
    color: #fff;
    text-align: left;
}

.host-rematch-kicker { font-size: 21px; font-weight: 1000; line-height: 1.2; }
.host-rematch-alert > strong { font-size: 17px; }
.host-rematch-alert > span { font-size: 13px; line-height: 1.5; }
.host-rematch-answers { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.host-rematch-person { display:grid; gap:4px; padding:10px; border:2px solid #fdba74; border-radius:10px; background:#fff; text-align:center; }
.host-rematch-person > strong { color:#7c2d12; font-size:17px; overflow-wrap:anywhere; }
.host-rematch-person > span { color:#667a76; font-size:12px; line-height:1.4; }
.host-rematch-buttons { display:grid; gap:8px; margin-top:12px; }
.host-rematch-buttons .online-mini { min-height:42px; font-size:13px; font-weight:1000; }
.host-rematch-buttons .btn { width:100%; min-height:48px; font-size:14px; font-weight:1000; }
.host-rematch-accept { border-color:#15803d !important; background:#ecfdf5 !important; color:#166534 !important; }
.host-rematch-decline { border-color:#9ca3af !important; background:#f8fafc !important; color:#334155 !important; }

.host-guide-summary { border:3px solid #f59e0b; background:#fffbeb; }
.host-guide-summary-title { color:#92400e; font-size:16px; font-weight:1000; }
.host-guide-summary-count { margin:3px 0 8px; color:#7c2d12; font-size:24px; font-weight:1000; }
.host-guide-summary-row { display:grid; gap:2px; margin-top:6px; padding:8px 10px; border-left:5px solid #64748b; border-radius:7px; background:#fff; }
.host-guide-summary-row strong { min-width:0; overflow-wrap:anywhere; }
.host-guide-summary-row span { color:#65736f; font-size:11px; line-height:1.4; }
.host-guide-summary-row.link-both { border-left-color:#3b82f6; background:#eff6ff; }
.host-guide-summary-row.link-one { border-left-color:#f59e0b; background:#fff8df; }
.host-guide-summary-row.link-none { border-left-color:#dc2626; background:#fff4f4; }
.host-guide-summary-row.link-checking { border-left-color:#64748b; background:#f8fafc; }
.host-guide-summary-more { margin-top:7px; color:#72540d; font-size:12px; font-weight:900; text-align:center; }

.host-live-alert {
    position: fixed;
    z-index: 1200;
    top: 74px;
    left: 50%;
    display: flex;
    width: min(calc(100% - 24px), 620px);
    transform: translateX(-50%);
    border: 2px solid #0f766e;
    border-radius: 12px;
    background: #ecfdf5;
    box-shadow: 0 12px 30px rgba(15, 118, 110, .25);
    color: #134e4a;
}
.host-live-alert[hidden] { display:none; }
.host-live-alert-main { flex:1; padding:12px 14px; border:0; background:transparent; color:inherit; text-align:left; }
.host-live-alert-main strong,.host-live-alert-main span { display:block; }
.host-live-alert-main span { margin-top:3px; font-size:12px; line-height:1.45; }
.host-live-alert-close { width:44px; border:0; background:transparent; color:#47635f; font-size:24px; }

.match-card {
    min-height: 74px;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #dce8e4;
    border-radius: 9px;
    box-shadow: 0 6px 14px rgba(23, 35, 38, 0.08);
}

.match-card.is-final {
    background: var(--accent-soft);
    border: 1px solid #efd28c;
    animation: none;
}

.result-entry-card {
    border-width: 2px;
}

.result-entry-card.result-host-required {
    background: #fff4f4;
    border-color: #dc2626;
    box-shadow: 0 8px 20px rgba(185, 28, 28, .14);
}

.result-entry-card.result-partly-linked {
    background: #fffbeb;
    border-color: #f59e0b;
}

.result-entry-card.result-fully-linked {
    background: #eff6ff;
    border-color: #3b82f6;
}

.result-entry-card.result-link-checking { background:#f8fafc; border-color:#64748b; }

.result-entry-card.is-final {
    outline: 3px solid rgba(202, 166, 74, .55);
    outline-offset: -3px;
}

.result-entry-status {
    margin: -2px 0 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 1000;
}

.result-host-required .result-entry-status { color: #991b1b; }
.result-partly-linked .result-entry-status { color: #92400e; }
.result-fully-linked .result-entry-status { color: #1d4ed8; }
.result-link-checking .result-entry-status { color:#475569; }

.result-player-link {
    margin: 3px 0;
    font-size: 11px;
    font-weight: 900;
}

.result-player-link.linked { color: #2563eb; }
.result-player-link.checking { color: #075985; }
.result-player-link.unlinked { color: #9b3a3a; }

.match-info {
    min-width: 0;
    font-size: 20px;
    line-height: 1.22;
}

.match-wins-sub {
    margin-top: 3px;
    color: var(--success);
    font-size: 12px;
}

.vs-label {
    color: var(--danger);
    font-weight: 900;
}

.table-badge {
    min-width: 42px;
    height: auto;
    min-height: 42px;
    margin-right: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #ffffff;
}

.final-badge {
    background: var(--accent);
    color: #422f0d;
    border-radius: 999px;
}

.p-item {
    min-height: 62px;
    gap: 12px;
    padding: 13px 14px;
    background: #ffffff;
    border-bottom: 1px solid var(--line-soft);
}

.p-item-main { min-width:0; }
.p-item-name-line { min-width:0; line-height:1.4; overflow-wrap:anywhere; }
.p-item-family { color:#7b8783; font-size:12px; white-space:nowrap; }
.p-item-record { display:block; margin-top:3px; white-space:nowrap; }
.p-item-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.p-item-cooldown { display:flex; flex-direction:column; color:#9a6700; font-size:12px; font-weight:900; line-height:1.35; }
.p-item-cooldown small { font-size:10px; white-space:nowrap; }
.participant-drop-button { border-color:#fecaca !important; background:#fff7f7 !important; color:#b91c1c !important; }

.p-item.is-adult {
    background: var(--adult-bg);
}

.p-item.selected {
    background: #fff7df !important;
    outline: 2px solid var(--accent);
    border-radius: 9px;
}

.family-label {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.p-warn-text,
.avoid-label {
    border-radius: 999px;
}

.avoid-label {
    background: #fff1e9;
    color: #a94d24;
    padding: 3px 8px;
}

.rank-card {
    border: 1px solid var(--line-soft) !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-card);
}

.rank-table {
    min-width: 600px;
    background: #ffffff;
}

.rank-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f0f6f4 !important;
    color: #445451 !important;
    border-bottom: 1px solid var(--line-soft);
    padding: 11px 8px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.rank-table td {
    background: #ffffff !important;
    color: var(--dark) !important;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 8px;
    font-size: 15px;
    vertical-align: middle;
}

.rank-table td:nth-child(2) {
    text-align: left;
    font-weight: 900;
}

.rank-table tr:first-child td,
.rank-table .row-rank-1 td {
    background: #fff8e6 !important;
    color: #1d2b2e !important;
    font-weight: 900;
}

.rank-table a,
.rank-table b[onclick] {
    color: var(--primary-strong) !important;
    text-decoration-color: rgba(15, 118, 110, 0.35) !important;
}

.rank-table .row-adult-rank td {
    background: #f5f7f6 !important;
    color: #687674 !important;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 24px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 13px;
}

#rank-target-toggle-bar,
#view-home > div[style*="display:flex"],
#view-results > div[style*="display:flex"],
.card div[style*="display:grid"] {
    gap: 8px !important;
}

button[onclick^="setRankTarget"],
button[onclick^="setRematch"],
button[onclick^="setFinalThresh"],
button[onclick^="setAdultPenaltyPreset"] {
    min-height: 44px;
    border-radius: 9px !important;
    font-weight: 900 !important;
    box-shadow: none !important;
}

#manual-bar {
    border: 1px solid #edd18b !important;
    background: #fff8e6 !important;
}

.player-detail-score-card { padding: 17px 18px; text-align: center; }
.player-detail-score { color: var(--primary); font-size: clamp(30px,8vw,42px); font-weight: 1000; line-height: 1.1; }
.player-detail-score-sub { margin-top: 6px; color: #66716f; font-size: 14px; font-weight: 800; }
.player-detail-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.player-detail-metrics div { padding:12px; border-radius:10px; background:#eaf5f0; }
.player-detail-metrics span,.player-detail-metrics strong { display:block; }
.player-detail-metrics span { color:#66716f; font-size:11px; font-weight:800; }
.player-detail-metrics strong { margin-top:3px; color:var(--primary); font-size:23px; }
.player-detail-opponents-title { margin:16px 0 9px; font-size:20px; }
.player-detail-table-wrap { overflow-x:auto; border:1px solid var(--line-soft); border-radius:12px; }
.player-detail-table { width:100%; min-width:390px; border-collapse:collapse; }
.player-detail-table th,.player-detail-table td { padding:10px 12px; border-bottom:1px solid var(--line-soft); text-align:center; }
.player-detail-table th:first-child,.player-detail-table td:first-child { text-align:left; }
.player-detail-table th { color:var(--primary); background:#eaf5f0; font-size:12px; }
.player-detail-result { font-size:23px; font-weight:1000; }
.player-detail-result.is-win { color:#ef476f; }
.player-detail-result.is-loss { color:#64748b; }
.player-detail-result.is-draw { color:#d97706; }
.player-detail-defeated { margin:10px 0 0; color:#66716f; font-size:12px; line-height:1.6; }
.player-detail-career,.player-detail-tournaments { padding:12px 16px; margin-bottom:12px; box-shadow:none; border-color:#e4e9e7; }
.player-detail-career-title { color:#7b8582; font-size:12px; font-weight:800; }
.player-detail-career-values { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:5px; color:#53615d; font-size:13px; font-weight:800; }
.player-detail-career-values span:first-child { color:#33413d; }
.rank-view-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:10px; }
.rank-view-tabs button { padding:10px 6px; border:2px solid #dce4e1; border-radius:10px; background:white; color:#69736f; font-size:13px; font-weight:900; cursor:pointer; }
.career-sync-status { margin:-2px 0 10px; padding:9px 12px; border-radius:9px; background:#f4f7f6; color:#63706c; font-size:12px; font-weight:800; line-height:1.5; }
.career-sync-status.is-ready { background:#edf9f4; color:#176b50; border:1px solid #b9e5d4; }
.career-sync-status.is-error { background:#fff4e8; color:#9a4c12; border:1px solid #f0c797; }
.career-sync-status button { margin-left:6px; border:1px solid currentColor; border-radius:7px; background:white; color:inherit; font-weight:900; cursor:pointer; }

#active-matches:empty::before,
#proposal-area:empty::before,
#waiting-list:empty::before,
#resting-list:empty::before {
    display: block;
    padding: 18px;
    color: var(--gray);
    font-size: 14px;
    text-align: center;
}

#active-matches:empty::before { content: "現在、対戦中の試合はありません。"; }
#proposal-area:empty::before { content: "参加者を登録すると、ここに推奨ペアが表示されます。"; }
#waiting-list:empty::before { content: "待機中の参加者はいません。"; }
#resting-list:empty::before { content: "休憩中の参加者はいません。"; }

.bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 920px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line-soft);
    border-bottom: 0;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    box-shadow: 0 -10px 28px rgba(23, 35, 38, 0.10);
    backdrop-filter: blur(14px);
}

.nav-item {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    color: #6b7875;
    font-weight: 800;
}

.nav-item i {
    margin-bottom: 0;
    font-size: 23px;
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.overlay {
    background: rgba(246, 248, 247, 0.98);
}

.overlay .card,
#dup-modal > div,
#share-text-modal > div {
    border: 1px solid var(--line-soft);
    border-radius: 14px !important;
    box-shadow: 0 24px 60px rgba(23, 35, 38, 0.18) !important;
}

#call-screen {
    background: #f6f8f7;
}

#call-screen .call-name {
    color: var(--dark);
    line-height: 1.08;
}

.final-overlay {
    background: linear-gradient(160deg, #183136, #0f766e);
}

.final-overlay .call-name {
    color: #ffffff;
}

hr {
    border-top-color: var(--line-soft) !important;
}

details summary {
    min-height: 38px;
    display: flex;
    align-items: center;
}

@media (min-width: 760px) {
    body {
        padding-top: 84px;
    }

    .app-shell-header {
        min-height: 70px;
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }

    .container {
        padding: 22px;
    }

    .card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .btn {
        min-height: 50px;
    }
}

@media (max-width: 560px) {
    body {
        padding-top: 72px;
        padding-bottom: 132px;
        font-size: 16px;
    }

    .app-shell-header {
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .app-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }

    .app-brand-title {
        font-size: 15px;
    }

    .app-brand-subtitle {
        display: none;
    }

    .app-status-panel {
        min-height: 30px;
        padding: 0 9px;
        font-size: 11px;
    }

    .header-qr-button { min-height:32px; padding:6px 9px; font-size:11px; }
    .header-setup-link { min-height:32px; padding:6px 8px; font-size:10px; }
    .quick-qr-card { align-items:stretch; flex-direction:column; }
    .quick-qr-card .btn { width:100%; }

    .host-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container {
        padding: 12px;
    }

    .page-title {
        min-height: 42px;
        margin-bottom: 10px;
        font-size: 20px;
    }

    .card {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .btn {
        min-height: 52px;
        padding: 11px 12px;
        font-size: 16px;
    }

    .tag-selector {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tag-opt {
        height: 52px;
    }

    .match-card {
        min-height: 70px;
        padding: 11px;
    }

    .match-info {
        font-size: 18px;
    }

    .host-live-alert { top:66px; }
    .host-rematch-answers { grid-template-columns:1fr; }
    .host-guide-priority { padding:8px; }
    .host-guide-primary-actions { grid-template-columns:minmax(0,1fr); gap:8px; }
    .host-guide-primary-actions .btn { width:100%; min-height:50px; }
    .p-item {
        display:grid;
        grid-template-columns:minmax(0,1fr);
        gap:9px;
        align-items:start;
        padding:12px;
    }
    .p-item-actions { justify-content:flex-start; }
    .waiting-player-row .status-btn { min-height:42px; }

    .rank-table {
        min-width: 560px;
    }

    .rank-table th,
    .rank-table td {
        padding: 10px 7px;
        font-size: 14px;
    }

    .bottom-nav {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .nav-item {
        min-height: 58px;
        font-size: 11px;
    }

    .nav-item i {
        font-size: 21px;
    }
}

.nav-icon-with-badge { position:relative; }
.nav-count-badge { position:absolute; top:-7px; right:-12px; min-width:18px; height:18px; padding:0 4px; border:2px solid #fff; border-radius:999px; background:#dc2626; color:#fff; font:900 10px/14px system-ui,sans-serif; text-align:center; }
.nav-count-badge[hidden] { display:none; }

@media (max-width: 380px) {
    .app-shell-header { gap:6px; padding-left:8px; padding-right:8px; }
    .app-brand { gap:6px; }
    .app-brand-title { font-size:13px; }
    .app-header-actions { gap:4px; }

    .app-status-panel span:last-child {
        display: none;
    }

    .app-status-panel {
        width: 32px;
        justify-content: center;
        padding: 0;
    }

    .btn {
        font-size: 15px;
    }
}

.online-admin-card { border: 2px solid #99d5cb; background: #f8fffd; scroll-margin-top:96px; }
.online-admin-card.online-panel-focus { outline:5px solid rgba(29,78,216,.22); box-shadow:0 0 0 8px rgba(29,78,216,.08),var(--shadow-raised); }
#online-current-qr, #online-create, #online-reconnect, #online-new-event, #online-create-confirm { scroll-margin-top:96px; }
.online-admin-card input[type="text"],
.online-admin-card input[type="password"] { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid #d4e3df; border-radius: 10px; font: inherit; }
.online-grid { display: grid; gap: 10px; }
.online-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.online-toggle { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 8px; border-radius: 10px; background: white; font-size: 13px; font-weight: 800; }
.online-toggle input { width: 22px; height: 22px; }
.online-url { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; }
.online-url code { overflow: hidden; padding: 10px; border-radius: 8px; background: #e8f2ef; text-overflow: ellipsis; white-space: nowrap; }
.host-player-launch { display:grid; gap:7px; margin-top:12px; padding:12px; border:2px solid #bfd9ff; border-radius:12px; background:#f4f8ff; color:#24436f; }
.host-player-launch strong { font-size:14px; }
.host-player-launch span { font-size:12px; line-height:1.65; }
.host-player-launch .btn { margin:2px 0 0; }
.online-qr { width: min(260px, 100%); display: block; margin: 12px auto; background: white; border-radius: 12px; }
.online-qr-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 10px; }
.online-qr-actions .online-mini { display:flex; align-items:center; justify-content:center; min-height:44px; text-decoration:none; }
.online-qr-actions .online-mini.print { background:#0b766d; color:#ffffff; }
.online-participant { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-top: 1px solid #dae7e4; }
.online-participant:first-child { border-top: 0; }
.online-participant small { display: block; color: #72827e; }
.online-participant-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.online-mini { min-height: 38px; padding: 6px 9px; border: 0; border-radius: 8px; font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; background: #deece9; color: #174c45; }
.online-mini.danger { background: #fee2e2; color: #b91c1c; }
.btn:disabled, .status-btn:disabled, .online-mini:disabled { opacity: .45; filter: grayscale(1); cursor: not-allowed; box-shadow: none; transform: none; }
.history-undo-reason { flex-basis: 100%; color: var(--gray); font-size: 11px; line-height: 1.5; margin-top: 4px; }
.history-undo-reason[hidden] { display: none; }
.online-status { padding: 9px 11px; border-radius: 9px; background: #e8f2ef; color: #315e58; font-size: 12px; font-weight: 800; }
.online-status.error { background: #fff0f0; color: #a62020; }
.emergency-handoff { margin-top: 12px; border: 2px solid #f59e0b; border-radius: 12px; background: #fffbeb; overflow: hidden; }
.emergency-handoff > summary { cursor: pointer; padding: 12px 14px; color: #92400e; font-size: 13px; font-weight: 900; }
.emergency-handoff-body { padding: 0 14px 14px; color: #667a76; font-size: 12px; line-height: 1.65; }
.emergency-handoff-actions { display: grid; gap: 8px; }
.emergency-handoff-actions .btn { width: 100%; text-align: center; text-decoration: none; box-sizing: border-box; }
.emergency-handoff-warning { margin: 10px 0 0; padding: 10px; border-radius: 8px; background: #fff; color: #7c2d12; }
.online-operations-snapshot { margin-top:9px; padding:12px; border:2px solid #bfd9ff; border-radius:12px; background:#f7faff; color:#24436f; }
.online-operations-title { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:13px; }
.online-operations-title span { font-size:11px; color:#5f7190; }
.online-operations-counts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin-top:9px; }
.online-operations-counts span { padding:7px 4px; border-radius:8px; background:#fff; text-align:center; font-size:10px; font-weight:900; }
.online-operations-counts b { display:block; font-size:19px; line-height:1.1; }
.online-device-health { display:flex; flex-wrap:wrap; gap:5px 10px; margin-top:9px; font-size:11px; font-weight:900; }
.online-device-health .fresh { color:#187347; }
.online-device-health .delayed { color:#9a6700; }
.online-device-health .stale { color:#b42318; }
.online-device-health .checking { color:#2563eb; }
.online-device-health .unlinked { color:#667085; }
.online-resume-panel { margin-top:9px; padding:13px; border:3px solid #d97706; border-radius:13px; background:#fffaf0; color:#7c2d12; }
.online-resume-panel > strong { font-size:16px; }
.online-resume-panel p { margin:9px 0; font-size:12px; line-height:1.65; }
.online-resume-checks { display:grid; gap:5px; margin-top:9px; }
.online-resume-checks span { padding:7px 9px; border-radius:8px; font-size:12px; font-weight:900; }
.online-resume-checks .ok { background:#eaf7ef; color:#17613a; }
.online-resume-checks .warn { background:#fff1e6; color:#9a3412; }
.online-resume-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.online-participant.freshness-stale { padding-left:8px; border-left:4px solid #dc2626; background:#fff7f7; }
.online-participant.freshness-delayed { padding-left:8px; border-left:4px solid #d97706; background:#fffbeb; }
.online-participant.freshness-checking { padding-left:8px; border-left:4px solid #2563eb; background:#eff6ff; }
.online-result-row { padding: 10px 0; border-top: 1px solid #dae7e4; }
.online-result-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 7px; }
.participant-link-badge { display:inline-flex; align-items:center; min-height:24px; padding:3px 7px; border-radius:999px; font-size:11px; font-weight:900; line-height:1.2; white-space:nowrap; }
.participant-link-badge.linked { background:#dbeafe; color:#1d4ed8; }
.participant-link-badge.checking { background:#e0f2fe; color:#075985; }
.participant-link-badge.unlinked { background:#edf1f0; color:#66736f; }
@media (max-width: 480px) { .online-two { grid-template-columns: 1fr; } .online-participant { grid-template-columns: 1fr; } .online-participant-actions { justify-content: flex-start; } .online-resume-actions { grid-template-columns:1fr; } }
#online-action-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}
