/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Oswald:wght@400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
    --bg:           #0f0e0c;
    --bg-card:      #161411;
    --bg-secondary: #232018;
    --bg-input:     #231f17;
    --bg-muted:     #1f1c19;
    --text:         #ccbf9f;
    --text-muted:   #7a7060;
    --primary:      #eeab05;
    --primary-dim:  rgba(238,171,5,.15);
    --primary-glow: 0 0 8px hsl(38 90% 50% / .4), 0 0 20px hsl(38 90% 50% / .15);
    --green:        #3a9e3a;
    --green-glow:   0 0 8px hsl(120 60% 35% / .5), 0 0 20px hsl(120 60% 35% / .2);
    --red:          #c91414;
    --border:       #2c2218;
    --border-hi:    rgba(238,171,5,.3);
    --radius:       2px;
    --font-mono:    'Share Tech Mono', monospace;
    --font-heading: 'Oswald', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Scanline overlay ── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,.03) 2px,
        rgba(0,0,0,.03) 4px
    );
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Hazard stripe ── */
.hazard-stripe {
    background: repeating-linear-gradient(
        -45deg,
        #1a1a1a,
        #1a1a1a 12px,
        rgba(199,141,5,.85) 12px,
        rgba(199,141,5,.85) 24px
    );
    height: 6px;
    flex-shrink: 0;
}

/* ══════════════════════════════
   LOGIN PAGE
══════════════════════════════ */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-wrapper::before {
    content: "";
    display: block;
    width: 100%;
    height: 6px;
    position: fixed;
    top: 0;
    left: 0;
    background: repeating-linear-gradient(
        -45deg,
        #1a1a1a, #1a1a1a 12px,
        rgba(199,141,5,.85) 12px, rgba(199,141,5,.85) 24px
    );
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 40px rgba(0,0,0,.6), 0 0 0 1px var(--border);
}

.login-card h1 {
    font-family: var(--font-heading);
    text-align: center;
    margin-bottom: 1.8rem;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    text-shadow: var(--primary-glow);
}

/* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hazard stripe at top of shell */
.app-shell::before {
    content: "";
    display: block;
    height: 6px;
    flex-shrink: 0;
    background: repeating-linear-gradient(
        -45deg,
        #1a1a1a, #1a1a1a 12px,
        rgba(199,141,5,.85) 12px, rgba(199,141,5,.85) 24px
    );
}

/* Inner layout: sidebar + content */
.app-shell > .app-inner {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ── Sidebar ── */
.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.25rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--primary);
    text-shadow: var(--primary-glow);
}

.sidebar-username {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .3rem;
    letter-spacing: .05em;
}

.role-badge {
    display: inline-block;
    margin-top: .4rem;
    padding: .15rem .55rem;
    border-radius: var(--radius);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-family: var(--font-heading);
    border: 1px solid;
}

.role-admin     { background: rgba(201,20,20,.2);  color: #e05555; border-color: rgba(201,20,20,.4); }
.role-organiser { background: rgba(30,120,220,.2); color: #5599e8; border-color: rgba(30,120,220,.4); }
.role-player    { background: rgba(58,158,58,.2);  color: #5ec45e; border-color: rgba(58,158,58,.4); }

.sidebar-nav { flex: 1; padding: .5rem 0; }

.nav-section-label {
    padding: 1rem 1.2rem .25rem;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .82rem;
    letter-spacing: .04em;
    transition: color .12s, background .12s, border-color .12s;
    border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--primary-dim);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-left-color: var(--primary);
    text-shadow: var(--primary-glow);
}

.sidebar-footer {
    padding: .9rem 1.2rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .8rem;
    transition: color .12s;
}

.sidebar-footer a:hover { color: var(--primary); }

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ══════════════════════════════
   TYPOGRAPHY
══════════════════════════════ */
.main-content h1,
.page-header h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    text-shadow: var(--primary-glow);
    margin-bottom: .5rem;
}

.main-content p { color: var(--text-muted); }

.section-heading {
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-hi);
    padding-bottom: .4rem;
    margin: 1.75rem 0 .75rem;
}

/* ══════════════════════════════
   ALERTS
══════════════════════════════ */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .85rem;
    letter-spacing: .03em;
    border-left: 3px solid;
}

.alert-success {
    background: rgba(58,158,58,.1);
    color: #5ec45e;
    border-color: var(--green);
    border: 1px solid rgba(58,158,58,.35);
    border-left: 3px solid var(--green);
}

.alert-error {
    background: rgba(201,20,20,.1);
    color: #e05555;
    border: 1px solid rgba(201,20,20,.35);
    border-left: 3px solid var(--red);
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}

/* ══════════════════════════════
   PAGE HEADER
══════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-hi);
}

.page-header h1 { margin-bottom: 0; }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.btn {
    display: inline-block;
    padding: .55rem 1.3rem;
    background: var(--primary);
    color: var(--bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
    width: 160px;
    text-align: center;
}

.btn:hover {
    background: #d49a04;
    box-shadow: 0 0 12px rgba(238,171,5,.35);
}

.btn:disabled,
.btn[disabled] {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    box-shadow: none;
}

/* Login page btn is full-width */
.login-card .btn { display: block; width: 100%; }

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    padding: .55rem 1.3rem;
    display: inline-block;
    transition: border-color .15s, color .15s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-inline {
    display: inline-block;
    padding: .45rem 1.1rem;
    font-size: .8rem;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: .85rem;
    letter-spacing: .04em;
    transition: text-shadow .15s;
}

.btn-link:hover { text-shadow: var(--primary-glow); }

/* ══════════════════════════════
   FORM ELEMENTS
══════════════════════════════ */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    max-width: 520px;
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    margin-bottom: .4rem;
    font-size: .75rem;
    font-weight: 400;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.form-group input,
.form-group select,
.form-card .form-group input,
.form-card .form-group select {
    width: 100%;
    padding: .6rem .85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-card .form-group input:focus,
.form-card .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group select option { background: var(--bg-input); }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    align-items: center;
}

.field-error {
    display: block;
    color: #e05555;
    font-size: .78rem;
    margin-top: .3rem;
    letter-spacing: .03em;
}

.field-hint {
    display: block;
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: .3rem;
    letter-spacing: .03em;
}

/* ══════════════════════════════
   DATA TABLE
══════════════════════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.data-table th {
    background: var(--bg-secondary);
    padding: .65rem 1rem;
    text-align: left;
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary);
    border-bottom: 1px solid var(--border-hi);
}

.data-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
    background: var(--primary-dim);
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem !important;
    letter-spacing: .06em;
}

.actions-cell { white-space: nowrap; }

.action-link {
    color: var(--primary);
    text-decoration: none;
    font-size: .8rem;
    margin-right: .75rem;
    letter-spacing: .04em;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: text-shadow .12s;
    padding: 0;
}

.action-link:hover { text-shadow: var(--primary-glow); }

.action-link-danger {
    color: #e05555;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .8rem;
    margin-right: .75rem;
    padding: 0;
    transition: text-shadow .12s;
}

.action-link-danger:hover { text-shadow: 0 0 8px rgba(201,20,20,.5); }

/* ── Status badges ── */
.status-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid;
}

.status-active   { background: rgba(58,158,58,.15);  color: #5ec45e; border-color: rgba(58,158,58,.4); }
.status-inactive { background: rgba(201,20,20,.15);  color: #e05555; border-color: rgba(201,20,20,.4); }
.status-na       { color: var(--text-muted); border-color: transparent; background: transparent; }

/* ── Score cells ── */
.score-done    { text-align: center; color: #5ec45e; font-weight: 600; text-shadow: var(--green-glow); }
.score-pending { text-align: center; color: var(--text-muted); }

/* ── Match result row highlighting ── */
.data-table td.result-win  { color: #5ec45e; font-weight: 600; text-shadow: var(--green-glow); }
.data-table td.result-draw { color: #e0b840; font-weight: 600; }
.data-table td.result-loss { color: #e05555; font-weight: 600; }

.score-input {
    width: 80px;
    padding: .35rem .6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .9rem;
    text-align: center;
}
.score-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

/* ══════════════════════════════
   MENU PAGE
══════════════════════════════ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
}

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: border-color .15s, box-shadow .15s, color .15s;
    display: block;
}

.menu-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-dim), inset 0 0 16px var(--primary-dim);
    color: var(--primary);
}

.menu-card .icon {
    font-size: 1.8rem;
    margin-bottom: .6rem;
    display: block;
}

.menu-card h3 {
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .3rem;
    color: var(--primary);
}

.menu-card p { font-size: .78rem; color: var(--text-muted); }

.menu-card.placeholder {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

/* ══════════════════════════════
   RADIO ROWS (score entry)
══════════════════════════════ */
.radio-row {
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
}

.radio-row:last-child { border-bottom: none; }

.radio-row label {
    display: grid;
    grid-template-columns: 1.2rem 2rem 1fr;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-size: .88rem;
    color: var(--text);
    line-height: 1.4;
}

.radio-row input[type="radio"] {
    cursor: pointer;
    accent-color: var(--primary);
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.radio-row label strong {
    display: block;
    text-align: right;
    color: var(--primary);
    font-weight: 600;
}

/* Vote rows — player name + gang info, no score number column */
.radio-row--vote label {
    grid-template-columns: 1.2rem 1fr auto;
}

.radio-row--vote .vote-name {
    color: var(--primary);
    font-weight: 600;
}

.radio-row--vote .vote-gang {
    color: var(--text-muted);
    font-size: .85rem;
    white-space: nowrap;
}

/* ══════════════════════════════
   PAINT SCORE ENTRY
══════════════════════════════ */
.ps-section {
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.ps-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .75rem 1rem .5rem;
    border-bottom: 1px solid var(--primary);
}

.ps-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ps-section-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.ps-section-pts {
    font-size: .85rem;
    color: var(--primary);
    white-space: nowrap;
    padding-top: .2rem;
}

.ps-row {
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border);
}

.ps-row:last-of-type { border-bottom: none; }

.ps-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .4rem;
}

.ps-label {
    font-size: .9rem;
    color: var(--text);
    font-weight: 500;
}

.ps-row-score {
    font-size: .85rem;
    color: var(--primary);
    font-weight: 600;
}

.ps-chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.ps-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.2rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}

.ps-chip input[type="radio"] { display: none; }

.ps-chip--on {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
    font-weight: 700;
}

.ps-chip:hover:not(.ps-chip--on) {
    border-color: var(--border-hi);
    color: var(--text);
}

.ps-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 1rem;
    background: var(--bg-secondary);
    font-size: .8rem;
    color: var(--text-muted);
    letter-spacing: .05em;
    border-top: 1px solid var(--border);
}

.ps-subtotal span:last-child {
    color: var(--primary);
    font-weight: 700;
    font-size: .95rem;
}

/* Checklist rows */
.ps-check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
}

.ps-check-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text);
}

.ps-check-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.ps-check-pts {
    font-size: .85rem;
    color: var(--primary);
    white-space: nowrap;
}

/* Grand total bar */
.ps-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--text-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ps-grand-total span:last-child {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.3rem;
}

/* ══════════════════════════════
   BATTLE POINT CHECKBOXES
══════════════════════════════ */
.bp-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.bp-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    cursor: pointer;
}

.bp-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid var(--border-hi);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.bp-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.bp-checkbox span {
    font-size: .75rem;
    color: var(--text-muted);
}

.bp-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 700;
}

.bp-total {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text);
}

.bp-total strong {
    color: var(--primary);
    font-size: 1.4rem;
}

.bp-reference {
    margin-top: 1.25rem;
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    padding: .6rem .85rem;
}

.bp-reference summary {
    cursor: pointer;
    color: var(--primary);
    font-size: .9rem;
    user-select: none;
    list-style: none;
}

.bp-reference summary::-webkit-details-marker { display: none; }

.bp-reference[open] summary { margin-bottom: .25rem; }

/* ══════════════════════════════
   HAMBURGER TOGGLE (hidden on desktop)
══════════════════════════════ */
.nav-toggle {
    display: none;
    position: fixed;
    top: .7rem;
    left: .75rem;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    color: var(--primary);
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    transition: box-shadow .15s;
    padding: 0;
}

.nav-toggle:hover { box-shadow: var(--primary-glow); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 998;
}

.nav-overlay.open { display: block; }

/* ══════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
══════════════════════════════ */
@media (max-width: 768px) {

    /* Show hamburger */
    .nav-toggle { display: flex; }

    /* Sidebar becomes a fixed overlay panel */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,.7);
    }

    /* Main content fills full width */
    .app-inner { flex-direction: column; }

    .main-content {
        padding: 1rem;
        padding-top: 3.5rem; /* clear the hamburger button */
    }

    /* Tables scroll horizontally instead of overflowing */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Form cards go full width */
    .form-card {
        max-width: 100%;
        padding: 1.25rem 1rem;
    }

    /* Side-by-side form fields stack vertically */
    .form-row { flex-direction: column; }

    /* Action buttons stack and go full width */
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn,
    .form-actions .btn-secondary,
    .form-actions a.btn,
    .form-actions a.btn-secondary {
        text-align: center;
        width: 100%;
    }

    /* Page header wraps on narrow screens */
    .page-header {
        flex-wrap: wrap;
        gap: .5rem;
    }

    /* Bigger touch targets */
    .btn, .btn-secondary {
        min-height: 2.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-nav a {
        padding: .75rem 1.2rem;
        font-size: .9rem;
    }

    /* Login card fits the screen */
    .login-card {
        margin: 1rem;
        padding: 2rem 1.25rem;
    }
}

/* ── Award cards (Final Results) ── */
.award-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.award-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.25rem 1.5rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.award-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.award-card--king::before    { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.award-card--sports::before  { background: linear-gradient(90deg, #22c55e, #86efac); }
.award-card--general::before { background: linear-gradient(90deg, #ef4444, #fca5a5); }
.award-card--paint::before    { background: linear-gradient(90deg, #a855f7, #d8b4fe); }
.award-card--helmawr::before  { background: linear-gradient(90deg, #dc2626, #f97316); }

.award-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: .5rem;
}

.award-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: .1rem;
}

.award-subtitle {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .9rem;
}

.award-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: .2rem;
    text-shadow: var(--primary-glow);
}

.award-gang {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.award-score {
    font-size: .78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: .6rem;
}

/* ── Tactics Card Browser ── */
.tc-category summary.tc-cat-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--primary);
    list-style: none;
    user-select: none;
}
.tc-cat-name { flex: 1; }
.tc-category summary.tc-cat-header::-webkit-details-marker { display: none; }
.tc-category summary.tc-cat-header::before {
    content: '▸';
    margin-right: .4rem;
    font-size: .7rem;
    transition: transform .15s;
}
.tc-category[open] summary.tc-cat-header::before { transform: rotate(90deg); }

.tc-cat-count {
    background: var(--bg-input);
    border-radius: 999px;
    padding: .1rem .5rem;
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.tc-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tc-card-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}
.tc-card-item:last-child { border-bottom: none; }

.tc-card-btn {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: none;
    border: none;
    padding: .45rem .75rem .45rem 1.25rem;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text);
    cursor: pointer;
    transition: background .12s, color .12s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tc-card-btn:hover         { background: rgba(255,255,255,.04); color: var(--primary); }
.tc-card-btn--active       { background: rgba(212,175,55,.08); color: var(--primary); font-weight: 700; }
.tc-card-btn--disabled     { color: var(--text-muted); text-decoration: line-through; opacity: .55; }

/* ── Toggle dot button ── */
.tc-toggle {
    flex-shrink: 0;
    width: 30px;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .12s;
}
.tc-toggle:hover { background: rgba(255,255,255,.06); }
.tc-toggle::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transition: background .15s;
}
.tc-toggle--on::before    { background: #4caf50; }
.tc-toggle--off::before   { background: #555; }
.tc-toggle--mixed::before { background: #ff9800; }

/* ── Tactics card collapse button (player dashboard) ── */
.tc-card-collapse-btn {
    background: none;
    border: none;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0 .15rem;
    opacity: .7;
    flex-shrink: 0;
}
.tc-card-collapse-btn:hover { opacity: 1; }

.tc-card-delete-btn {
    background: #444;
    border: 1px solid #c0392b;
    border-radius: 3px;
    color: #c0392b;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: .1rem .3rem;
    flex-shrink: 0;
    transition: background .12s;
}
.tc-card-delete-btn:hover { background: #555; }

/* ── Physical card representation ── */
.tc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    max-width: 520px;
    box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.tc-card-category {
    background: var(--primary);
    color: #000;
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .35rem .85rem;
}
.tc-card-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .85rem .85rem .5rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.tc-card-body {
    padding: .85rem;
    font-size: .875rem;
    line-height: 1.6;
    color: var(--text);
    min-height: 80px;
}
.tc-card-body p { margin: 0 0 .6rem; }
.tc-card-body p:last-child { margin-bottom: 0; }
.tc-bullets {
    margin: .3rem 0 .6rem 1rem;
    padding: 0;
    list-style: disc;
}
.tc-bullets li { margin-bottom: .25rem; }
.tc-card-ref {
    padding: .45rem .85rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-input);
}
