/**
 * Geo Explorer Auburn - Tablet PWA Styles
 * Brand-compliant design for student experience
 */

/* ============================================
   CSS VARIABLES - Brand Colors
   ============================================ */
:root {
    /* Primary */
    --auburn-blue: #0b2341;
    --auburn-orange: #e86100;
    
    /* Secondary */
    --offset-blue: #3d4f67;
    --sky-blue: #a6dbf7;
    
    /* Neutral */
    --darkest-text: #1a1a1a;
    --dark-text: #4b4b4b;
    --light-text: #7a7a7a;
    --smoke-white: #f1f1f1;
    --white: #ffffff;
    
    /* Feedback */
    --success: #87ad44;
    --gold: #ffbc66;
    --error: #dc3545;
    
    /* Typography - Use BadaBoomProBB from brand.css */
    --font-display: 'BadaBoomProBB', Impact, sans-serif;
    --font-body: 'Roboto', -apple-system, sans-serif;
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;
    
    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
    color: var(--darkest-text);
    background: var(--auburn-blue);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

#app {
    height: 100%;
    width: 100%;
    position: relative;
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ============================================
   SETUP SCREEN - Join Code Entry
   ============================================ */
.setup-screen {
    background: linear-gradient(135deg, var(--auburn-blue) 0%, var(--offset-blue) 100%);
    justify-content: center;
    align-items: center;
    padding: var(--space-5);
}

.setup-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.setup-logo {
    width: 200px;
    margin-bottom: var(--space-4);
}

.setup-card h1 {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--auburn-blue);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
}

.setup-card p {
    color: var(--light-text);
    margin-bottom: var(--space-4);
}

.code-input {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.code-input input {
    width: 50px;
    height: 60px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    border: 3px solid var(--smoke-white);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.code-input input:focus {
    outline: none;
    border-color: var(--auburn-orange);
}

.code-input input.error {
    border-color: var(--error);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.setup-error {
    color: var(--error);
    font-size: 14px;
    min-height: 24px;
    margin-bottom: var(--space-3);
}

/* ============================================
   STATION SELECT SCREEN (list style)
   ============================================ */
.station-select-screen {
    background: var(--smoke-white);
    padding: var(--space-5);
}

.station-select-header {
    text-align: center;
    margin-bottom: var(--space-4);
}

.station-select-header h1 {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--auburn-blue);
    text-transform: uppercase;
}

.station-select-header p {
    color: var(--light-text);
    font-size: 20px;
}

.stations-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-3) 100px var(--space-3);
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.station-list-item {
    background: var(--white);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-4);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.station-list-item:hover {
    border-color: var(--auburn-blue);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.station-list-item.selected {
    border-color: var(--auburn-orange);
    background: #fff8f5;
}

.station-list-item img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    object-fit: contain;
}

.station-list-item h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--auburn-blue);
    text-transform: uppercase;
    flex: 1;
}

.station-list-check {
    font-size: 22px;
    font-weight: 700;
    color: var(--auburn-orange);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================
   LESSON SELECT SCREEN
   ============================================ */
.lesson-select-screen {
    background: var(--smoke-white);
    padding: var(--space-5);
}

.lesson-select-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.lesson-select-header .back-btn {
    background: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.station-badge {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.station-badge img {
    width: 60px;
    height: 60px;
}

.station-badge h2 {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--auburn-blue);
    text-transform: uppercase;
}

.lessons-list {
    max-width: 800px;
    margin: 0 auto;
}

.lesson-option {
    background: var(--white);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-option:hover {
    border-color: var(--auburn-blue);
}

.lesson-option.selected {
    border-color: var(--auburn-orange);
}

.lesson-option h3 {
    font-size: 22px;
    font-weight: 500;
}

.lesson-option .lesson-meta {
    color: var(--light-text);
    font-size: 14px;
}

.start-btn {
    position: fixed;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--white);
    background: var(--auburn-orange);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(232, 97, 0, 0.3);
}

.start-btn:disabled {
    background: var(--light-text);
    box-shadow: none;
    cursor: not-allowed;
}

.start-btn:not(:disabled):hover {
    transform: translateX(-50%) scale(1.05);
}

/* ============================================
   READY SCREEN - Kiosk Start
   ============================================ */
.ready-screen {
    background: var(--smoke-white);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-5);
    color: var(--auburn-blue);
    position: relative;
    overflow: hidden;
}

/* Decorative accent bar at top */
.ready-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--auburn-blue), var(--auburn-orange));
}

.ready-content {
    max-width: 700px;
}

.ready-content img {
    width: 160px;
    margin-bottom: var(--space-4);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.ready-content h1 {
    font-family: var(--font-display);
    font-size: 56px;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
    color: var(--auburn-blue);
}

.ready-content p {
    font-size: 26px;
    color: var(--dark-text);
    margin-bottom: var(--space-5);
}

.begin-btn {
    padding: var(--space-5) var(--space-6);
    font-family: var(--font-display);
    font-size: 40px;
    color: var(--white);
    background: var(--auburn-orange);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 8px 24px rgba(232, 97, 0, 0.3);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(232, 97, 0, 0.3); }
    50% { box-shadow: 0 4px 32px rgba(232, 97, 0, 0.5); }
}

.begin-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   LESSON SCREEN - Step Player
   ============================================ */
.lesson-screen {
    background: var(--smoke-white);
}

.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--auburn-blue);
    color: var(--white);
}

.lesson-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.lesson-header img {
    width: 48px;
    height: 48px;
}

.lesson-title {
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.progress-bar {
    width: 200px;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--auburn-orange);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 16px;
    font-weight: 500;
}

/* Step Content */
.step-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    overflow: hidden;
}

.step-content {
    flex: 1;
    display: flex;
    gap: var(--space-4);
    overflow: hidden;
}

/* Media Side */
.step-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.step-media.full-width {
    flex: none;
    width: 100%;
    aspect-ratio: 16/9;
}

/* Video media - similar to featured image layout */
.step-media.video-media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
}

.step-media.video-media .video-container {
    width: 100%;
    aspect-ratio: 16/9;
}

/* Interaction Side */
.step-interaction {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step-question {
    font-size: 26px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: var(--space-4);
    color: var(--darkest-text);
}

/* Multiple Choice */
.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.option-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--smoke-white);
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    font-size: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--offset-blue);
}

.option-btn.selected {
    border-color: var(--auburn-blue);
    background: var(--sky-blue);
}

.option-btn.correct {
    border-color: var(--success);
    background: #e8f5e0;
}

.option-btn.incorrect {
    border-color: var(--error);
    background: #fde8e8;
}

.option-letter {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.option-btn.selected .option-letter {
    background: var(--auburn-blue);
    color: var(--white);
}

/* True/False */
.tf-buttons {
    display: flex;
    gap: var(--space-4);
}

.tf-btn {
    flex: 1;
    padding: var(--space-5);
    font-family: var(--font-display);
    font-size: 36px;
    text-transform: uppercase;
    background: var(--smoke-white);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.tf-btn.true { color: var(--success); }
.tf-btn.false { color: var(--error); }

.tf-btn:hover {
    border-color: var(--offset-blue);
}

.tf-btn.selected {
    border-color: var(--auburn-blue);
    background: var(--sky-blue);
}

/* Text Input */
.text-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-input-area textarea {
    flex: 1;
    padding: var(--space-3);
    font-size: 20px;
    font-family: var(--font-body);
    border: 3px solid var(--smoke-white);
    border-radius: var(--radius-md);
    resize: none;
    min-height: 150px;
}

.text-input-area textarea:focus {
    outline: none;
    border-color: var(--auburn-blue);
}

/* Navigation */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    margin-top: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn.back {
    background: var(--smoke-white);
    color: var(--dark-text);
}

.nav-btn.next {
    background: var(--auburn-orange);
    color: var(--white);
}

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

.nav-btn:not(:disabled):hover {
    transform: scale(1.02);
}

/* ============================================
   COMPLETE SCREEN
   ============================================ */
.complete-screen {
    background: var(--smoke-white);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-5);
    color: var(--auburn-blue);
    position: relative;
    overflow: hidden;
}

/* Decorative accent bar at top */
.complete-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--success), var(--gold));
}

.complete-content {
    max-width: 600px;
}

.complete-icon {
    font-size: 100px;
    animation: bounce-in 0.5s ease-out;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.complete-content h1 {
    font-family: var(--font-display);
    font-size: 48px;
    text-transform: uppercase;
    margin: var(--space-4) 0;
    color: var(--auburn-blue);
}

.complete-content p {
    font-size: 20px;
    color: var(--dark-text);
}

.complete-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    margin: var(--space-5) 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--auburn-orange);
}

.stat-label {
    font-size: 16px;
    color: var(--dark-text);
    opacity: 0.8;
}

.restart-btn {
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--white);
    background: var(--auburn-orange);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-transform: uppercase;
    margin-top: var(--space-4);
    box-shadow: 0 8px 24px rgba(232, 97, 0, 0.3);
    transition: all 0.2s;
}

.restart-btn:hover {
    transform: scale(1.03);
}

/* ============================================
   OVERLAYS
   ============================================ */
.offline-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2) var(--space-3);
    background: var(--gold);
    color: var(--darkest-text);
    text-align: center;
    font-weight: 500;
    z-index: 1000;
}

.offline-bar.hidden {
    display: none;
}

.command-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.command-overlay.hidden {
    display: none;
}

.command-content {
    text-align: center;
    color: var(--auburn-blue);
    position: relative;
    padding: var(--space-6);
    max-width: 600px;
}

.command-close {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--smoke-white);
    border: 2px solid var(--offset-blue);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.2s;
}

.command-close:hover {
    background: var(--auburn-orange);
    border-color: var(--auburn-orange);
    color: var(--white);
}

.command-close.hidden {
    display: none;
}

.command-mascot {
    width: 180px;
    height: auto;
    margin-bottom: var(--space-4);
    animation: bounce 2s infinite;
}

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

.command-content h2 {
    font-family: var(--font-display);
    font-size: 48px;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
    color: var(--auburn-blue);
}

.command-content p {
    font-size: 24px;
    color: var(--dark-text);
    margin-bottom: var(--space-4);
}

.command-countdown {
    margin: var(--space-4) 0;
}

.command-countdown.hidden {
    display: none;
}

#countdownNumber {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 120px;
    color: var(--auburn-orange);
    line-height: 1;
    animation: pulse 1s infinite;
}

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

.command-restart {
    margin-top: var(--space-4);
    font-size: 20px;
    padding: var(--space-3) var(--space-5);
}

.command-restart.hidden {
    display: none;
}


.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.feedback-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.feedback-overlay.hidden {
    display: none;
}

.feedback-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    min-width: 300px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.feedback-overlay.show .feedback-card {
    transform: scale(1);
}

.feedback-icon {
    font-size: 80px;
}

.feedback-card h2 {
    font-family: var(--font-display);
    font-size: 36px;
    text-transform: uppercase;
    margin: var(--space-3) 0;
}

.feedback-card.correct h2 { color: var(--success); }
.feedback-card.incorrect h2 { color: var(--error); }

.feedback-card p {
    color: var(--light-text);
    font-size: 18px;
}

/* ============================================
   STEP TITLE
   ============================================ */
.step-title {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--auburn-blue);
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

/* ============================================
   FILL IN THE BLANKS
   ============================================ */
.fill-blanks-content {
    font-size: 22px;
    line-height: 2;
}

.fill-blanks-text {
    margin: 0;
}

.fill-blank-input {
    display: inline-block;
    width: 120px;
    padding: var(--space-2) var(--space-3);
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    border: 3px solid var(--offset-blue);
    border-radius: var(--radius-sm);
    background: var(--smoke-white);
    margin: 0 var(--space-1);
}

.fill-blank-input:focus {
    outline: none;
    border-color: var(--auburn-orange);
    background: var(--white);
}

/* Drag and Drop Fill-in-Blanks */
.fill-blank-dropzone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 44px;
    padding: 8px 16px;
    margin: 0 4px;
    border: 3px dashed var(--offset-blue);
    border-radius: 8px;
    background: var(--smoke-white);
    vertical-align: middle;
    transition: all 0.2s;
}

.fill-blank-dropzone:hover,
.fill-blank-dropzone.drag-over {
    border-color: var(--auburn-orange);
    background: #fff8f5;
}

.blank-placeholder {
    color: #999;
    font-weight: 500;
    font-size: 20px;
}

.dropped-answer {
    display: inline-block;
    padding: 6px 12px;
    background: var(--auburn-blue);
    color: white;
    border-radius: 20px;
    font-weight: 500;
    cursor: grab;
}

.answer-bank {
    margin-top: 24px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
}

.answer-bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.answer-bank-item {
    padding: 10px 20px;
    background: var(--auburn-blue);
    color: white;
    border-radius: 25px;
    font-weight: 500;
    font-size: 18px;
    cursor: grab;
    transition: all 0.2s;
}

.answer-bank-item.used {
    background: #ccc;
    color: #666;
    cursor: default;
}

/* ============================================
   MATCHING
   ============================================ */
.matching-container {
    width: 100%;
}

.matching-instructions {
    margin-bottom: var(--space-4);
    color: var(--light-text);
}

.matching-columns {
    display: flex;
    gap: var(--space-5);
}

.matching-left,
.matching-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.matching-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--smoke-white);
    border-radius: var(--radius-md);
}

.matching-letter,
.matching-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auburn-blue);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}

.matching-select {
    padding: var(--space-2) var(--space-3);
    font-size: 16px;
    border: 2px solid var(--offset-blue);
    border-radius: var(--radius-sm);
    background: var(--white);
    min-width: 150px;
    margin-left: auto;
}

/* ============================================
   ORDERING
   ============================================ */
.ordering-container {
    width: 100%;
}

.ordering-instructions {
    margin-bottom: var(--space-4);
    color: var(--light-text);
}

.ordering-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.ordering-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--smoke-white);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all 0.2s;
}

.ordering-item:hover {
    border-color: var(--offset-blue);
}

.ordering-item.dragging {
    opacity: 0.5;
    border-color: var(--auburn-orange);
}

.ordering-handle {
    color: var(--light-text);
    font-size: 20px;
}

.ordering-position {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auburn-blue);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.ordering-text {
    font-size: 18px;
}

/* ============================================
   HOTSPOT
   ============================================ */
.hotspot-container {
    width: 100%;
}

.hotspot-instructions {
    margin-bottom: var(--space-3);
    color: var(--light-text);
}

.hotspot-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.hotspot-image-wrapper img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

.hotspot-area {
    position: absolute;
    border: 3px dashed transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.hotspot-area:hover {
    border-color: var(--offset-blue);
    background: rgba(61, 79, 103, 0.2);
}

.hotspot-area.selected {
    border-color: var(--auburn-orange);
    background: rgba(232, 97, 0, 0.3);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ============================================
   OPTION CARDS WITH IMAGES
   ============================================ */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4) 0;
}

.option-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 3px solid #e0e0e0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    padding: 0;
}

.option-card:hover {
    border-color: var(--auburn-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.option-card.selected {
    border-color: var(--auburn-orange);
    background: rgba(232, 97, 0, 0.05);
}

.option-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    pointer-events: none;
}

.option-card-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    pointer-events: none;
}

.option-card-content .option-letter {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auburn-blue);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.option-card.selected .option-letter {
    background: var(--auburn-orange);
}

.option-card-content .option-text {
    flex: 1;
    font-size: 18px;
    line-height: 1.4;
    color: var(--darkest-text);
}

/* ============================================
   AUDIO PLAYER (IN FOOTER)
   ============================================ */
.audio-player-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 300px;
    margin: 0 auto;
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--auburn-blue);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.audio-play-btn:hover {
    background: var(--offset-blue);
}

.audio-play-btn .play-icon {
    margin-left: 2px;
}

.audio-play-btn .restart-icon {
    font-size: 18px;
}

.audio-progress-container {
    flex: 1;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    min-width: 80px;
}

.audio-progress-bar {
    height: 100%;
    background: var(--auburn-orange);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-progress-dot {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--auburn-orange);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.audio-time {
    font-size: 12px;
    color: var(--light-text);
    font-family: monospace;
    min-width: 36px;
}
/* ============================================
   LARGE SCREEN ADJUSTMENTS
   ============================================ */

/* Subtle adjustments for larger screens - fill space gracefully */
@media screen and (min-width: 1400px) {
    .step-content {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .step-media {
        max-height: 70vh;
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* For matching questions with featured images - image on top.
   The whole step scrolls (rather than the question card scrolling inside a fixed
   height) so the image moves out of the way and the drag columns get full height. */
.matching-layout-vertical {
    flex-direction: column;
    overflow-y: auto;
}

.matching-layout-vertical .step-media {
    flex: none;
    width: 100%;
    max-height: min(250px, 28vh);
    margin-bottom: var(--space-4);
}

.matching-layout-vertical .step-media img {
    max-height: min(250px, 28vh);
    width: auto;
    margin: 0 auto;
}

.matching-layout-vertical .step-interaction {
    flex: none;
    overflow-y: visible;
}

/* ============================================
   FLOATING NAVIGATION (hidden by default)
   ============================================ */
.floating-nav {
    display: none;
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    display: none;
    text-align: center;
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    background: var(--auburn-orange);
    border-radius: 24px;
    margin: 8px auto;
    width: fit-content;
    animation: scroll-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
    flex-shrink: 0;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(221, 109, 16, 0.35);
}

@keyframes scroll-pulse {
    0%, 100% { transform: translateY(0); opacity: 0.85; box-shadow: 0 4px 12px rgba(221, 109, 16, 0.35); }
    50% { transform: translateY(6px); opacity: 1; box-shadow: 0 6px 18px rgba(221, 109, 16, 0.5); }
}

.scroll-indicator.hidden {
    display: none !important;
}

/* ============================================
   MATCHING — DRAG & DROP REDESIGN
   ============================================ */
.matching-pairs {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.matching-pair-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--smoke-white);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
}

.matching-pair-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}

.matching-pair-label span:last-child {
    font-size: 16px;
    line-height: 1.3;
}

.matching-drop-zone {
    min-width: 120px;
    min-height: 40px;
    padding: 6px 12px;
    border: 2px dashed var(--offset-blue);
    border-radius: var(--radius-sm);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    max-width: 50%;
}

.matching-drop-zone-placeholder {
    color: #bbb;
    font-size: 13px;
    font-style: italic;
}

.matching-drop-zone.drag-over {
    border-color: var(--auburn-orange);
    background: #fff8f5;
    transform: scale(1.03);
}

.matching-drop-zone.filled {
    border-style: solid;
    border-color: var(--auburn-blue);
    background: var(--sky-blue);
    cursor: pointer;
}

.matching-drop-zone .matching-placed-answer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--auburn-blue);
}

.matching-bank {
    padding: var(--space-3);
    background: var(--smoke-white);
    border-radius: var(--radius-md);
    min-height: 50px;
}

.matching-bank-title {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.matching-bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.matching-draggable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--auburn-blue);
    color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: grab;
    transition: all 0.15s;
    touch-action: none;
    user-select: none;
}

.matching-draggable:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.matching-draggable.placed {
    display: none;
}

.matching-drag-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.9;
    transform: scale(1.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--auburn-orange);
    color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.matching-draggable .matching-drag-number {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================
   MATCHING BINS (SORTING) STYLES
   ============================================ */
.sorting-container {
    width: 100%;
}

.sorting-bins {
    display: grid;
    /* Column count set inline via JS for stability — no auto-reflow */
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.sorting-bin {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: var(--white);
    min-width: 0;
}

.sorting-bin-header {
    padding: var(--space-2) var(--space-3);
    color: white;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sorting-bin-dropzone {
    min-height: 80px;
    padding: var(--space-2);
    border: 2px dashed #ddd;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sorting-bin-dropzone.drag-over {
    border-color: var(--auburn-orange);
    background: #fff8f5;
}

.sorting-bin-placeholder {
    color: #bbb;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: var(--space-3) 0;
}

.sorting-placed-item {
    padding: 8px 12px;
    background: var(--sky-blue);
    border: 1px solid var(--auburn-blue);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: transform 0.15s;
}

.sorting-placed-item:active {
    cursor: grabbing;
    transform: scale(1.03);
}

.sorting-bank {
    padding: var(--space-3);
    background: var(--smoke-white);
    border-radius: var(--radius-md);
    min-height: 50px;
}

.sorting-bank-title {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.sorting-bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-height: 40px;
    padding: var(--space-1);
    border: 2px dashed transparent;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, background 0.2s;
}

.sorting-bank-items.drag-over {
    border-color: var(--auburn-blue);
    background: #f0f4ff;
}

.sorting-draggable {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--auburn-blue);
    color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: grab;
    transition: all 0.15s;
    touch-action: none;
    user-select: none;
}

.sorting-draggable:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.sorting-draggable.placed {
    display: none;
}

.sorting-drag-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.9;
    transform: scale(1.1);
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--auburn-orange);
    color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ============================================
   IMAGE LABEL (DRAG WORDS ONTO IMAGE) STYLES
   ============================================ */
.label-container {
    width: 100%;
}

.label-image-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.label-image {
    width: 100%;
    display: block;
}

.label-spots-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.label-spot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 44px;
    background: rgba(255, 255, 255, 0.92);
    border: 2.5px dashed #999;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-text);
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.label-spot.filled {
    background: rgba(255, 255, 255, 0.97);
    border: 2.5px solid var(--auburn-blue);
    color: var(--auburn-blue);
}

.label-word-bank {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--smoke-white);
    border-radius: var(--radius-md);
}

.label-bank-title {
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: var(--space-2);
    font-weight: 500;
    text-align: center;
}

.label-bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    min-height: 40px;
    padding: var(--space-1);
}

.label-word {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--auburn-blue);
    color: var(--white);
    border-radius: 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: grab;
    transition: all 0.15s;
    touch-action: none;
    user-select: none;
}

.label-word:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.label-word.used {
    opacity: 0.3;
    pointer-events: none;
}

.label-drag-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.92;
    transform: scale(1.1);
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--auburn-orange);
    color: var(--white);
    border-radius: 22px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ============================================
   ADVANCED STEP STYLES
   ============================================ */
.advanced-fullscreen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.advanced-fullscreen-mode .lesson-header {
    display: none;
}

.advanced-fullscreen-mode .step-nav {
    display: none;
}

.advanced-fullscreen-mode .floating-nav {
    z-index: 100;
}

.advanced-container {
    width: 100%;
    min-height: 200px;
}

.advanced-container iframe {
    width: 100%;
    min-height: 400px;
    border: none;
}

.advanced-nav-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-3);
    z-index: 100;
    background: rgba(255,255,255,0.95);
    padding: 8px 16px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.advanced-nav-overlay .nav-btn {
    padding: 8px 20px;
    border-radius: 16px;
    font-size: 14px;
}

/* ============================================
   CHANGE STATION LINK (completion screen)
   ============================================ */
.change-station-link {
    display: block;
    background: none;
    border: none;
    color: var(--offset-blue);
    opacity: 0.7;
    text-decoration: underline;
    font-size: 15px;
    font-family: var(--font-body);
    margin: var(--space-3) auto 0;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: var(--space-2);
}

.change-station-link:hover {
    opacity: 1;
}

/* ============================================
   SMALL SCREEN ADJUSTMENTS (tablets 10" and under)
   Targets landscape tablets where viewport height
   is 900px or less AND the device uses touch input
   (pointer: coarse). This prevents laptops with
   trackpads/mice from triggering tablet mode.
   ============================================ */
@media screen and (max-height: 900px) and (pointer: coarse) {

    /* --- General UI tightening --- */
    .step-container {
        padding: var(--space-2);
    }

    .step-content {
        gap: var(--space-2);
    }

    .step-question {
        font-size: 22px;
        margin-bottom: var(--space-2);
        line-height: 1.3;
    }

    .step-title {
        font-size: 22px;
        margin-bottom: var(--space-2);
    }

    .option-btn {
        padding: var(--space-2) var(--space-3);
        font-size: 19px;
    }

    .option-letter {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .tf-btn {
        padding: var(--space-3);
        font-size: 30px;
    }

    .options-grid {
        gap: var(--space-2);
        padding: var(--space-2) 0;
    }

    .option-card-image {
        height: 100px;
    }

    .option-card-content {
        padding: var(--space-2) var(--space-3);
    }

    .option-card-content .option-text {
        font-size: 17px;
    }

    .step-interaction {
        padding: var(--space-2) var(--space-3);
    }

    .text-input-area textarea {
        font-size: 18px;
        min-height: 80px;
    }

    .fill-blanks-content {
        font-size: 20px;
    }

    /* --- Adaptive header shrinking --- */
    .lesson-header {
        padding: 6px 14px;
    }

    .lesson-header img {
        width: 34px;
        height: 34px;
    }

    .lesson-header-left {
        gap: 10px;
    }

    .lesson-title {
        font-size: 17px;
    }

    .progress-container {
        gap: 8px;
    }

    .progress-bar {
        width: 120px;
        height: 10px;
    }

    .progress-text {
        font-size: 13px;
    }

    /* --- Floating nav replaces footer --- */
    .step-nav {
        display: none !important;
    }

    .floating-nav {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        z-index: 100;
        pointer-events: none;
    }

    .floating-nav-btn {
        width: 58px;
        height: 58px;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.92);
        color: var(--auburn-blue);
        font-size: 31px;
        font-weight: 700;
        cursor: pointer;
        pointer-events: auto;
        box-shadow: 0 2px 12px rgba(0,0,0,0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s;
    }

    .floating-nav-btn:active {
        transform: scale(0.93);
    }

    .floating-nav-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .floating-nav-btn.next {
        background: var(--auburn-orange);
        color: var(--white);
    }

    .floating-nav-audio {
        pointer-events: auto;
        background: rgba(255, 255, 255, 0.92);
        border-radius: 24px;
        padding: 4px 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.15);
        max-width: 200px;
    }

    .floating-nav-audio .audio-player-footer {
        max-width: none;
        margin: 0;
    }

    .step-container {
        padding-bottom: 0;
    }

    /* --- Vertical stack: image on top, question below --- */
    /* :has() for modern browsers, .has-media-and-interaction as JS fallback */
    .step-content:has(.step-media):has(.step-interaction),
    .step-content.has-media-and-interaction {
        flex-direction: column;
        overflow-y: auto;
    }

    .step-content:has(.step-media):has(.step-interaction) .step-media:not(.full-width),
    .step-content.has-media-and-interaction .step-media:not(.full-width) {
        flex: none;
        width: 100%;
        max-height: 80vh;
        min-height: 0;
    }

    .step-content:has(.step-media):has(.step-interaction) .step-interaction,
    .step-content.has-media-and-interaction .step-interaction {
        flex: none;
        overflow-y: visible;
    }

    /* Matching keeps a short image: the generic rule above allows 80vh, which would
       push the drag columns too far down on a short tablet screen */
    .step-content.matching-layout-vertical:has(.step-media):has(.step-interaction) .step-media:not(.full-width),
    .step-content.matching-layout-vertical.has-media-and-interaction .step-media:not(.full-width) {
        max-height: min(200px, 24vh);
    }

    .matching-layout-vertical .step-media img {
        max-height: min(200px, 24vh);
    }

    /* Show scroll indicator on small screens */
    .scroll-indicator {
        display: block;
    }

    /* --- Image label adjustments for small screens --- */
    .label-spot {
        width: 100px;
        height: 38px;
        font-size: 13px;
    }

    .label-word {
        padding: 8px 14px;
        font-size: 14px;
    }

    .label-drag-clone {
        padding: 8px 14px;
        font-size: 14px;
    }

    /* --- Smaller ready screen --- */
    .ready-content img {
        width: 110px;
        margin-bottom: var(--space-2);
    }

    .ready-content h1 {
        font-size: 40px;
        margin-bottom: var(--space-2);
    }

    .ready-content p {
        font-size: 22px;
        margin-bottom: var(--space-3);
    }

    .begin-btn {
        padding: var(--space-3) var(--space-5);
        font-size: 32px;
    }

    /* --- Smaller complete screen --- */
    .complete-icon {
        font-size: 60px;
    }

    .complete-content h1 {
        font-size: 32px;
        margin: var(--space-2) 0;
    }

    .complete-stats {
        margin: var(--space-3) 0;
        padding: var(--space-3) var(--space-4);
    }

    .stat-value {
        font-size: 36px;
    }

    .restart-btn {
        font-size: 22px;
        padding: var(--space-3) var(--space-5);
    }

    /* --- Smaller station select --- */
    .station-select-header {
        margin-bottom: var(--space-2);
    }

    .station-select-header h1 {
        font-size: 28px;
    }

    .station-select-header p {
        font-size: 16px;
    }

    .stations-list {
        gap: var(--space-2);
    }

    .station-list-item {
        padding: var(--space-3) var(--space-3);
    }

    .station-list-item img {
        width: 48px;
        height: 48px;
    }

    .station-list-item h3 {
        font-size: 20px;
    }

    /* --- Matching on small screens --- */
    .matching-pair-row {
        padding: var(--space-1) var(--space-2);
    }

    .matching-drop-zone {
        min-width: 90px;
        min-height: 34px;
        padding: 4px 8px;
    }

    .matching-draggable {
        padding: 8px 12px;
        font-size: 15px;
    }
}