/* Root layout for 9:16 style screen */
#speed-quiz-app {
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #f5f7fb 0%, #e3e7ff 100%);
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.sq-root {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Header: START (links) + Countdown + NEUSTART (rechts) */
.sq-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.sq-countdown-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sq-logo-wrap {
    flex: 0 0 auto;
}

.sq-logo {
    max-height: 40px;
    object-fit: contain;
}

.sq-countdown {
    flex: 0 0 auto;
    text-align: center;
    font-size: 3.2rem;
    font-weight: 800;
    padding: 8px 32px;
    border-radius: 16px;
    background: #ffffff;
    border: 3px solid #1e88e5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.sq-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
    touch-action: manipulation;
}

.sq-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.sq-btn.sq-btn-start {
    background: #e53935 !important;
    color: #ffffff !important;
}

.sq-btn.sq-btn-reset {
    background: #43a047 !important;
    color: #ffffff !important;
}

/* Players */
.sq-players-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sq-players-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.sq-btn-player {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 16px;
    background: #1e88e5 !important;
    color: #ffffff !important;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    align-items: center;
    gap: 2px;
}

.sq-player-active {
    background: #e53935 !important;
}

.sq-player-score {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Questions area */
.sq-field-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 18px;
    background: #ffffff;
    border: 2px solid #c5cae9;
    padding: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 4px 10px rgba(0,0,0,0.06);
}

.sq-field {
    width: 100%;
    height: 100%;
    max-height: calc(100vh * 13 / 16 - 180px);
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    padding-right: 4px;
    box-sizing: border-box;
}

.sq-question-card {
    background: #e3f2fd;
    border-radius: 14px;
    border: 2px solid #90caf9;
    padding: 14px 18px;
    font-size: 1.3rem;
    line-height: 1.5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: 90px;
    width: 100%;
    flex: 0 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease, background 0.1s ease, border-color 0.1s ease;
}

.sq-question-card:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.sq-question-text {
    padding: 2px;
    width: 100%;
}

.sq-question-disabled {
    background: #eceff1;
    border-color: #b0bec5;
    color: #78909c;
    opacity: 0.7;
    cursor: default;
    box-shadow: none;
}

.sq-no-questions {
    font-size: 0.95rem;
    color: #546e7a;
    text-align: center;
    padding: 16px;
}

/* Controls */
.sq-controls {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #c5cae9;
}

.sq-control-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    flex: 1 1 0;
    min-width: 0;
}

.sq-control-group label {
    font-weight: 600;
    color: #3949ab;
}

.sq-control-group select {
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid #9fa8da;
    font-size: 0.8rem;
    outline: none;
}

/* Popups */
.sq-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sq-popup {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    width: 85vw;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sq-popup-question {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.sq-popup-answers {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sq-btn-answer {
    width: 100%;
    border-radius: 12px;
    background: #1e88e5 !important;
    color: #ffffff !important;
    font-size: 0.9rem;
    padding: 8px 10px;
}

.sq-btn-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: #b0bec5 !important;
    color: #ffffff !important;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    box-shadow: none;
}

/* Winner popup */
.sq-popup-winner {
    text-align: center;
    width: 75vw;
    max-width: 420px;
    border: 4px solid #e53935;
}

.sq-winner-title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: #e53935;
}

.sq-winner-name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.sq-winner-score {
    font-size: 2.0rem;
    margin-bottom: 18px;
}

/* Responsive */
@media (max-width: 480px) {
    .sq-countdown {
        font-size: 2.4rem;
        padding: 8px 16px;
    }
    .sq-header {
        flex-direction: column;
        gap: 10px;
    }
}


/* Sicherheit: Falls noch ein alter Close-Button im Fragen-PopUp vorhanden ist,
   wird er hier vollständig ausgeblendet, damit der Spieler eine Antwort klicken muss. */
#sq-popup-close {
    display: none !important;
}
