:root {
    --bg-dark: #09090c;
    --bg-card: #12131a;
    --bg-card-hover: #191b24;
    --border-color: #262836;
    --gold-light: #fce694;
    --gold-main: #d4af37;
    --gold-dark: #9c7b16;
    --text-main: #f4f4f6;
    --text-muted: #989cb0;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 90px;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(18, 19, 26, 0.9);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.logo-svg {
    width: 44px;
    height: 44px;
}

.brand-title {
    display: block;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* PRZYCISKI */
.btn {
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-main));
    color: #09090c;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gold-main);
    color: var(--gold-light);
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.12);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 7px 13px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* KONTENER */
.container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
}

/* LOGOWANIE / REJESTRACJA */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72vh;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    color: var(--gold-light);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-dark);
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 22px;
}

.auth-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--bg-card-hover);
    color: var(--gold-light);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold-main);
}

.error-text {
    color: var(--danger);
    font-size: 0.88rem;
    margin-bottom: 12px;
    min-height: 18px;
}

/* BANERY I POSTĘP */
.alert-banner {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: #86efac;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.progress-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-info h2 {
    font-size: 1.25rem;
    color: var(--gold-light);
}

.progress-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.progress-bar-bg {
    height: 10px;
    background: var(--bg-dark);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    transition: width 0.35s ease;
}

/* SIATKA KATEGORII */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 145px;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-main);
    transform: translateY(-3px);
}

.category-card.voted {
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, var(--bg-card) 100%);
}

.category-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cat-number {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.status-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
}

.status-pill.done {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-pill.pending {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.status-pill.empty {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.category-card-choice {
    font-size: 0.85rem;
    color: var(--gold-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* WIDOK KATEGORII I KLIPY */
.category-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-counter {
    color: var(--gold-light);
    font-weight: 700;
}

.category-header {
    margin-bottom: 28px;
}

.category-header h1 {
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.category-header p {
    color: var(--text-muted);
}

.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
}

.clip-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
}

.clip-card.selected {
    border-color: var(--gold-main);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.clip-body {
    padding: 18px;
}

.clip-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.clip-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.btn-select-clip {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-main);
    transition: 0.2s;
}

.clip-card.selected .btn-select-clip {
    background: var(--gold-main);
    color: #09090c;
    border-color: var(--gold-main);
}

/* DOLNY PASEK ZATWIERDZANIA */
.sticky-vote-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(18, 19, 26, 0.96);
    border-top: 1px solid var(--gold-dark);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 40;
}

.selected-info strong {
    color: var(--gold-light);
}

/* PANEL ADMINA */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.admin-card h2 {
    color: var(--gold-light);
    margin-bottom: 18px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.admin-clips-list {
    margin-top: 14px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-clip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.voters-box {
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-cat-block {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.result-cat-block h4 {
    color: var(--gold-light);
    margin-bottom: 8px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 4px 0;
}

/* MODAL PODSUMOWANIA */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 100;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    padding: 28px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-header h2 {
    color: var(--gold-light);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.summary-list {
    overflow-y: auto;
    flex: 1;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
}

.summary-row span:first-child {
    color: var(--text-muted);
}

.summary-row span:last-child {
    color: var(--gold-light);
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* TOAST */
.toast {
    position: fixed;
    top: 84px;
    right: 24px;
    background: var(--gold-main);
    color: #09090c;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}