/* ═══ Kolo štěstí – Velká jízda v Olympii ═══ */
/* Brand colors from visuals:
   Primary green: #57B894 (Olympia brand green)
   Dark navy:     #1a3347 (text, accents)
   Light mint:    #A8DECA
   Accent gold:   #E8A838
   White:         #FFFFFF
*/

:root {
    --green: #57B894;
    --green-light: #6CC9A4;
    --green-dark: #3D9A77;
    --navy: #1a3347;
    --navy-light: #2A5068;
    --mint: #A8DECA;
    --gold: #E8A838;
    --white: #FFFFFF;
    --gray-100: #F5F7F9;
    --gray-200: #E2E8ED;
    --gray-400: #94A3B8;
    --gray-600: #64748B;
    --gray-800: #1E293B;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(26, 51, 71, 0.12);
    --shadow-lg: 0 8px 40px rgba(26, 51, 71, 0.2);
}

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

html, body {
    height: 100%;
    font-family: 'Montserrat', sans-serif;
    background: var(--green);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
}
body.no-scroll {
    overflow: hidden;
}

.bg-swoosh {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── Screen management ─── */
.screen {
    display: none;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}
.screen.active {
    display: flex;
    flex-direction: column;
}

/* ─── Main App Layout ─── */
.app-layout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    gap: 40px;
    min-height: 0;
}

.panel-left {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2;
    min-width: 0;
}

.panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: visible;
}

/* ─── Branding ─── */
.branding {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.olympia-logo {
    width: 180px;
    height: auto;
}

.olympia-sub {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--navy);
    margin-left: 2px;
    margin-top: -4px;
}

.title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    line-height: 1.05;
    color: var(--white);
    text-shadow: 0 2px 12px rgba(26, 51, 71, 0.15);
}

.dates {
    font-size: 22px;
    font-weight: 800;
    color: var(--navy);
    margin-top: -4px;
}

/* ─── Email Form ─── */
.email-section {
    margin-top: 8px;
}
.email-section.hidden {
    display: none;
}

.instruction {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
    opacity: 0.9;
}

.email-form {
    display: flex;
    gap: 12px;
}

.email-form input[type="email"] {
    flex: 1;
    padding: 14px 20px;
    font-size: 17px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border: 3px solid var(--white);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.95);
    color: var(--navy);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.email-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(232, 168, 56, 0.3);
}
.email-form input::placeholder {
    color: var(--gray-400);
}

.btn-spin {
    padding: 14px 28px;
    font-size: 18px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.btn-spin:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn-spin:active {
    transform: translateY(0);
}
.btn-spin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-spin .btn-icon {
    font-size: 20px;
}

.gdpr-note {
    font-size: 11px;
    color: rgba(26, 51, 71, 0.6);
    margin-top: 8px;
    line-height: 1.4;
}

/* ─── Result Section ─── */
.result-section {
    margin-top: 8px;
}
.result-section.hidden {
    display: none;
}

.result-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.result-content .result-icon {
    font-size: 48px;
    margin-bottom: 8px;
}
.result-content .result-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.result-content .result-prize {
    font-size: 28px;
    font-weight: 900;
    color: var(--navy);
    line-height: 1.2;
}
.result-content.no-win .result-prize {
    font-size: 22px;
    color: var(--gray-600);
}

.btn-new-spin {
    margin-top: 16px;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--white);
    color: var(--navy);
    border: 3px solid var(--navy);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-new-spin:hover {
    background: var(--navy);
    color: var(--white);
}

/* ─── Wheel ─── */
.wheel-container {
    position: relative;
    width: min(480px, 55vh);
    height: min(480px, 55vh);
    flex-shrink: 0;
    margin-top: 20px;
}

.wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 32px solid var(--navy);
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 
        0 0 0 8px var(--white),
        0 0 0 12px var(--navy),
        var(--shadow-lg);
    transition: filter 0.3s;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 3px solid var(--navy);
}
.wheel-center-inner {
    font-size: 28px;
}

/* ─── Sponsor Bar ─── */
.sponsor-bar {
    padding: 12px 48px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(26, 51, 71, 0.08);
    flex-shrink: 0;
}
.sponsor-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--navy);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}
.sponsor-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sponsor {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    opacity: 0.65;
}
.sponsor-dot {
    color: var(--navy);
    opacity: 0.3;
}

/* ─── Confetti ─── */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

/* ─── Spinning animation ─── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 8px var(--white), 0 0 0 12px var(--navy), var(--shadow-lg); }
    50% { box-shadow: 0 0 0 8px var(--white), 0 0 0 12px var(--gold), 0 0 40px rgba(232, 168, 56, 0.4); }
}
#wheel-canvas.spinning {
    animation: pulse-glow 0.5s ease-in-out infinite;
}

/* ═══ ADMIN PANEL ═══ */
#admin {
    overflow-y: auto;
    background: var(--gray-100);
    height: auto;
    min-height: 100vh;
    padding-bottom: 40px;
}
#admin.active {
    display: block;
}

.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header h2 {
    font-size: 22px;
    font-weight: 800;
}
.admin-actions {
    display: flex;
    gap: 8px;
}

.btn-admin {
    padding: 10px 18px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    border: 2px solid var(--navy);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--white);
    color: var(--navy);
}
.btn-admin:hover {
    background: var(--navy);
    color: var(--white);
}
.btn-save {
    background: var(--green);
    color: var(--white);
    border-color: var(--green-dark);
}
.btn-save:hover {
    background: var(--green-dark);
}
.btn-danger {
    border-color: #DC2626;
    color: #DC2626;
}
.btn-danger:hover {
    background: #DC2626;
    color: var(--white);
}

/* Admin stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--navy);
}
.stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin sections */
.admin-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--navy);
}

/* Prize config */
.prize-row {
    display: grid;
    grid-template-columns: 48px 1fr 100px 70px 80px 40px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}
.prize-row:last-child {
    border-bottom: none;
}
.prize-row input, .prize-row select {
    padding: 8px 10px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
}
.prize-row input:focus {
    border-color: var(--green);
    outline: none;
}
.prize-color-input {
    width: 44px;
    height: 38px;
    padding: 2px !important;
    cursor: pointer;
}
.prize-delete {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.prize-delete:hover {
    opacity: 1;
}

.prize-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.prize-header {
    display: grid;
    grid-template-columns: 48px 1fr 100px 70px 80px 40px;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--navy);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

/* Spin log table */
.spin-log-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}
.spin-log {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.spin-log th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    background: var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 1;
}
.spin-log td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-200);
}
.spin-log tr:hover td {
    background: rgba(87, 184, 148, 0.05);
}

.badge-win {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: #D1FAE5;
    color: #065F46;
}
.badge-loss {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-600);
}
.badge-issued {
    background: #DBEAFE;
    color: #1E40AF;
}

.issue-toggle {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    font-size: 11px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    background: var(--white);
    transition: all 0.15s;
}
.issue-toggle:hover {
    border-color: var(--green);
}
.issue-toggle.issued {
    background: #D1FAE5;
    border-color: #065F46;
    color: #065F46;
}

/* ─── Responsive (Tablet portrait) ─── */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
        padding: 16px 24px;
        gap: 10px;
        justify-content: flex-start;
        padding-top: 20px;
    }
    .panel-left {
        flex: 0 0 auto;
        width: 100%;
        max-width: 500px;
        gap: 6px;
        text-align: center;
        align-items: center;
    }
    .branding {
        align-items: center;
    }
    .title {
        font-size: 30px;
    }
    .dates {
        font-size: 18px;
    }
    .wheel-container {
        width: min(380px, 42vh);
        height: min(380px, 42vh);
        margin-top: 0;
    }
    .sponsor-bar {
        padding: 10px 24px;
    }
    .email-form input[type="email"] {
        font-size: 16px;
        padding: 12px 16px;
    }
    .btn-spin {
        padding: 12px 24px;
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .title {
        font-size: 26px;
    }
    .email-form {
        flex-direction: column;
    }
    .wheel-container {
        width: min(300px, 38vh);
        height: min(300px, 38vh);
    }
}

/* ─── Landscape tablet optimization ─── */
@media (min-width: 901px) and (max-height: 700px) {
    .app-layout {
        padding: 12px 32px;
        gap: 32px;
    }
    .panel-left {
        gap: 8px;
    }
    .title {
        font-size: 40px;
    }
    .wheel-container {
        width: min(420px, 55vh);
        height: min(420px, 55vh);
    }
}
