:root {
    --bg: #060b1f;
    --bg-soft: #0d1637;
    --surface: rgba(13, 24, 61, 0.9);
    --text: #edf1ff;
    --muted: #a8b4d8;
    --gold: #e8c06d;
    --gold-soft: rgba(232, 192, 109, 0.2);
    --silver: #c9d0e7;
    --bronze: #c4956a;
    --line: rgba(167, 179, 216, 0.23);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -10%, rgba(94, 119, 229, 0.18), transparent 44%),
        radial-gradient(circle at 90% 10%, rgba(232, 192, 109, 0.18), transparent 45%),
        linear-gradient(120deg, #050914 0%, #060d23 45%, #071130 100%);
}

body.ranking-locked .ranking-header,
body.ranking-locked .ranking-main {
    opacity: 0;
    pointer-events: none;
}

.access-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 19, 0.82);
    display: none;
    place-items: center;
    z-index: 60;
    padding: 18px;
}

.access-modal-overlay.visible {
    display: grid;
}

.access-modal {
    width: min(430px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(232, 192, 109, 0.3);
    background: linear-gradient(160deg, rgba(13, 24, 61, 0.98), rgba(8, 15, 39, 0.98));
    box-shadow: 0 24px 40px rgba(2, 4, 12, 0.55);
    padding: 18px;
}

.access-modal h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.7rem;
    color: #f3e5c0;
}

.access-modal-subtitle {
    margin-top: 8px;
    color: #b6c2e6;
    font-size: 0.92rem;
}

.access-code-form {
    margin-top: 14px;
}

.access-code-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(206, 214, 239, 0.3);
    background: rgba(5, 11, 31, 0.7);
    color: var(--text);
    font-size: 1rem;
    padding: 11px 12px;
    outline: none;
}

.access-code-input:focus {
    border-color: rgba(232, 192, 109, 0.68);
}

.access-code-error {
    min-height: 20px;
    margin-top: 8px;
    color: #ffc5c5;
    font-size: 0.85rem;
}

.access-code-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.access-btn {
    border-radius: 9px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
}

.access-btn-primary {
    border: none;
    color: #16110a;
    background: linear-gradient(135deg, #c39a4a, #f0c76d);
}

.access-btn-secondary {
    border: 1px solid rgba(189, 198, 229, 0.32);
    color: #dbe2fb;
    background: rgba(255, 255, 255, 0.03);
}

.ranking-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(5, 10, 28, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(232, 192, 109, 0.25);
}

.ranking-topbar {
    width: min(1080px, 92vw);
    margin: 0 auto;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff6df 10%, #e8c06d 70%, #a67929 100%);
    box-shadow: 0 0 14px rgba(232, 192, 109, 0.6);
}

.brand-title {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #f7e8c2;
}

.back-link {
    text-decoration: none;
    color: var(--gold);
    border: 1px solid rgba(232, 192, 109, 0.4);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ranking-main {
    width: min(1080px, 92vw);
    margin: 0 auto;
    padding: 56px 0 90px;
    display: grid;
    gap: 30px;
}

.intro {
    text-align: center;
    display: grid;
    gap: 12px;
}

.intro-label {
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

.intro h1 {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 600;
}

.updated-at {
    color: var(--muted);
    font-size: 0.93rem;
}

.podium-section,
.table-section {
    background: linear-gradient(160deg, var(--surface), rgba(8, 15, 39, 0.86));
    border: 1px solid rgba(232, 192, 109, 0.22);
    border-radius: 18px;
    padding: 22px;
}

.podium-section h2,
.table-section h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
    margin-bottom: 16px;
}

.podium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.podium-card {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(6, 14, 34, 0.8);
    padding: 14px;
    text-align: center;
    display: grid;
    gap: 8px;
}

.place-badge {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
}

.place-1 .place-badge {
    background: var(--gold-soft);
    border: 1px solid rgba(232, 192, 109, 0.5);
    color: var(--gold);
}

.place-2 .place-badge {
    background: rgba(201, 208, 231, 0.14);
    border: 1px solid rgba(201, 208, 231, 0.48);
    color: var(--silver);
}

.place-3 .place-badge {
    background: rgba(196, 149, 106, 0.14);
    border: 1px solid rgba(196, 149, 106, 0.44);
    color: var(--bronze);
}

.podium-photo {
    width: 94px;
    height: 94px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 2px solid rgba(232, 192, 109, 0.4);
}

.podium-card h3 {
    font-size: 1rem;
    font-weight: 700;
}

.podium-card p {
    color: var(--muted);
    font-size: 0.86rem;
}

.podium-card strong {
    color: #f4d188;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: #cfd8f5;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.candidate-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 700px) {
    .back-link {
        font-size: 0.7rem;
        padding: 7px 11px;
    }

    .podium-section,
    .table-section {
        padding: 16px;
    }
}
