body {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    height: 100%;
    overflow-x: hidden;
}

/* Fullscreen background for Room 1 (index 0) - Etterkrigstiden */
.room-bg-0 {
    background-image: url('assets/images/room1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 2 (index 1) - Allianser */
.room-bg-1 {
    background-image: url('assets/images/room2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 3 (index 2) - Berlinmuren */
.room-bg-2 {
    background-image: url('assets/images/room3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 4 (index 3) - Cubakrisen */
.room-bg-3 {
    background-image: url('assets/images/room4.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 5 (index 4) - Hemmelige dokumenter */
.room-bg-4 {
    background-image: url('assets/images/room6_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 6 (index 5) - Avlyttet melding */
.room-bg-5 {
    background-image: url('assets/images/room7.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 7 (index 6) - Tidsforståelse */
.room-bg-6 {
    background-image: url('assets/images/room7_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 8 (index 7) - Forhandlingene */
.room-bg-7 {
    background-image: url('assets/images/room8_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 9 (index 8) - Fluktrute */
.room-bg-8 {
    background-image: url('assets/images/room9.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Fullscreen background for Room 10 (index 9) - Begrepsforståelse */
.room-bg-9 {
    background-image: url('assets/images/room10_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

html {
    height: 100%;
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
    background-image: url('assets/images/landing_bilde.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.4);
    z-index: 1;
}

.landing-content {
    max-width: 900px;
    z-index: 10;
    position: relative;
    animation: fadeInUp 1s ease-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    margin: 0 auto; /* ensure centered */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.classified-banner {
    background: repeating-linear-gradient(
        45deg,
        #ff0000,
        #ff0000 10px,
        #cc0000 10px,
        #cc0000 20px
    );
    padding: 15px;
    text-align: center;
    margin-bottom: 30px;
    border: 3px solid #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.red-stamp {
    color: white;
    font-weight: bold;
    font-size: 24px;
    transform: rotate(-5deg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.classified-text {
    color: white;
    font-weight: bold;
    font-size: 20px;
    flex: 1;
    text-align: center;
}

.landing-title {
    font-size: 84px;
    text-align: center;
    margin: 20px 0;
    color: #ffd93d;
    text-shadow: 0 0 30px rgba(255, 217, 61, 0.8), 4px 4px 8px rgba(0, 0, 0, 1), 0 0 50px rgba(255, 217, 61, 0.4);
    letter-spacing: 12px;
    animation: glow 2s ease-in-out infinite alternate;
    font-weight: bold;
}

@keyframes glow {
    from {
        text-shadow: 0 0 30px rgba(255, 217, 61, 0.8), 4px 4px 8px rgba(0, 0, 0, 1), 0 0 50px rgba(255, 217, 61, 0.4);
    }
    to {
        text-shadow: 0 0 50px rgba(255, 217, 61, 1), 4px 4px 8px rgba(0, 0, 0, 1), 0 0 70px rgba(255, 217, 61, 0.6);
    }
}

.subtitle {
    text-align: center;
    font-size: 32px;
    color: #e94560;
    margin-bottom: 40px;
    letter-spacing: 5px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 1), 0 0 20px rgba(233, 69, 96, 0.6);
    font-weight: bold;
}

.mission-briefing {
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #e94560;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.mission-briefing h2 {
    color: #ffd93d;
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.briefing-text {
    color: #fff;
    line-height: 1.8;
    font-size: 16px;
}

.briefing-text p {
    margin: 15px 0;
}

.briefing-text ul {
    margin: 20px 0;
    padding-left: 20px;
}

.briefing-text li {
    margin: 10px 0;
    list-style: none;
    padding-left: 10px;
}

.warning-text {
    color: #ff6b6b !important;
    font-weight: bold;
    text-align: center;
    margin-top: 20px !important;
    font-size: 18px;
}

/* Hint info inside briefing */
.hint-info {
    background: rgba(255, 217, 61, 0.06);
    border: 1px solid rgba(255, 217, 61, 0.12);
    padding: 14px 16px;
    border-radius: 10px;
    margin-top: 18px;
    color: #fff;
}
.hint-info h2 { margin: 0 0 8px 0; color: #ffd93d; font-size: 18px; }
.hint-info p { margin: 0; color: #eee; line-height: 1.5; }

.mission-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* Rooms modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}
.modal-content {
    background: linear-gradient(180deg, #0f1724, #111827);
    margin: 8% auto;
    padding: 20px 30px;
    border: 2px solid #ffd93d;
    width: 90%;
    max-width: 720px;
    border-radius: 12px;
    color: #fff;
}
.modal-close {
    background: transparent;
    border: none;
    color: #ffd93d;
    font-size: 22px;
    float: right;
    cursor: pointer;
}

/* Compact inline modal variant for small reference content (e.g., morse alphabet) */
.inline-modal {
    display: none; /* toggled via JS */
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 680px;
    margin: 12px 0 0 0;
    background: linear-gradient(180deg, rgba(15,23,36,0.95), rgba(17,24,39,0.95));
    border: 1px solid rgba(255, 217, 61, 0.12);
    padding: 12px 14px;
    border-radius: 8px;
}
.inline-modal .modal-content {
    margin: 0;
    padding: 12px;
    border: none;
    background: transparent;
    max-height: 220px;
    overflow: auto;
}
.inline-modal .modal-close {
    float: none;
    display: inline-block;
    margin-left: 6px;
}

/* When modal is used inline we don't want the fullscreen backdrop; keep a subtle backdrop class if needed */
.modal-backdrop {
    background-color: transparent;
}

/* Improve typography for monospace table inside modal */
.inline-modal pre, .inline-modal p { font-family: 'Courier New', monospace; color: #fff; line-height:1.4; font-size:14px; margin:6px 0; }
.inline-modal h3 { margin: 0 0 6px 0; color: #ffd93d; font-size:16px; }

/* Cooldown overlay shown when player has 3 failed attempts */
.cooldown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}
.cooldown-overlay .countdown-box {
    background: rgba(17,24,39,0.95);
    border: 2px solid #ffd93d;
    color: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.cooldown-overlay .countdown-box .title { color: #ffd93d; font-weight: bold; margin-bottom: 8px; }
.cooldown-overlay .countdown-box .time { font-size: 22px; margin-top: 6px; }

/* Attempts counter */
.attempts-box {
    font-family: 'Courier New', monospace;
    color: #ffd93d;
    background: rgba(0,0,0,0.35);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,217,61,0.08);
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
}

.room-list { list-style: none; padding: 0; margin: 12px 0; }
.room-list li { padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.room-list li:first-child { padding-top: 0; }
.room-list li strong { color: #ffd93d; margin-right: 8px; }

#infoBody { margin-top: 8px; line-height: 1.6; color: #ddd; }

/* Fixed back button - top right corner */
.fixed-back-btn {
    position: fixed;
    right: 16px;
    top: 16px;
    left: auto;
    bottom: auto;
    background: rgba(0,0,0,0.85);
    color: #ffd93d;
    padding: 8px 14px;
    border: 2px solid #ffd93d;
    border-radius: 8px;
    text-decoration: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    font-size: 12px;
    transition: all 0.3s ease;
}
.fixed-back-btn:hover { 
    transform: scale(1.05); 
    background: rgba(255, 217, 61, 0.2);
}

.stat-item {
    background: rgba(233, 69, 96, 0.9);
    border: 3px solid #e94560;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    flex: 1;
    min-width: 150px;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

/* show pointer for interactive stat items */
.stat-item[role="button"] { cursor: pointer; }

.stat-number {
    font-size: 48px;
    color: #ffd93d;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    color: #fff;
    font-size: 16px;
}

.start-mission-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
    padding: 25px 40px;
    background: linear-gradient(45deg, #e94560, #ff6b6b);
    border: 3px solid #ffd93d;
    border-radius: 50px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-mission-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-mission-btn:hover::before {
    width: 400px;
    height: 400px;
}

.start-mission-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(233, 69, 96, 0.6);
}

.btn-text {
    display: block;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* If any .btn-subtext remains, hide it (we removed subtext from button) */
.btn-subtext { display: none !important; }

.footer-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
}

.footer-logo {
    height: 50px;
    width: auto;
    display: block;
    margin-top: 4px;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.footer-note {
    text-align: center;
    margin-top: 40px;
    color: #999;
    font-size: 14px;
}

.footer-note p {
    margin: 5px 0;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.1;
}

.globe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border: 2px solid #e94560;
    border-radius: 50%;
    animation: rotate 30s linear infinite;
}

.globe::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: #e94560;
}

.globe::after {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    width: 2px;
    height: 120%;
    background: #e94560;
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(233, 69, 96, 0.1) 50px, rgba(233, 69, 96, 0.1) 51px),
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(233, 69, 96, 0.1) 50px, rgba(233, 69, 96, 0.1) 51px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Briefing page styles */
.briefing-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image: url('assets/images/briefing.png'); /* Bytt ut med opplastet bilde */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 40px 20px 20px 20px;
    overflow-y: auto;
}

.briefing-container {
    max-width: 900px;
    width: 100%;
    z-index: 10;
    position: relative;
}

.briefing-card {
    background: rgba(0,0,0,0.9);
    border: 3px solid #ffd93d;
    border-radius: 15px;
    padding: 30px;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}

.briefing-card h1 {
    color: #ffd93d;
    text-align: center;
    margin-bottom: 10px;
}

.briefing-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.briefing-card .btn {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    background: rgba(233,69,96,0.9);
    border: 2px solid #ffd93d;
}

.cancel-btn {
    background: transparent;
    color: #ffd93d;
    border: 2px solid #ffd93d;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    border: 2px solid #e94560;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: inline-block;
    width: auto;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.header h1 {
    font-size: 18px;
    margin: 5px 0;
}

.header p {
    font-size: 12px;
    margin: 3px 0;
}

.classified-stamp {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: bold;
    transform: rotate(-5deg);
    margin-bottom: 5px;
}

.timer {
    font-size: 20px;
    color: #ffd93d;
    margin: 8px 0;
    font-weight: bold;
}

.room {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #e94560;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Custom scrollbar for rooms */
.room::-webkit-scrollbar {
    width: 8px;
}

.room::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.room::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 4px;
}

.room::-webkit-scrollbar-thumb:hover {
    background: #ff6b8a;
}

.room.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.room h2 {
    color: #ffd93d;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.puzzle {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #e94560;
}

.code-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.code-input input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #e94560;
    color: #ffd93d;
    padding: 12px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    text-align: center;
    width: 120px;
}

.code-input input:focus {
    outline: none;
    border-color: #ffd93d;
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.3);
}

.btn {
    background: linear-gradient(45deg, #e94560, #ff6b6b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.success-message {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
}

.error-message {
    background: linear-gradient(45deg, rgba(180, 40, 40, 0.95), rgba(150, 30, 30, 0.95));
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 20px;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.hint-box {
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid #ffd93d;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    display: none;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.map-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #e94560;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-item:hover {
    background: rgba(233, 69, 96, 0.2);
    transform: scale(1.05);
}

.map-item.selected {
    background: rgba(255, 217, 61, 0.3);
    border-color: #ffd93d;
}

.morse-display {
    font-family: monospace;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    letter-spacing: 3px;
    margin: 20px 0;
}

/* Cuba Crisis Room - Encrypted Messages */
.encrypted-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.message-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ff4444;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.message-box:hover {
    border-color: #ff6666;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.message-box h4 {
    color: #ffd93d;
    margin-bottom: 15px;
    font-size: 18px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.encrypted-text {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    color: #00ff41;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    letter-spacing: 3px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #00ff41;
}

.decrypt-input {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.decrypt-input input {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #555;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.decrypt-input input:focus {
    outline: none;
    border-color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.btn-small {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.btn-small:hover {
    background: linear-gradient(135deg, #ff6666, #ff0000);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.hint {
    color: #ffd700;
    font-size: 14px;
    font-style: italic;
    margin-top: 10px;
}

.final-code-section {
    background: rgba(0, 255, 65, 0.1);
    border: 3px solid #00ff41;
    border-radius: 10px;
    padding: 30px;
    margin-top: 30px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 65, 0.6);
    }
}

.final-code-section h3 {
    color: #00ff41;
    margin-bottom: 15px;
}

.final-code-section .code-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.final-code-section .code-input input {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 5px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .code-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .code-input input {
        width: 100%;
        margin: 5px 0;
    }
    
    .map-grid {
        grid-template-columns: 1fr;
    }
    
    /* Landing page mobile */
    .landing-title {
        font-size: 36px;
        letter-spacing: 3px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .classified-banner {
        flex-direction: column;
        gap: 10px;
    }
    
    .red-stamp {
        font-size: 18px;
    }
    
    .classified-text {
        font-size: 16px;
    }
    
    .mission-briefing {
        padding: 20px;
    }
    
    .mission-briefing h2 {
        font-size: 22px;
    }
    
    .briefing-text {
        font-size: 14px;
    }
    
    .mission-stats {
        flex-direction: column;
    }
    
    .stat-item {
        width: 100%;
    }
    
    .start-mission-btn {
        font-size: 18px;
        padding: 20px 30px;
    }
    
    .globe {
        width: 300px;
        height: 300px;
    }
}

/* Riktig stempel Cuba-oppgave */
.riktig-stamp {
    display: inline-block;
    transform: rotate(-15deg);
    background: linear-gradient(135deg, #00ff41, #00cc33);
    color: #000;
    font-size: 2.5rem;
    font-weight: bold;
    border: 4px solid #fff;
    border-radius: 15px;
    padding: 15px 40px;
    box-shadow: 0 8px 30px rgba(0, 255, 65, 0.6), 
                inset 0 2px 5px rgba(255, 255, 255, 0.5);
    z-index: 100;
    opacity: 1;
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    animation: stamp-appear 0.5s ease-out;
}

/* Partial success stamp for sub-tasks */
.partial-success-stamp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #fff;
    border-radius: 12px;
    padding: 15px 30px;
    box-shadow: 0 8px 30px rgba(78, 205, 196, 0.6);
    z-index: 10000;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    animation: partial-stamp-appear 0.4s ease-out;
}

.partial-success-stamp.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes partial-stamp-appear {
    0% {
        transform: translate(-50%, -50%) rotate(-5deg) scale(0);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) rotate(-5deg) scale(1.15);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-5deg) scale(1);
        opacity: 1;
    }
}

@keyframes stamp-appear {
    0% {
        transform: rotate(-15deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: rotate(-15deg) scale(1.2);
    }
    100% {
        transform: rotate(-15deg) scale(1);
        opacity: 1;
    }
}

.stamp-container {
    position: relative;
    text-align: center;
    margin-top: 10px;
    min-height: 40px;
    overflow: visible;
    pointer-events: none;
    z-index: 100;
}

.message-box {
    position: relative;
    overflow: visible;
}

/* Solved stamp overlay - fullscreen */
.solved-stamp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: overlay-fade-in 0.3s ease-out;
    pointer-events: none;
}

.solved-stamp-container {
    animation: stamp-appear-big 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.solved-stamp-image {
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.5));
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes stamp-appear-big {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(-10deg);
        opacity: 1;
    }
}

/* Room 7 - Timeline Puzzle Styles */
.timeline-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.timeline-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.timeline-slot.correct-slot {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.timeline-slot.incorrect-slot {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.timeline-slot p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

.timeline-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.timeline-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    text-align: center;
}

.timeline-card:active {
    cursor: grabbing;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.timeline-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.timeline-card p {
    font-size: 13px;
    font-weight: 600;
    margin: 5px 0;
    color: #fff;
}

.timeline-card .card-year {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #4ecdc4;
    margin-top: 5px;
}

.placed-card {
    position: relative;
    width: 100%;
}

.placed-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.placed-card p {
    font-size: 13px;
    font-weight: 600;
    margin: 5px 0;
    color: #fff;
}

.placed-card .card-year {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #4ecdc4;
    margin-top: 5px;
}

.remove-card-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.remove-card-btn:hover {
    background: #ff0000;
    transform: scale(1.1);
}

/* Check indicators (✓ and ✖) */
.check-indicator {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
}

.correct-indicator {
    color: #44ff44;
    text-shadow: 0 0 8px rgba(68, 255, 68, 0.7), 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.incorrect-indicator {
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.7), 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Room 7 - Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.image-modal-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    animation: zoom 0.3s ease;
    border-radius: 8px;
}

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

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.image-modal-close:hover {
    color: #ff4444;
}

.image-modal-caption {
    color: #fff;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    margin-top: 10px;
}

.timeline-card img {
    cursor: pointer;
    transition: transform 0.2s;
}

.timeline-card img:hover {
    transform: scale(1.05);
}

/* Room 7 - Card digit overlay */
.card-image-wrapper {
    position: relative;
    display: inline-block;
}

.card-digit {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.95);
    color: #000;
    font-size: 24px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Room 8 - Balance puzzle */
.balance-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 12px;
    cursor: move;
    transition: all 0.3s;
    font-size: 14px;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.balance-card:hover {
    background: rgba(0, 50, 0, 0.8);
    transform: scale(1.05);
}

.balance-zone {
    min-height: 300px;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.4);
}

.balance-zone:hover {
    background: rgba(0, 0, 0, 0.5);
}

.balance-zone h4 {
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 6px;
}

.zone-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.placed-balance-card {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.placed-balance-card .remove-card-btn {
    position: static;
    display: inline-block;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.placed-balance-card .remove-card-btn:hover {
    background: #ff0000;
    transform: scale(1.05);
}

/* Room 9 & 10 - Memory Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
    max-width: 900px;
}

.memory-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #e94560;
    border-radius: 8px;
    padding: 12px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    user-select: none;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.memory-card:hover {
    transform: scale(1.02);
    background: rgba(233, 69, 96, 0.2);
}

.memory-card.selected {
    background: rgba(255, 217, 61, 0.3);
    border-color: #ffd93d;
    box-shadow: 0 0 15px rgba(255, 217, 61, 0.4);
    transform: scale(1.05);
}

.memory-card.matched {
    background: rgba(0, 255, 65, 0.2);
    border-color: #00ff41;
    cursor: default;
    pointer-events: none;
    transform: none;
}

.memory-card.error {
    background: rgba(255, 68, 68, 0.3);
    border-color: #ff4444;
    animation: shake 0.5s;
}

.card-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.card-type.cause { color: #ffd93d; }
.card-type.effect { color: #4ecdc4; }

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

@media (max-width: 600px) {
    .memory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.splash-content {
    background: rgba(20, 20, 40, 0.95);
    border: 3px solid #e94560;
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
    animation: splashSlideIn 0.6s ease-out;
    margin: auto;
}

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

.splash-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e94560;
    padding-bottom: 20px;
}

.splash-header h1 {
    font-size: 48px;
    color: #00ff41;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.classified-badge {
    color: #ffd93d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    font-weight: bold;
}

.splash-body {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.splash-image {
    max-width: 300px;
    width: 100%;
    border: 2px solid #00ff41;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.debrief-report {
    flex: 1;
}

.debrief-report h2 {
    color: #e94560;
    font-size: 24px;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.time-display {
    background: rgba(233, 69, 96, 0.1);
    border-left: 4px solid #ffd93d;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 3px;
}

.time-display p {
    color: #4ecdc4;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.time-display h3 {
    color: #00ff41;
    font-size: 28px;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.success-message {
    color: #ddd;
    line-height: 1.8;
    font-size: 15px;
}

.success-message p {
    margin: 10px 0;
}

.success-message ul {
    color: #00ff41;
    font-weight: bold;
}

.success-message li {
    margin: 8px 0;
}

.splash-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e94560;
}

.replay-btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.replay-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
}

@media (max-width: 768px) {
    .splash-body {
        flex-direction: column;
        gap: 15px;
    }

    .splash-image {
        max-width: 100%;
    }

    .splash-header h1 {
        font-size: 36px;
    }

    .splash-content {
        padding: 20px;
    }
}

/* Small height screens - compact splash */
@media (max-height: 700px) {
    .splash-screen {
        padding: 10px;
    }
    
    .splash-content {
        padding: 15px;
    }
    
    .splash-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .splash-header h1 {
        font-size: 28px;
        letter-spacing: 1px;
    }
    
    .classified-badge {
        font-size: 10px;
        margin-top: 5px;
    }
    
    .splash-body {
        flex-direction: row;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .splash-image {
        max-width: 150px;
        flex-shrink: 0;
    }
    
    .debrief-report h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .time-display {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    .time-display p {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .time-display h3 {
        font-size: 20px;
    }
    
    .success-message {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .success-message ul {
        margin: 8px 0;
        padding-left: 20px;
    }
    
    .success-message li {
        margin: 4px 0;
    }
    
    .splash-footer {
        padding-top: 12px;
    }
    
    .replay-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Very small screens - hide image, stack vertically */
@media (max-height: 600px) {
    .splash-body {
        flex-direction: column;
        gap: 10px;
    }
    
    .splash-image {
        display: none;
    }
    
    .splash-header h1 {
        font-size: 24px;
    }
    
    .time-display h3 {
        font-size: 18px;
    }
    
    .debrief-report h2 {
        font-size: 14px;
    }
}

/* Combined small width and height */
@media (max-width: 500px) and (max-height: 800px) {
    .splash-image {
        max-width: 120px;
    }
    
    .splash-header h1 {
        font-size: 24px;
    }
}

/* Styles for card-type in Room 10 */
.card-type.concept { color: #ffd93d; }
.card-type.explanation { color: #4ecdc4; }

/* ========================================
   ROOM 10 - CONNECT THE CONCEPTS GAME
   ======================================== */

.connect-game {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    min-height: 500px;
}

.lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.concepts-column,
.explanations-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2;
    width: 42%;
}

.concepts-column {
    align-items: flex-end;
}

.explanations-column {
    align-items: flex-start;
}

.connect-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(20, 20, 40, 0.9);
    border: 2px solid #444;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 100%;
}

.concept-item {
    flex-direction: row;
    border-color: #ffd93d;
    text-align: right;
}

.explanation-item {
    flex-direction: row;
    border-color: #4ecdc4;
    text-align: left;
}

.connect-item:hover:not(.connected) {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
}

.concept-item:hover:not(.connected) {
    border-color: #fff;
    background: rgba(255, 217, 61, 0.1);
}

.explanation-item:hover:not(.connected) {
    border-color: #fff;
    background: rgba(78, 205, 196, 0.1);
}

.connect-item.selected {
    border-color: #fff !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
    animation: pulse-glow 1s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 35px rgba(255, 255, 255, 0.7); }
}

.connect-item.connected {
    cursor: default;
    opacity: 0.9;
}

.connect-item.correct {
    border-color: #00ff41 !important;
    background: rgba(0, 255, 65, 0.15) !important;
}

.connect-item.incorrect {
    border-color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.15) !important;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.item-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.concept-item .item-text {
    color: #ffd93d;
}

.explanation-item .item-text {
    color: #4ecdc4;
}

.connect-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.concept-dot {
    background: radial-gradient(circle at 30% 30%, #ffd93d, #b8860b);
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.5);
}

.explanation-dot {
    background: radial-gradient(circle at 30% 30%, #4ecdc4, #2a9d8f);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.connect-item.selected .connect-dot {
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.connect-item.correct .connect-dot {
    background: radial-gradient(circle at 30% 30%, #00ff41, #00aa2a) !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
}

.connect-item.incorrect .connect-dot {
    background: radial-gradient(circle at 30% 30%, #ff4444, #aa0000) !important;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.7);
}

/* Animated Lines */
.animated-line {
    transition: stroke-dashoffset 0.6s ease-out;
    filter: drop-shadow(0 0 3px currentColor);
}

.correct-line {
    filter: drop-shadow(0 0 6px rgba(0, 255, 65, 0.6));
}

.incorrect-line {
    filter: drop-shadow(0 0 6px rgba(255, 68, 68, 0.6));
}

.animated-line.celebration {
    animation: line-celebration 1.5s ease-in-out infinite;
}

@keyframes line-celebration {
    0%, 100% { 
        filter: drop-shadow(0 0 6px rgba(0, 255, 65, 0.6));
        stroke-width: 3;
    }
    50% { 
        filter: drop-shadow(0 0 15px rgba(0, 255, 65, 1));
        stroke-width: 5;
    }
}

.animated-line.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Responsive for connect game */
@media (max-width: 768px) {
    .connect-game {
        flex-direction: column;
        gap: 40px;
        padding: 15px;
    }
    
    .concepts-column,
    .explanations-column {
        width: 100%;
        align-items: stretch;
    }
    
    .concept-item,
    .explanation-item {
        text-align: left;
        flex-direction: row;
    }
    
    .item-text {
        font-size: 13px;
    }
}

/* ========================================
   LAPTOP / SMALL SCREENS (13" screens)
   Typisk 1280x800 eller 1366x768
   ======================================== */

@media (max-height: 800px) {
    .header {
        padding: 8px 15px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .timer {
        font-size: 14px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .room {
        padding: 15px;
        margin: 10px 0;
    }
    
    .room h2 {
        font-size: 18px;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }
    
    .puzzle {
        padding: 12px;
        margin: 10px 0;
    }
    
    .puzzle h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .puzzle p {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .code-input input {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Connect game for small screens */
    .connect-game {
        padding: 12px;
        min-height: 350px;
    }
    
    .connect-item {
        padding: 8px 12px;
    }
    
    .item-text {
        font-size: 12px;
    }
    
    .connect-dot {
        width: 12px;
        height: 12px;
    }
    
    /* Memory grid for small screens */
    .memory-grid {
        gap: 8px;
    }
    
    .memory-card {
        padding: 8px;
        min-height: 70px;
        font-size: 12px;
    }
    
    /* Timeline for small screens */
    .timeline-slot {
        padding: 8px;
        min-height: 50px;
    }
    
    .timeline-event-card {
        padding: 8px;
        font-size: 11px;
    }
    
    /* Leader cards for small screens */
    .leader-card, .alliance-card {
        padding: 10px;
    }
    
    .leader-card img {
        width: 60px;
        height: 60px;
    }
    
    /* Balance game for small screens */
    .balance-scale {
        gap: 15px;
    }
    
    .scale-side {
        padding: 10px;
        min-height: 150px;
    }
}

/* Extra small height (very cramped screens) */
@media (max-height: 700px) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 5px 10px;
    }
    
    .room {
        padding: 10px;
        margin: 5px 0;
    }
    
    .puzzle {
        padding: 10px;
        margin: 8px 0;
    }
    
    .connect-game {
        min-height: 300px;
        padding: 8px;
    }
    
    .concepts-column,
    .explanations-column {
        gap: 6px;
    }
    
    .connect-item {
        padding: 6px 10px;
    }
    
    .item-text {
        font-size: 11px;
    }
}

/* Wider screens but short height (laptop in landscape) */
@media (min-width: 1024px) and (max-height: 800px) {
    .container {
        max-width: 95%;
        padding: 10px;
    }
    
    .room {
        max-width: 1100px;
        margin: 10px auto;
    }
    
    /* Two-column layout for puzzles on wider small-height screens */
    .connect-game {
        gap: 30px;
    }
    
    .concepts-column,
    .explanations-column {
        width: 45%;
        gap: 8px;
    }
}
