/* Wer wird Millionär - Authentic TV Design */

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

:root {
    /* WWM Authentic Colors */
    --wwm-dark-blue: #0a1628;
    --wwm-mid-blue: #1a3a6a;
    --wwm-light-blue: #2a5a9a;
    --wwm-highlight: #4a8ad4;
    --wwm-border: #5a9ae4;
    --accent-orange: #ff9500;
    --accent-gold: #ffd700;
    --text-white: #ffffff;
    --correct-green: #00c853;
    --wrong-red: #ff1744;
}

body {
    font-family: 'Myriad Pro', 'Myriad', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(ellipse at center, #1a2a4a 0%, #0a0a1a 100%);
    min-height: 100vh;
    color: var(--text-white);
    overflow-x: hidden;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

/* Screens */
.screen {
    display: none !important;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block !important;
}

#start-screen.active {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Start Screen */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.logo {
    margin-bottom: 60px;
}

.logo h1 {
    font-family: 'Copperplate', 'Copperplate Gothic Bold', serif;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    color: var(--text-white);
    text-shadow: 0 0 30px rgba(100, 150, 255, 0.5);
    margin-bottom: 10px;
}

.logo h2 {
    font-family: 'Copperplate', 'Copperplate Gothic Bold', serif;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Button */
.main-btn {
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 18px 50px;
    background: linear-gradient(180deg, var(--wwm-light-blue) 0%, var(--wwm-mid-blue) 100%);
    border: 2px solid var(--wwm-border);
    border-radius: 8px;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.main-btn:hover {
    background: linear-gradient(180deg, var(--wwm-highlight) 0%, var(--wwm-light-blue) 100%);
    transform: scale(1.02);
}

/* Sound Button */
.sound-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--wwm-border);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.sound-btn:hover {
    background: rgba(42, 90, 154, 0.5);
}

/* TTS Button */
.tts-btn {
    position: fixed;
    top: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--wwm-border);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0.6;
}

.tts-btn:hover {
    background: rgba(42, 90, 154, 0.5);
    opacity: 1;
}

.tts-btn.active {
    background: rgba(255, 149, 0, 0.5);
    border-color: var(--accent-orange);
    opacity: 1;
}

/* Joker Bar */
.joker-bar {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 15px;
    margin-bottom: 15px;
}

.joker-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--wwm-light-blue) 0%, var(--wwm-mid-blue) 100%);
    border: 2px solid var(--wwm-border);
    color: var(--text-white);
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joker-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--wwm-highlight) 0%, var(--wwm-light-blue) 100%);
    transform: scale(1.05);
}

.joker-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Game Main Area */
.game-main {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 25px;
    align-items: start;
}

/* ========== WWM HEXAGON DESIGN ========== */

/* Question Box - Hexagonal Shape */
.question-box {
    position: relative;
    background: linear-gradient(180deg, var(--wwm-light-blue) 0%, var(--wwm-mid-blue) 50%, var(--wwm-dark-blue) 100%);
    padding: 25px 60px;
    text-align: center;
    clip-path: polygon(3% 50%, 0 50%, 3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
    margin-bottom: 15px;
}

.question-box::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(180deg, var(--wwm-mid-blue) 0%, var(--wwm-dark-blue) 100%);
    clip-path: polygon(3% 50%, 0 50%, 3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
    z-index: -1;
}

#question-text {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Answer Grid */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Answer Button - WWM Hexagonal Style */
.answer-btn {
    position: relative;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 16px 20px 16px 50px;
    background: linear-gradient(180deg, var(--wwm-light-blue) 0%, var(--wwm-mid-blue) 50%, var(--wwm-dark-blue) 100%);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.answer-btn::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(180deg, var(--wwm-mid-blue) 0%, #152a4a 100%);
    clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
    z-index: -1;
}

.answer-letter {
    font-weight: 700;
    color: var(--accent-orange);
    min-width: 25px;
}

.answer-text {
    flex: 1;
}

.answer-btn:hover:not(:disabled):not(.selected):not(.correct):not(.wrong) {
    background: linear-gradient(180deg, var(--wwm-highlight) 0%, var(--wwm-light-blue) 50%, var(--wwm-mid-blue) 100%);
}

/* Selected Answer - Orange */
.answer-btn.selected {
    background: linear-gradient(180deg, #ff9500 0%, #cc7700 50%, #995500 100%);
    animation: pulse 0.8s infinite;
}

.answer-btn.selected::before {
    background: linear-gradient(180deg, #cc7700 0%, #884400 100%);
}

/* Correct Answer - Green */
.answer-btn.correct {
    background: linear-gradient(180deg, #00cc55 0%, #009933 50%, #006622 100%);
    animation: correctFlash 0.4s ease 3;
}

.answer-btn.correct::before {
    background: linear-gradient(180deg, #009933 0%, #005522 100%);
}

/* Wrong Answer - Red */
.answer-btn.wrong {
    background: linear-gradient(180deg, #ff3344 0%, #cc1122 50%, #990011 100%);
    animation: wrongFlash 0.4s ease 3;
}

.answer-btn.wrong::before {
    background: linear-gradient(180deg, #cc1122 0%, #880011 100%);
}

.answer-btn.hidden-answer {
    visibility: hidden;
}

.answer-btn:disabled {
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes correctFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

@keyframes wrongFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Prize Ladder */
.prize-ladder {
    background: linear-gradient(180deg, rgba(20, 40, 80, 0.9), rgba(10, 20, 40, 0.95));
    border: 2px solid var(--wwm-border);
    border-radius: 10px;
    padding: 12px;
}

.prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.prize-item.milestone {
    color: var(--accent-orange);
    font-weight: 700;
    opacity: 0.7;
}

.prize-item.current {
    opacity: 1;
    background: linear-gradient(90deg, var(--wwm-light-blue), transparent);
    font-weight: 700;
}

.prize-item.passed {
    opacity: 0.3;
}

.prize-item .amount {
    font-family: 'Copperplate', 'Copperplate Gothic Bold', serif;
    font-weight: 600;
    font-size: 1.05rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.action-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 25px;
    background: linear-gradient(180deg, #3a3a4a, #2a2a3a);
    border: 2px solid #555;
    border-radius: 6px;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--wwm-border);
    background: linear-gradient(180deg, #4a4a5a, #3a3a4a);
}

/* Popup */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: linear-gradient(180deg, var(--wwm-mid-blue), var(--wwm-dark-blue));
    border: 2px solid var(--wwm-border);
    border-radius: 15px;
    padding: 35px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.popup-content h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--accent-orange);
}

#joker-result {
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Audience Chart */
.audience-chart {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    height: 130px;
    margin: 15px 0;
}

.audience-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.audience-bar .bar {
    width: 45px;
    background: linear-gradient(180deg, var(--wwm-highlight), var(--wwm-mid-blue));
    border-radius: 4px 4px 0 0;
    transition: height 1s ease;
}

.audience-bar .label {
    font-weight: 700;
    color: var(--accent-orange);
}

.audience-bar .percent {
    font-size: 0.85rem;
}

/* Phone Friend Selection */
.phone-friend-content {
    max-width: 500px;
}

.phone-friends {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.phone-friend-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(180deg, #2a3a5a, #1a2a4a);
    border: 2px solid var(--wwm-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.phone-friend-card:hover {
    border-color: var(--accent-orange);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
}

.friend-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(180deg, #3a4a6a, #2a3a5a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid var(--wwm-border);
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}

.friend-specialty {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Result Screen */
#result-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.result-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#result-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-orange);
}

#result-message {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
    white-space: pre-line;
}

#result-prize {
    font-family: 'Copperplate', 'Copperplate Gothic Bold', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 35px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.overlay.hidden {
    display: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(100, 150, 255, 0.2);
    border-top-color: var(--wwm-highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-overlay p {
    font-size: 1.1rem;
    font-weight: 500;
}

.error-content {
    text-align: center;
    padding: 30px;
}

.error-content h3 {
    color: var(--wrong-red);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

#error-message {
    margin-bottom: 25px;
    font-size: 1rem;
    max-width: 350px;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-main {
        grid-template-columns: 1fr;
    }

    .prize-ladder {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .prize-item {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.8rem;
        letter-spacing: 0.3em;
    }

    .logo h2 {
        font-size: 2.5rem;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .answer-btn {
        font-size: 1rem;
        padding: 14px 15px 14px 40px;
    }

    .question-box {
        padding: 20px 40px;
    }

    #question-text {
        font-size: 1.1rem;
    }

    .joker-btn {
        width: 55px;
        height: 55px;
        font-size: 0.95rem;
    }
}
