/* ===== CSS Variables ===== */
:root {
    --bg-dark: #0a0a1a;
    --bg-card: rgba(20, 20, 40, 0.9);
    --card-border: rgba(255, 255, 255, 0.1);
    --orange-primary: #ff6b35;
    --orange-glow: #ff9f1c;
    --orange-light: rgba(255, 107, 53, 0.2);
    --blue-primary: #00bfff;
    --blue-glow: #4dd2ff;
    --blue-light: rgba(0, 191, 255, 0.2);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --gradient-orange: linear-gradient(90deg, #ff6b35, #ff9f1c, #ffcc00);
    --gradient-blue: linear-gradient(270deg, #00bfff, #4dd2ff, #00ffff);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Prompt', sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 107, 53, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(0, 191, 255, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    color: var(--text-light);
}

/* ===== Container ===== */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 0.5rem;
    padding-bottom: 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== Closed Page ===== */
.closed-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.closed-content {
    text-align: center;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.closed-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.closed-content h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--orange-glow), var(--blue-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 0.3rem 0;
}

.title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
    background: linear-gradient(135deg, var(--orange-glow), #ffffff, var(--blue-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* ===== Poll Section ===== */
.poll-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== Versus Compact Layout ===== */
.versus-compact {
    display: flex;
    gap: 0.4rem;
    position: relative;
}

.option-compact {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid var(--card-border);
    border-radius: 14px;
    padding: 0.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.option-compact:first-child {
    border-color: rgba(255, 107, 53, 0.3);
}

.option-compact:last-child {
    border-color: rgba(0, 191, 255, 0.3);
}

.option-compact.voted:first-child {
    border-color: var(--orange-primary);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
}

.option-compact.voted:last-child {
    border-color: var(--blue-primary);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
}

.image-wrapper-compact {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
}

.option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.3s ease;
}

.option-image-flip {
    transform: scaleX(-1);
}

.option-compact:hover .option-image {
    transform: scale(1.02);
}

.option-compact:hover .option-image-flip {
    transform: scaleX(-1) scale(1.02);
}

.option-title-compact {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0.35rem 0 0.3rem;
}

.option-title-orange {
    color: var(--orange-glow);
}

.option-title-blue {
    color: var(--blue-glow);
}

/* ===== Vote Buttons ===== */
.vote-btn-compact {
    border: none;
    border-radius: 20px;
    padding: 0.45rem 0.8rem;
    font-family: 'Prompt', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn-orange {
    background: var(--gradient-orange);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4);
}

.vote-btn-blue {
    background: var(--gradient-blue);
    box-shadow: 0 3px 10px rgba(0, 191, 255, 0.4);
}

.vote-btn-compact:hover {
    transform: scale(1.05);
}

.vote-btn-compact:active {
    transform: scale(0.98);
}

/* ===== VS Badge ===== */
.vs-badge-compact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--orange-primary), var(--blue-primary));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    border: 2px solid white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    z-index: 10;
    animation: vsPulse 2s infinite;
}

@keyframes vsPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ===== Result Display ===== */
.result-compact {
    margin-top: 0.3rem;
}

.result-bar-compact {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.result-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 1s ease-out;
}

.result-fill-orange {
    background: var(--gradient-orange);
}

.result-fill-blue {
    background: var(--gradient-blue);
}

.result-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.2rem;
}

.result-percent-compact {
    font-size: 1.2rem;
    font-weight: 800;
}

.result-percent-orange {
    color: var(--orange-glow);
}

.result-percent-blue {
    color: var(--blue-glow);
}

.result-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== POWER BATTLE ARENA ===== */
.battle-arena {
    margin: 0.8rem 0;
    padding: 0.8rem 0.5rem;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(10, 10, 30, 0.9) 50%,
            rgba(0, 0, 0, 0.6) 100%);
    border-radius: 15px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

/* Starfield background effect */
.battle-arena::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.2) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 60%, rgba(255, 255, 255, 0.3) 50%, transparent 50%);
    pointer-events: none;
}

.arena-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    position: relative;
}

.arena-fighter {
    width: 80px;
    height: 95px;
    flex-shrink: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arena-fighter-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* ===== BEAM BATTLE - Dragon Ball Style ===== */
.beam-battle-container {
    flex: 1;
    height: 50px;
    position: relative;
    margin: 0 -15px;
    /* Overlap with character hands */
}

.beam {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 35px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Orange beam - from left (lawyer) */
.beam-orange {
    left: 0;
    width: 50%;
    background: linear-gradient(90deg,
            rgba(255, 107, 53, 0.3) 0%,
            rgba(255, 150, 50, 0.7) 20%,
            rgba(255, 200, 100, 0.9) 40%,
            rgba(255, 220, 150, 1) 60%,
            rgba(255, 255, 200, 1) 100%);
    border-radius: 0 50% 50% 0;
    box-shadow:
        0 0 10px rgba(255, 107, 53, 0.8),
        0 0 25px rgba(255, 150, 50, 0.6),
        0 0 40px rgba(255, 200, 100, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
    animation: beamFlowOrange 0.3s linear infinite;
}

/* Blue beam - from right (student) */
.beam-blue {
    right: 0;
    width: 50%;
    background: linear-gradient(270deg,
            rgba(0, 191, 255, 0.3) 0%,
            rgba(50, 200, 255, 0.7) 20%,
            rgba(100, 220, 255, 0.9) 40%,
            rgba(150, 240, 255, 1) 60%,
            rgba(200, 255, 255, 1) 100%);
    border-radius: 50% 0 0 50%;
    box-shadow:
        0 0 10px rgba(0, 191, 255, 0.8),
        0 0 25px rgba(50, 200, 255, 0.6),
        0 0 40px rgba(100, 220, 255, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
    animation: beamFlowBlue 0.3s linear infinite;
}

@keyframes beamFlowOrange {

    0%,
    100% {
        box-shadow:
            0 0 10px rgba(255, 107, 53, 0.8),
            0 0 25px rgba(255, 150, 50, 0.6),
            0 0 40px rgba(255, 200, 100, 0.4);
    }

    50% {
        box-shadow:
            0 0 15px rgba(255, 107, 53, 1),
            0 0 35px rgba(255, 150, 50, 0.8),
            0 0 55px rgba(255, 200, 100, 0.6);
    }
}

@keyframes beamFlowBlue {

    0%,
    100% {
        box-shadow:
            0 0 10px rgba(0, 191, 255, 0.8),
            0 0 25px rgba(50, 200, 255, 0.6),
            0 0 40px rgba(100, 220, 255, 0.4);
    }

    50% {
        box-shadow:
            0 0 15px rgba(0, 191, 255, 1),
            0 0 35px rgba(50, 200, 255, 0.8),
            0 0 55px rgba(100, 220, 255, 0.6);
    }
}

/* ===== CLASH POINT - Explosion Effect ===== */
.clash-point {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 10;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.clash-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 200, 0.9) 50%,
            rgba(255, 200, 150, 0.5) 100%);
    border-radius: 50%;
    animation: coreFlash 0.2s ease-in-out infinite;
}

@keyframes coreFlash {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.9;
    }
}

.clash-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: ringExpand 0.8s ease-out infinite;
}

.clash-ring-1 {
    width: 30px;
    height: 30px;
    animation-delay: 0s;
}

.clash-ring-2 {
    width: 30px;
    height: 30px;
    animation-delay: 0.4s;
}

@keyframes ringExpand {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
        border-color: rgba(255, 255, 255, 0.9);
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
        border-color: rgba(255, 200, 100, 0);
    }
}

/* Sparks around clash */
.clash-sparks {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background:
        radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 100, 1) 50%, transparent 50%),
        radial-gradient(2px 2px at 90% 30%, rgba(255, 200, 100, 1) 50%, transparent 50%),
        radial-gradient(2px 2px at 20% 80%, rgba(100, 200, 255, 1) 50%, transparent 50%),
        radial-gradient(2px 2px at 80% 70%, rgba(100, 255, 255, 1) 50%, transparent 50%),
        radial-gradient(2px 2px at 50% 10%, rgba(255, 255, 255, 1) 50%, transparent 50%),
        radial-gradient(2px 2px at 50% 90%, rgba(255, 255, 200, 1) 50%, transparent 50%);
    animation: sparksRotate 0.5s linear infinite;
}

@keyframes sparksRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== Power Display ===== */
.power-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.power-percent {
    font-size: 1.3rem;
    font-weight: 800;
}

.power-percent-orange {
    color: var(--orange-glow);
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.power-percent-blue {
    color: var(--blue-glow);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.power-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== Total Votes ===== */
.total-votes {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.3rem 0;
}

.total-votes strong {
    color: white;
}

/* ===== Share Section ===== */
.share-section {
    text-align: center;
    padding: 0.3rem 0;
}

.share-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.share-buttons {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.share-btn {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 8px;
    font-family: 'Prompt', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-fb {
    background: #1877F2;
}

.share-x {
    background: #000;
}

.share-line {
    background: #00B900;
}

.share-copy {
    background: linear-gradient(135deg, var(--orange-primary), var(--blue-primary));
}

.share-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* ===== CTA Section ===== */
.cta-section {
    text-align: center;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.cta-btn-main {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffaa00, #ff8c00);
    border: 2px solid #ffd700;
    border-radius: 30px;
    padding: 0.9rem 2rem;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: ctaGlow 1.5s ease-in-out infinite;
}

.cta-btn-main:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7);
}

@keyframes ctaGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 0.25rem 0;
    border-top: 1px solid var(--card-border);
}

.disclaimer p {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin: 0.15rem 0;
    opacity: 0.7;
}

.disclaimer a {
    color: var(--orange-glow);
    text-decoration: none;
}

.disclaimer a:hover {
    text-decoration: underline;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--orange-primary), var(--blue-primary));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Desktop ===== */
@media (min-width: 768px) {
    .container {
        max-width: 550px;
        padding: 1.5rem;
    }

    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .option-compact {
        padding: 1rem;
    }

    .option-title-compact {
        font-size: 1rem;
    }

    .vote-btn-compact {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .vs-badge-compact {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .arena-container {
        height: 130px;
    }

    .arena-fighter {
        width: 110px;
        height: 125px;
    }

    .beam {
        height: 45px;
    }

    .clash-point {
        width: 80px;
        height: 80px;
    }

    .clash-core {
        width: 25px;
        height: 25px;
    }

    .power-percent {
        font-size: 1.6rem;
    }

    .share-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}