/* A quiet expedition interface. Gameplay IDs, controls and state classes are
   deliberately inherited from the original game. */
:root {
    --primary-color: #c6dfca;
    --secondary-color: #eacb89;
    --accent-color: #c6dfca;
    --accent-dark: #8fb09a;
    --text-color: #eef1e8;
    --panel: #152327;
    --muted: #a7b8b7;
    --line: rgba(220, 236, 221, .16);
}
body { background: #101c20; color: var(--text-color); }
body::before { display: none; }
button { border-radius: 7px; box-shadow: none; color: #152327; font-weight: 800; transition: background .18s, border-color .18s, transform .18s; }
button:hover { transform: translateY(-1px); box-shadow: none; }
button:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #eacb89; outline-offset: 4px; }
#loading-screen { z-index: 50; background: #101c20; }
#loading-screen p { color: #ccd8d3; font-size: 15px; }
.loader { border-color: #304447; border-top-color: #c6dfca; }
#start-screen { background: radial-gradient(ellipse at 15% 12%, #2b4645 0, transparent 52%), radial-gradient(ellipse at 95% 100%, #283431 0, transparent 50%), #101c20; padding: clamp(16px, 4vw, 56px); }
.start-content { display: grid; grid-template-columns: 1.05fr 1fr; width: min(1040px, 100%); max-width: 1040px; max-height: calc(100dvh - 64px); margin: auto; padding: 0; text-align: left; background: #152327; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 32px 100px #03090966; overflow-y: auto; }
.expedition-intro { position: relative; padding: 36px; background: linear-gradient(150deg, #1d3435, #132326 75%); border-right: 1px solid var(--line); }
.home-link { display: inline-block; margin-bottom: 42px; color: #b8c9c4; font-size: 12px; text-decoration: none; }
.home-link:hover { color: white; }
.eyebrow { display: block; color: #a9c3b6; font: 800 10px/1.5 'Nunito', sans-serif; letter-spacing: .18em; }
#game-title { margin: 10px 0 15px; color: #f1f0e4; font: 700 clamp(42px, 4.8vw, 66px)/.98 'Barlow Condensed', sans-serif; letter-spacing: -.015em; text-align: left; text-shadow: none; }
.intro-copy { margin: 0; color: #b8c9c4; font-size: 15px; line-height: 1.65; text-align: left; }
.car-preview-container { width: 100%; height: 235px; margin: 12px auto 0; background: #132326; border-radius: 6px; }
.car-preview-container canvas { display: block; width: 100%; height: 100%; }
.adventure-caption { display: flex; align-items: center; gap: 7px; color: #d4dfd7; font-size: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.adventure-caption > span:last-child { margin-left: auto; font: 700 9px 'Barlow Condensed', sans-serif; letter-spacing: .12em; color: #8ca39d; }
.status-light { width: 5px; height: 5px; border-radius: 50%; background: #c6dfca; box-shadow: 0 0 10px #c6dfca66; }
.journey-notes { display: flex; flex-wrap: wrap; gap: 7px 14px; color: #a4bbb0; font-size: 10px; margin-top: 16px; }
.journey-notes span::before { content: '◇'; color: #ddc58f; margin-right: 5px; }
.expedition-settings { display: flex; flex-direction: column; justify-content: center; padding: 36px; min-width: 0; }
.mode-selection, .tafels-selection { width: 100%; max-width: none; margin: 23px 0 0; padding: 0; background: none; border: 0; border-radius: 0; }
.mode-selection h3, .tafels-selection h3 { color: #f1f0e4; font: 700 21px/1.2 'Barlow Condensed', sans-serif; margin: 0 0 12px; text-align: left; }
.mode-buttons { gap: 10px; }
.mode-button { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 65px; gap: 12px; padding: 13px 15px; background: #1c2d31; color: #adbfbd; border: 1px solid #3a4b4b; border-radius: 8px; box-shadow: none; }
.mode-button:hover { background: #263b3c; border-color: #a0b9a6; box-shadow: none; }
.mode-button.active { background: #c6dfca; color: #172924; border: 1px solid #c6dfca; box-shadow: none; }
.mode-icon { font: 600 30px/1 'Barlow Condensed', sans-serif; }
.mode-label { font-size: 13px; }
.tafels-selection p { margin: -5px 0 16px; color: #a7b8b7; font-size: 12px; line-height: 1.5; text-align: left; }
.tafels-display, #multiplication-settings .tafels-display { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 0; }
.tafel-number, #multiplication-settings .tafel-number { width: 100%; height: 40px; min-height: 40px; min-width: 0; aspect-ratio: auto; border-radius: 6px; border: 1px solid #465452; background: #1c2c30; color: #c0ceca; font-size: 14px; opacity: 1; }
.tafel-number.active, #multiplication-settings .tafel-number.active { background: #304c44; border-color: #8db49c; color: #e5f1e1; transform: none; box-shadow: inset 0 0 0 1px #8db49c33; }
.tafel-number:hover { background: #3c5b50; transform: none; }
#start-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; margin-top: 26px; padding: 15px 19px; background: #dbe8c9; color: #1b3028; font-size: 16px; }
#start-button span { font-size: 23px; line-height: 1; }
.input-hint { margin: 13px 0 0; font-size: 10px; color: #94a9a3; line-height: 1.5; text-align: center; }
#score-container { top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); display: flex; align-items: flex-end; gap: 10px; }
.hud-points, .speedometer { background: rgba(14, 26, 28, .8); border: 1px solid #dfecd12b; border-radius: 9px; box-shadow: 0 5px 25px #06100c25; backdrop-filter: blur(14px); }
.hud-points { padding: 10px 14px; font-size: 33px; border-left: 2px solid #d3ba7b; }
.hud-unit { color: #d3ba7b; }
.speedometer { width: 155px; padding: 9px; border-bottom: 2px solid #b2cbb3; }
#back-button, #map-button { margin: 0; min-height: 40px; background: #102326b8; border: 1px solid #dfecd133; border-radius: 7px; color: #eef1e8; font-size: 12px; padding: 10px 13px; }
#map-button { left: max(91px, calc(env(safe-area-inset-left) + 91px)); }
#mission-container { background: #132b2cc9; color: #edf2e6; border-color: #dfecd12b; border-radius: 7px; font-size: 12px; letter-spacing: .02em; padding: 13px 16px; }
.mission-dot { background: #e4ce8a; box-shadow: 0 0 12px #e4ce8a66; width: 6px; height: 6px; }
#world-map-panel { background: #132426f5; border-color: #a9c1a94d; border-radius: 12px; }
#world-map-panel > #world-map-canvas { width: var(--map-size) !important; height: var(--map-size) !important; }
#map-backdrop { background: #06131380; backdrop-filter: blur(4px); }
#joystick-base { background: #14272750; border: 1px solid #edf2e544; box-shadow: inset 0 0 28px #0b17172b; backdrop-filter: blur(4px); }
#joystick-knob { background: #e1e7d7c9; border: 1px solid #ffffee77; box-shadow: 0 4px 14px #10202022; }
#math-problem-popup { background: #06151870; backdrop-filter: blur(8px); }
.math-problem-container { width: min(460px, 94%); }
.math-problem-content { min-height: 410px; padding: 0; background: #172b2f; border: 1px solid #b3cbbb66; border-radius: 18px; box-shadow: 0 28px 90px #020b0c88; }
.math-problem-front, .math-problem-back { padding: 30px; }
.math-problem-front > h2, .math-problem-back > h2 { margin: 12px 0 4px; color: #edf0df; font: 700 30px/1.1 'Barlow Condensed', sans-serif; }
#math-problem, #math-answer { margin: 12px auto 0; padding: 12px 0 0; background: none; border: 0; }
#problem-text { color: #f4f2dd; font: 600 48px/1.2 'Barlow Condensed', sans-serif; margin-bottom: 22px; }
#answer-input { width: 100%; max-width: 100%; min-height: 58px; background: #0f2226; color: #f4f2dd; border: 1px solid #92b5a2; border-radius: 8px; font-size: 23px; outline-offset: 3px; }
#answer-input::placeholder { color: #98afa8; font-size: 16px; }
#submit-answer, #continue-button { width: 100%; margin: 0; min-height: 48px; font-size: 16px; background: #dbe8c9; }
#answer-message { color: #bccac1; font-size: 15px; }
#correct-answer { color: #f0eedb; font-size: 28px; }
#score-change.score-bonus { color: #b8e5a9; }
#score-change.score-penalty { color: #ffb5a6; }
#continue-button { margin-top: 15px; }
.garage-card { background: #15272cf5; border: 1px solid #bed3bc44; border-radius: 14px; }
.garage-header span, .garage-category-title { color: #bbcfb8; }
.garage-message { color: #b9cbc2; }
.garage-tile, .garage-choice { background: #21383b; border-color: #9db7a44d; border-radius: 8px; }
.garage-tile small, .garage-choice small { color: #b7c6bd; }
.garage-choice.is-owned { background: #314e42; border-color: #9cbd98; }
.garage-points { border-color: #d3be8238; background: #d3be8212; }
.garage-confirm { border-radius: 8px; }
#garage-buy { background: #dbe8c9; color: #1b3028; }
.attribute-toggle { background: #132b2cc9; border: 1px solid #bed3bc55; color: #eff3e7; box-shadow: none; }
.game-over-content { background: #172b2f; border: 1px solid var(--line); }
.game-over-content h1 { color: #f1efdf; text-shadow: none; font-family: 'Barlow Condensed', sans-serif; }
#final-score { background: #21383b; border: 1px solid var(--line); }
#final-score p { color: #edf0df; }
@media (max-width: 800px) {
    #start-screen { padding: 20px; }
    .start-content { grid-template-columns: 1fr; width: min(480px, 100%); max-height: calc(100dvh - 40px); }
    .expedition-intro { padding: 22px 26px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
    .home-link { margin-bottom: 22px; }
    #game-title { font-size: 44px; margin: 8px 0; }
    .intro-copy { font-size: 12px; }
    .car-preview-container { height: 158px; margin-top: 0; }
    .adventure-caption { padding: 8px 0 0; }
    .journey-notes { display: none; }
    .expedition-settings { padding: 22px 26px; }
    .mode-selection { margin-top: 12px; }
    .mode-selection h3, .tafels-selection h3 { font-size: 20px; }
    .mode-button { min-height: 54px; padding: 10px 14px; }
    .tafels-selection { margin-top: 22px; }
    .input-hint .mobile-only { display: block; }
    .input-hint .desktop-only { display: none; }
    #mission-container { top: 75px; max-width: calc(100vw - 210px); left: 20px; transform: none; line-height: 1.4; }
    #mission-container.is-dismissed { transform: translateY(-12px); }
    .speedometer { width: 132px; }
    .hud-points { font-size: 28px; }
}
@media (max-width: 420px) {
    #start-screen { padding: 12px; }
    .start-content { max-height: calc(100dvh - 24px); }
    .expedition-intro { padding: 18px 20px 10px; }
    .home-link { margin-bottom: 16px; }
    .car-preview-container { height: 125px; }
    .expedition-settings { padding: 20px; }
    .tafel-number, #multiplication-settings .tafel-number { height: 42px; min-height: 42px; min-width: 0; font-size: 14px; }
    #score-container { top: 16px; right: 12px; }
    .speedometer { width: 112px; }
    #mission-container { max-width: calc(100vw - 155px); font-size: 11px; padding: 9px; left: 12px; }
    #back-button { left: 12px; }
    #map-button { left: 78px; }
    .math-problem-front, .math-problem-back { padding: 22px; }
}
@media (max-height: 600px) and (min-width: 700px) {
    #start-screen { padding: 12px; }
    .start-content { grid-template-columns: 1fr 1fr; max-height: calc(100dvh - 24px); width: min(1000px, 100%); }
    .expedition-intro, .expedition-settings { padding: 22px; }
    .home-link { margin-bottom: 24px; }
    .car-preview-container { height: 180px; }
    .tafels-selection { margin-top: 14px; }
    #start-button { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    button { transition: none; }
    .math-problem-content { transition-duration: .01s; }
}
