/* ================================================================
   FONTS
   ================================================================ */
@font-face {
    font-family: 'BetterWith';
    src: url('../assets/fonts/BetterWith-Regular.otf') format('opentype');
    font-weight: 400 900;
    font-style: normal;
}

/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
    --red:      #f70000;
    --red2:     #cc0000;
    --red-glow: rgba(247, 0, 0, 0.35);
    --gold:     #FFD700;
    --gold2:    #FFAA00;
    --white:    #ffffff;
    --off-white:#f5f5f5;
    --dark:     #0a0a0a;
    --dark2:    #111111;
    --dark3:    #1a1a1a;
    --glass:    rgba(255,255,255,0.08);
    --glass2:   rgba(255,255,255,0.14);
    --border:   rgba(255,255,255,0.15);
    --font:     'BetterWith', 'Arial', sans-serif;
}

/* ================================================================
   RESET + BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Responsive-first: always fill viewport */
html, body {
    width: 100vw; height: 100dvh;
    overflow: hidden;
    background: #000;
    font-family: var(--font);
    font-size: 18px;
    color: var(--white);
    -webkit-font-smoothing: antialiased;
}
/* Kiosk: exact portrait dimensions only when monitor supports it */
@media (min-width: 1080px) and (min-height: 1920px) {
    html, body { width: 1080px; height: 1920px; }
    .screen { width: 1080px; height: 1920px; }
}

/* ================================================================
   SCREEN SYSTEM
   ================================================================ */
.screen {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: none;
    overflow: hidden;
    background: url('../assets/images/bg-app.png') center/cover no-repeat;
}
.screen.active { display: block; }

/* ================================================================
   GLOBAL FOOTER
   ================================================================ */
.app-footer {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 3vh;
    z-index: 200;
    pointer-events: none;
}
.app-footer img {
    height: auto;
    width: 30vw;
    opacity: 0.9;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}
#s0.active ~ .app-footer { display: none; }
#s1v.active ~ .app-footer { display: none; }

/* ================================================================
   UTILITIES
   ================================================================ */
.hidden { display: none !important; }

/* ================================================================
   MODAL — Duplicate phone
   ================================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-box {
    background: #fff;
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 420px; width: 100%;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.modal-icon { font-size: 48px; line-height: 1; }
.modal-title {
    font-family: var(--font); font-size: 22px; font-weight: 900;
    color: #111; letter-spacing: 0.04em;
}
.modal-body {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 15px; color: #555; width: 100%;
}
.modal-body p { margin: 4px 0; }
.modal-highlight {
    font-family: var(--font); font-size: 20px; font-weight: 800;
    color: #111; padding: 10px 16px;
    background: #f5f5f5; border-radius: 12px;
    margin: 4px 0;
}
.modal-team { color: var(--red); }
.modal-box .pill-btn { margin-top: 8px; width: 100%; }

/* ================================================================
   PILL BUTTONS — shared across multiple screens
   ================================================================ */
.pill-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 28px 64px;
    border-radius: 100px;
    border: none; cursor: pointer;
    font-family: var(--font); font-size: 28px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.2s;
    user-select: none; -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.pill-btn:active { transform: scale(0.97); }
.pill-btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; }

.pill-btn-primary {
    background: linear-gradient(135deg, var(--red), var(--red2));
    color: #fff;
    box-shadow: 0 8px 32px var(--red-glow), 0 2px 8px rgba(0,0,0,0.4);
}
.pill-btn-primary:hover:not(:disabled) {
    box-shadow: 0 12px 48px var(--red-glow), 0 4px 16px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}
.pill-btn-primary.ready {
    animation: btn-pulse 2s ease-in-out infinite;
}
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 8px 32px var(--red-glow), 0 2px 8px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 8px 56px rgba(247,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4); }
}

.pill-btn-ghost {
    background: transparent;
    color: rgba(255,255,255,0.75);
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.pill-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ================================================================
   S1 — DATA ENTRY
   ================================================================ */
.s1-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 52px;
    padding: 60px 110px 200px;
}

.s1-header-text {
    position: absolute;
    top: 10vh;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    overflow: hidden;
}

.s1-header-line1,
.s1-header-line2 {
    font-family: var(--font);
    font-size: 6vw;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 4px 24px rgba(0,0,0,0.6);
}

.s1-form-card {
    width: 100%;
    display: flex; flex-direction: column;
    gap: 36px;
}

.s1-field {
    display: flex; flex-direction: column;
    gap: 14px;
}

.s1-label {
    font-family: var(--font);
    font-size: 30px; font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.s1-input {
    width: 100%;
    background: #fff;
    border: none;
    border-radius: 18px;
    padding: 28px 40px;
    font-family: var(--font); font-size: 40px; font-weight: 700;
    color: #111;
    outline: none;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s;
}
.s1-input::placeholder { color: rgba(247,0,0,0.2); }
.s1-input:focus {
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 6px rgba(255,255,255,0.5);
}

.s1-err {
    background: rgba(0,0,0,0.4);
    border-radius: 14px;
    padding: 16px 24px;
    font-family: var(--font);
    font-size: 24px; color: #ffcccc;
    text-align: center;
}

.s1-btn {
    width: 100%;
    background: var(--red);
    color: #fff;
    border: none; border-radius: 3vw;
    padding: 3.8vw;
    font-family: var(--font); font-size: 4.5vw; font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 40px rgba(247,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin-top: 15vw;
}
.s1-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 50px rgba(247,0,0,0.45); }
.s1-btn:active { transform: scale(0.98); }
.s1-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.s1-btn-arrow { font-size: 40px; }

/* ================================================================
   S0 — PRELOAD SCREEN
   ================================================================ */
#s0 { background: #000; }

.s0-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 60px 80px;
}

.s0-logo {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 2px 12px rgba(247,0,0,0.4));
}

.s0-title {
    font-family: var(--font);
    font-size: 22px; font-weight: 700;
    color: #fff;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.s0-bar-wrap {
    width: 100%;
    max-width: 320px;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 100px;
    overflow: hidden;
}

.s0-bar-fill {
    height: 100%;
    background: var(--red);
    border-radius: 100px;
    transition: width 0.25s ease;
}

.s0-status {
    font-family: var(--font);
    font-size: 15px; font-weight: 400;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.06em;
}

.s0-pct {
    font-family: var(--font);
    font-size: 52px; font-weight: 900;
    color: var(--red);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ================================================================
   S1V — VIDEO SETELAH REGISTRASI
   ================================================================ */
#s1v { background: #000; }

.s1v-video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.s1v-skip {
    position: absolute;
    bottom: 52px;
    left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.65);
    border: 1.5px solid rgba(255,255,255,0.22);
    border-radius: 100px;
    padding: 16px 48px;
    font-family: var(--font);
    font-size: 20px; font-weight: 600;
    letter-spacing: 0.08em;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 10;
}
.s1v-skip:hover  { background: rgba(255,255,255,0.22); color: #fff; border-color: rgba(255,255,255,0.4); }
.s1v-skip:active { transform: translateX(-50%) scale(0.96); }

/* ================================================================
   S2 — LOADING SCREEN
   ================================================================ */
.s2-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 56px 72px 200px;
    gap: 28px;
    background: rgba(0,0,0,0.62);
}

.s2-header { text-align: center; flex-shrink: 0; }
.s2-eyebrow {
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--red);
    text-transform: uppercase;
}
.s2-title {
    font-size: 52px; font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.05em;
}

/* ── Stats grid (white cards) ── */
.s2-stats-grid {
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    align-content: flex-start;
}

.s2-stat-card {
    flex: 0 0 calc(25% - 10.5px);
    background: #fff;
    border-radius: 18px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    padding: 20px 12px 16px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.s2-stat-flag { font-size: 44px; line-height: 1; display: block; }

.s2-stat-name {
    font-size: 15px; font-weight: 700;
    color: #111;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}
.s2-stat-pct {
    font-size: 22px; font-weight: 900;
    color: var(--red);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.s2-stat-votes {
    font-size: 13px; font-weight: 500;
    color: #888;
    font-variant-numeric: tabular-nums;
}

.s2-loading {
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    text-align: center;
    padding: 40px;
}

/* ================================================================
   S3 — INFO 16 BESAR
   ================================================================ */
.s3-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 52px 64px 18vh;
    gap: 0;
}

/* ── Header ── */
.s3-header { text-align: center; flex-shrink: 0; padding-bottom: 16px; }
.s3-eyebrow {
    font-size: 18px; font-weight: 700;
    letter-spacing: 0.22em;
    color: #fff;
    text-transform: uppercase;
}
.s3-title {
    font-size: 72px; font-weight: 900;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 4px 28px rgba(0,0,0,0.6);
    margin-top: 4px;
}
.s3-sub {
    font-size: 20px; font-weight: 600;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.12em;
    margin-top: 10px;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ── Rank bar (label + badge) ── */
.s3-rank-bar {
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
    padding: 10px 0 4px;
    margin-bottom: 0;
}
.s3-rank-label {
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.14em;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.s3-voters-badge {
    background: var(--red);
    color: #fff;
    font-size: 15px; font-weight: 700;
    padding: 6px 18px;
    border-radius: 100px;
    letter-spacing: 0.04em;
}

/* ── Viewport + sliding track ── */
.s3-list-viewport {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}
.s3-list-track {
    display: flex; flex-direction: row;
    width: 200%; height: 100%;
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ── Country list (each page panel) ── */
.s3-country-list {
    flex: 0 0 50%;
    height: 100%;
    display: flex; flex-direction: column;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    min-height: 0;
    box-sizing: border-box;
    padding: 0 16px;
}
.s3-country-list::-webkit-scrollbar { width: 3px; }
.s3-country-list::-webkit-scrollbar-track { background: transparent; }
.s3-country-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Row: 4-col 2-row grid ── */
.s3-country-row {
    display: grid;
    grid-template-columns: 64px 82px 1fr 100px;
    grid-template-rows: auto auto;
    column-gap: 18px;
    row-gap: 6px;
    align-items: center;
    align-content: center;
    padding: 14px 24px;
    background: #fff;
    border-radius: 14px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

/* Rank badge — spans both rows */
.s3-rank {
    grid-column: 1; grid-row: 1 / 3;
    align-self: center; justify-self: center;
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900;
    flex-shrink: 0;
}
.s3-rank--gold   { background: #FFD700; color: #5a3e00; }
.s3-rank--silver { background: #C0C0C0; color: #3a3a3a; }
.s3-rank--bronze { background: #cd7f32; color: #fff; }
.s3-rank--plain  { background: rgba(0,0,0,0.08); color: #111; }

/* Flag — spans both rows */
.s3-cflag {
    grid-column: 2; grid-row: 1 / 3;
    align-self: center; justify-self: center;
    font-size: 64px; line-height: 1;
}

/* Name + confederation — row 1, col 3 */
.s3-cname-area {
    grid-column: 3; grid-row: 1;
    display: flex; align-items: baseline; gap: 10px;
    min-width: 0;
}
.s3-cname {
    font-size: 30px; font-weight: 800;
    color: #111;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s3-cconf {
    font-size: 16px; font-weight: 600;
    color: rgba(0,0,0,0.32);
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Bar — row 2, col 3 */
.s3-cbar-wrap {
    grid-column: 3; grid-row: 2;
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 100px;
    overflow: hidden;
    align-self: center;
}
.s3-cbar {
    height: 100%;
    background: linear-gradient(90deg, var(--red2), var(--red));
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* Pct — row 1, col 4 */
.s3-cpct {
    grid-column: 4; grid-row: 1;
    font-size: 28px; font-weight: 900;
    color: var(--red);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: end;
}

/* Votes — row 2, col 4 */
.s3-cvotes {
    grid-column: 4; grid-row: 2;
    font-size: 16px; font-weight: 500;
    color: rgba(0,0,0,0.4);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: start;
}

/* ── Pagination dots ── */
.s3-page-dots {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 18px;
    padding: 4px 0 8px;
}
.s3-dot {
    display: flex; align-items: center; justify-content: center;
    min-width: 90px; height: 48px;
    border-radius: 24px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    padding: 0 20px;
    flex-shrink: 0;
}
.s3-dot:hover { background: rgba(255,255,255,0.2); }
.s3-dot--active { background: var(--red); border-color: var(--red); transform: scale(1.06); }
.s3-dot-label {
    font-size: 16px; font-weight: 700;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.s3-dot--active .s3-dot-label { color: #fff; }
.s3-nav-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 38px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, opacity 0.3s;
    flex-shrink: 0;
    padding: 0;
}
.s3-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.22); }
.s3-nav-btn:disabled { opacity: 0.25; cursor: default; }

/* ── Footer area ── */
.s3-foot {
    flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: center;
    gap: 0;
    padding-top: 4px;
}
.s3-foot-text {
    font-size: 18px;
    color: rgba(255,255,255,0.55);
    text-align: center;
}
#s3 .pill-btn { width: 100%; }
.s3-foot-hint {
    font-size: 15px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    letter-spacing: 0.03em;
}

.s3-empty {
    padding: 40px; text-align: center;
    font-size: 20px; color: rgba(255,255,255,0.4);
}

/* ================================================================
   S4 — PILIH JAGOAN (country grid)
   ================================================================ */
.s4-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 64px 200px;
    gap: 28px;
}

.s4-header {
    text-align: center; flex-shrink: 0;
}
.s4-title-main {
    font-size: 58px; font-weight: 900;
    letter-spacing: 0.08em;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 4px 28px rgba(0,0,0,0.6);
}
.s4-sub-main {
    font-size: 19px;
    color: rgba(255,255,255,0.45);
    margin-top: 10px;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.s4-countries-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 0;
}

.s4-country-card {
    flex: 0 0 calc(25% - 7.5px); /* 4 per row: (100% - 3×10px) / 4 */
    background: #fff;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 24px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 28px 14px 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.12);
    transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.3s;
    user-select: none; -webkit-tap-highlight-color: transparent;
    aspect-ratio: 1 / 1.2;
    min-width: 0;
    box-sizing: border-box;
}
.s4-country-card:hover {
    background: #f5f5f5;
    border-color: rgba(0,0,0,0.18);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
.s4-country-card:active { transform: scale(0.96); }
.s4-country-card.selected {
    background: #fff0f0;
    border-color: var(--red);
    box-shadow: 0 0 32px rgba(247,0,0,0.3);
    transform: scale(1.04);
}
.s4-country-card.dimmed {
    opacity: 0.22;
    filter: grayscale(0.6);
    pointer-events: none;
}

.s4-cc-flag { line-height: 1; }
.s4-cc-flag .fi { font-size: 88px; display: block; }

.s4-cc-name {
    font-size: 16px; font-weight: 700;
    text-align: center; line-height: 1.2;
    color: #111;
    word-break: break-word;
    letter-spacing: 0.02em;
}

.s4-cc-votes {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
}
.s4-cc-pct {
    font-size: 20px; font-weight: 900;
    color: var(--red);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.s4-cc-vcount {
    font-size: 13px; font-weight: 500;
    color: rgba(0,0,0,0.45);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.s4-empty {
    grid-column: 1 / -1;
    text-align: center; padding: 80px;
    font-size: 28px; color: rgba(255,255,255,0.4);
}

/* ================================================================
   S5 — RINGKASAN + KONFIRMASI
   ================================================================ */
.s5-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 80px 100px 200px;
    gap: 44px;
    text-align: center;
}

/* ── Greeting ── */
.s5-greeting {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    flex-shrink: 0;
}
.s5-hello {
    font-size: 60px; font-weight: 900;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 4px 24px rgba(0,0,0,0.5);
}
.s5-name-accent {
    color: #fff;
    font-weight: 900;
}
.s5-greeting-sub {
    font-size: 30px; font-weight: 400;
    color: #fff;
    letter-spacing: 0.05em;
    margin-top: 4px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ── Single chosen country ── */
.s5-chosen-wrap {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.s5-chosen-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 28px;
    padding: 64px 120px;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 40px;
    box-shadow: 0 8px 60px rgba(0,0,0,0.2);
}

.s5-chosen-flag { font-size: 160px; display: block; line-height: 1; }

.s5-chosen-name {
    font-size: 56px; font-weight: 900;
    color: #111;
    letter-spacing: 0.04em;
}

.s5-vote-stats {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.s5-vote-pct {
    font-size: 52px; font-weight: 900;
    color: var(--red);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-shadow: 0 2px 24px rgba(255,215,0,0.45);
    letter-spacing: 0.02em;
}
.s5-vote-count {
    font-size: 22px; font-weight: 600;
    color: rgba(0,0,0,0.45);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.s5-empty {
    font-size: 26px;
    color: rgba(255,255,255,0.4);
    padding: 40px 0;
}

/* ── Buttons ── */
.s5-actions {
    width: 100%; flex-shrink: 0;
    display: flex; flex-direction: column;
    gap: 20px;
}
.s5-actions .pill-btn { width: 100%; }
#s5 .pill-btn-ghost {
    background: #fff;
    color: #111;
    border-color: rgba(0,0,0,0.18);
}
#s5 .pill-btn-ghost:hover { background: #f0f0f0; color: #000; }

/* ================================================================
   S6 — PHOTO BOOTH
   ================================================================ */
.s6-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 36px;
    padding: 80px 80px 200px;
    background: rgba(0,0,0,0.55);
}

.s6-title {
    font-size: 52px; font-weight: 900;
    letter-spacing: 0.12em;
    color: #fff;
}

.s6-webcam-wrap {
    position: relative;
    width: 800px; height: 800px;
    border-radius: 28px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 80px rgba(0,0,0,0.5);
}
#webcam-live {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.s6-countdown {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    border-radius: 28px;
}
#s6-count-num {
    font-size: 220px; font-weight: 900;
    color: #fff;
    text-shadow: 0 0 60px rgba(247,0,0,0.6);
}
@keyframes countdown-pop {
    0%   { transform: scale(1.4); opacity: 0; }
    20%  { transform: scale(1);   opacity: 1; }
    80%  { transform: scale(1);   opacity: 1; }
    100% { transform: scale(0.6); opacity: 0; }
}

#capture-canvas { display: none; }

.s6-shutter {
    width: 120px; height: 120px;
    background: transparent; border: none;
    cursor: pointer;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.s6-shutter:hover { transform: scale(1.08); }
.s6-shutter:active { transform: scale(0.93); }
.s6-shutter svg { width: 120px; height: 120px; }

.s6-hint {
    font-size: 24px;
    color: rgba(255,255,255,0.45);
}

/* ================================================================
   S6B — PHOTO PREVIEW
   ================================================================ */
.s6b-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 36px;
    padding: 80px 80px 200px;
    background: rgba(0,0,0,0.55);
}

.s6b-title {
    font-size: 52px; font-weight: 900;
    letter-spacing: 0.1em; color: #fff;
}

#photo-canvas {
    width: 700px; height: 700px;
    border-radius: 24px;
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 80px rgba(0,0,0,0.5);
}

.s6b-actions {
    display: flex; flex-direction: column;
    gap: 18px; width: 100%;
}
.s6b-actions .pill-btn { width: 100%; }

/* ================================================================
   S7 — AI PROCESSING
   ================================================================ */
.s7-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 36px;
    padding: 80px 100px 200px;
    background: rgba(0,0,0,0.62);
}

.proc-ring-wrap {
    position: relative;
    width: 180px; height: 180px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ai-spinner {
    position: absolute; inset: 0;
    border: 6px solid rgba(255,255,255,0.1);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.proc-spinner { width: 180px; height: 180px; }
@keyframes spin { to { transform: rotate(360deg); } }
.proc-pct {
    font-size: 48px; font-weight: 900;
    color: #fff;
}

.s7-title {
    font-size: 44px; font-weight: 900;
    letter-spacing: 0.06em; color: #fff;
    text-align: center;
}
#s7-status {
    font-size: 26px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    min-height: 32px;
    letter-spacing: 0.04em;
}

/* Proc steps */
.proc-steps {
    display: flex; align-items: center;
    gap: 0; width: 100%;
    justify-content: center;
}
.proc-step {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    flex-shrink: 0;
}
.proc-step-dot {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900;
    color: rgba(255,255,255,0.4);
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.proc-step.active .proc-step-dot {
    background: rgba(247,0,0,0.3);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 20px var(--red-glow);
}
.proc-step.done .proc-step-dot {
    background: rgba(78,255,145,0.2);
    border-color: #4eff91;
    color: #4eff91;
}
.proc-step-label {
    font-size: 19px; text-align: center;
    color: rgba(255,255,255,0.45);
    line-height: 1.3;
    transition: color 0.3s;
}
.proc-step.active .proc-step-label { color: rgba(255,255,255,0.9); }
.proc-step.done .proc-step-label { color: #4eff91; }

.proc-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.12);
    margin-bottom: 30px;
    transition: background 0.4s;
}
.proc-step-line.done { background: #4eff91; }

.progress-bar-wrap {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 100px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red2), var(--red));
    border-radius: 100px;
    transition: width 1s ease;
    box-shadow: 0 0 12px var(--red-glow);
}
.proc-elapsed {
    font-size: 22px;
    color: rgba(255,255,255,0.4);
    font-variant-numeric: tabular-nums;
}

/* AI Error box */
.ai-error-box {
    width: 100%;
    background: rgba(247,0,0,0.08);
    border: 1px solid rgba(247,0,0,0.3);
    border-radius: 24px;
    padding: 40px 48px;
    text-align: center;
    display: flex; flex-direction: column;
    gap: 28px;
}
.ai-error-msg {
    font-size: 26px; color: #ff8080;
    line-height: 1.5;
}
.ai-error-actions {
    display: flex; flex-direction: column;
    gap: 16px;
}
.btn-retry, .btn-retake-err, .btn-cancel-err {
    width: 100%;
    padding: 20px 28px;
    border-radius: 16px;
    border: none; cursor: pointer;
    font-family: var(--font); font-size: 24px; font-weight: 700;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-retry     { background: var(--red); color: #fff; }
.btn-retake-err{ background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-cancel-err{ background: transparent; color: rgba(255,255,255,0.45); }
.btn-retry:hover, .btn-retake-err:hover { opacity: 0.85; transform: translateY(-1px); }

/* ================================================================
   S8 — HASIL / RESULT
   ================================================================ */
.s8-overlay {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 40px;
    padding: 80px 100px 200px;
    gap: 0;
    background: rgba(0,0,0,0.58);
}

.s8-title {
    font-size: 42px; font-weight: 900;
    letter-spacing: 0.06em;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.s8-img-frame {
    flex: 1;
    width: 100%;
    display: flex; align-items: flex-start; justify-content: center;
}
#s8-result-img {
    max-width: 80%; max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 8px 80px rgba(0,0,0,0.6);
}

.s8-actions {
    width: 100%; flex-shrink: 0;
    display: flex; flex-direction: column;
    gap: 18px;
}
.s8-actions .pill-btn { width: 100%; }

/* ================================================================
   RESPONSIVE — shared rules (all non-kiosk)
   ================================================================ */
.s1-overlay, .s2-overlay, .s3-overlay, .s4-overlay,
.s5-overlay, .s6-overlay, .s6b-overlay, .s7-overlay, .s8-overlay {
    box-sizing: border-box;
    overflow: hidden;
}
.s3-list-viewport { min-height: 0; }
.s4-countries-grid { min-height: 0; }

/* ================================================================
   RESPONSIVE — Desktop / laptop (≥901px wide, NOT kiosk height)
   Content centered in a portrait column via side padding
   ================================================================ */
@media (min-width: 901px) and (max-height: 1919px) {
    .app-footer { padding-bottom: 3vh; }

    /* Center content: side padding grows to keep a ~600–650px content column */
    .s1-overlay  { padding: 36px max(48px, calc(50vw - 260px)) 80px;  gap: 22px; }
    .s2-overlay  { padding: 32px max(48px, calc(50vw - 340px)) 80px;  gap: 18px; }
    .s3-overlay  { padding: 28px max(48px, calc(50vw - 320px)) 18vh; }
    .s4-overlay  { padding: 32px max(48px, calc(50vw - 290px)) 80px;  gap: 18px; }
    .s5-overlay  { padding: 36px max(48px, calc(50vw - 260px)) 80px;  gap: 22px; }
    .s6-overlay, .s6b-overlay { padding: 32px max(48px, calc(50vw - 240px)) 80px; gap: 18px; }
    .s7-overlay  { padding: 32px max(48px, calc(50vw - 280px)) 80px;  gap: 16px; }
    .s8-overlay  { padding: 32px max(48px, calc(50vw - 280px)) 80px;  gap: 22px; }

    /* S1 */
    .s1-header-text  { top: 10vh; }
    .s1-label  { font-size: 15px; }
    .s1-input  { font-size: 22px; padding: 14px 22px; border-radius: 14px; }
    .s1-btn    { font-size: 18px; padding: 18px 36px; border-radius: 14px; margin-top: 32px; }
    .s1-err    { font-size: 14px; }

    /* S2 */
    .s2-eyebrow { font-size: 13px; }
    .s2-title   { font-size: 38px; }
    .s2-stats-grid { width: 90%; max-width: 660px; gap: 10px; }
    .s2-stat-card  { flex: 0 0 calc(25% - 7.5px); padding: 14px 8px 12px; border-radius: 14px; gap: 4px; }
    .s2-stat-flag  { font-size: 32px; }
    .s2-stat-name  { font-size: 12px; }
    .s2-stat-pct   { font-size: 17px; }
    .s2-stat-votes { font-size: 11px; }

    /* S3 */
    .s3-eyebrow     { font-size: 13px; }
    .s3-title br    { display: none; }
    .s3-title       { font-size: 26px; margin-top: 2px; }
    .s3-sub         { font-size: 13px; letter-spacing: 0.1em; margin-top: 5px; }
    .s3-header      { padding-bottom: 8px; }
    .s3-rank-bar    { padding: 6px 0 3px; margin-bottom: 0; }
    .s3-rank-label  { font-size: 12px; }
    .s3-voters-badge{ font-size: 12px; padding: 4px 12px; }
    .s3-country-list{ gap: 8px; }
    .s3-country-row { grid-template-columns: 28px 38px 1fr 54px; column-gap: 10px; row-gap: 3px; padding: 5px 12px; border-radius: 10px; }
    .s3-rank  { width: 22px; height: 22px; font-size: 10px; }
    .s3-cflag { font-size: 40px; }
    .s3-cname { font-size: 20px; }
    .s3-cconf { font-size: 11px; }
    .s3-cbar-wrap { height: 6px; }
    .s3-cpct  { font-size: 18px; }
    .s3-cvotes{ font-size: 11px; }
    .s3-page-dots { padding: 3px 0 4px; gap: 12px; }
    .s3-nav-btn   { width: 38px; height: 38px; font-size: 22px; }
    .s3-dot       { min-width: 60px; height: 32px; border-radius: 16px; padding: 0 14px; }
    .s3-dot-label { font-size: 12px; }
    .s3-foot  { padding-top: 3px; }

    /* S4 */
    .s4-title-main { font-size: 36px; }
    .s4-sub-main   { font-size: 15px; }
    .s4-countries-grid { width: 96%; max-width: 700px; gap: 10px; }
    .s4-country-card   { flex: 0 0 calc(25% - 7.5px); padding: 20px 10px 16px; gap: 6px; border-radius: 18px; aspect-ratio: 1 / 1.2; }
    .s4-cc-flag .fi    { font-size: 60px; }
    .s4-cc-name        { font-size: 12px; }
    .s4-cc-pct         { font-size: 14px; }
    .s4-cc-vcount      { font-size: 10px; }

    /* S5 */
    .s5-hello        { font-size: 34px; }
    .s5-greeting-sub { font-size: 17px; }
    .s5-chosen-card  { padding: 28px 40px; gap: 14px; }
    .s5-chosen-flag  { font-size: 88px; }
    .s5-chosen-name  { font-size: 30px; }
    .s5-vote-pct     { font-size: 32px; }
    .s5-vote-count   { font-size: 15px; }

    /* S6 / S6b */
    .s6-title, .s6b-title { font-size: 28px; }
    .s6-webcam-wrap { width: min(55vh, 420px); height: min(55vh, 420px); }
    #photo-canvas   { width: min(55vh, 420px) !important; height: min(55vh, 420px) !important; }
    .s6-shutter     { width: 68px; height: 68px; }
    .s6-shutter svg { width: 68px; height: 68px; }
    #s6-count-num   { font-size: 120px; }

    /* S7 */
    .proc-ring-wrap { width: 110px; height: 110px; }
    .proc-spinner   { width: 110px; height: 110px; }
    .proc-pct       { font-size: 26px; }
    .s7-title       { font-size: 24px; }
    #s7-status      { font-size: 14px; }
    .proc-step-dot  { width: 36px; height: 36px; font-size: 14px; }
    .proc-step-label{ font-size: 12px; }

    /* S8 */
    .s8-title { font-size: 30px; }

    /* S1V */
    .s1v-skip { font-size: 16px; padding: 12px 36px; bottom: 40px; }

    /* Pill button */
    .pill-btn { font-size: 18px; padding: 16px 36px; }
}

/* ================================================================
   RESPONSIVE — Tablet portrait (541px – 900px)
   ================================================================ */
@media (min-width: 541px) and (max-width: 900px) {
    .app-footer { padding-bottom: 3vh; }

    /* S1 */
    .s1-overlay { padding: 48px 56px 140px; gap: 28px; }
    .s1-input   { font-size: 26px; padding: 18px 26px; }
    .s1-btn     { font-size: 4.5vw; padding: 3.8vw; border-radius: 3vw; margin-top: 15vw; }

    /* S2 */
    .s2-overlay    { padding: 28px 32px 100px; gap: 16px; overflow: hidden; }
    .s2-eyebrow    { font-size: 13px; }
    .s2-title      { font-size: 38px; }
    .s2-stats-grid { width: 92%; gap: 10px; }
    .s2-stat-card  { flex: 0 0 calc(25% - 7.5px); padding: 12px 8px 10px; border-radius: 14px; gap: 4px; }
    .s2-stat-flag  { font-size: 30px; }
    .s2-stat-name  { font-size: 11px; }
    .s2-stat-pct   { font-size: 16px; }
    .s2-stat-votes { font-size: 10px; }

    /* S3 */
    .s3-overlay { padding: 36px 40px 18vh; }
    .s3-eyebrow { font-size: 13px; }
    .s3-title br{ display: none; }
    .s3-title   { font-size: 38px; margin-top: 2px; }
    .s3-sub     { font-size: 14px; margin-top: 6px; }
    .s3-rank-label   { font-size: 13px; }
    .s3-voters-badge { font-size: 13px; padding: 5px 14px; }
    .s3-country-list { gap: 8px; overflow-y: auto; }
    .s3-country-row  { grid-template-columns: 36px 46px 1fr 60px; column-gap: 12px; row-gap: 3px; padding: 6px 14px; border-radius: 12px; flex: 0 0 auto; overflow: visible; }
    .s3-rank  { width: 28px; height: 28px; font-size: 12px; }
    .s3-cflag { font-size: 44px; }
    .s3-cname { font-size: 22px; }
    .s3-cconf { font-size: 12px; }
    .s3-cbar-wrap { height: 7px; }
    .s3-cpct  { font-size: 20px; }
    .s3-cvotes{ font-size: 12px; }
    .s3-page-dots { padding: 10px 0 4px; gap: 14px; }
    .s3-nav-btn   { width: 46px; height: 46px; font-size: 26px; }
    .s3-dot       { min-width: 70px; height: 38px; border-radius: 19px; padding: 0 16px; }
    .s3-dot-label { font-size: 13px; }
    .s3-foot  { padding-top: 10px; }

    /* S4 */
    .s4-overlay { padding: 40px 36px 140px; gap: 22px; }
    .s4-title-main { font-size: 44px; }
    .s4-sub-main   { font-size: 16px; }
    .s4-countries-grid { width: 98%; gap: 10px; }
    .s4-country-card   { flex: 0 0 calc(25% - 7.5px); padding: 22px 12px 18px; gap: 6px; border-radius: 20px; aspect-ratio: 1 / 1.2; }
    .s4-cc-flag .fi    { font-size: 69px; }
    .s4-cc-name        { font-size: 13px; }
    .s4-cc-pct         { font-size: 16px; }
    .s4-cc-vcount      { font-size: 11px; }

    /* S5 */
    .s5-overlay   { padding: 56px 60px 140px; gap: 32px; }
    .s5-hello      { font-size: 44px; }
    .s5-chosen-flag{ font-size: 110px; }
    .s5-chosen-name{ font-size: 38px; }
    .s5-vote-pct   { font-size: 40px; }
    .s5-vote-count { font-size: 18px; }

    /* S6 / S6b */
    .s6-overlay, .s6b-overlay { padding: 44px 48px 140px; gap: 24px; }
    .s6-webcam-wrap { width: min(70vw, 520px); height: min(70vw, 520px); }
    #photo-canvas   { width: min(70vw, 520px) !important; height: min(70vw, 520px) !important; }

    /* S7 */
    .s7-overlay { padding: 44px 60px 140px; gap: 24px; }

    /* S8 */
    .s8-overlay { padding: 44px 60px 140px; gap: 28px; }

    /* S1V */
    .s1v-skip { font-size: 17px; padding: 13px 40px; bottom: 44px; }

    .pill-btn { font-size: 20px; padding: 20px 44px; }
}

/* ================================================================
   RESPONSIVE — Mobile portrait (≤540px)
   Semua nilai pakai vw/vh agar fluid di semua lebar HP
   ================================================================ */
@media (max-width: 540px) {
    .app-footer { padding-bottom: 3vh; }
    .app-footer img { width: 38vw; }

    /* S1 */
    .s1-overlay    { padding: 3vh 5vw 14vh; gap: 2.5vw; }
    .s1-header-text  { top: 10vh; }
    .s1-form-card  { gap: 3vw; }
    .s1-label      { font-size: 3.5vw; letter-spacing: 0.12em; }
    .s1-input      { font-size: 4.5vw; padding: 3.5vw 4vw; border-radius: 3vw; }
    .s1-btn        { font-size: 4.5vw; padding: 3.8vw; border-radius: 3vw; margin-top: 15vw; }
    .s1-btn-arrow  { font-size: 4.5vw; }
    .s1-err        { font-size: 3vw; padding: 2.5vw 3vw; }

    /* S2 */
    .s2-overlay    { padding: 2vh 2vw 12vh; gap: 2vw; justify-content: flex-start; overflow: hidden; }
    .s2-eyebrow    { font-size: 2.2vw; }
    .s2-title      { font-size: 5.5vw; }
    .s2-stats-grid { width: 100%; gap: 1.5vw; }
    .s2-stat-card  { flex: 0 0 calc(25% - 1.15vw); padding: 2vw 1vw; border-radius: 2vw; gap: 1vw; }
    .s2-stat-flag  { font-size: 5.5vw; }
    .s2-stat-name  { font-size: 2vw; }
    .s2-stat-pct   { font-size: 3.2vw; }
    .s2-stat-votes { font-size: 1.8vw; }

    /* S3 */
    .s3-overlay      { padding: 1.5vh 3vw 13vh; gap: 1vw; justify-content: flex-start; overflow: hidden; }
    .s3-header       { padding-bottom: 0.5vw; }
    .s3-eyebrow      { font-size: 2.2vw; letter-spacing: 0.12em; }
    .s3-title        { font-size: 5vw; margin-top: 0.5vw; }
    .s3-title br     { display: none; }
    .s3-sub          { font-size: 2vw; letter-spacing: 0.04em; margin-top: 0.5vw; }
    .s3-rank-bar     { padding: 0.6vw 0 0.8vw; }
    .s3-rank-label   { font-size: 2.2vw; }
    .s3-voters-badge { font-size: 2.2vw; padding: 0.8vw 2vw; }
    .s3-list-viewport{ flex: 1; min-height: 0; }
    .s3-country-list { gap: 1.2vw; overflow-y: auto; }
    .s3-country-row  { grid-template-columns: 5.5vw 7.5vw 1fr 10.5vw; column-gap: 1.5vw; padding: 0.9vw 2.5vw; border-radius: 2vw; flex: 0 0 auto; row-gap: 0.5vw; }
    .s3-rank         { width: 4.5vw; height: 4.5vw; font-size: 1.8vw; }
    .s3-cflag        { font-size: 5.5vw; }
    .s3-cname        { font-size: 3vw; }
    .s3-cconf        { font-size: 2vw; }
    .s3-cbar-wrap    { height: 1vw; }
    .s3-cpct         { font-size: 3vw; }
    .s3-cvotes       { font-size: 2vw; }
    .s3-page-dots    { padding: 1.5vw 0 1vw; gap: 2vw; flex-shrink: 0; }
    .s3-nav-btn      { width: 8vw; height: 8vw; font-size: 4.5vw; }
    .s3-dot          { min-width: 13vw; height: 7vw; border-radius: 3.5vw; padding: 0 2vw; }
    .s3-dot-label    { font-size: 2.5vw; }
    .s3-foot         { padding-top: 1vw; flex-shrink: 0; }

    /* S4 */
    .s4-overlay        { padding: 2.5vh 2.5vw 13vh; gap: 2vw; justify-content: flex-start; align-items: stretch; }
    .s4-header         { flex-shrink: 0; }
    .s4-title-main     { font-size: 5.5vw; }
    .s4-sub-main       { font-size: 2.8vw; margin-top: 1vw; }
    .s4-countries-grid { width: 100%; gap: 1.8vw; flex: 1; min-height: 0; overflow-y: auto; align-content: center; }
    .s4-country-card   { flex: 0 0 calc(25% - 1.35vw); padding: 2vw 1vw 1.5vw; gap: 1vw; border-radius: 2.5vw; border-width: 1px; aspect-ratio: 1 / 1.1; }
    .s4-cc-flag .fi    { font-size: 7vw; }
    .s4-cc-name        { font-size: 2.2vw; }
    .s4-cc-pct         { font-size: 2.5vw; }
    .s4-cc-vcount      { font-size: 2.2vw; }

    /* S5 */
    .s5-overlay      { padding: 3vh 5vw 13vh; gap: 3.5vw; }
    .s5-hello        { font-size: 6vw; }
    .s5-greeting-sub { font-size: 3.2vw; }
    .s5-chosen-card  { padding: 5vw 7vw; gap: 3vw; border-radius: 4.5vw; }
    .s5-chosen-flag  { font-size: 17vw; }
    .s5-chosen-name  { font-size: 5.5vw; }
    .s5-vote-pct     { font-size: 6.5vw; }
    .s5-vote-count   { font-size: 3vw; }
    .s5-actions      { gap: 2vw; }

    /* S6 / S6b */
    .s6-overlay, .s6b-overlay { padding: 2.5vh 4vw 13vh; gap: 3vw; }
    .s6-title, .s6b-title     { font-size: 5vw; }
    .s6-webcam-wrap { width: 80vw; height: 80vw; }
    #photo-canvas   { width: 80vw !important; height: 80vw !important; }
    .s6-shutter     { width: 14vw; height: 14vw; }
    .s6-shutter svg { width: 14vw; height: 14vw; }
    #s6-count-num   { font-size: 22vw; }
    .s6-hint        { font-size: 3vw; }

    /* S7 */
    .s7-overlay      { padding: 2.5vh 4vw 13vh; gap: 3.5vw; }
    .proc-ring-wrap  { width: 22vw; height: 22vw; flex-shrink: 0; }
    .proc-spinner    { width: 22vw; height: 22vw; }
    .proc-pct        { font-size: 5vw; }
    .s7-title        { font-size: 4.5vw; }
    #s7-status       { font-size: 2.8vw; }
    .proc-steps      { gap: 0; }
    .proc-step-dot   { width: 7vw; height: 7vw; font-size: 2.8vw; }
    .proc-step-label { font-size: 2.5vw; }
    .proc-step-line  { margin-bottom: 4vw; }
    .progress-bar-wrap { height: 2vw; }
    .proc-elapsed    { font-size: 2.8vw; }

    /* S8 */
    .s8-overlay { padding: 2.5vh 4vw 13vh; gap: 3.5vw; }
    .s8-title   { font-size: 4.5vw; }
    .s8-actions { gap: 2vw; }

    /* S1V */
    .s1v-skip { font-size: 3.5vw; padding: 2.8vw 7vw; bottom: 6vh; }

    /* Pill button */
    .pill-btn { font-size: 3.8vw; padding: 3.2vw 5.5vw; }
}
