:root {
    color-scheme: dark;
    --bg: #131011;
    --bg-card: #1c1719;
    --bg-head: #241d1f;
    --border: #322a2c;
    --text: #f2eceb;
    --text-muted: #9d908f;
    --lamb: #ff9393;
    --ram: #ea2323;
    --dark: #a81919;
    --radius: 5px;
}

.jacquard-12-regular {
  font-family: "Jacquard 12", system-ui;
  font-weight: 400;
  font-style: normal;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    padding: 32px clamp(16px, 5vw, 56px) 56px;
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 50% -240px, rgba(234, 35, 35, 0.18), transparent 70%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto 28px;
}

.eyebrow {
    margin: 0;
    color: var(--ram);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 4px 0 0;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    letter-spacing: -0.02em;
    font-family: "Jacquard 12", system-ui;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.refresh {
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.refresh:hover:not(:disabled) {
    border-color: var(--ram);
    background: var(--bg-head);
}

.refresh:disabled {
    opacity: 0.5;
    cursor: progress;
}

.gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px 0;
}

.gate-box {
    width: min(380px, 100%);
    padding: 30px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    text-align: center;
}

.gate-box h2 {
    font-family: "Jacquard 12", system-ui;
    margin: 4px 0 0;
    font-size: 1.4rem;
}

.gate-hint {
    margin: 8px 0 20px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.gate-box input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}

.gate-box input:focus {
    border-color: var(--ram);
    outline: none;
}

.gate-box button {
    width: 100%;
    margin-top: 12px;
    padding: 11px 18px;
    border: 1px solid var(--dark);
    border-radius: 10px;
    background: var(--dark);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.gate-box button:hover:not(:disabled) {
    border-color: var(--ram);
    background: var(--ram);
}

.gate-box button:disabled {
    opacity: 0.55;
    cursor: progress;
}

.gate-error {
    margin: 16px 0 0;
    color: var(--lamb);
    font-size: 0.85rem;
}

.gate-notice {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.86rem;
    text-align: left;
}

.gate-notice p {
    margin: 0 0 10px;
}

.gate-link {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--dark);
    border-radius: 10px;
    color: var(--lamb);
    font-size: 0.84rem;
    text-align: center;
    text-decoration: none;
    word-break: break-all;
}

.gate-link:hover {
    border-color: var(--ram);
    color: var(--text);
}

.sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 1180px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .sections {
        grid-template-columns: 1fr 1fr;
    }

    .weeklyplan,
    .leaderboard-level {
        grid-column: 1 / -1;
    }
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.card-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(234, 35, 35, 0.09), transparent);
}

.card-head h2 {
    font-family: "Jacquard 12", system-ui;
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.card-hint {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.card-hint code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--bg-head);
    font-size: 0.82em;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    padding: 11px 16px;
    background: var(--bg-head);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(234, 35, 35, 0.06);
}

.col-rank {
    width: 1%;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.col-rank-1 { color: #ffd05e; }
.col-rank-2 { color: #d8dbe0; }
.col-rank-3 { color: #d38b52; }

.col-name {
    font-weight: 600;
}

.col-number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.col-muted {
    color: var(--text-muted);
}

.col-nowrap {
    white-space: nowrap;
}

.col-title .title {
    display: block;
    font-weight: 600;
}

.col-title .description {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.83rem;
}

.role {
    color: var(--lamb);
    font-weight: 600;
    white-space: nowrap;
}

.col-progress {
    min-width: 150px;
}

.bar {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-head);
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ram);
    transition: width 0.3s ease;
}

.bar-label {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-planned {
    border-color: rgba(255, 147, 147, 0.35);
    color: var(--lamb);
}

.badge-posted {
    border-color: rgba(120, 200, 130, 0.35);
    color: #7cc98a;
}

.state {
    margin: 0;
    padding: 26px 22px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.state-error {
    color: var(--lamb);
}

noscript .state-error {
    max-width: 1180px;
    margin: 0 auto 22px;
    border: 1px solid var(--dark);
    border-radius: var(--radius);
    background: var(--bg-card);
}

footer {
    max-width: 1180px;
    margin: 34px auto 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

footer p {
    margin: 0;
}

