/* OpenTTD-indeling, opgefrist: afgeschuinde panelen, strakkere typografie */
:root {
  --panel: #545b66;
  --panel-hi: #7a8391;
  --panel-lo: #2f343b;
  --inset: #2a2f36;
  --title: #2c4a73;
  --title-hi: #3d6396;
  --text: #f1f3f5;
  --dim: #aab3bf;
  --accent: #f2c40f;
  --pos: #8be38f;
  --neg: #ff8b7d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #18231b; color: var(--text); font: 13px/1.4 Inter, system-ui, sans-serif; user-select: none; }
#view { position: fixed; top: 34px; left: 0; width: 100vw; height: calc(100vh - 34px - 26px); display: block; cursor: default; }
body.tool-active #view { cursor: crosshair; }

#toolbar { position: fixed; top: 0; left: 0; right: 0; height: 34px; display: flex; justify-content: safe center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 6px; padding: 2px 6px; background: linear-gradient(#5d6571, #4b525c); border-bottom: 1px solid #22262c; box-shadow: 0 2px 6px rgba(0,0,0,0.35); z-index: 100; }
.tb-group { display: flex; gap: 1px; padding: 0 2px; align-items: center; }
.tb-btn { width: 32px; height: 28px; display: grid; place-items: center; padding: 0; color: #e9edf2; background: var(--panel); border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 2px; cursor: pointer; }
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn:hover { background: #626a76; }
.tb-btn.on, .tb-btn:active { background: #3d434c; border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); color: var(--accent); }
.tb-speed { min-width: 30px; text-align: center; font-weight: 600; color: var(--accent); font-size: 12px; }

#statusbar { position: fixed; bottom: 0; left: 0; right: 0; height: 26px; display: grid; grid-template-columns: 150px 1fr 170px; gap: 3px; padding: 2px; background: #4b525c; border-top: 1px solid #22262c; z-index: 100; }
#statusbar > div { background: var(--inset); border: 1px solid; border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); padding: 1px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
#sb-date, #sb-money { text-align: center; font-variant-numeric: tabular-nums; }
#sb-money.neg { color: var(--neg); }
#sb-news { color: #ffe9a8; }
#sb-news.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #6a5a1a; } to { background: var(--inset); } }

.win { position: fixed; max-width: calc(100vw - 16px); background: var(--panel); border: 1px solid; border-color: var(--panel-hi) #1d2025 #1d2025 var(--panel-hi); border-radius: 3px; box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.35); max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.win-title { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 3px; background: linear-gradient(var(--title-hi), var(--title)); border-bottom: 1px solid #1a2c45; cursor: move; border-radius: 2px 2px 0 0; }
.win-name { flex: 1; font-weight: 600; font-size: 12.5px; letter-spacing: 0.01em; text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.win-close, .win-pin { width: 18px; height: 18px; padding: 0; line-height: 15px; font-size: 15px; font-weight: 700; color: #fff; border: 1px solid; border-radius: 2px; cursor: pointer; }
.win-close { background: #b8433a; border-color: #e07a70 #6d201a #6d201a #e07a70; }
.win-pin { background: #4d5a6a; border-color: #7b8899 #262c33 #262c33 #7b8899; font-size: 12px; }
.win-pin.on { background: #d6a40c; }
.win-body { overflow: auto; }
.pad { padding: 8px 10px; }
.prose p, .prose ol { margin: 0 0 8px; }
.prose li { margin-bottom: 4px; }
.prose li svg { width: 14px; height: 14px; vertical-align: -2px; }
.lead { font-size: 14px; }
.hint { color: var(--dim); font-size: 12px; margin: 0 0 6px; }
.dim { color: var(--dim); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.row { display: flex; flex-wrap: wrap; gap: 4px; }
.section { padding: 5px 10px; background: rgba(0,0,0,0.18); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #cfd6df; }
.btn { font: 600 12px Inter, system-ui, sans-serif; color: var(--text); padding: 4px 10px; background: #626a76; border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 2px; cursor: pointer; }
.btn:hover { background: #6d7682; }
.btn.primary { background: #2f6a3d; border-color: #57a066 #183a21 #183a21 #57a066; }
.btn.danger { background: #7a2e28; }
.btn.on { background: #3d434c; color: var(--accent); border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); }
.btn:disabled { opacity: 0.45; cursor: default; }
.chip { font: 600 11px Inter, sans-serif; color: var(--dim); background: transparent; border: 1px solid #6b7480; border-radius: 10px; padding: 1px 7px; cursor: pointer; }
.chip.on { color: #1c1c1c; background: var(--accent); border-color: var(--accent); }
.chip.x { border: none; font-size: 15px; color: #ff9d92; }
table.grid { width: 100%; border-collapse: collapse; background: var(--inset); }
table.grid td, table.grid th { padding: 5px 10px; border-bottom: 1px solid #3a4048; vertical-align: top; }
table.grid th { text-align: left; color: var(--dim); font-weight: 600; font-size: 11.5px; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.total td { font-weight: 700; border-top: 1px solid #6b7480; }
table.click tr, table.click td[data-act] { cursor: pointer; }
table.click tr:hover { background: #343a42; }
table.orders tr.cur { background: #3a3f2a; }
table.orders td.idx { width: 22px; color: var(--accent); font-weight: 700; }
.sub { color: var(--dim); font-size: 11.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.kv span { color: var(--dim); }
.kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.status-line { margin: 6px; padding: 5px 8px; background: var(--inset); border: 1px solid; border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); font-weight: 600; color: #ffe9a8; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.rating { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 8px; margin: 3px 0; }
.rating .bar { height: 8px; background: #2a2f36; border-radius: 4px; overflow: hidden; }
.rating .bar i { display: block; height: 100%; }
.rating b { text-align: right; }

.toolwin .win-body { padding: 4px; }
.toolrow { display: flex; gap: 2px; align-items: center; }
.tool-btn { width: 40px; height: 34px; display: grid; place-items: center; color: #e9edf2; background: var(--panel); border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 2px; cursor: pointer; }
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn.on { background: #3d434c; color: var(--accent); border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); }
.toolrow .sep { width: 8px; }
.toolhint { padding: 5px 4px 2px; font-size: 11.5px; color: var(--dim); min-height: 34px; }

#tooltip { position: fixed; display: none; pointer-events: none; padding: 3px 8px; background: rgba(28,32,38,0.92); border: 1px solid #77808c; border-radius: 3px; font-weight: 600; font-size: 12px; color: #ffe9a8; z-index: 500; white-space: nowrap; }
.errbox { position: fixed; width: 260px; z-index: 600; background: #7a2420; border: 1px solid; border-color: #d36a60 #3a0f0c #3a0f0c #d36a60; border-radius: 3px; box-shadow: 0 8px 20px rgba(0,0,0,0.5); transition: opacity 0.5s; pointer-events: none; }
.errbox.fade { opacity: 0; }
.err-title { padding: 3px 8px; background: #a8322b; font-weight: 700; font-size: 12px; }
.err-msg { padding: 6px 8px; font-size: 12.5px; }

.news { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); box-sizing: border-box; z-index: 700; background: #f3ecd9; color: #2b2418; border: 1px solid #b9a77f; box-shadow: 0 14px 34px rgba(0,0,0,0.5); padding: 12px 16px 10px; font-family: Georgia, serif; animation: rise 0.35s ease-out; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } }
.news-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px double #2b2418; padding-bottom: 4px; font: 700 20px 'Playfair Display', Georgia, serif; }
.news-head span { font: 12px Georgia, serif; }
.news h2 { margin: 10px 0 4px; font: 700 21px 'Playfair Display', Georgia, serif; }
.news p { margin: 0 0 10px; font-size: 14px; }
.news-live { display: block; width: 100%; height: 130px; margin: 4px 0 8px; border: 1px solid #2b2418; background: #18231b; cursor: pointer; filter: sepia(0.15); }
.news-btns { display: flex; gap: 6px; justify-content: flex-end; }
.news-btns button { font: 600 12px Inter, sans-serif; padding: 3px 10px; background: #2b2418; color: #f3ecd9; border: 0; border-radius: 2px; cursor: pointer; }
canvas.minimap { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: crosshair; background: #18231b; }

.credits-list { margin: 0; padding: 4px 4px 2px 18px; font-size: 12.5px; line-height: 1.55; }
.credits-list li span { color: var(--dim); }

.mission { padding: 6px 0 8px; border-bottom: 1px solid #3a4048; }
.mission:last-child { border-bottom: 0; }
.mission-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mission-head .dim { margin-left: auto; font-size: 11.5px; }
.mission p { margin: 4px 0 6px; font-size: 12.5px; color: #dfe4ea; }
.mission.failed b { color: var(--dim); }
.chip.pos-chip { color: #1c1c1c; background: var(--pos); border-color: var(--pos); }

/* tabbladen (financiën) */
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: rgba(0,0,0,0.18); }
.tab { font: 600 12px Inter, system-ui, sans-serif; color: var(--dim); padding: 4px 12px; background: #4a515b; border: 1px solid var(--panel-lo); border-bottom: 0; border-radius: 3px 3px 0 0; cursor: pointer; }
.tab.on { color: var(--text); background: var(--inset); }
/* financiën per boekjaar */
table.fin td, table.fin th { padding: 3px 10px; }
table.fin td:first-child { white-space: nowrap; }
table.fin tr.head td { padding: 6px 10px 3px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #cfd6df; background: rgba(0,0,0,0.15); }
table.fin tr.total.big td { font-size: 13.5px; border-top: 2px solid #8a939f; }
table.fin th .sub { font-weight: 500; }
.fin-bank { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; padding: 8px 10px 0; }
.chart { padding: 4px 10px 6px; }
.chart-title { font-weight: 600; font-size: 12px; margin-bottom: 2px; display: flex; gap: 10px; align-items: center; }
.legend { margin-left: auto; font-weight: 500; color: var(--dim); font-size: 11.5px; }
.legend i, .chart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: -1px; }
.chart canvas { display: block; width: 100%; height: 130px; background: var(--inset); border-radius: 2px; cursor: crosshair; }
.chart-tip { position: absolute; display: none; pointer-events: none; z-index: 5; min-width: 170px; padding: 5px 8px; background: rgba(28,32,38,0.95); border: 1px solid #77808c; border-radius: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-tip i { margin-left: 0; }
/* gemeentehuis */
.gm-chips { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 8px; background: rgba(0,0,0,0.18); }
.mayor { display: flex; gap: 12px; padding: 10px; align-items: center; }
.portrait { width: 96px; height: 106px; flex: none; border: 1px solid #1a2c45; border-radius: 6px; }
.mayor-info { flex: 1; min-width: 0; }
.mayor-name { font: 700 17px 'Playfair Display', Georgia, serif; margin-bottom: 2px; }
.mayor-info .rating { grid-template-columns: 70px 1fr 30px; margin-top: 8px; }
.mood-word { font-weight: 700; font-size: 12.5px; }
.hist { font-size: 12px; margin: 2px 0; }
.hist .dim { display: inline-block; min-width: 64px; }
.hist.bad { color: #ffb3a8; }
.hist.good { color: #c2f0c4; }
.hist.mayor { color: #ffe9a8; }
.toolrow.opts { margin-top: 3px; flex-wrap: wrap; }
.tool-btn.small { width: 28px; height: 26px; font-size: 10px; padding: 0; overflow: hidden; }
.tool-btn.small svg { width: 22px; height: 12px; }
.toolrow .optnote { flex: 1 1 100%; font-size: 11px; color: var(--dim); padding: 2px 2px 0; }
.errbox.warn { background: #6e5212; border-color: #d8b25a #3a2a06 #3a2a06 #d8b25a; }

/* multiplayer: bedrijfskleuren */
.co-badge { display: inline-flex; align-items: center; gap: 5px; }
.co-badge i, .co-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.co-dot { margin-right: 5px; vertical-align: -1px; }
.foreign-note { margin: 8px 10px 2px; padding: 6px 9px; border-left: 4px solid #888; background: rgba(255,255,255,0.05); border-radius: 3px; font-size: 12px; }
table.league th { text-align: left; font-weight: 600; font-size: 11px; color: #aab3bf; padding: 4px 6px; }
table.league th.num { text-align: right; }
table.league tr.cur td { background: rgba(255,255,255,0.06); }

#toolbar::-webkit-scrollbar { display: none; }
#toolbar .tb-group { flex: none; }
/* rondleiding voor nieuwe spelers (src/ui/tour.js) */
.tour[hidden] { display: none; }
.tour-dim { position: fixed; inset: 0; background: rgba(12,16,22,0.55); z-index: 880; pointer-events: none; }
.tour-spot { position: fixed; z-index: 881; border-radius: 6px; pointer-events: none; outline: 2px solid var(--accent); box-shadow: 0 0 0 max(100vw, 100vh) rgba(12,16,22,0.5), 0 0 18px rgba(242,196,15,0.7); }
.tour-card { position: fixed; z-index: 890; background: #3a414b; color: var(--text); border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 6px; box-shadow: 0 14px 36px rgba(0,0,0,0.55); padding: 14px 16px 12px; }
.tour-card h3 { margin: 2px 26px 6px 0; font-size: 16px; color: var(--accent); }
.tour-text { font-size: 13.5px; line-height: 1.45; }
.tour-step { font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.tour-btns { display: flex; gap: 6px; margin-top: 12px; align-items: center; }
.tour-btns .btn[hidden] { display: none; }
.tour-x { position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border: 0; background: transparent; color: var(--dim); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 4px; }
.tour-x:hover { background: rgba(255,255,255,0.08); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }

/* smal scherm (telefoon): statusbalk met meer ruimte voor het nieuws */
@media (max-width: 560px) {
  #statusbar { grid-template-columns: auto 1fr auto; font-size: 12px; }
  #statusbar > div { padding: 1px 5px; }
}

/* niet beschikbaar in dit jaar: grijs met het jaartal */
.tool-btn.locked { opacity: 0.45; cursor: not-allowed; position: relative; }
.tool-btn .tool-year { position: absolute; right: 1px; bottom: 0; font: 700 9px Inter, sans-serif; color: #ffd27a; background: rgba(0,0,0,0.65); padding: 0 2px; border-radius: 2px; }
.tag-year { font: 600 11px Inter, sans-serif; color: #ffd27a; margin-left: 6px; }

/* hoofdmenu (src/ui/menu.js): het spel draait op de achtergrond, de camera zweeft langs bekende plekken */
body.menu #toolbar, body.menu #statusbar, body.menu #tooltip { display: none; }
body.menu #view { top: 0; height: 100vh; }
#menu { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; }
#menu[hidden] { display: none; }
.mn-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(10,14,20,0) 40%, rgba(10,14,20,0.32) 100%), linear-gradient(rgba(10,14,20,0.18), rgba(10,14,20,0) 18%, rgba(10,14,20,0) 78%, rgba(10,14,20,0.3)); }
body.menu .news { display: none; } /* spelberichten (krant) niet achter of over het hoofdmenu */
.mn-fade { display: none; }
/* achtergrondfilmpje (data/menu): vult het scherm, per shot zacht in en uit (ui/menu.js video) */
#menu { background: #0b1016; }
.mn-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mn-livebg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity 0.25s linear; } /* live achtergrond (ui/menubg.js) */
.mn-livebg[hidden] { display: none; }
.mn-card { position: relative; z-index: 1; width: min(440px, 100%); padding: 26px 24px 16px; background: rgba(48,54,63,0.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid; border-color: var(--panel-hi) #1d2025 #1d2025 var(--panel-hi); border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,0.55); transition: width 0.25s ease, transform 0.35s ease; max-height: calc(100vh - 32px); overflow: auto; }
#menu.mn-wide .mn-card { width: min(500px, 100%); }
.mn-logo { font: 700 50px/1 'Playfair Display', Georgia, serif; text-align: center; letter-spacing: 0.01em; color: #fff; text-shadow: 0 2px 0 #1b2633, 0 0 24px rgba(242,196,15,0.25); }
.mn-logo::after { content: ''; display: block; width: 64px; height: 3px; margin: 10px auto 0; background: var(--accent); border-radius: 2px; }
.mn-tag { text-align: center; color: #c9d0d8; font-size: 13px; margin: 12px 0 20px; text-wrap: balance; }
.mn-page { display: flex; flex-direction: column; gap: 8px; }
.mn-page[hidden] { display: none; }
.mn-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 10px 14px; text-align: left; font: inherit; color: var(--text); background: #5b636f; border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 4px; cursor: pointer; transition: background 0.15s, transform 0.15s; }
.mn-btn b { font-size: 15px; font-weight: 700; }
.mn-btn span { font-size: 12px; color: #d3d9e0; }
.mn-btn:hover, .mn-btn:focus-visible { background: #68717e; transform: translateX(3px); outline: none; }
.mn-btn.primary { background: #2f6a3d; border-color: #57a066 #183a21 #183a21 #57a066; }
.mn-btn.primary:hover, .mn-btn.primary:focus-visible { background: #377a47; }
.mn-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-top: 6px; }
.mn-years { display: flex; flex-wrap: wrap; gap: 4px; }
.mn-chip { font: 600 12.5px Inter, system-ui, sans-serif; color: var(--text); padding: 5px 9px; background: #5b636f; border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 3px; cursor: pointer; font-variant-numeric: tabular-nums; }
.mn-chip:hover { background: #68717e; }
.mn-chip.on { background: #3d434c; color: var(--accent); border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); }
.mn-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mn-opt { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); padding: 9px 10px; background: #474e58; border: 1px solid #2f343b; border-radius: 4px; cursor: pointer; }
.mn-opt b { font-size: 13px; }
.mn-opt span { font-size: 11.5px; color: var(--dim); line-height: 1.35; }
.mn-opt:hover { background: #505863; }
.mn-opt.on { background: #2e4a35; border-color: #6fbf80; box-shadow: inset 0 0 0 1px #6fbf80; }
.mn-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 12.5px; color: #dfe4ea; }
.mn-check input { margin-top: 3px; accent-color: #57a066; }
.mn-check b { color: var(--text); margin-right: 4px; }
.mn-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.mn-row.left { justify-content: flex-start; margin-top: 0; flex-wrap: wrap; }
.mn-row input[type=range] { flex: 1; min-width: 120px; }
.mn-start { padding: 6px 22px; font-size: 13px; }
.mn-p { margin: 0; font-size: 13px; }
.mn-note { font-size: 12px; }
.mn-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(40,45,53,0.92); border-radius: 6px; font-weight: 600; }
.mn-wait[hidden] { display: none; }
.mn-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--accent); animation: mnspin 0.9s linear infinite; }
@keyframes mnspin { to { transform: rotate(360deg); } }
.mn-caption { position: absolute; left: 22px; bottom: 18px; z-index: 1; display: flex; flex-direction: column; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.mn-caption b { font: 700 22px/1.1 'Playfair Display', Georgia, serif; }
.mn-caption span { font-size: 12.5px; color: #e3e7ec; }
@media (max-width: 640px) {
  .mn-logo { font-size: 34px; }
  .mn-opts { grid-template-columns: 1fr; }
  .mn-caption { left: 16px; bottom: 34px; }
}
@media (prefers-reduced-motion: reduce) { .mn-btn:hover { transform: none; } .mn-card { transition: none; } }
.mn-spin[hidden] { display: none; }
.mn-bar { width: 72%; height: 10px; border-radius: 5px; background: #23282f; border: 1px solid #1a1e23; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.5); }
.mn-bar[hidden] { display: none; }
.mn-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3f8a50, #8be38f); border-radius: 5px; transition: width 0.2s ease; }
.mn-ws { color: var(--dim); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; min-height: 1em; }
.mn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mn-two label { display: flex; flex-direction: column; gap: 4px; }
.mn-sel, .mn-in { font: 500 13px Inter, system-ui, sans-serif; color: var(--text); background: var(--inset); border: 1px solid; border-color: var(--panel-lo) var(--panel-hi) var(--panel-hi) var(--panel-lo); border-radius: 3px; padding: 6px 8px; width: 100%; }
.mn-in::placeholder { color: #8d96a2; }
@media (max-width: 640px) { .mn-two { grid-template-columns: 1fr; } }
/* hoofdmenu: twee grote keuzes, links, laadstatus */
.mn-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mn-mode { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 14px 13px; min-height: 132px; text-align: left; font: inherit; color: var(--text); background: #535b67; border: 1px solid; border-color: var(--panel-hi) var(--panel-lo) var(--panel-lo) var(--panel-hi); border-radius: 6px; cursor: pointer; transition: background 0.15s, transform 0.15s, box-shadow 0.15s; }
.mn-mode svg { width: 34px; height: 34px; margin-bottom: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.95; }
.mn-mode b { font-size: 17px; font-weight: 700; margin-top: 10px; }
.mn-mode span { font-size: 12px; color: #d6dce3; line-height: 1.35; }
.mn-mode:hover, .mn-mode:focus-visible { background: #616a77; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,0.3); outline: none; }
.mn-mode.primary { background: #2f6a3d; border-color: #57a066 #183a21 #183a21 #57a066; }
.mn-mode.primary:hover, .mn-mode.primary:focus-visible { background: #377a47; }
.mn-mode.primary svg { color: #c9f2cf; }
.mn-mode:not(.primary) svg { color: var(--accent); }
.mn-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; color: var(--dim); font-size: 12.5px; }
.mn-link { background: none; border: 0; padding: 4px 2px; font: inherit; color: #dfe4ea; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.25); text-underline-offset: 3px; }
.mn-link:hover, .mn-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; outline: none; }
.mn-title { font: 700 20px/1.2 'Playfair Display', Georgia, serif; margin: -4px 0 2px; }
.mn-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px -24px -16px; padding: 8px 12px; font-size: 11.5px; color: var(--dim); background: rgba(0,0,0,0.18); border-top: 1px solid rgba(255,255,255,0.06); border-radius: 0 0 6px 6px; }
.mn-status[hidden] { display: none; }
.mn-status i { width: 7px; height: 7px; border-radius: 50%; background: #8d96a2; flex: none; }
.mn-status.busy i { background: var(--accent); animation: mnpulse 1.2s ease-in-out infinite; }
.mn-status.ready i { background: #6fdc84; box-shadow: 0 0 6px #6fdc84; }
.mn-status.ready { color: #cfe9d3; }
@keyframes mnpulse { 50% { opacity: 0.3; } }
/* laadscherm: wisselende weetjes */
#menu.mn-busy .mn-card { min-height: 400px; }
.mn-wait { padding: 24px; text-align: center; }
.mn-fact { max-width: 380px; margin-top: 14px; padding: 12px 14px; background: rgba(0,0,0,0.22); border-left: 3px solid var(--accent); border-radius: 3px; text-align: left; opacity: 0; transform: translateY(4px); transition: opacity 0.35s ease, transform 0.35s ease; }
.mn-fact.on { opacity: 1; transform: none; }
.mn-fact small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 4px; }
.mn-fact p { margin: 0; font-weight: 500; font-size: 13px; line-height: 1.45; color: #eef1f4; min-height: 3.9em; }
.mn-cancel { margin-top: 4px; }
.mn-cancel[hidden] { display: none; }
/* multiplayer in het menu */
.mn-who { display: flex; align-items: flex-end; gap: 10px; }
.mn-who label { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mn-in:disabled { opacity: 0.7; }
.mn-conn { font-size: 12px; color: var(--dim); padding-bottom: 7px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.mn-conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.mn-conn i.ok { background: #6fdc84; } .mn-conn i.bad { background: #e0675b; }
.mn-conn b { color: var(--text); }
.mn-tabs { display: flex; gap: 2px; margin-top: 8px; border-bottom: 1px solid #2a2f36; }
.mn-tab { flex: 1; padding: 7px 6px; font: 600 12.5px Inter, system-ui, sans-serif; color: var(--dim); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.mn-tab:hover { color: var(--text); }
.mn-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.mn-pane { display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.mn-pane[hidden] { display: none; }
.mn-pane > label { display: flex; flex-direction: column; gap: 4px; }
.mn-pwrow[hidden] { display: none; }
.mn-rooms { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; padding-top: 6px; }
.mn-room { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.05); border-radius: 4px; }
.mn-room.full { opacity: 0.6; }
.mn-rn { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.mn-rn b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mn-rn small { flex-basis: 100%; color: var(--dim); font-size: 11.5px; }
.mn-tagp, .mn-tagm { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: #4a3f6b; color: #ddd3ff; }
.mn-tagm { background: #2e5a38; color: #c9f2cf; }
.mn-seats { display: flex; align-items: center; gap: 3px; }
.mn-seats i { width: 8px; height: 8px; border-radius: 50%; background: #2a2f36; border: 1px solid #697280; }
.mn-seats i.on { background: #6fdc84; border-color: #6fdc84; }
.mn-seats small { margin-left: 4px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mn-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; color: var(--dim); text-align: center; font-size: 12.5px; }
.mn-err { margin-top: 4px; padding: 8px 10px; font-size: 12.5px; color: #ffd9d4; background: rgba(170,50,40,0.35); border-left: 3px solid #e0675b; border-radius: 3px; }
.mn-err[hidden] { display: none; }
@media (max-width: 640px) {
  .mn-modes { grid-template-columns: 1fr; }
  .mn-mode { min-height: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
  .mn-mode svg { grid-row: span 2; margin: 0; }
  .mn-mode b { margin-top: 0; }
  .mn-card { padding: 20px 16px 14px; }
  .mn-status { margin: 12px -16px -14px; }
  .mn-room { grid-template-columns: 1fr auto; }
  .mn-seats { display: none; }
  #menu.mn-busy .mn-card { min-height: 360px; }
}

/* stationskeuzes onder de spoorbalk (sporen, lengte, kant) */
.stopts { padding: 4px 8px 2px; display: flex; flex-direction: column; gap: 4px; }
.stopts .row { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.stopts .row .dim { width: 78px; font-size: 11.5px; }
.stopts .btn { padding: 2px 7px; font-size: 11.5px; }
.stopts .sub { font-size: 11px; color: var(--dim); }

/* ---------- telefoon en tablet (body.touch, ui/touch.js) ---------- */
body.touch #view { touch-action: none; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body.touch input, body.touch select, body.touch textarea { font-size: 16px; -webkit-user-select: text; user-select: text; } /* iOS zoomt anders in bij typen */
body.touch .tb-btn { width: 40px; height: 34px; }
body.touch #toolbar { height: calc(42px + env(safe-area-inset-top)); padding-top: calc(3px + env(safe-area-inset-top)); justify-content: flex-start; }
body.touch #view { top: calc(42px + env(safe-area-inset-top)); height: calc(100vh - 42px - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 42px - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
body.touch #statusbar { height: calc(30px + env(safe-area-inset-bottom)); padding-bottom: calc(2px + env(safe-area-inset-bottom)); }
body.touch.menu #view { top: 0; height: 100dvh; }
body.touch .win-close, body.touch .win-pin { width: 28px; height: 26px; font-size: 18px; line-height: 22px; }
body.touch .win-title { height: 34px; }
body.touch .btn, body.touch button.tool-btn { min-height: 34px; }
#touchbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(38px + env(safe-area-inset-bottom)); z-index: 300; display: flex; gap: 6px; padding: 6px; background: rgba(40,45,52,0.94); border: 1px solid #22262c; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); max-width: calc(100vw - 16px); }
#touchbar[hidden] { display: none; }
#touchbar button { min-width: 44px; height: 44px; padding: 0 12px; font: 600 16px Inter, sans-serif; color: #e9edf2; background: #5a626d; border: 1px solid #77808c; border-radius: 7px; }
#touchbar button[hidden] { display: none; }
#touchbar .tb-ok { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 120px; max-width: 62vw; background: #3f7a45; border-color: #6cae70; text-align: left; line-height: 1.1; }
#touchbar .tb-ok b { font-size: 15px; }
#touchbar .tb-ok span { font-size: 11.5px; font-weight: 500; color: #e3f2df; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#touchbar .tb-ok.bad { background: #7a4440; border-color: #b0716b; }
#touchbar .tb-no { background: #6b3a36; border-color: #a0605a; }
/* smal scherm: vensters als blad onderin (volle breedte), bouwbalken als strook bovenin */
@media (max-width: 760px) {
  .win { left: 4px !important; right: 4px; width: auto !important; max-width: none; top: auto !important; bottom: calc(32px + env(safe-area-inset-bottom)); max-height: 58vh; max-height: 58dvh; border-radius: 10px 10px 4px 4px; }
  .win-title { cursor: default; }
  .win[data-win^="bar:"] { top: calc(46px + env(safe-area-inset-top)) !important; bottom: auto; max-height: none; border-radius: 4px 4px 10px 10px; }
  .win[data-win^="bar:"] .win-body { display: flex; overflow-x: auto; }
  body.touch.tool-active .win:not([data-win^="bar:"]) { display: none; } /* met gereedschap in de hand: de kaart vrij */
  #statusbar { grid-template-columns: auto 1fr auto; font-size: 12px; }
}
/* hoofdmenu: weergave kiezen (3D op de grafische kaart of klassiek) */
.mn-view { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; margin-top: 12px; }
.mn-vopt { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 6px; border: 1px solid #1d2025; background: rgba(30,34,40,0.7); color: #dfe4ea; font: inherit; cursor: pointer; }
.mn-vopt b { font-size: 14px; } .mn-vopt span { font-size: 11.5px; color: var(--dim); line-height: 1.35; }
.mn-vopt em { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #1c1c1c; background: var(--accent); border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
.mn-vopt[data-view="gpu"] { border-color: rgba(242,196,15,0.55); box-shadow: 0 0 0 1px rgba(242,196,15,0.15) inset; }
.mn-vopt:hover, .mn-vopt:focus-visible { border-color: var(--accent); outline: none; }
.mn-vopt.on { background: rgba(242,196,15,0.14); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mn-vopt.on b { color: var(--accent); }
@media (max-width: 420px) { .mn-view { grid-template-columns: 1fr; } }
/* multiplayer: je bedrijf oprichten (naam en kleur) */
.mn-found { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.mn-corow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mn-corow .mn-in { flex: 1 1 180px; }
.mn-colors { display: flex; gap: 5px; flex-wrap: wrap; }
.mn-col { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,0.35); cursor: pointer; padding: 0; }
.mn-col:hover, .mn-col:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 1px; }
.mn-col.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.mn-found .mn-note { font-size: 11.5px; }
#sb-news.go { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); text-underline-offset: 3px; }
.mp-build { cursor: pointer; color: #cfd5dc; } .mp-build:hover { color: var(--accent); }
/* hoofdmenu: muziek aan/uit (ui/menumusic.js) */
.mn-music { position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; align-items: center; gap: 7px; padding: 6px 11px; font: 600 12.5px Inter, system-ui, sans-serif; color: #dfe4ea; background: rgba(30,34,40,0.72); border: 1px solid rgba(255,255,255,0.18); border-radius: 18px; cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.mn-music:hover, .mn-music:focus-visible { border-color: var(--accent); outline: none; }
.mn-music .mn-mi { font-size: 15px; line-height: 1; }
.mn-music.on .mn-mi { color: var(--accent); }
.mn-music.wait { border-color: var(--accent); animation: mn-pulse 1.8s ease-in-out infinite; }
@keyframes mn-pulse { 50% { box-shadow: 0 0 0 4px rgba(242,196,15,0.25); } }
@media (prefers-reduced-motion: reduce) { .mn-music.wait { animation: none; } }
.mn-credits .credits-list { padding-left: 16px; font-size: 12px; color: #cfd5dc; }
/* hoofdmenu: verder met het automatisch bewaarde spel (net/autosave.js) */
.mn-continue { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-bottom: 10px; padding: 10px 14px; text-align: left; font: inherit; color: #1c1c1c; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
.mn-continue b { font-size: 15px; } .mn-continue span { font-size: 12px; opacity: 0.8; }
.mn-continue:hover, .mn-continue:focus-visible { filter: brightness(1.06); outline: none; }
.mn-continue[hidden] { display: none; }
.mn-page[data-p="settings"] .mn-view { margin-top: 2px; }
