/* ========================================
   Thisgun Viral - Common Styles
   ======================================== */

/* Reset & Base */
.tv-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.tv-container * {
    box-sizing: border-box;
}

/* ========================================
   WORLDCUP STYLES
   ======================================== */
.tv-worldcup {
    background: linear-gradient(135deg, #ff6b35, #ff2e63);
    border-radius: 20px;
    padding: 30px 20px;
    color: #fff;
    min-height: 400px;
}

.tv-worldcup h2 {
    text-align: center;
    font-size: 28px;
    margin: 0 0 10px;
    color: #fff;
}

.tv-worldcup .tv-subtitle {
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 25px;
}

/* Category Selection */
.tv-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.tv-category-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.tv-category-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.tv-category-btn .tv-cat-emoji {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.tv-category-btn .tv-cat-rounds {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Round Indicator */
.tv-round-indicator {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}

/* Battle Arena */
.tv-battle {
    display: flex;
    align-items: stretch;
    gap: 0;
    justify-content: center;
    min-height: 250px;
}

.tv-battle-card {
    flex: 1;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 30px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.tv-battle-card:hover {
    background: rgba(255,255,255,0.25);
    border-color: #fff;
    transform: scale(1.03);
}

.tv-battle-card.tv-winner-anim {
    animation: tvWinnerPop 0.5s ease;
    background: rgba(255,255,255,0.35);
    border-color: #fff;
}

@keyframes tvWinnerPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1.05); }
}

.tv-battle-card .tv-card-emoji {
    font-size: 52px;
    margin-bottom: 12px;
}

.tv-battle-card .tv-card-name {
    font-size: 20px;
    font-weight: 700;
}

.tv-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    color: #ffe066;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    min-width: 50px;
    flex-shrink: 0;
}

/* Winner Screen */
.tv-winner-screen {
    text-align: center;
    padding: 30px 0;
}

.tv-winner-screen .tv-trophy {
    font-size: 72px;
    animation: tvBounce 1s ease infinite;
}

@keyframes tvBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tv-winner-screen .tv-winner-label {
    font-size: 16px;
    opacity: 0.8;
    margin: 10px 0 5px;
}

.tv-winner-screen .tv-winner-name {
    font-size: 36px;
    font-weight: 900;
    margin: 5px 0 20px;
}

.tv-winner-screen .tv-winner-emoji {
    font-size: 60px;
    margin-bottom: 10px;
}

/* Confetti */
.tv-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.tv-confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: tvConfettiFall 3s ease-out forwards;
}

@keyframes tvConfettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ========================================
   BALANCE GAME STYLES
   ======================================== */
.tv-balance {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 20px;
    padding: 30px 20px;
    color: #fff;
    min-height: 400px;
}

.tv-balance h2 {
    text-align: center;
    font-size: 28px;
    margin: 0 0 10px;
    color: #fff;
}

.tv-balance .tv-subtitle {
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 20px;
}

/* Progress Bar */
.tv-progress-wrap {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    height: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tv-progress-bar {
    height: 100%;
    background: #ffe066;
    border-radius: 20px;
    transition: width 0.4s ease;
    width: 0%;
}

.tv-progress-text {
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 15px;
}

/* Question */
.tv-balance-question {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Choices */
.tv-balance-choices {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: 180px;
}

.tv-balance-btn {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 30px 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
}

.tv-balance-btn.tv-choice-a {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    margin-right: 0;
}

.tv-balance-btn.tv-choice-b {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    margin-left: 0;
}

.tv-balance-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.tv-balance-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: #ffe066;
    text-shadow: 0 0 15px rgba(255,224,102,0.5);
    min-width: 50px;
    flex-shrink: 0;
    position: relative;
}

.tv-balance-vs::before,
.tv-balance-vs::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 30px;
    background: #ffe066;
    opacity: 0.4;
}

.tv-balance-vs::before { top: -35px; }
.tv-balance-vs::after { bottom: -35px; }

/* Result Bar */
.tv-result-bar-wrap {
    margin-top: 20px;
    animation: tvFadeIn 0.5s ease;
}

@keyframes tvFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tv-result-bar {
    display: flex;
    height: 45px;
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
}

.tv-result-bar .tv-bar-a {
    background: rgba(59,130,246,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1s ease;
}

.tv-result-bar .tv-bar-b {
    background: rgba(239,68,68,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1s ease;
}

.tv-result-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
}

/* Summary */
.tv-balance-summary {
    text-align: center;
}

.tv-balance-summary h3 {
    font-size: 24px;
    margin: 0 0 20px;
    color: #fff;
}

.tv-summary-list {
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.tv-summary-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tv-summary-item .tv-q-num {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ========================================
   AGE GUESS STYLES
   ======================================== */
.tv-age-guess {
    background: linear-gradient(135deg, #10b981, #0d9488);
    border-radius: 20px;
    padding: 30px 20px;
    color: #fff;
    min-height: 400px;
}

.tv-age-guess h2 {
    text-align: center;
    font-size: 28px;
    margin: 0 0 10px;
    color: #fff;
}

.tv-age-guess .tv-subtitle {
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 20px;
}

.tv-age-question {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.4;
}

.tv-age-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tv-age-option {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.tv-age-option:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    transform: translateY(-2px);
}

.tv-age-option.tv-selected {
    background: rgba(255,255,255,0.35);
    border-color: #ffe066;
    transform: scale(1.02);
}

/* Age Result */
.tv-age-result {
    text-align: center;
    padding: 20px 0;
}

.tv-age-counter {
    font-size: 80px;
    font-weight: 900;
    margin: 15px 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tv-age-counter span {
    font-size: 32px;
    font-weight: 400;
}

.tv-age-result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.tv-age-result-desc {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
}

.tv-age-comparison {
    font-size: 16px;
    font-weight: 700;
    margin: 15px 0 20px;
    padding: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}

/* ========================================
   SHARED UI ELEMENTS
   ======================================== */

/* Buttons */
.tv-btn {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #fff;
}

.tv-btn-share {
    background: #25d366;
    margin-right: 8px;
}

.tv-btn-share:hover {
    background: #1fb855;
    transform: translateY(-2px);
}

.tv-btn-retry {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
}

.tv-btn-retry:hover {
    background: rgba(255,255,255,0.35);
}

.tv-btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Toast */
.tv-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    transition: transform 0.3s ease;
    pointer-events: none;
}

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

/* Start Screen */
.tv-start-screen {
    text-align: center;
    padding: 20px 0;
}

.tv-start-screen .tv-start-emoji {
    font-size: 60px;
    margin-bottom: 10px;
}

.tv-start-screen .tv-start-desc {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 25px;
    line-height: 1.5;
}

.tv-btn-start {
    background: #ffe066;
    color: #333;
    font-size: 18px;
    padding: 16px 40px;
}

.tv-btn-start:hover {
    background: #ffd633;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
    .tv-container {
        padding: 10px;
    }

    .tv-worldcup, .tv-balance, .tv-age-guess {
        padding: 20px 15px;
        border-radius: 16px;
    }

    .tv-worldcup h2, .tv-balance h2, .tv-age-guess h2 {
        font-size: 22px;
    }

    /* Worldcup mobile: stack cards vertically */
    .tv-battle {
        flex-direction: column;
        min-height: auto;
    }

    .tv-battle-card {
        min-height: 120px;
        padding: 20px 15px;
    }

    .tv-battle-card .tv-card-emoji {
        font-size: 40px;
    }

    .tv-battle-card .tv-card-name {
        font-size: 18px;
    }

    .tv-vs {
        min-width: auto;
        padding: 8px 0;
        font-size: 22px;
    }

    /* Balance mobile: stack vertically */
    .tv-balance-choices {
        flex-direction: column;
    }

    .tv-balance-btn {
        min-height: 80px;
        font-size: 16px;
        padding: 20px 15px;
    }

    .tv-balance-vs {
        min-width: auto;
        padding: 8px 0;
        font-size: 20px;
    }

    .tv-balance-vs::before,
    .tv-balance-vs::after {
        display: none;
    }

    .tv-categories {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tv-category-btn {
        padding: 18px 10px;
        font-size: 14px;
    }

    .tv-category-btn .tv-cat-emoji {
        font-size: 32px;
    }

    .tv-age-options {
        grid-template-columns: 1fr;
    }

    .tv-winner-screen .tv-winner-name {
        font-size: 28px;
    }

    .tv-age-counter {
        font-size: 60px;
    }

    .tv-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .tv-btn-start {
        font-size: 16px;
        padding: 14px 32px;
    }
}
