/**
 * Countdown Starter - CSS for Whole Class Activities
 * Optimized for interactive whiteboard display
 */

:root {
    --primary: #0EA5E9;
    --secondary: #38BDF8;
    --light: #FFFFFF;
    --dark: #1D1D1B;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --card-bg: #1E293B;
    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --card-border: rgba(148, 163, 184, 0.2);
}

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

body.countdown-starter-page {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    background: radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.12), transparent 55%),
                radial-gradient(circle at 85% 25%, rgba(56, 189, 248, 0.12), transparent 50%),
                linear-gradient(180deg, #0B1120 0%, #0F172A 100%);
    min-height: 100vh;
    color: var(--light);
    overflow-x: hidden;
}

/* Game Container */
.game-container {
    width: 100%;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Screen Management */
.game-screen {
    display: none;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.game-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

/* Selection Screen */
.selection-card {
    background: var(--card-bg);
    border: 4px solid var(--secondary);
    border-radius: 24px;
    padding: 4rem;
    text-align: center;
    max-width: 1200px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.selection-card h1 {
    color: var(--primary);
    font-size: 4rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.instruction-text {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.large-number-selector {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.number-choice-btn {
    background: var(--card-bg);
    border: 4px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.number-choice-btn:hover {
    transform: translateY(-8px);
    border-color: var(--secondary);
    box-shadow: 0 12px 32px rgba(56, 189, 248, 0.4);
}

.number-choice-btn.selected {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
    font-weight: bold;
}

.choice-number {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.number-choice-btn.selected .choice-number {
    color: var(--dark);
}

.choice-label {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Game Play Layout */
.game-play-layout {
    width: 100%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Target Card - Large and Prominent */
.target-card {
    background: linear-gradient(135deg, var(--primary) 0%, #0284C7 100%);
    border-radius: 20px;
    padding: 3rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.4);
    flex-shrink: 0;
}

.target-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.target-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.target-number {
    color: var(--light);
    font-size: 6rem;
    font-weight: 900;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

/* Timer Display */
.timer-display {
    width: 140px;
    height: 140px;
    position: relative;
    flex-shrink: 0;
}

.timer-circle {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.timer-background {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 10;
}

.timer-progress {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 10;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
    stroke-linecap: round;
}

.timer-progress.warning {
    stroke: var(--warning);
}

.timer-progress.danger {
    stroke: var(--danger);
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% {
        stroke-width: 10;
    }
    50% {
        stroke-width: 12;
    }
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--light);
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.game-main-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Numbers Section */
.numbers-section {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.numbers-section h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.number-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.number-tile {
    background: var(--primary);
    color: var(--light);
    border: none;
    border-radius: 16px;
    padding: 2rem 1rem;
    font-size: 3.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-tile:hover:not(:disabled) {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.5);
}

.number-tile:disabled {
    background: var(--card-bg);
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

.number-tile.selected {
    background: var(--secondary);
    color: var(--dark);
    animation: tileSelect 0.3s ease;
}

@keyframes tileSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

/* Operations Section */
.operations-section {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.operations-section h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.operation-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.operation-btn {
    background: var(--secondary);
    color: var(--dark);
    border: none;
    border-radius: 16px;
    padding: 2rem 1rem;
    font-size: 4rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.operation-btn:hover:not(:disabled) {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 32px rgba(250, 183, 25, 0.5);
}

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

/* Current Calculation Card */
.current-calc-card {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.current-calc-card h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.calculation-display {
    background: rgba(255, 255, 255, 0.1);
    border: 3px dashed var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Gloria Hallelujah', cursive;
    margin-bottom: 1rem;
}

.calc-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 2rem;
}

.calc-expression {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.calc-number {
    color: var(--primary);
    font-size: 3rem;
}

.calc-operation {
    color: var(--secondary);
    font-size: 3.5rem;
}

.calc-result-display {
    text-align: center;
    margin-top: 1rem;
}

.calc-result {
    color: var(--success);
    font-size: 3rem;
    font-weight: bold;
}

/* Control Buttons */
.control-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-weight: bold;
    border-radius: 16px;
    padding: 1.5rem 3rem;
    font-size: 1.8rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-height: 70px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: var(--primary);
    color: var(--light);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 3px solid var(--card-border);
}

.btn-success {
    background: var(--success);
    color: var(--light);
}

.btn-submit {
    background: #FAB719;
    color: var(--dark);
    font-weight: 800;
    box-shadow: 0 4px 20px rgba(250, 183, 25, 0.5);
}

.btn-lg {
    padding: 2rem 4rem;
    font-size: 2.2rem;
}

/* History Card */
.history-card {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
}

.history-card h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.calculation-history {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.history-empty {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
    font-size: 1.8rem;
    grid-column: 1 / -1;
}

.history-step {
    background: rgba(30, 41, 59, 0.6);
    border-left: 5px solid var(--secondary);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 1.8rem;
    animation: slideInRight 0.3s ease;
    font-family: 'Gloria Hallelujah', cursive;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-step-expression {
    color: var(--text-primary);
    font-weight: bold;
}

.history-step-result {
    color: var(--secondary);
    font-weight: bold;
    font-size: 2rem;
}

/* Results Screen */
.results-layout {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.results-title {
    color: var(--primary);
    font-size: 4.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
}

.results-comparison {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    justify-content: center;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.result-label {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.result-value {
    font-size: 5rem;
    font-weight: 900;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
}

.target-value {
    color: var(--light);
}

.user-value {
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

.result-separator {
    font-size: 3rem;
    color: var(--text-secondary);
    font-weight: bold;
}

.score-display {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 20px;
    padding: 2rem 4rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.score-label {
    color: var(--light);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.score-value {
    color: var(--light);
    font-size: 5rem;
    font-weight: 900;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
    animation: scoreReveal 0.6s ease;
}

@keyframes scoreReveal {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.solution-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.solution-card h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.solution-step {
    background: rgba(255, 255, 255, 0.1);
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--light);
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
    font-family: 'Gloria Hallelujah', cursive;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.solution-step:nth-child(1) { animation-delay: 0.1s; }
.solution-step:nth-child(2) { animation-delay: 0.2s; }
.solution-step:nth-child(3) { animation-delay: 0.3s; }
.solution-step:nth-child(4) { animation-delay: 0.4s; }
.solution-step:nth-child(5) { animation-delay: 0.5s; }

.results-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .target-number {
        font-size: 5rem;
    }
    
    .number-tile {
        font-size: 3rem;
        padding: 1.5rem 1rem;
    }
    
    .operation-btn {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
    }
    
    .selection-card {
        padding: 2rem;
    }
    
    .selection-card h1 {
        font-size: 2.5rem;
    }
    
    .instruction-text {
        font-size: 1.5rem;
    }
    
    .number-choice-btn {
        width: 120px;
        padding: 1.5rem 1rem;
    }
    
    .choice-number {
        font-size: 3rem;
    }
    
    .game-main-content {
        grid-template-columns: 1fr;
    }
    
    .target-number {
        font-size: 4rem;
    }
    
    .target-label {
        font-size: 1.2rem;
    }
    
    .timer-display {
        width: 100px;
        height: 100px;
    }
    
    .timer-circle {
        width: 100px;
        height: 100px;
    }
    
    .timer-text {
        font-size: 2rem;
    }
    
    .number-tile {
        font-size: 2.5rem;
        padding: 1.5rem 1rem;
        min-height: 100px;
    }
    
    .operation-btn {
        font-size: 3rem;
        padding: 1.5rem 1rem;
        min-height: 100px;
    }
    
    .btn {
        font-size: 1.5rem;
        padding: 1.2rem 2rem;
    }
    
    .results-title {
        font-size: 3rem;
    }
    
    .result-value {
        font-size: 4rem;
    }
    
    .score-value {
        font-size: 4rem;
    }
}
