:root{
  --teal:#1f7a72; --teal-d:#155a54; --teal-l:#d7efeb;
  --coral:#e0644f; --cream:#fbf6ec; --ink:#23312f; --muted:#6b7a77;
  --ok:#2e9d6a; --warn:#e3a33b; --bad:#d64a3a;
  --shadow:0 6px 20px rgba(20,40,38,.18);
  --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#9cc27a;font-family:"Nunito","Segoe UI",system-ui,-apple-system,sans-serif;color:var(--ink);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
canvas#game{position:fixed;inset:0;width:100%;height:100%;touch-action:none;display:block}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}

/* Bovenbalk */
#topbar{position:fixed;top:0;left:0;right:0;display:flex;align-items:center;gap:10px;padding:8px 12px;background:rgba(251,246,236,.94);box-shadow:var(--shadow);z-index:10;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:6px;font-weight:800;color:var(--teal);font-size:18px}
.brand svg{width:30px;height:18px;color:var(--coral)}
.stats{display:flex;gap:8px;flex-wrap:wrap}
.stat{background:#fff;border-radius:10px;padding:4px 10px;font-weight:700;box-shadow:inset 0 0 0 1px #e6dccb;white-space:nowrap}
.stat .ico{color:var(--teal);margin-right:4px}
.stat.neg #money{color:var(--bad)}
.speed{display:flex;background:#fff;border-radius:10px;overflow:hidden;box-shadow:inset 0 0 0 1px #e6dccb}
.speed button{padding:5px 9px;font-size:12px;letter-spacing:-2px;min-width:38px}
.speed button.active{background:var(--teal);color:#fff}
.ver{font-size:12px;font-weight:800;color:var(--muted);background:#fff;border-radius:8px;padding:3px 8px;box-shadow:inset 0 0 0 1px #e6dccb}
.open-btn{margin-left:auto;background:var(--coral);color:#fff;font-weight:800;padding:7px 14px;border-radius:10px;box-shadow:0 3px 0 #b44c3a}
.admin-btn{background:#2f3b3a;color:#fff;font-weight:800;font-size:13px;padding:6px 10px;border-radius:10px;box-shadow:0 3px 0 #1a2120}
.admin-btn.hidden{display:none}
.admrow{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;align-items:center}.admrow input{width:130px;padding:6px 8px;border:1px solid #d9ccb6;border-radius:8px;font:inherit}
@media (max-width:600px){.admin-btn .t{display:none}.admin-btn{padding:6px 8px}}
.admintable{width:100%;border-collapse:collapse;font-size:12px}.admintable th,.admintable td{text-align:left;padding:4px 5px;border-bottom:1px solid #eee3d2;white-space:nowrap}.admintable td.em{max-width:190px;overflow:hidden;text-overflow:ellipsis}
.open-btn.is-open{background:var(--teal);box-shadow:0 3px 0 var(--teal-d)}

/* Werkbalk */
#toolbar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + var(--safe-b));display:flex;gap:4px;background:rgba(251,246,236,.96);padding:6px;border-radius:16px;box-shadow:var(--shadow);z-index:10;max-width:calc(100vw - 16px);overflow-x:auto}
#toolbar button{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 8px;border-radius:12px;font-size:12px;font-weight:700;min-width:62px}
#toolbar button .ti{font-size:20px;line-height:1}
#toolbar button.active{background:var(--teal);color:#fff}
#toolbar button:hover:not(.active){background:var(--teal-l)}

.sub{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(86px + var(--safe-b));display:flex;gap:6px;background:#fff;padding:8px;border-radius:14px;box-shadow:var(--shadow);z-index:10;max-width:calc(100vw - 16px);overflow-x:auto}
.sub button{display:flex;flex-direction:column;align-items:flex-start;padding:7px 10px;border-radius:10px;background:var(--cream);font-size:13px;font-weight:700;min-width:104px;white-space:nowrap;box-shadow:inset 0 0 0 1px #eadfcc}
.sub button small{font-weight:600;color:var(--muted)}
.sub button.rot{background:var(--coral);color:#fff;box-shadow:none;min-width:80px}
.sub button.rot small{color:#ffe3dc}
.sub button.active{background:var(--teal);color:#fff;box-shadow:none}
.sub button.active small{color:#d7efeb}
.sub .sw{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}

.hint{position:fixed;left:50%;transform:translateX(-50%);top:64px;background:rgba(35,49,47,.86);color:#fff;padding:7px 14px;border-radius:20px;font-size:13px;z-index:9;max-width:92vw;text-align:center;pointer-events:none}

/* Doelen */
.goals{position:fixed;left:10px;top:64px;width:260px;background:rgba(251,246,236,.95);border-radius:14px;box-shadow:var(--shadow);z-index:8;font-size:13px;overflow:hidden}
.goals h3{margin:0;padding:8px 12px;font-size:14px;background:var(--teal);color:#fff;display:flex;justify-content:space-between;align-items:center;cursor:pointer}
.goals ul{list-style:none;margin:0;padding:6px 10px 10px}
.goals li{padding:4px 0 4px 24px;position:relative;line-height:1.3}
.goals li::before{content:"";position:absolute;left:2px;top:5px;width:14px;height:14px;border-radius:50%;border:2px solid #b9c7c4}
.goals li.done{color:var(--muted);text-decoration:line-through}
.goals li.done::before{background:var(--ok);border-color:var(--ok)}
.goals li.next{font-weight:800}
.gprog{font-weight:600;font-size:12px;color:var(--muted);margin-top:3px}.gprog .gbar{height:6px;border-radius:3px;background:#e6dccb;overflow:hidden;margin-bottom:2px}.gprog .gbar i{display:block;height:100%;background:var(--teal)}.gprog .ok{color:var(--ok)}.gprog .low{color:#b23b2b}
.goals.collapsed ul{display:none}

/* Meldingen */
#toasts{position:fixed;right:10px;top:64px;display:flex;flex-direction:column;gap:8px;z-index:12;width:310px;max-width:calc(100vw - 20px)}
.toast{background:#fff;border-left:5px solid var(--teal);border-radius:10px;padding:9px 12px;box-shadow:var(--shadow);font-size:13px;animation:tin .25s ease}
.toast.warn{border-color:var(--warn)}
.toast.bad{border-color:var(--bad)}
.toast.good{border-color:var(--ok)}
.toast button{margin-top:6px;background:var(--teal);color:#fff;border-radius:8px;padding:4px 10px;font-weight:700;font-size:12px}
@keyframes tin{from{opacity:0;transform:translateY(-6px)}to{opacity:1}}

body.panel-open #toasts{right:400px}
/* Paneel */
.panel{position:fixed;right:10px;top:64px;bottom:calc(92px + var(--safe-b));width:380px;max-width:calc(100vw - 20px);background:var(--cream);border-radius:16px;box-shadow:var(--shadow);z-index:11;display:flex;flex-direction:column;overflow:hidden}
.panel header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--teal);color:#fff}
.panel h2{margin:0;font-size:17px}
.panel header button{color:#fff;font-size:18px;padding:2px 6px}
#panelBody{overflow-y:auto;padding:12px 14px;font-size:14px;line-height:1.4;-webkit-user-select:text;user-select:text}
.hidden{display:none!important}

.card{background:#fff;border-radius:12px;padding:10px 12px;margin-bottom:10px;box-shadow:inset 0 0 0 1px #eadfcc}
.card h4{margin:0 0 4px;font-size:15px}
.row{display:flex;justify-content:space-between;align-items:center;gap:8px}
.muted{color:var(--muted)}
.small{font-size:12px}
.btn{background:var(--teal);color:#fff;border-radius:9px;padding:6px 12px;font-weight:800;font-size:13px}
.btn.coral{background:var(--coral)}
.btn.ghost{background:#fff;color:var(--teal);box-shadow:inset 0 0 0 2px var(--teal)}
.btn.bad{background:var(--bad)}
.btn:disabled{opacity:.45;cursor:default}
.bar{height:7px;background:#e8e1d4;border-radius:4px;overflow:hidden;margin:3px 0}
.bar i{display:block;height:100%;background:var(--teal)}
.bar.pat i{background:var(--ok)}
.statline{display:grid;grid-template-columns:110px 1fr 30px;gap:6px;align-items:center;font-size:12px}
.tag{display:inline-block;padding:1px 8px;border-radius:10px;background:var(--teal-l);color:var(--teal-d);font-size:12px;font-weight:700;margin:2px 3px 2px 0}
.tag.bad{background:#fbe1dc;color:#9c2f22}
.tag.no{background:#eee;color:#888;text-decoration:line-through}
.prob{display:grid;grid-template-columns:1fr 46px auto;gap:8px;align-items:center;margin:5px 0}
.prob .bar{margin:0}
.section-title{font-weight:800;margin:12px 0 6px;color:var(--teal-d)}
.problems li{color:var(--bad)}
.tabs{display:flex;gap:6px;margin-bottom:10px;flex-wrap:wrap}
.tabs button{padding:5px 10px;border-radius:9px;background:#fff;font-weight:700;font-size:13px;box-shadow:inset 0 0 0 1px #eadfcc}
.tabs button.active{background:var(--teal);color:#fff;box-shadow:none}
input[type=range]{width:100%;accent-color:var(--teal)}

/* Telefoon */
@media (max-width:700px){
  #topbar{gap:6px;padding:6px 8px}
  .brand span{display:none}
  .stat{padding:3px 7px;font-size:13px}
  .speed button{min-width:30px;padding:4px 6px}
  .open-btn{padding:6px 10px;font-size:13px}
  .ver{font-size:10px;padding:2px 5px}
  .goals{top:auto;left:8px;bottom:calc(84px + var(--safe-b));width:auto;max-width:calc(100vw - 16px);font-size:12px}
  .goals h3{font-size:12px;padding:6px 10px;gap:8px}
  .goals ul{max-height:38vh;overflow-y:auto}
  #toasts,body.panel-open #toasts{top:104px;right:8px;width:calc(100vw - 16px)}
  .toast{padding:7px 10px;font-size:12px}
  .panel{left:0;right:0;top:auto;bottom:0;width:100%;max-width:100%;height:64vh;border-radius:18px 18px 0 0;padding-bottom:var(--safe-b)}
  #toolbar{bottom:calc(6px + var(--safe-b));gap:2px;padding:4px}
  #toolbar button{min-width:42px;padding:4px 3px;font-size:10px}
  #toolbar button .ti{font-size:18px}
  #toolbar .desk-only{display:none}
  .sub{bottom:calc(68px + var(--safe-b))}
  .sub button{min-width:92px;font-size:12px;padding:6px 8px}
  .hint{top:auto;bottom:calc(128px + var(--safe-b));font-size:12px}
  .hint.nosub{bottom:calc(120px + var(--safe-b))}
}
@media (min-width:701px){ .mob-only{display:none!important} }

/* Inloggen en overzicht */
.overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:16px;background:linear-gradient(160deg,rgba(215,239,235,.92),rgba(251,236,226,.92));-webkit-user-select:text;user-select:text}
.login-card{background:var(--cream);border-radius:22px;box-shadow:var(--shadow);padding:22px 22px 16px;width:360px;max-width:100%;display:flex;flex-direction:column;gap:6px}
.login-card .logo{text-align:center;margin-bottom:8px;color:var(--teal)}
.login-card .logo svg{width:70px;height:40px;color:var(--teal)}
.login-card .l1{font-size:34px;font-weight:900;color:#1d4f4a;line-height:1}
.login-card .l2{font-size:26px;font-weight:900;font-style:italic;color:var(--coral);line-height:1.1}
.login-card label{font-weight:800;font-size:14px;margin-top:6px}
.login-card input{font:inherit;font-size:16px;padding:10px 12px;border-radius:12px;border:2px solid #d9cfbe;background:#fff}
.login-card input:focus{outline:none;border-color:var(--teal)}
.btn.big{font-size:18px;padding:12px;border-radius:14px;margin-top:10px}
.linkbtn{color:var(--coral);font-weight:800;text-decoration:underline;padding:8px}
.lerr{color:var(--bad);font-size:13px;min-height:18px;text-align:center}
.away-card h2{margin:0 0 6px;color:var(--teal-d)}

.stattable{width:100%;border-collapse:collapse;font-size:12px}
.stattable th{text-align:right;color:var(--muted);font-weight:800;padding:2px 4px}
.stattable td{text-align:right;padding:3px 4px;border-top:1px solid #f0e8da;white-space:nowrap}
.stattable td:first-child,.stattable th:first-child{text-align:left}
.stattable tr.sum td{border-top:2px solid #e6dccb}

.angrylist div{padding:3px 0;border-bottom:1px solid #eee3d2}.angrylist div:last-child{border-bottom:0}
.chips{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-top:6px}.chips .lbl{font-size:12px;color:var(--muted);font-weight:700;min-width:58px}
.chip{border:1.5px solid #d9ccb6;background:#fff;border-radius:999px;padding:4px 10px;font:inherit;font-size:12px;font-weight:700;color:#5b5346;cursor:pointer}
.chip.on{background:var(--teal);border-color:var(--teal);color:#fff}
.staffcard.off{opacity:.7;background:#f3eee5}
.fundtag{display:inline-block;color:#fff;border-radius:6px;padding:1px 6px;font-size:11px;font-weight:800}
.stars{color:#e3a12f;font-size:15px;letter-spacing:1px}
.card.fund .ok{color:var(--ok)}.card.fund .low{color:#b23b2b}
.goals .ctrhead{font-size:12px;font-weight:800;color:var(--muted);margin:8px 0 2px;text-transform:uppercase;letter-spacing:.04em}
.goals li.ctr{cursor:pointer;font-size:13px}.goals li.ctr i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.goals li.ctr .ok{color:var(--ok)}.goals li.ctr .low{color:#b23b2b}
.goals li.ctr{padding-left:2px}.goals li.ctr::before{display:none}
.goals .ctrhead{padding:0 12px;border-top:1px solid #eee3d2;padding-top:8px}
.dia-stat{cursor:pointer;font:inherit;font-weight:700;color:inherit}.dia-stat:hover{box-shadow:inset 0 0 0 1.5px var(--teal)}
.shop-btn{background:#f2c14e;color:#3a2c05;font-weight:800;font-size:14px;padding:7px 12px;border-radius:12px;box-shadow:0 3px 0 #c99a25}
@media (max-width:600px){.shop-btn .t{display:none}.shop-btn{padding:6px 9px}}
.boostbar{display:inline-flex;gap:4px}.boostbar .boost{background:#fff5d6;border-radius:9px;padding:3px 7px;font-size:12px;font-weight:800;box-shadow:inset 0 0 0 1px #f0d98a;white-space:nowrap}
.shophead{font-size:15px;margin-bottom:8px}
.shopitem{display:flex;gap:10px;align-items:center}.shopitem .si-ico{font-size:28px;width:38px;text-align:center}.shopitem .si-txt{flex:1}
.shopitem .btn{min-width:84px;line-height:1.1}.shopitem .btn small{font-weight:700;opacity:.9}
.shopitem .ok{color:var(--ok);font-weight:700}
.funds-btn{background:#fff;color:var(--teal);font-weight:800;font-size:14px;padding:7px 12px;border-radius:12px;box-shadow:inset 0 0 0 1.5px var(--teal);position:relative}
.funds-btn.hidden{display:none}.funds-btn b{position:absolute;top:-6px;right:-6px;background:var(--teal);color:#fff;border-radius:9px;font-size:11px;min-width:18px;padding:1px 4px}.funds-btn b:empty{display:none}
@media (max-width:600px){.funds-btn .t{display:none}.funds-btn{padding:6px 9px}}
.boostbar .boost i{font-style:normal}
@media (max-width:600px){.boostbar .boost i{display:none}.boostbar .boost{padding:3px 4px}.boostbar{gap:2px}}
.card.fund .earn{background:#eaf6ef;border-radius:8px;padding:5px 8px;margin-top:6px;font-size:13px}
.card.fund .cost{background:#fbeeea;border-radius:8px;padding:5px 8px;margin-top:4px;font-size:13px}
.trustrow{margin-top:2px;gap:8px}.trustrow .chip{white-space:nowrap;flex-shrink:0}.trustrow .chip[disabled]{opacity:.5}
.works-btn{background:#fff3e0;color:#9a5a12;font-weight:800;font-size:14px;padding:7px 10px;border-radius:12px;box-shadow:inset 0 0 0 1.5px #e8913a;position:relative}
.works-btn.hidden{display:none}.works-btn b{margin-left:3px}
.spotlegend{display:flex;flex-direction:column;justify-content:center;gap:3px;font-size:11px;font-weight:700;color:var(--muted);padding:0 8px;white-space:nowrap}.spotlegend i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:4px;opacity:.7;vertical-align:-1px}
.stattable.bill td{text-align:left}.stattable.bill td:last-child{text-align:right;white-space:nowrap}.stattable.bill td:first-child{color:var(--muted);white-space:nowrap}.stattable.bill tr.tot td{border-top:2px solid #e6dccb}
.card.log div{padding:2px 0;border-bottom:1px solid #f1ebe0}.card.log div:last-child{border-bottom:0}
.objbtns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.objbtns .btn{display:flex;flex-direction:column;align-items:center;padding:10px 6px;line-height:1.15}.objbtns .btn small{font-weight:600;opacity:.85;font-size:11px;margin-top:2px}
.login-card h3{margin:2px 0 2px;font-size:19px;color:#1d4f4a}.login-card .fhint{font-size:12px;color:#7a6f60;margin-top:-2px}.lmode{display:flex;flex-direction:column;gap:6px}.lmode.hidden{display:none}.lrow{display:flex;justify-content:space-between;flex-wrap:wrap}.codein{text-align:center;font-size:26px!important;letter-spacing:10px;font-weight:900}.login-card{max-height:calc(100vh - 32px);overflow:auto}
.clinicname{font-size:13px;font-weight:800;color:#7a6f60;margin-left:8px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width:700px){.clinicname{display:none}}
.confirmbar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(150px + var(--safe-b));z-index:12;background:#fffaf0;border:3px solid var(--teal);border-radius:16px;box-shadow:var(--shadow);padding:10px 12px;width:min(440px,calc(100vw - 16px));display:flex;flex-direction:column;gap:8px}
.confirmbar.danger{border-color:#d64a3a}.confirmbar .cbtext{font-size:14px;line-height:1.35}.confirmbar .cbtext b{font-size:15px}.confirmbar .warn{color:#b2452f;font-weight:800;font-size:13px}
.confirmbar .cbbtns{display:flex;gap:8px}.confirmbar .cbbtns .btn{flex:1;padding:12px;font-size:16px}#cbYes{background:#2e9e5b;color:#fff}#cbNo{background:#d64a3a;color:#fff;border-color:#d64a3a}#cbRot{flex:.8}
@media (max-width:700px){.confirmbar{bottom:calc(126px + var(--safe-b))}}
.mchip{background:#e8f4f1;border:2px solid var(--teal);color:#1d4f4a;border-radius:10px;padding:3px 8px;font-weight:800;font-size:12px;white-space:nowrap;cursor:pointer}.mchip.hidden{display:none}
.mission-card{text-align:center}.mission-card .micon{font-size:54px;line-height:1}.mission-card h2{margin:4px 0}.mission-card p{font-size:16px;line-height:1.4}.mission-card .mbtns{display:flex;gap:8px}.mission-card .mbtns .btn{flex:1}
#missionPop{background:rgba(20,40,38,.45)}
.roomfurn{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:4px}.roomfurn .rf{background:#fff;border:2px solid #e4dccd;border-radius:12px;padding:7px 8px;text-align:left;display:flex;flex-direction:column;cursor:pointer}.roomfurn .rf b{font-size:13px}.roomfurn .rf small{font-size:11px;color:#7a6f60;font-weight:700}.roomfurn .rf.miss{border-color:#e0644f;background:#fff4f0}.roomfurn .rf.miss small{color:#c0503c}.roomfurn .rf:hover{border-color:var(--teal)}
.coinfly{position:fixed;left:0;top:0;width:18px;height:18px;border-radius:50%;pointer-events:none;z-index:60;background:radial-gradient(circle at 35% 35%,#fff6c4 0,#ffd54a 35%,#e0a516 75%,#b07a0a 100%);box-shadow:0 0 10px 4px rgba(255,205,60,.55),0 0 22px 8px rgba(255,220,120,.25);opacity:0}
.payfloat{position:fixed;transform:translate(-50%,-100%);pointer-events:none;z-index:61;font-weight:900;font-size:14px;color:#2e9e5b;text-shadow:0 1px 0 #fff,0 0 6px rgba(255,255,255,.9);animation:payup 1.3s ease-out forwards}
@keyframes payup{0%{opacity:0;margin-top:0}15%{opacity:1}100%{opacity:0;margin-top:-34px}}
.bump{animation:bump .45s ease}@keyframes bump{0%{transform:scale(1)}35%{transform:scale(1.14);box-shadow:0 0 14px 4px rgba(255,205,60,.6)}100%{transform:scale(1)}}

.langpick{text-align:center;margin:-2px 0 6px;font-size:13px;color:#7a6f60}.langpick select{font:inherit;padding:2px 6px;border-radius:8px;border:1px solid #d8cdb8;background:#fff}
