/* Student Mobile Clicker Styling - Ultra Responsive & Touch-Optimized */
:root {
    --bg-dark: #070e24;
    --card-bg: #0f1c3f;
    --border-gold: #e5b044;
    --gold-glow: rgba(229, 176, 68, 0.4);
    --text-light: #ffffff;
    --text-dim: #9aa8c7;
    --accent-blue: #1e88e5;
    --btn-a: #e53935;
    --btn-b: #1e88e5;
    --btn-c: #fbc02d;
    --btn-d: #43a047;
    --success-green: #00e676;
    --error-red: #ff1744;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    background-image: radial-gradient(circle at 50% 20%, #132454 0%, #060b1c 100%);
    overflow-x: hidden;
}

.student-app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
}

/* Header */
.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(229, 176, 68, 0.2);
    margin-bottom: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-badge {
    background: linear-gradient(135deg, #ffd54f, #ff8f00);
    color: #050b1a;
    font-weight: 900;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.logo-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffd54f;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-green);
    box-shadow: 0 0 8px var(--success-green);
}

.room-pill {
    background: rgba(30, 136, 229, 0.25);
    border: 1px solid var(--accent-blue);
    color: #90caf9;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 700;
}

/* Screens Common */
.screen-box {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.25s ease-out;
}

.screen-box.active {
    display: flex;
}

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

/* Screen 1: Join Screen */
.join-card {
    background: var(--card-bg);
    border: 1px solid var(--gold-glow);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.join-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.join-card h2 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 6px;
}

.join-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 22px;
}

.input-group {
    text-align: left;
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #ffd54f;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    background: #09132c;
    border: 1.5px solid #233568;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--border-gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

.btn-join {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #ffb300, #ff8f00);
    border: none;
    color: #060b1c;
    font-size: 16px;
    font-weight: 800;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 143, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-join:active {
    transform: scale(0.97);
}

.error-msg {
    margin-top: 14px;
    color: #ff8a80;
    background: rgba(211, 47, 47, 0.2);
    border: 1px solid #d32f2f;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}

/* Screen 2: Waiting Room */
.waiting-card {
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    padding: 30px 16px;
}

.pulse-ring {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 136, 229, 0.4) 0%, rgba(30, 136, 229, 0) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ripple 2s infinite ease-out;
}

@keyframes ripple {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 25px rgba(30, 136, 229, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(30, 136, 229, 0); }
}

.wave-icon {
    font-size: 40px;
}

.waiting-card h3 {
    font-size: 22px;
    color: #fff;
    margin-bottom: 6px;
}

.waiting-name {
    font-size: 15px;
    color: #ffd54f;
    font-weight: 600;
    margin-bottom: 24px;
}

.waiting-status-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: #e0e0e0;
    margin-bottom: 16px;
}

.waiting-tip {
    font-size: 12px;
    color: var(--text-dim);
}

/* Screen 3: Active Response Screen */
.active-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.q-badge {
    background: rgba(229, 176, 68, 0.18);
    border: 1px solid var(--border-gold);
    color: #ffd54f;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.timer-badge {
    font-size: 12px;
    font-weight: 600;
    color: #90caf9;
}

.instructions-banner {
    font-size: 13px;
    color: #cdd6eb;
    margin-bottom: 16px;
    text-align: center;
    padding: 8px;
    background: rgba(15, 28, 63, 0.6);
    border-radius: 8px;
}

/* 4 Big Clicker Buttons (2x2 Grid) */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    flex: 1;
    margin-bottom: 16px;
}

.opt-btn {
    border: none;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease, filter 0.1s ease;
    padding: 20px 10px;
    position: relative;
    overflow: hidden;
}

.opt-btn:active {
    transform: scale(0.94);
}

.opt-btn.opt-a {
    background: linear-gradient(145deg, #e53935, #c62828);
    color: #ffffff;
}
.opt-btn.opt-b {
    background: linear-gradient(145deg, #1e88e5, #1565c0);
    color: #ffffff;
}
.opt-btn.opt-c {
    background: linear-gradient(145deg, #fbc02d, #f57f17);
    color: #261700;
}
.opt-btn.opt-d {
    background: linear-gradient(145deg, #43a047, #2e7d32);
    color: #ffffff;
}

.btn-key {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

/* Locked State for Option Button */
.opt-btn.locked {
    filter: brightness(1.2);
    outline: 4px solid #fff;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}

.opt-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.5);
}

.lock-status {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid #2196f3;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: #90caf9;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Screen 4: Result Feedback Screen */
.result-card {
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    padding: 32px 20px;
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}

.result-card.correct {
    background: radial-gradient(circle, #0e3b26 0%, #061f13 100%);
    border: 2px solid #00e676;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.4);
}

.result-card.wrong {
    background: radial-gradient(circle, #421111 0%, #200707 100%);
    border: 2px solid #ff1744;
    box-shadow: 0 0 30px rgba(255, 23, 68, 0.4);
}

.result-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.result-card h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.result-card.correct h2 { color: #00e676; }
.result-card.wrong h2 { color: #ff5252; }

.result-details {
    font-size: 14px;
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 16px;
}

.result-time {
    font-size: 13px;
    font-weight: 700;
    color: #ffd54f;
    margin-bottom: 20px;
}

.next-prompt {
    font-size: 12px;
    color: var(--text-dim);
}
