:root {
    /* Rich Modern Midnight & Electric Indigo / Cyan Palette */
    --bg-page: #0a0e1a;
    --bg-card: rgba(18, 24, 43, 0.88);
    --bg-card-hover: rgba(26, 35, 62, 0.95);
    --bg-input: #0f1527;
    
    --border-subtle: rgba(99, 102, 241, 0.15);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.35);
    --border-focus: #38bdf8;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Vibrant modern accents */
    --cyan-400: #38bdf8;
    --cyan-500: #0ea5e9;
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --violet-400: #c084fc;
    --emerald-400: #34d399;
    --amber-400: #fbbf24;
    --rose-400: #fb7185;
    
    --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --track-gradient: linear-gradient(90deg, #0ea5e9 0%, #818cf8 100%);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-button: 0 4px 16px rgba(14, 165, 233, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.09) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.09) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

.app-container {
    width: 100%;
    max-width: 550px;
    padding: 24px 16px 120px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 16px 8px 8px 8px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--cyan-400);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.header-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Progress Tracker */
.progress-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-card);
}

.progress-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.progress-info strong {
    color: var(--cyan-400);
    font-weight: 700;
}

.progress-track {
    flex-grow: 1;
    height: 8px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--track-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Category / Award Card */
.category-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.category-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.category-card.completed {
    border-color: rgba(52, 211, 153, 0.35);
}

.category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.category-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--cyan-400);
    width: fit-content;
}

.category-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
}

.category-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.category-card.custom-award-card {
    border: 1px dashed rgba(168, 85, 247, 0.45);
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.35) 0%, rgba(18, 24, 43, 0.92) 100%);
}

.category-card.custom-award-card:hover {
    border-color: rgba(168, 85, 247, 0.75);
}

.category-card.custom-award-card.completed {
    border-color: rgba(52, 211, 153, 0.45);
}

.category-tag.custom-tag {
    color: var(--violet-400);
}

.custom-title-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    color: var(--text-primary);
    font-size: 16px; /* Prevents auto-zoom on iOS */
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.custom-title-input:focus {
    border-color: var(--violet-400);
    background: rgba(168, 85, 247, 0.05);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.custom-title-input::placeholder {
    color: var(--text-muted);
}

.status-badge {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-card);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.status-badge.completed {
    background: var(--emerald-400);
    color: #0b1120;
    border-color: var(--emerald-400);
    font-weight: 800;
}

/* Nominee Picker Trigger */
.picker-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.picker-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.picker-trigger {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.96rem;
    min-height: 50px;
    user-select: none;
    transition: all 0.2s ease;
}

.picker-trigger:hover,
.picker-trigger:active {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.picker-trigger.has-value {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(14, 165, 233, 0.08);
}

.picker-placeholder {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.picker-selected-text {
    font-weight: 600;
    color: #ffffff;
}

.picker-arrow {
    color: var(--cyan-400);
    font-size: 0.75rem;
}

/* Bottom Submit Dock */
.submit-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-card);
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
    z-index: 100;
}

.submit-btn {
    width: 100%;
    max-width: 518px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-button);
    transition: all 0.2s ease;
}

.submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #1e2640;
    color: var(--text-muted);
    box-shadow: none;
}

.submit-btn:not(:disabled):active {
    transform: scale(0.99);
}

/* ==================================================== */
/* TOP-ANCHORED IPHONE MODAL PICKER                     */
/* ==================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.modal-backdrop.open .picker-modal {
    transform: translateY(0);
}

.modal-top-bar {
    background: rgba(18, 24, 43, 0.95);
    border-bottom: 1px solid var(--border-card);
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-close-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.search-input-wrap {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 13px 16px 13px 40px;
    color: var(--text-primary);
    font-size: 16px; /* Prevents iOS auto-zoom */
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--cyan-400);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.attendees-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 12px 16px 36px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clear-selection-btn {
    background: rgba(251, 113, 133, 0.1);
    border: 1px dashed rgba(251, 113, 133, 0.35);
    color: var(--rose-400);
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    margin-bottom: 6px;
}

.attendee-item {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.97rem;
    transition: all 0.15s ease;
}

.attendee-item:active {
    background: rgba(14, 165, 233, 0.15);
    border-color: var(--cyan-400);
}

.attendee-item.selected {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--cyan-400);
    font-weight: 700;
}

.no-results {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Confirmed Receipt Card */
.confirmed-card {
    background: var(--bg-card);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-lg);
    padding: 26px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 30px rgba(52, 211, 153, 0.1);
}

.confirmed-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
}

.confirmed-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.ballot-summary {
    width: 100%;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    border: 1px solid var(--border-card);
}

.summary-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-label {
    color: var(--cyan-400);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    color: #ffffff;
    font-weight: 600;
}

/* ==================================================== */
/* ADMIN SUITE & RESULTS STYLES                         */
/* ==================================================== */
.admin-container {
    width: 100%;
    max-width: 900px;
    padding: 24px 16px 80px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.tab-group {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.35);
    color: var(--cyan-400);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-button);
}

.btn-danger {
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--rose-400);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

/* Question Admin Cards */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.question-admin-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.type-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
}

.type-pill.single {
    background: rgba(14, 165, 233, 0.12);
    color: var(--cyan-400);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.type-pill.pair {
    background: rgba(192, 132, 252, 0.12);
    color: var(--violet-400);
    border: 1px solid rgba(192, 132, 252, 0.3);
}

/* Results Leaderboard Cards */
.category-results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-card);
}

.cat-res-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 14px;
    gap: 12px;
}

/* Podium Grid */
.podium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.podium-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.podium-card.gold {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(15, 21, 39, 0.9) 100%);
}

.podium-card.silver {
    border-color: rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, rgba(15, 21, 39, 0.9) 100%);
}

.podium-card.bronze {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.08) 0%, rgba(15, 21, 39, 0.9) 100%);
}

.podium-badge {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.podium-card.gold .podium-badge { color: var(--amber-400); }
.podium-card.silver .podium-badge { color: #cbd5e1; }
.podium-card.bronze .podium-badge { color: #f59e0b; }

.podium-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: #ffffff;
    word-break: break-word;
}

.podium-votes {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.podium-votes strong {
    color: #ffffff;
}

/* Tally Table */
.tally-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tally-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-card);
}

.tally-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mini-track {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    background: var(--track-gradient);
    border-radius: var(--radius-full);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--emerald-400);
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px var(--emerald-400);
    display: inline-block;
}
