/* Tycoon engine – shared style */
:root { --bar: 94px; --ink: #e9eef5; --mut: #93a4bb; --pan: rgba(19,28,42,.94); --pan2: rgba(36,51,72,.85); --line: rgba(110,140,180,.28); --line2: rgba(140,170,210,.45);
  --acc: #ffb703; --acc2: #ffd166; --good: #51cf66; --bad: #ff6b6b; --warn: #fcc419; --prim: #1c7ed6; --prim2: #4dabf7; --r: 14px;
  --glass: linear-gradient(180deg, rgba(40,58,84,.92), rgba(18,27,41,.94)); --shadow: 0 12px 34px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #16221a; color: var(--ink); font: 13px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; user-select: none; }
button { font: inherit; color: inherit; }
b { font-weight: 700; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.sm { font-size: 12px; color: var(--mut); margin-top: 3px; }
.sm.good { color: var(--good); } .sm.bad { color: var(--bad); }
.stars { color: var(--acc); letter-spacing: 1px; }
#view { position: fixed; left: 0; top: 0; width: 100vw; height: calc(100vh - var(--bar)); display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(140,170,210,.3); border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }

/* sterren (terminalbeoordeling) */
.rate { position: relative; display: inline-block; letter-spacing: 1px; line-height: 1; font-size: 12px; vertical-align: -1px; }
.rate .rbg { color: rgba(148,163,184,.35); } .rate .rfg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--acc); text-shadow: 0 0 6px rgba(255,183,3,.45); }
.rate.big { font-size: 34px; letter-spacing: 4px; }

/* onderbalk */
#bar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar); display: flex; align-items: stretch; gap: 10px; padding: 9px 10px;
  background: linear-gradient(180deg, rgba(36,52,76,.96), rgba(16,24,37,.98)); border-top: 1px solid rgba(140,170,210,.35); box-shadow: 0 -8px 26px rgba(0,0,0,.42); z-index: 20; backdrop-filter: blur(8px); }
#bar::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); opacity: .55; }
.binfo { min-width: 232px; background: rgba(8,13,22,.75); border: 1px solid var(--line2); border-radius: 12px; padding: 6px 11px; font-size: 12px; display: flex; flex-direction: column; justify-content: center; box-shadow: inset 0 2px 8px rgba(0,0,0,.35); }
.binfo .money { font-size: 20px; font-weight: 800; color: #8ce99a; font-variant-numeric: tabular-nums; letter-spacing: .3px; text-shadow: 0 0 10px rgba(140,233,154,.25); }
.binfo .money.neg { color: var(--bad); text-shadow: 0 0 10px rgba(255,107,107,.3); }
.binfo .rush { animation: pulse 1.4s infinite; display: inline-block; }
@keyframes pulse { 50% { transform: scale(1.25); } }
.bbtns { display: flex; gap: 6px; }
.bbtns button { width: 70px; background: linear-gradient(180deg, #44608a, #2a3f5d); border: 1px solid #5d7ea9; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 650;
  box-shadow: 0 3px 0 #182638, inset 0 1px 0 rgba(255,255,255,.15); transition: transform .12s, background .15s, box-shadow .12s; }
.bbtns button span { font-size: 24px; line-height: 1.1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.bbtns button:hover { background: linear-gradient(180deg, #5274a3, #34506f); transform: translateY(-2px); box-shadow: 0 5px 0 #182638, inset 0 1px 0 rgba(255,255,255,.18); }
.bbtns button:active { transform: translateY(1px); box-shadow: 0 1px 0 #182638; }
.bbtns button.on { background: linear-gradient(180deg, #ffc533, #e29100); border-color: #ffd166; color: #1b1b1b; box-shadow: 0 3px 0 #8a5a00, 0 0 18px rgba(255,183,3,.35); }
.bmid { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.bgoals { display: flex; gap: 4px; flex-wrap: nowrap; max-width: 440px; overflow: hidden; }
.bgoals span { background: rgba(8,13,22,.75); border: 1px solid var(--line2); border-radius: 8px; padding: 2px 7px; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bgoals span.ok { border-color: var(--good); color: #b2f2bb; background: rgba(43,138,62,.18); }
.speed { display: flex; background: rgba(8,13,22,.75); border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); align-self: flex-start; }
.speed button { background: none; border: 0; padding: 4px 11px; cursor: pointer; color: var(--mut); transition: background .15s; }
.speed button:hover { color: #fff; background: rgba(255,255,255,.06); }
.speed button.on { background: linear-gradient(180deg, var(--prim2), var(--prim)); color: #fff; }
.adv { flex: 1; min-width: 160px; display: flex; gap: 10px; align-items: center; background: linear-gradient(180deg, #fbf4e3, #efe2c2); color: #3a2e1c; border: 1px solid #d8c18b; border-radius: 14px; padding: 6px 12px; cursor: pointer; font-size: 13px; overflow: hidden; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #a88f55; }
#advText { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.adv .av { flex: none; font-size: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.adv.flash { animation: flash 1.2s; }
@keyframes flash { 0%, 40% { background: #ffe066; } }
#bar .menu { width: 52px; background: rgba(8,13,22,.75); border: 1px solid var(--line2); border-radius: 12px; font-size: 22px; cursor: pointer; transition: background .15s; }
#bar .menu:hover { background: rgba(60,85,120,.6); }

/* vluchtenbord */
#board { position: fixed; top: 10px; right: 10px; width: 410px; max-height: calc(100vh - var(--bar) - 20px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0d1014, #07090c); border: 1px solid #2d333b; border-radius: 12px; z-index: 15; font-family: 'Consolas', 'SFMono-Regular', 'Menlo', 'Courier New', monospace; color: #ffd43b; box-shadow: 0 10px 30px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05); overflow: hidden; }
body:not(.nomini) #board { max-height: calc(100vh - var(--bar) - 200px); }
#board.min .brows, #board.min .bauto { display: none; }
.bhead { display: flex; justify-content: space-between; padding: 8px 11px; background: linear-gradient(180deg, #20252c, #15191e); cursor: pointer; border-bottom: 1px solid #2d333b; letter-spacing: 2px; }
.bhead span { color: #adb5bd; font-size: 12px; letter-spacing: .5px; }
.bauto { padding: 4px 10px; background: #13161a; cursor: pointer; font-size: 12px; color: #74c0fc; }
.brows { overflow-y: auto; }
.brow { display: grid; grid-template-columns: 44px 58px 1fr 16px 34px 44px 92px; gap: 4px; padding: 3px 8px; font-size: 12px; border-bottom: 1px solid #181c21; cursor: pointer; white-space: nowrap; overflow: hidden; }
.brow:nth-child(even):not(.hdr) { background: rgba(255,255,255,.018); }
.brow span { overflow: hidden; text-overflow: ellipsis; }
.brow.hdr { color: #868e96; font-size: 10px; cursor: default; position: sticky; top: 0; background: #0b0d10; letter-spacing: 1px; }
.brow:hover:not(.hdr) { background: #1c2129; }
.brow.sel { background: #10344e; outline: 1px solid #22b8cf; }
.brow.departed, .brow.taxiOut { opacity: .45; }
.brow.holding { background: #3a1214; }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.bempty { padding: 12px; color: #868e96; }

/* minikaart */
#mini { position: fixed; right: 10px; bottom: calc(var(--bar) + 10px); width: 210px; z-index: 14; border-radius: 10px; border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0,0,0,.5); background: #1d2633; cursor: crosshair; image-rendering: pixelated; }
body.nomini #mini, #mini.off { display: none; }

/* eerste stappen */
#quest { position: fixed; left: 10px; top: 10px; width: 290px; z-index: 16; background: var(--glass); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(6px); }
#quest .qh { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: pointer; background: linear-gradient(90deg, rgba(255,183,3,.18), transparent); }
#quest .qh span { color: var(--acc2); font-weight: 700; font-size: 12px; }
#quest ol { list-style: none; margin: 0; padding: 4px 12px 8px; font-size: 12px; }
#quest li { padding: 3px 0; color: var(--mut); }
#quest li.ok { color: #8ce99a; text-decoration: line-through; text-decoration-color: rgba(140,233,154,.4); }
#quest li.cur { color: #fff; font-weight: 600; }
#quest li small { display: block; color: var(--acc2); font-weight: 400; margin: 2px 0 2px 16px; }
#quest .qbar { height: 4px; background: rgba(0,0,0,.4); } #quest .qbar div { height: 100%; background: linear-gradient(90deg, var(--acc), #8ce99a); transition: width .4s; }

/* modebalk, inspector, vensters */
#modeBar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, #ffc533, #f0a000); color: #1b1b1b; padding: 9px 18px; border-radius: 12px; z-index: 18; box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5); max-width: 60vw; pointer-events: none; }
#insp { position: fixed; left: 10px; bottom: calc(var(--bar) + 10px); width: 310px; background: var(--glass); border: 1px solid var(--line2); border-radius: var(--r); padding: 11px 13px; z-index: 16; box-shadow: var(--shadow); backdrop-filter: blur(6px); animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#insp > div { margin-top: 3px; }
.ih, .wh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; }
.ih span, .wh span { cursor: pointer; color: var(--mut); padding: 2px 7px; border-radius: 6px; } .ih span:hover, .wh span:hover { background: rgba(255,255,255,.08); color: #fff; }
.prob { background: linear-gradient(180deg, #33264d, #271d3b); border: 1px solid rgba(218,119,242,.25); border-radius: 10px; padding: 7px 9px; margin-top: 6px; }
.pbar { height: 8px; background: rgba(0,0,0,.45); border-radius: 5px; overflow: hidden; margin: 2px 0 4px; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.pbar div { height: 100%; background: var(--prim); border-radius: 5px; transition: width .3s; background-image: linear-gradient(180deg, rgba(255,255,255,.25), transparent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn { background: linear-gradient(180deg, #3d5675, #2c405a); border: 1px solid #56769c; border-radius: 10px; padding: 6px 12px; cursor: pointer; box-shadow: 0 2px 0 #17253a, inset 0 1px 0 rgba(255,255,255,.12); transition: transform .1s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #4dabf7, #1971c2); border-color: #74c0fc; color: #fff; box-shadow: 0 2px 0 #0b3d6b, inset 0 1px 0 rgba(255,255,255,.3); }
.btn.danger { background: linear-gradient(180deg, #7d3333, #5c2424); border-color: #a14848; box-shadow: 0 2px 0 #331212; }
.btn.big { padding: 11px 20px; font-size: 15px; font-weight: 650; border-radius: 12px; }
.btn.sm2 { padding: 6px 9px; }
#win { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar) + 10px); width: min(740px, 94vw); max-height: calc(100vh - var(--bar) - 40px); overflow-y: auto;
  background: var(--glass); border: 1px solid var(--line2); border-radius: 16px; padding: 13px 15px; z-index: 17; box-shadow: 0 16px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(8px); }
#win h4 { margin: 12px 0 7px; color: var(--acc2); font-size: 13px; letter-spacing: .3px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 7px; }
.card { background: linear-gradient(180deg, rgba(52,72,100,.9), rgba(32,46,66,.9)); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; transition: transform .12s, border-color .12s, box-shadow .12s; }
.card:hover:not(:disabled) { border-color: var(--acc); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(255,183,3,.25); }
.card .ic { font-size: 28px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); } .card b { font-size: 12px; } .card small { color: var(--mut); font-size: 11px; }
.card.lock, .fobj.lock { opacity: .4; cursor: not-allowed; filter: grayscale(.5); }
.flist { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.fobj { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 6px; align-items: center; background: var(--pan2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; cursor: pointer; text-align: left; transition: border-color .12s; }
.fobj:hover { border-color: var(--line2); }
.fobj.on { border-color: var(--acc); background: rgba(255,183,3,.14); box-shadow: 0 0 0 1px rgba(255,183,3,.3); }
.fobj .ic { font-size: 20px; } .fobj small { color: var(--mut); } .fobj .pr { color: var(--mut); font-size: 11px; } .fobj .cnt { font-weight: 700; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { background: var(--pan2); border: 1px solid var(--line); border-radius: 9px; padding: 5px 11px; cursor: pointer; transition: background .12s; }
.tabs button:hover { background: rgba(60,85,120,.7); }
.tabs button.on { background: linear-gradient(180deg, var(--prim2), var(--prim)); border-color: #74c0fc; color: #fff; }
.cands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cand { background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 9px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.slist { display: flex; flex-direction: column; gap: 3px; }
.srow { display: grid; grid-template-columns: 1fr 80px 100px 70px; gap: 8px; align-items: center; background: var(--pan2); border-radius: 9px; padding: 4px 8px; cursor: pointer; }
.srow:hover { background: rgba(60,85,120,.7); }
table.led { width: 100%; border-collapse: collapse; font-size: 12px; }
table.led td { padding: 4px 2px; border-bottom: 1px solid rgba(110,140,180,.18); }
table.led td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
table.led tr.tot td { font-weight: 700; border: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.book { display: flex; flex-direction: column; gap: 5px; }
.bk { display: grid; grid-template-columns: 36px 1fr 90px; gap: 8px; align-items: center; background: var(--pan2); border-radius: 12px; padding: 7px 10px; border: 1px solid var(--line); }
.bk .ic { font-size: 24px; } .bk.unk { opacity: .5; } .bk .cnt { font-size: 11px; text-align: right; color: var(--mut); }
.msgs div { padding: 5px 0; border-bottom: 1px solid rgba(110,140,180,.18); } .msgs span { color: var(--mut); font-size: 11px; margin-right: 6px; }
ul.goals { list-style: none; padding: 0; margin: 6px 0; }
ul.goals li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; background: var(--pan2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 5px; }
ul.goals li .pbar { grid-column: 1 / -1; } ul.goals li.ok { border-color: var(--good); background: rgba(43,138,62,.14); } ul.goals li.ok .pbar div { background: var(--good); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.charts > div { background: rgba(8,13,22,.55); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.chr { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0 8px; font-size: 12px; }
.lgd { display: inline-flex; gap: 8px; margin-left: 8px; font-size: 10px; opacity: .85; flex-wrap: wrap; } .lgd i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }
.bk { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; margin: 6px 0; font-size: 12px; } .bk i { grid-column: 1 / -1; height: 7px; background: rgba(127,127,127,.18); border-radius: 4px; overflow: hidden; }
.bk i em { display: block; height: 100%; border-radius: 4px; background: #51cf66; } .bk i em.bad { background: #ff6b6b; } .bk small { grid-column: 1 / -1; opacity: .65; font-size: 10px; }
.bksum { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 6px 0; } .mini > div { background: rgba(127,127,127,.12); border-radius: 8px; padding: 6px 8px; font-size: 11px; } .mini b { display: block; font-size: 16px; }
table.dt { width: 100%; border-collapse: collapse; font-size: 12px; } table.dt th { text-align: left; font-size: 10px; text-transform: uppercase; opacity: .7; padding: 3px 4px; } table.dt td { padding: 4px; border-top: 1px solid rgba(127,127,127,.2); } table.dt td.n, table.dt th.n { text-align: right; }
.cst { display: inline-block; font-style: normal; font-size: 9px; font-weight: 800; color: #fff; padding: 0 4px; border-radius: 3px; line-height: 14px; vertical-align: 1px; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.cstl { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; margin: 6px 0; }
tr.on td { background: rgba(190,75,219,.12); }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.offer { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: rgba(127,127,127,.12); border: 2px solid transparent; color: inherit; font-size: 12px; }
.offer b { font-size: 13px; color: inherit; } .offer .sm { opacity: .8; } .offer.on { border-color: #40c057; background: rgba(64,192,87,.12); } .offer .btn { align-self: flex-start; }
.langrow { display: flex; justify-content: center; margin: 10px 0 2px; }
.langsw { display: inline-flex; gap: 4px; background: rgba(127,127,127,.15); border-radius: 999px; padding: 3px; }
.langsw button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; opacity: .65; }
.langsw button.on { background: rgba(255,255,255,.85); color: #212529; opacity: 1; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.kgames { display: block; text-align: center; margin-top: 6px; font-size: 11px; letter-spacing: .03em; opacity: .55; color: inherit; text-decoration: none; }
.kgames b { font-weight: 800; } .kgames:hover { opacity: .9; text-decoration: underline; }
.charts b { font-size: 12px; } .charts canvas { width: 100%; height: 110px; display: block; margin-top: 4px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 8px; }
.ach { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px; opacity: .55; }
.ach span { font-size: 24px; text-align: center; } .ach small { display: block; color: var(--mut); font-size: 11px; }
.ach.on { opacity: 1; border-color: rgba(255,183,3,.6); background: linear-gradient(135deg, rgba(255,183,3,.16), rgba(36,51,72,.85)); }

/* tooltip, toasts */
#tip { position: fixed; z-index: 50; background: rgba(12,18,28,.97); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 11px; font-size: 12px; pointer-events: none; max-width: 280px; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(400px, 46vw); pointer-events: none; }
#modeBar:not([hidden]) ~ #toasts { top: 60px; }
.toast { width: 100%; background: rgba(20,30,45,.96); border: 1px solid var(--line2); border-left: 4px solid var(--prim2); border-radius: 12px; padding: 9px 13px; box-shadow: 0 10px 26px rgba(0,0,0,.45); animation: tin .3s cubic-bezier(.2,1.4,.4,1); transition: opacity .6s, transform .6s; backdrop-filter: blur(6px); }
.toast.good { border-left-color: var(--good); } .toast.warn { border-left-color: var(--warn); } .toast.bad { border-left-color: var(--bad); background: rgba(52,22,26,.96); }
.toast.disc { border-left-color: #da77f2; background: rgba(45,30,62,.97); }
.toast.achv { border: 1px solid rgba(255,183,3,.7); border-left: 4px solid var(--acc); background: linear-gradient(135deg, rgba(70,52,14,.97), rgba(26,30,40,.97)); box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px rgba(255,183,3,.25); }
.achT { display: flex; gap: 12px; align-items: center; } .achT > span { font-size: 34px; animation: spin .8s ease-out; } .achT small { display: block; color: var(--acc2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; } .achT b { display: block; font-size: 15px; } .achT i { color: var(--mut); font-size: 12px; }
@keyframes spin { from { transform: scale(.2) rotate(-200deg); } }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes tin { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* modals */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,10,18,.62); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
#sky:not([hidden]) ~ #modal { background: transparent; backdrop-filter: none; }
#modal[hidden] { display: none; }
.mbox { width: min(760px, 94vw); max-height: 92vh; overflow-y: auto; background: linear-gradient(180deg, rgba(38,54,78,.97), rgba(18,27,40,.97)); border: 1px solid rgba(140,170,210,.45); border-radius: 22px; padding: 28px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08); animation: mpop .28s cubic-bezier(.2,1.2,.4,1); }
@keyframes mpop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.mbox.start { background: linear-gradient(180deg, rgba(30,46,70,.78), rgba(14,22,35,.86)); backdrop-filter: blur(10px); text-align: center; }
.mbox h2 { margin: 0 0 4px; font-size: 26px; } .mbox .sub { color: var(--mut); margin-bottom: 12px; } .mbox .sub.c { text-align: center; } .mbox p { color: #cbd5e1; }
.logo { display: flex; justify-content: center; margin-top: -6px; }
.logo .lp { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; font-size: 40px; background: linear-gradient(145deg, #4dabf7, #1864ab); box-shadow: 0 10px 30px rgba(28,126,214,.5), inset 0 2px 0 rgba(255,255,255,.35); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-4deg); } }
.title { text-align: center; font-size: 56px; font-weight: 900; margin: 10px 0 8px; letter-spacing: 1px; line-height: 1.05;
  background: linear-gradient(180deg, #fff, #c9dcf2); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(10,18,30,.8)); }
.title span { background: linear-gradient(180deg, #ffd166, #f59f00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { text-align: center; font-size: 15px; max-width: 580px; margin: 0 auto 22px; }
.mbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.mbtns.small { margin-top: 12px; } .mbtns.small .btn b { color: var(--acc2); }
.ver { margin-top: 18px; font-size: 11px; color: var(--mut); opacity: .8; }
.mcol { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 14px auto 0; }
.mrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .mrow .btn { padding: 8px 4px; font-size: 12px; }
.lvgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.lv { position: relative; background: linear-gradient(180deg, rgba(52,72,100,.9), rgba(30,43,62,.9)); border: 1px solid var(--line2); border-radius: 14px; padding: 14px 8px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; transition: transform .14s, border-color .14s, box-shadow .14s; }
.lv:hover:not(.locked) { border-color: var(--acc); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,.35); }
.lv .n { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(180deg, #ffd166, #f59f00); color: #1b1b1b; display: grid; place-items: center; font-weight: 900; font-size: 17px; box-shadow: 0 3px 0 #8a5a00; }
.lv.won .n { background: linear-gradient(180deg, #8ce99a, #2f9e44); box-shadow: 0 3px 0 #1b5e2a; color: #fff; }
.lv small { color: var(--mut); font-size: 11px; } .lv em { font-style: normal; font-size: 11px; color: var(--acc); } .lv .lvmeta { font-size: 10px; color: #74c0fc; letter-spacing: .5px; }
.lv.locked { opacity: .4; cursor: not-allowed; } .lv i { position: absolute; top: 6px; right: 8px; font-style: normal; }
.box { background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.box h4 { margin: 2px 0 6px; } .box ul { margin: 0; padding-left: 18px; color: var(--ink); opacity: .88; }
.opt { background: var(--pan2); border-radius: 12px; padding: 9px 12px; margin: 8px 0; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; border: 1px solid var(--line); }
.opt b { min-width: 130px; } .opt label { cursor: pointer; }
.seg { display: inline-flex; background: rgba(8,13,22,.6); border-radius: 10px; padding: 3px; gap: 2px; border: 1px solid var(--line); flex-wrap: wrap; }
.seg input { display: none; } .seg span { display: block; padding: 5px 12px; border-radius: 8px; color: var(--mut); transition: background .12s; }
.seg input:checked + span { background: linear-gradient(180deg, var(--prim2), var(--prim)); color: #fff; }
.sets { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tgl { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; text-align: left; background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.tgl small { display: block; color: var(--mut); font-size: 12px; }
.tgl .sw { width: 42px; height: 24px; border-radius: 12px; background: #3b4a5f; position: relative; transition: background .2s; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.tgl .sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #dee2e6; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.tgl.on .sw { background: linear-gradient(180deg, #69db7c, #2f9e44); } .tgl.on .sw::after { left: 21px; background: #fff; }
.vol { display: flex; gap: 14px; align-items: center; background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.vol input { flex: 1; accent-color: var(--acc); }
.slots { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.slot { display: grid; grid-template-columns: 130px 1fr auto auto; gap: 10px; align-items: center; background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; text-align: left; }
.slot .si b { display: block; } .slot.empty { opacity: .7; } .slot .sn { font-weight: 700; }
.help h4 { margin: 14px 0 3px; color: var(--acc); } .help p { margin: 2px 0 6px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; color: #cbd5e1; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: linear-gradient(180deg, #4a5f7d, #2e3f57); border: 1px solid #6681a6; box-shadow: 0 2px 0 #1a2638; font: 600 11px system-ui; text-align: center; color: #fff; }
.endt { text-align: center; font-size: 38px; font-weight: 900; } .endt.win { color: var(--good); text-shadow: 0 0 24px rgba(81,207,102,.4); } .endt.lose { color: var(--bad); }
.endrate { text-align: center; margin: 4px 0 8px; } .endrate small { display: block; color: var(--mut); }
.score { text-align: center; font-size: 21px; margin: 10px 0; } .score b { color: var(--acc); }
.hs { background: var(--pan2); border-radius: 12px; padding: 10px 14px; border: 1px solid var(--line); } .hs h4 { margin: 0 0 6px; }
.hsform { display: flex; gap: 8px; margin-top: 8px; }
.hsform input { flex: 1; background: rgba(8,13,22,.7); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 11px; color: var(--ink); font: inherit; user-select: text; }

/* titelscherm-achtergrond */
#sky { position: fixed; inset: 0; z-index: 55; overflow: hidden; background: linear-gradient(180deg, #0f3d73 0%, #2b78c2 42%, #8cc7ef 72%, #ffd9a0 100%); }
#sky .sun { position: absolute; right: 14%; top: 16%; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, #fff7d6 0%, #ffd166 45%, rgba(255,209,102,0) 70%); filter: blur(1px); }
#sky .cl { position: absolute; height: 46px; border-radius: 40px; background: #fff; opacity: .85; filter: blur(.5px); animation: drift linear infinite; }
#sky .cl::before, #sky .cl::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
#sky .cl::before { width: 60px; height: 60px; left: 20px; top: -30px; } #sky .cl::after { width: 80px; height: 80px; left: 60px; top: -44px; }
#sky .c1 { width: 180px; top: 18%; animation-duration: 70s; animation-delay: -10s; } #sky .c2 { width: 240px; top: 34%; animation-duration: 95s; animation-delay: -60s; opacity: .7; }
#sky .c3 { width: 150px; top: 52%; animation-duration: 60s; animation-delay: -30s; opacity: .6; } #sky .c4 { width: 210px; top: 8%; animation-duration: 110s; animation-delay: -80s; opacity: .5; }
@keyframes drift { from { transform: translateX(-320px); } to { transform: translateX(110vw); } }
#sky .pl { position: absolute; width: 150px; filter: drop-shadow(0 6px 6px rgba(0,30,60,.25)); animation: fly linear infinite; }
#sky .p1 { top: 26%; animation-duration: 22s; } #sky .p2 { top: 12%; width: 90px; animation-duration: 34s; animation-delay: -14s; opacity: .85; } #sky .p3 { top: 44%; width: 70px; animation-duration: 28s; animation-delay: -6s; opacity: .7; }
@keyframes fly { from { transform: translate(-200px, 60px) rotate(-6deg); } to { transform: translate(110vw, -80px) rotate(-6deg); } }
#sky .city { position: absolute; left: 0; right: 0; bottom: 70px; height: 90px; background:
  linear-gradient(0deg, #29405c 0 100%) 4% 100% / 60px 70px no-repeat, linear-gradient(0deg, #2e4766 0 100%) 10% 100% / 40px 50px no-repeat, linear-gradient(0deg, #253a55 0 100%) 18% 100% / 90px 40px no-repeat,
  linear-gradient(0deg, #2b4361 0 100%) 74% 100% / 50px 80px no-repeat, linear-gradient(0deg, #263c58 0 100%) 82% 100% / 120px 36px no-repeat, linear-gradient(0deg, #30496a 0 100%) 92% 100% / 30px 64px no-repeat,
  linear-gradient(0deg, #34506f 0 100%) 50% 100% / 420px 34px no-repeat; opacity: .75; }
#sky .runway { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(180deg, #3d5a3a, #2c4529 40%, #3a3f46 40%, #2f3339); display: flex; justify-content: space-around; align-items: flex-end; padding-bottom: 14px; }
#sky .runway i { width: 7px; height: 7px; border-radius: 50%; background: #ffe08a; box-shadow: 0 0 10px 3px rgba(255,224,138,.7); animation: rl 2.4s infinite; }
#sky .runway i:nth-child(2n) { animation-delay: .2s; } #sky .runway i:nth-child(3n) { animation-delay: .4s; } #sky .runway i:nth-child(4n) { animation-delay: .6s; }
@keyframes rl { 50% { opacity: .35; } }

/* confetti */
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
#confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: translateX(60px) rotate(720deg); } }

@media (max-width: 1200px) { .bgoals { display: none; } .binfo { min-width: 190px; } #board { width: 350px; } .brow { grid-template-columns: 40px 54px 1fr 14px 30px 40px 80px; font-size: 11px; } #quest { width: 250px; } }
@media (max-width: 900px) { .bbtns button { width: 56px; font-size: 10px; } .adv { display: none; } #board { width: 300px; } .lvgrid { grid-template-columns: repeat(2, 1fr); } .cands { grid-template-columns: 1fr; } .cols, .charts { grid-template-columns: 1fr; } }
.ulist { display: flex; flex-direction: column; gap: 5px; }
.upg { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; background: var(--pan2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.upg .ic { font-size: 24px; } .upg.own { border-color: var(--good); background: rgba(43,138,62,.14); }
#win h4:first-of-type { margin-top: 4px; }
[hidden] { display: none !important; }

/* ===================================================== aanraken & kleine schermen */
#view { touch-action: none; height: calc(100vh - var(--bar) - env(safe-area-inset-bottom)); }
@supports (height: 100dvh) { #view { height: calc(100dvh - var(--bar) - env(safe-area-inset-bottom)); } }
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
#bar { height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.mob { display: none !important; }
#tt { position: fixed; right: 10px; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 12px); z-index: 19; display: flex; flex-direction: column; gap: 8px; }
#tt button { width: 62px; height: 62px; border-radius: 50%; border: 3px solid #ffd166; background: linear-gradient(#ffb703, #e29100); color: #1b1b1b; font-size: 24px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.45); cursor: pointer; line-height: 1; }
#tt button small { font-size: 9px; font-weight: 700; margin-top: 2px; }
#modeBar i { font-style: normal; opacity: .75; }

@media (max-width: 820px), (max-height: 520px) {
  :root { --bar: 64px; }
  body { font-size: 12px; }
  #bar { gap: 4px; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .binfo { min-width: 0; width: 104px; flex: 0 0 104px; padding: 3px 6px; font-size: 10px; border-radius: 8px; }
  .binfo .money { font-size: 14px; }
  .binfo div:last-child { display: none; }
  .bbtns { flex: 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 4px; -webkit-overflow-scrolling: touch; }
  .bbtns::-webkit-scrollbar { display: none; }
  .bbtns button { flex: 0 0 50px; width: 50px; font-size: 9px; border-radius: 8px; padding: 0; }
  .bbtns button span { font-size: 19px; }
  .mob { display: flex !important; }
  .bmid { flex: 0 0 auto; }
  .bgoals, .adv { display: none !important; }
  .speed button { padding: 6px 7px; font-size: 12px; }
  .speed button[data-v="2"] { display: none; }
  #bar .menu { width: 40px; flex: 0 0 40px; font-size: 18px; border-radius: 8px; }

  #board { top: 6px; right: 6px; left: 6px; width: auto; max-height: 46dvh; border-width: 2px; }
  .bhead { padding: 7px 10px; font-size: 13px; }
  .brow { grid-template-columns: 40px 58px 18px 34px 1fr; font-size: 11px; padding: 5px 8px; }
  .brow span:nth-child(3), .brow span:nth-child(6) { display: none; }

  #toasts { top: 50px; left: 6px; right: 6px; max-width: none; }
  .toast { font-size: 12px; padding: 6px 10px; }
  #modeBar { top: 50px; left: 6px; right: 6px; transform: none; max-width: none; font-size: 12px; padding: 7px 10px; text-align: center; }
  #modeBar:not([hidden]) ~ #toasts { top: 100px; }

  #win { left: 6px; right: 6px; transform: none; width: auto; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 6px); max-height: 56dvh; padding: 10px; border-radius: 12px; }
  #win.compact { max-height: 34dvh; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; }
  .card { padding: 7px 3px; } .card .ic { font-size: 22px; } .card b { font-size: 11px; } .card small { font-size: 10px; }
  .flist { grid-template-columns: 1fr; }
  .cands { grid-template-columns: 1fr; }
  .cand { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .srow { grid-template-columns: 1fr 70px 60px; } .srow span:last-child { display: none; }
  .cols { grid-template-columns: 1fr; }
  .bk { grid-template-columns: 30px 1fr; } .bk .cnt { grid-column: 2; text-align: left; }
  .upg { grid-template-columns: 30px 1fr; } .upg > :last-child { grid-column: 2; justify-self: start; }

  #insp { left: 6px; right: 6px; width: auto; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 6px); max-height: 42dvh; overflow-y: auto; padding: 8px 10px; font-size: 12px; }
  #tt { bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 10px); }
  #win:not([hidden]) ~ #tt, #insp:not([hidden]) ~ #tt { bottom: auto; top: 96px; }
  #tt button { width: 54px; height: 54px; font-size: 21px; }

  .mbox { padding: 16px 14px; border-radius: 14px; max-height: 94dvh; width: 96vw; }
  .mbox h2 { font-size: 20px; }
  .title { font-size: 32px; } .lead { font-size: 13px; }
  .two { grid-template-columns: 1fr; }
  .lvgrid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .opt { flex-direction: column; align-items: flex-start; gap: 6px; }
  .btn.big { padding: 9px 14px; font-size: 14px; }
  .btn { padding: 8px 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --bar: 56px; }
  #board { left: auto; width: 330px; max-height: 70dvh; }
  #win { left: 50%; right: auto; transform: translateX(-50%); width: min(640px, 96vw); max-height: 70dvh; }
  #insp { left: 6px; right: auto; width: 290px; max-height: 70dvh; }
  #toasts { right: auto; width: 320px; top: 6px; }
  #modeBar { top: 6px; left: 50%; right: auto; transform: translateX(-50%); max-width: 50vw; }
  #win:not([hidden]) ~ #tt, #insp:not([hidden]) ~ #tt { top: auto; bottom: calc(var(--bar) + 10px); }
}

/* telefoon staand: balk in twee rijen zodat alle knoppen zichtbaar zijn */
@media (max-width: 820px) and (orientation: portrait) {
  :root { --bar: 118px; }
  #bar { flex-wrap: wrap; align-content: flex-start; row-gap: 6px; }
  .binfo { order: 1; flex: 1 1 0; min-width: 0; width: auto; height: 42px; flex-direction: row; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
  .binfo div:last-child { display: none; }
  .bmid { order: 2; height: 42px; justify-content: center; }
  #bar .menu { order: 3; height: 42px; }
  .bbtns { order: 4; flex: 1 1 100%; overflow: visible; display: flex; height: 56px; }
  .bbtns button { flex: 1 1 0; min-width: 0; width: auto; height: 56px; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .bbtns button span { font-size: 18px; }
}
@media (max-width: 820px), (max-height: 520px) {
  #tt { z-index: 45; top: 30dvh; bottom: auto !important; }
  #win:not([hidden]) ~ #tt, #insp:not([hidden]) ~ #tt { top: 30dvh; }
}
@media (max-height: 520px) and (orientation: landscape) { #tt { top: 22dvh; } }

.btns.sticky { position: sticky; bottom: -12px; background: var(--pan); padding: 8px 0 4px; margin-bottom: -4px; z-index: 1; }

/* v2: kleine schermen */
@media (max-width: 820px), (max-height: 520px) {
  #mini { display: none !important; }
  #toasts { left: 6px; right: 6px; transform: none; width: auto; align-items: stretch; }
  #quest { left: 6px; right: auto; top: auto; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 6px); width: min(300px, 70vw); font-size: 12px; }
  body:has(#insp:not([hidden])) #quest, body:has(#win:not([hidden])) #quest { display: none; }
  .title { font-size: 36px; } .logo .lp { width: 56px; height: 56px; font-size: 30px; border-radius: 16px; }
  .slot { grid-template-columns: 1fr auto auto; } .slot .sn { grid-column: 1 / -1; }
  .mrow { grid-template-columns: repeat(2, 1fr); }
  .achs { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  #sky .sun { width: 90px; height: 90px; }
}

/* ---------------------------------------------------------------- engine additions */
#sky .lawn { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(180deg, #4f7d3f, #33572a); }
#sky .hero { position: absolute; bottom: 52px; font-size: 92px; line-height: 1; filter: drop-shadow(0 10px 10px rgba(0,30,60,.3)); }
#sky .hero.h1 { left: 8%; } #sky .hero.h2 { right: 9%; font-size: 70px; animation: bob 3s ease-in-out infinite; } #sky .hero.h3 { left: 30%; font-size: 54px; bottom: 60px; animation: bob 4s ease-in-out infinite -1.5s; }
#sky .walker { position: absolute; bottom: 30px; font-size: 34px; animation: walk linear infinite; }
#sky .walker.w1 { animation-duration: 26s; } #sky .walker.w2 { animation-duration: 34s; animation-delay: -12s; } #sky .walker.w3 { animation-duration: 30s; animation-delay: -22s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes walk { from { left: -60px; } to { left: calc(100% + 60px); } }
#board { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); width: 300px; }
.gb { padding: 4px 0 6px; }
.gb .gl { display: flex; justify-content: space-between; gap: 8px; padding: 4px 12px; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,.04); }
.gb .gl b { font-variant-numeric: tabular-nums; color: var(--acc2); }
.gb .gl.bad b, .gb .gl.bad span { color: var(--bad); } .gb .gl.good b { color: var(--good); }
.gb .gsub { padding: 6px 12px 2px; font-size: 11px; letter-spacing: 1px; color: var(--warn); text-transform: uppercase; }
.gb .gemg { margin: 4px 8px 6px; padding: 7px 10px; border-radius: 10px; background: linear-gradient(90deg, rgba(224,49,49,.35), rgba(224,49,49,.12)); border: 1px solid rgba(255,107,107,.6); font-size: 12px; animation: pulse 1.6s infinite; }
.gb .gbar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; margin: 0 12px 4px; } .gb .gbar div { height: 100%; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 rgba(255,107,107,0); } 50% { box-shadow: 0 0 14px rgba(255,107,107,.45); } }
table.cases { width: 100%; margin-top: 8px; } table.cases th { text-align: left; font-size: 11px; color: var(--mut); font-weight: 600; padding: 4px; } table.cases td { vertical-align: top; padding: 6px 4px; }
table.cases td.fee { white-space: nowrap; } table.cases td.fee b { display: inline-block; min-width: 62px; text-align: center; } table.cases td.fee small { display: block; text-align: center; }
.btn.sm2 { padding: 1px 8px; min-width: 0; font-size: 13px; }
.gauge { display: flex; gap: 6px; align-items: center; } .gauge input[type=range] { flex: 1; }
.menulist { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; align-items: center; }
.menulist .on { color: var(--good); }
@media (max-width: 700px) { #board { width: auto; } }

/* furnish window: compact, never covers most of the room */
#win.compact { max-height: 38vh; }
#win.compact .flist { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 820px) { #win.compact { max-height: 34dvh; } #win.compact .flist { grid-template-columns: 1fr 1fr; } #win.compact .fobj { grid-template-columns: 24px 1fr auto; } #win.compact .fobj .pr { display: none; } }
/* series signature in every menu */
.kseries { display: block; text-align: center; margin: 12px auto -2px; font-size: 10.5px; letter-spacing: .06em; opacity: .42; color: inherit; text-decoration: none; white-space: nowrap; }
.kseries b { font-weight: 800; letter-spacing: .03em; }
.kseries:hover { opacity: .85; text-decoration: underline; }


/* ---------- Bistro Boss theme ---------- */
/* =========================================================================
   Bistro Boss theme: "chalkboard bistro"
   Chalkboard panels in a wooden frame, chalk handwriting for headings,
   cream paper menu cards and order tickets, a red-and-white tablecloth,
   and a polished wooden bar counter as the bottom bar.
   ========================================================================= */
body.g-restaurant {
  --ink: #f3efe6; --mut: #b9b3a3; --pan: #1e2723; --pan2: rgba(255,255,255,.06); --line: rgba(243,239,230,.14); --line2: rgba(243,239,230,.3);
  --acc: #ffb84d; --acc2: #ffd8a8; --good: #8ce99a; --bad: #ff8787; --warn: #ffd43b; --prim: #c92a2a; --prim2: #fa5252; --r: 10px;
  --chalk: 'Segoe Print', 'Bradley Hand', 'Chalkboard SE', 'Comic Neue', 'Noteworthy', cursive;
  --serif: Georgia, 'Palatino Linotype', 'Book Antiqua', 'Times New Roman', serif;
  --board: radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.05), transparent 55%), radial-gradient(ellipse at 80% 90%, rgba(255,255,255,.04), transparent 50%), linear-gradient(160deg, #26332d, #1a2420);
  --wood: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 46px), linear-gradient(180deg, #8a5a36, #6b4226 55%, #57331c);
  --frame: 0 0 0 5px #7a4b2a, 0 0 0 7px #4a2a14, 0 0 0 8px rgba(255,220,170,.15);
  --cloth: repeating-conic-gradient(#d63031 0 25%, #fff5f5 0 50%) 0 0 / 14px 14px;
  --paper: linear-gradient(180deg, #fffaf0, #f6ecd8);
  --glass: var(--board); --shadow: var(--frame), 0 18px 40px rgba(0,0,0,.55);
  background: #2a1a12; font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}
body.g-restaurant ::-webkit-scrollbar-thumb { background: rgba(243,239,230,.25); }

/* ---------- chalkboard panels in a wooden frame ---------- */
body.g-restaurant #win, body.g-restaurant #insp, body.g-restaurant #quest {
  background: var(--board); border: 0; border-radius: 6px; box-shadow: var(--shadow); color: var(--ink); backdrop-filter: none;
}
body.g-restaurant #win { margin-bottom: 8px; }
body.g-restaurant .wh b, body.g-restaurant .ih b, body.g-restaurant #win h4, body.g-restaurant .mbox h2 { font-family: var(--chalk); font-weight: 700; color: #fffdf5; text-shadow: 0 0 1px rgba(255,255,255,.6), 0 0 6px rgba(255,255,255,.12); letter-spacing: .3px; }
body.g-restaurant .wh b, body.g-restaurant .ih b { font-size: 18px; }
body.g-restaurant .wh, body.g-restaurant .ih { border-bottom: 2px solid rgba(255,255,255,.12); padding-bottom: 6px; margin-bottom: 9px; }
body.g-restaurant #win h4 { font-size: 16px; color: #ffd8a8; }
body.g-restaurant #win h4::before { content: '~ '; opacity: .6; } body.g-restaurant #win h4::after { content: ' ~'; opacity: .6; }
body.g-restaurant .wh span, body.g-restaurant .ih span { font-family: var(--chalk); font-size: 18px; color: #ffd8a8; }
body.g-restaurant .pbar { background: rgba(0,0,0,.35); border: 1px dashed rgba(255,255,255,.2); }

/* paper-tag buttons with stitching; primary = tomato red */
body.g-restaurant .btn { background: var(--paper); color: #4a2a14; border: 1px solid #d9c3a0; border-radius: 6px; font-weight: 700;
  box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px rgba(122,75,42,.35), 0 2px 0 #8a6a45; }
body.g-restaurant .btn:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
body.g-restaurant .btn.primary { background: linear-gradient(180deg, #e03131, #b02525); color: #fff; border-color: #861d1d; box-shadow: inset 0 0 0 3px #e03131, inset 0 0 0 4px rgba(255,255,255,.45), 0 2px 0 #6a1414; }
body.g-restaurant .btn.danger { background: #3b2a24; color: #ffc9c9; border-color: #6a3a2e; box-shadow: inset 0 0 0 3px #3b2a24, inset 0 0 0 4px rgba(255,135,135,.35), 0 2px 0 #1e1410; }
body.g-restaurant .btn:disabled { opacity: .45; }

/* tablecloth tabs */
body.g-restaurant .tabs button { background: transparent; border: 1px dashed rgba(255,255,255,.25); color: #e8e1d2; border-radius: 6px; font-family: var(--chalk); }
body.g-restaurant .tabs button.on { background: linear-gradient(180deg, #e03131, #b02525) top / 100% calc(100% - 6px) no-repeat, var(--cloth); color: #fff; border: 1px solid #861d1d; font-weight: 700; padding-bottom: 9px; }

/* cards: little menu cards pinned to the board */
body.g-restaurant .card { background: var(--paper); color: #3b2a1a; border: 0; border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,.4); position: relative; padding-top: 12px; }
body.g-restaurant .card::before { content: ''; position: absolute; top: 3px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8787, #c92a2a); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
body.g-restaurant .card:nth-child(3n+1) { transform: rotate(-1deg); } body.g-restaurant .card:nth-child(3n+2) { transform: rotate(.8deg); }
body.g-restaurant .card:hover:not(:disabled) { transform: rotate(0) translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,.45); }
body.g-restaurant .card b { font-family: var(--serif); } body.g-restaurant .card small { color: #8a5a36; font-weight: 700; }
body.g-restaurant .card.lock { filter: grayscale(.8) brightness(.8); opacity: .65; }
body.g-restaurant .fobj, body.g-restaurant .cand, body.g-restaurant .srow, body.g-restaurant ul.goals li, body.g-restaurant .ach, body.g-restaurant .box, body.g-restaurant .slot, body.g-restaurant .opt { background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.22); color: var(--ink); }
body.g-restaurant .fobj.on { border: 2px solid #ffd8a8; background: rgba(255,216,168,.12); }
body.g-restaurant table.led td { border-bottom: 1px dashed rgba(255,255,255,.14); }
body.g-restaurant table.led tr.tot td { border-top: 2px solid rgba(255,255,255,.5); font-family: var(--chalk); }
body.g-restaurant .msgs div { border-bottom: 1px dashed rgba(255,255,255,.14); }
body.g-restaurant ul.goals li.ok { border: 1px solid #8ce99a; background: rgba(140,233,154,.08); }
body.g-restaurant kbd { background: var(--paper); color: #4a2a14; border-color: #d9c3a0; box-shadow: 0 2px 0 #8a6a45; }
body.g-restaurant .stars, body.g-restaurant .rate .rfg { color: #ffd43b; }

/* the menu window is a real menu card */
body.g-restaurant #win[data-w=menu] { background: linear-gradient(180deg, #fffaf0, #f3e6cc); color: #3b2a1a; box-shadow: 0 0 0 6px #fffaf0, 0 0 0 8px #c9a46c, 0 0 0 9px #fffaf0, 0 18px 40px rgba(0,0,0,.55); font-family: var(--serif); }
body.g-restaurant #win[data-w=menu] .wh { border-bottom: 3px double #c9a46c; justify-content: center; position: relative; }
body.g-restaurant #win[data-w=menu] .wh b { color: #7a1f1f; font-size: 26px; text-shadow: none; }
body.g-restaurant #win[data-w=menu] .wh span { position: absolute; right: 0; color: #7a4b2a; }
body.g-restaurant #win[data-w=menu] h4 { color: #7a1f1f; text-align: center; font-size: 19px; text-shadow: none; }
body.g-restaurant #win[data-w=menu] .sm { color: #7d6a55; } body.g-restaurant #win[data-w=menu] .sm.bad, body.g-restaurant #win[data-w=menu] small.bad { color: #c92a2a; }
body.g-restaurant #win[data-w=menu] table.led td { border-bottom: 1px dotted #c9a46c; color: #3b2a1a; }
body.g-restaurant #win[data-w=menu] table.cases td.fee b { color: #7a1f1f; font-size: 15px; }
body.g-restaurant #win[data-w=menu] .btn { box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px rgba(122,75,42,.35), 0 1px 0 #8a6a45; }

/* quest panel: the chef's prep list */
body.g-restaurant #quest .qh { background: linear-gradient(180deg, #e03131, #b02525) top / 100% calc(100% - 6px) no-repeat, var(--cloth); color: #fff; font-family: var(--chalk); padding-bottom: 12px; } body.g-restaurant #quest .qh span { color: #ffe3e3; }
body.g-restaurant #quest li { font-family: var(--chalk); color: #e8e1d2; } body.g-restaurant #quest li.cur { color: #ffd8a8; background: rgba(255,216,168,.08); } body.g-restaurant #quest li.ok { color: #8ce99a; text-decoration: line-through; text-decoration-color: rgba(140,233,154,.5); }
body.g-restaurant #quest .qbar { background: rgba(0,0,0,.35); } body.g-restaurant #quest .qbar div { background: repeating-linear-gradient(90deg, #e03131 0 10px, #fff 10px 20px); }

/* ---------- order rail: steel rail with paper tickets ---------- */
body.g-restaurant #board { width: 340px; background: transparent; border: 0; box-shadow: none; color: #3b2a1a; overflow: visible; }
body.g-restaurant .bhead { background: linear-gradient(180deg, #dee2e6, #adb5bd 55%, #868e96); color: #212529; border: 0; border-radius: 6px; box-shadow: 0 3px 0 #495057, 0 8px 18px rgba(0,0,0,.45); font-family: var(--chalk); }
body.g-restaurant .bhead span { color: #343a40; }
body.g-restaurant .brows.gb { background: transparent; padding: 6px 4px 2px; max-height: calc(100vh - var(--bar) - 260px); }
body.g-restaurant .gb .gl { background: var(--paper); color: #3b2a1a; border: 0; border-radius: 2px 2px 8px 8px; margin: 0 6px 6px; padding: 6px 10px 7px; box-shadow: 0 3px 6px rgba(0,0,0,.4); position: relative; border-bottom: 2px dashed rgba(122,75,42,.35); }
body.g-restaurant .gb .gl::before { content: ''; position: absolute; top: -4px; left: 50%; width: 22px; height: 7px; margin-left: -11px; background: linear-gradient(180deg, #ced4da, #868e96); border-radius: 2px; }
body.g-restaurant .gb .gl.rail:nth-child(odd) { transform: rotate(-.6deg); } body.g-restaurant .gb .gl.rail:nth-child(even) { transform: rotate(.5deg); }
body.g-restaurant .gb .gl b { color: #7a1f1f; } body.g-restaurant .gb .gl.bad span, body.g-restaurant .gb .gl.bad b { color: #c92a2a; }
body.g-restaurant .gb .gl .sm { color: #7d6a55; }
body.g-restaurant .gb .tk { background: rgba(59,42,26,.08); } body.g-restaurant .gb .tk.cook { background: rgba(255,146,43,.35); } body.g-restaurant .gb .tk.ready, body.g-restaurant .gb .tk.carry { background: rgba(64,192,87,.35); }
body.g-restaurant .gb .tk.wait { color: #a33a00; background: rgba(255,212,59,.45); }
body.g-restaurant .gb .tno { background: #3b2a1a; color: #fffaf0 !important; font-family: var(--chalk); }

/* ---------- wooden bar counter (bottom bar) ---------- */
body.g-restaurant #bar { background: var(--wood); border-top: 0; box-shadow: 0 -4px 0 #c08a5a, 0 -6px 0 #4a2a14, 0 -12px 28px rgba(0,0,0,.5); }
body.g-restaurant #bar::before { height: 3px; opacity: .8; background: linear-gradient(90deg, transparent, #ffe8cc, transparent); }
body.g-restaurant .binfo { background: var(--board); border: 3px solid #4a2a14; border-radius: 6px; color: #e8e1d2; font-family: var(--chalk); }
body.g-restaurant .binfo .money { color: #fffdf5; font-family: var(--chalk); text-shadow: 0 0 6px rgba(255,255,255,.25); }
body.g-restaurant .bbtns button { background: var(--paper); color: #4a2a14; border: 1px solid #d9c3a0; border-radius: 6px; box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px rgba(122,75,42,.3), 0 3px 0 #3a2210; font-family: var(--serif); font-weight: 700; }
body.g-restaurant .bbtns button:hover { background: #fffaf0; box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px rgba(122,75,42,.3), 0 5px 0 #3a2210; }
body.g-restaurant .bbtns button.on { background: linear-gradient(180deg, #e03131, #b02525); color: #fff; border-color: #861d1d; box-shadow: inset 0 0 0 3px #e03131, inset 0 0 0 4px rgba(255,255,255,.45), 0 3px 0 #3a2210; }
body.g-restaurant .bgoals span { background: var(--board); border: 1px solid #4a2a14; color: #e8e1d2; font-family: var(--chalk); }
body.g-restaurant .bgoals span.ok { color: #8ce99a; border-color: #8ce99a; }
body.g-restaurant .speed { background: var(--board); border: 2px solid #4a2a14; border-radius: 6px; }
body.g-restaurant .speed button { color: #b9b3a3; } body.g-restaurant .speed button:hover { color: #fff; }
body.g-restaurant .speed button.on { background: linear-gradient(180deg, #e03131, #b02525) top / 100% calc(100% - 4px) no-repeat, var(--cloth); color: #fff; }
body.g-restaurant .adv { background: var(--paper); color: #3b2a1a; border: 1px solid #d9c3a0; border-radius: 4px; box-shadow: 0 3px 0 #3a2210; font-family: var(--serif); font-style: italic; }
body.g-restaurant #bar .menu { background: var(--board); color: #fffdf5; border: 3px solid #4a2a14; border-radius: 6px; }

/* small floating bits: little paper notes */
body.g-restaurant #tip { background: var(--paper); color: #3b2a1a; border: 1px solid #d9c3a0; border-radius: 3px; }
body.g-restaurant #tip .bad { color: #c92a2a; }
body.g-restaurant #modeBar { background: var(--board); color: #fffdf5; box-shadow: 0 0 0 3px #7a4b2a, 0 6px 20px rgba(0,0,0,.45); font-family: var(--chalk); }
body.g-restaurant #modeBar b { color: #ffd8a8; }
body.g-restaurant .toast { background: var(--paper); color: #3b2a1a; border: 0; border-left: 6px solid #c92a2a; border-radius: 3px; box-shadow: 0 8px 18px rgba(0,0,0,.45); }
body.g-restaurant .toast.good { border-left-color: #2f9e44; } body.g-restaurant .toast.warn { border-left-color: #f59f00; }
body.g-restaurant .toast .bad { color: #c92a2a; } body.g-restaurant .toast .good { color: #2b8a3e; }
body.g-restaurant .toast.achv { background: linear-gradient(90deg, #fff3bf, #fffaf0); border-left-color: #f59f00; }
body.g-restaurant .achT small, body.g-restaurant .achT i { color: #7d6a55; }
body.g-restaurant #tt button { background: var(--paper); color: #4a2a14; border-color: #d9c3a0; }

/* ---------- menus: a chalkboard sign under a striped awning ---------- */
body.g-restaurant #modal { background: rgba(20,10,5,.6); }
body.g-restaurant .mbox { background: var(--board); color: var(--ink); border: 0; border-radius: 6px; box-shadow: 0 0 0 8px #7a4b2a, 0 0 0 11px #4a2a14, 0 30px 80px rgba(0,0,0,.6); }
body.g-restaurant .mbox p, body.g-restaurant .mbox .sub { color: #d8d1c0; }
body.g-restaurant .mbox h2 { font-size: 30px; }
body.g-restaurant .mbox.start { background: var(--board); backdrop-filter: none; padding-top: 52px; position: relative; overflow-x: hidden; }
body.g-restaurant .mbox.start::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 28px;
  background: repeating-linear-gradient(90deg, #e03131 0 24px, #fff5f5 24px 48px);
  -webkit-mask: linear-gradient(#000, #000) top / 100% 16px no-repeat, radial-gradient(circle 12px at 12px 14px, #000 97%, transparent 100%) 0 0 / 24px 100% repeat-x;
  mask: linear-gradient(#000, #000) top / 100% 16px no-repeat, radial-gradient(circle 12px at 12px 14px, #000 97%, transparent 100%) 0 0 / 24px 100% repeat-x;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
body.g-restaurant .logo .lp { background: var(--paper); border-radius: 50%; box-shadow: 0 0 0 4px #fffaf0, 0 0 0 7px #c92a2a, 0 10px 24px rgba(0,0,0,.5); }
body.g-restaurant .title { font-family: var(--chalk); color: #fffdf5; font-weight: 700; text-shadow: 0 0 2px rgba(255,255,255,.7), 0 0 14px rgba(255,255,255,.18); letter-spacing: 1px; }
body.g-restaurant .title span { background: none; color: #ffb84d; -webkit-text-fill-color: #ffb84d; text-decoration: underline wavy rgba(255,184,77,.6); text-underline-offset: 10px; }
body.g-restaurant .lead { color: #e8e1d2; font-family: var(--serif); font-style: italic; }
body.g-restaurant .ver { color: #9c9584; }
body.g-restaurant .lv { background: var(--paper); color: #3b2a1a; border: 0; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.45); }
body.g-restaurant .lv:nth-child(odd) { transform: rotate(-1.2deg); } body.g-restaurant .lv:nth-child(even) { transform: rotate(1deg); }
body.g-restaurant .lv:hover:not(.locked) { transform: rotate(0) translateY(-4px); }
body.g-restaurant .lv b { font-family: var(--serif); } body.g-restaurant .lv small, body.g-restaurant .lv .lvmeta { color: #7d6a55; }
body.g-restaurant .lv .n { background: #c92a2a; color: #fff; font-family: var(--chalk); box-shadow: 0 0 0 3px #fffaf0, 0 0 0 4px #c92a2a; }
body.g-restaurant .lv.won .n { background: #2f9e44; box-shadow: 0 0 0 3px #fffaf0, 0 0 0 4px #2f9e44; }
body.g-restaurant .lv em { color: #7a1f1f; }
body.g-restaurant .lv.locked { filter: grayscale(.9) brightness(.75); }
body.g-restaurant .seg input:checked + span { background: linear-gradient(180deg, #e03131, #b02525) top / 100% calc(100% - 6px) no-repeat, var(--cloth); color: #fff; font-weight: 700; }
body.g-restaurant .tgl.on .sw { background: #c92a2a; }
body.g-restaurant .endt { font-family: var(--chalk); } body.g-restaurant .endt.win { color: #8ce99a; }
body.g-restaurant .hsform input { background: var(--paper); color: #3b2a1a; border: 1px solid #d9c3a0; }
body.g-restaurant #sky { background: linear-gradient(180deg, #4a1d3f 0%, #b2456e 40%, #f7a072 72%, #ffe8cc 100%); }
body.g-restaurant #sky .sun { background: radial-gradient(circle, #fff3bf 0%, #ff922b 45%, rgba(255,146,43,0) 70%); top: 30%; }

/* ---------- game-specific bits (order rail tickets, reviews) ---------- */
.gb .gl.rail { cursor: pointer; align-items: center; }
.gb .tno { display: inline-block; min-width: 26px; padding: 0 4px; border-radius: 5px; font-size: 11px; text-align: center; }
.gb .tks { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.gb .tk { position: relative; font-style: normal; padding: 1px 4px; border-radius: 6px; font-size: 13px; overflow: hidden; white-space: nowrap; }
.gb .tk.queue { opacity: .55; } .gb .tk.done { background: transparent; opacity: .7; font-size: 11px; }
.gb .tk.wait { font-size: 11px; }
.gb .tk u { position: absolute; left: 0; bottom: 0; height: 2px; background: #e8590c; text-decoration: none; }
.revhead { display: flex; align-items: center; gap: 10px; margin: 8px 0; } .revhead b { font-size: 26px; font-family: var(--chalk); }
.revs { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px; }
.rev { display: grid; grid-template-columns: 80px 1fr; gap: 2px 10px; padding: 8px 10px; border-radius: 3px; background: var(--paper); color: #3b2a1a; box-shadow: 0 3px 6px rgba(0,0,0,.35); }
.rev:nth-child(odd) { transform: rotate(-.5deg); } .rev small { grid-column: 2; color: #7d6a55; } .rev i { font-family: var(--serif); } .rev .stars { color: #e8590c; } .rev .stars .sm { color: #d9c3a0; }
