/* ==========================================================================
   Kubus Hotel — eigen stijl: donkerblauwe vensters, gele accenten, blokkig.
   ========================================================================== */
:root {
  --navy: #2b2f4a;
  --navy-2: #3b4166;
  --navy-3: #4d5580;
  --yellow: #ffd166;
  --orange: #e0613a;
  --berry: #b5395a;
  --paper: #f5f1e8;
  --paper-2: #e9e3d4;
  --ink: #23263a;
  --muted: #6f7086;
  --ok: #3f9d5a;
  --bad: #c8453a;
  --radius: 8px;
  font-family: Verdana, Tahoma, 'DejaVu Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c1f33; }
[hidden] { display: none !important; }
h2, h3, h4 { margin: 6px 0; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--navy-3); margin-top: 12px; }
p { margin: 6px 0; }
a.link { color: #2d63b5; cursor: pointer; }

/* ── Formulieren & knoppen ─────────────────────────────────────────────── */
.input {
  font: inherit; padding: 6px 8px; border: 2px solid #b9b3a4; border-radius: 6px;
  background: #fff; color: var(--ink); min-width: 0; flex: 1;
}
.input:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 2px rgba(255, 209, 102, .6); }
.input.color { padding: 2px; height: 30px; width: 56px; flex: 0 0 56px; }
.input.amount { flex: 0 0 60px; }
select.input { padding: 5px; }
.btn {
  font: inherit; font-weight: bold; cursor: pointer; padding: 6px 12px; border-radius: 6px;
  border: 2px solid var(--navy); background: linear-gradient(#fff, #e3dfd3); color: var(--ink);
  box-shadow: 0 2px 0 var(--navy); transition: transform .05s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(#ffe29a, var(--yellow)); }
.btn.danger { background: linear-gradient(#f39a8f, #de6b5e); color: #fff; }
.btn.small { padding: 4px 8px; font-size: 11px; }
.btn.tiny { padding: 1px 5px; font-size: 10px; box-shadow: none; }
.btn.big { width: 100%; padding: 10px; font-size: 14px; }
.row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; flex: 1; }
.field > span { font-weight: bold; font-size: 11px; color: var(--navy-2); }
.muted { color: var(--muted); }
.small { font-size: 10px; }
.error { color: var(--bad); }
.tag { display: inline-block; font-size: 10px; background: var(--paper-2); border: 1px solid #cfc7b3; border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.tag.staff { background: var(--yellow); border-color: var(--navy); }
.coin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: 3px;
  background: radial-gradient(circle at 35% 35%, #fff6c9, #f4c542 45%, #b9861a); border: 1px solid #8a6412;
}
.badge {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px;
  color: #fff; font-size: 15px; border: 2px solid var(--navy); text-shadow: 0 1px 0 rgba(0, 0, 0, .4); flex: 0 0 28px;
}

/* ── Inlogscherm ───────────────────────────────────────────────────────── */
#auth { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.auth-bg { position: absolute; inset: 0; background: url(/assets/hotel-view.svg) center bottom / cover no-repeat; filter: saturate(1.1); }
.auth-card {
  position: relative; width: min(380px, calc(100vw - 32px)); background: var(--paper); border: 3px solid var(--navy);
  border-radius: 14px; padding: 18px 22px; box-shadow: 0 10px 0 rgba(20, 22, 40, .45), 0 20px 50px rgba(0, 0, 0, .35);
  max-height: calc(100vh - 32px); overflow: auto;
}
.logo { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.tagline { text-align: center; color: var(--navy-2); font-weight: bold; }
.auth-form h2 { color: var(--navy); }
.auth-links { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; align-items: center; }
.form-msg { min-height: 16px; margin: 6px 0; font-weight: bold; }
.form-msg.error { color: var(--bad); }
.form-msg.success { color: var(--ok); }

/* ── Hotel ─────────────────────────────────────────────────────────────── */
#hotel { position: fixed; inset: 0; }
#hotel-view { position: absolute; inset: 0 0 52px 0; background: url(/assets/hotel-view.svg) center bottom / cover no-repeat; }
.logo.corner { position: absolute; left: 16px; top: 12px; margin: 0; }
.hotel-view-hint {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(43, 47, 74, .85);
  color: #fff; padding: 8px 14px; border-radius: 20px; white-space: nowrap;
}
#room-ui { position: absolute; inset: 0 0 52px 0; background: #11131f; }
#room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#room-bar {
  position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; align-items: center; background: rgba(43, 47, 74, .9);
  color: #fff; padding: 6px 10px; border-radius: var(--radius); border: 2px solid #15172a; max-width: calc(100% - 24px);
}
.room-bar-name { font-weight: bold; color: var(--yellow); }
.room-bar-owner { font-size: 10px; opacity: .85; }
#zoom-controls { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
#placement-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--yellow); border: 2px solid var(--navy);
  border-radius: var(--radius); padding: 6px 10px; display: flex; gap: 6px; align-items: center; z-index: 5;
}
#chat-bar {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(620px, calc(100% - 20px));
  display: flex; gap: 6px; background: rgba(43, 47, 74, .92); padding: 6px; border-radius: 10px; border: 2px solid #15172a;
}
.chat-mode.shout { background: linear-gradient(#fff3c4, #ffd166); }
.chat-mode.whisper { background: linear-gradient(#f2eeff, #cfc3ff); }
#chat-history {
  position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); width: min(620px, calc(100% - 20px));
  max-height: 200px; overflow-y: auto; background: rgba(245, 241, 232, .95); border: 2px solid var(--navy); border-radius: var(--radius); padding: 6px;
}
.chat-line { padding: 2px 0; border-bottom: 1px dotted #d8d1bf; }
.chat-line.shout { font-weight: bold; }
.chat-line.whisper { font-style: italic; color: #5b4bb0; }
.chat-time { color: var(--muted); margin-right: 6px; font-size: 10px; }

.side-panel {
  position: absolute; right: 12px; bottom: 70px; width: 270px; background: var(--paper); border: 3px solid var(--navy);
  border-radius: var(--radius); padding: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); z-index: 4;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel-row { display: flex; gap: 8px; align-items: flex-start; }
.panel-text { flex: 1; }
.furni-icon { width: 70px; height: 70px; background: var(--paper-2); border-radius: 6px; flex: 0 0 70px; }
.card-avatar { width: 60px; height: 96px; background: linear-gradient(#dfe9f3, #b9cbe0); border-radius: 6px; flex: 0 0 60px; }
.motto { font-style: italic; color: var(--navy-2); }
.mod-row { border-top: 1px dashed #cfc7b3; padding-top: 6px; }

/* ── Werkbalk ──────────────────────────────────────────────────────────── */
#toolbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; justify-content: space-between; align-items: center;
  padding: 0 8px; background: linear-gradient(var(--navy-2), var(--navy)); border-top: 3px solid #15172a; z-index: 50; gap: 8px;
}
.tool-group { display: flex; gap: 2px; align-items: center; overflow-x: auto; }
.tool-group.right { gap: 8px; flex-shrink: 0; }
.tool {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: none;
  border: 0; color: #fff; cursor: pointer; padding: 3px 8px; border-radius: 6px; font: inherit; text-decoration: none; min-width: 58px;
}
.tool:hover { background: rgba(255, 255, 255, .12); }
.tool-icon { font-size: 20px; line-height: 22px; }
.tool-label { font-size: 10px; }
.count-badge {
  position: absolute; top: 0; right: 6px; background: var(--orange); color: #fff; border-radius: 8px; font-size: 10px; padding: 0 5px; border: 1px solid #fff;
}
.wallet { background: #15172a; color: var(--yellow); padding: 5px 10px; border-radius: 14px; font-weight: bold; }
.btn.bonus { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 209, 102, .5); } }
.conn { font-size: 10px; color: #aab; white-space: nowrap; }
.conn.ok { color: #8fe3a4; }
.conn.bad { color: #ff9c8f; }

/* ── Vensters ─────────────────────────────────────────────────────────── */
#windows { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.window {
  position: absolute; pointer-events: auto; background: var(--paper); border: 3px solid var(--navy); border-radius: 10px;
  box-shadow: 0 6px 0 rgba(20, 22, 40, .45), 0 12px 30px rgba(0, 0, 0, .3); max-height: calc(100vh - 80px); display: flex; flex-direction: column;
  max-width: calc(100vw - 16px);
}
.win-header {
  display: flex; justify-content: space-between; align-items: center; background: linear-gradient(var(--navy-3), var(--navy));
  color: #fff; padding: 6px 8px 6px 12px; border-radius: 6px 6px 0 0; cursor: move; user-select: none; touch-action: none;
}
.win-title { font-weight: bold; color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-close {
  background: var(--orange); color: #fff; border: 2px solid #15172a; border-radius: 5px; width: 22px; height: 22px; line-height: 16px;
  font-weight: bold; cursor: pointer; padding: 0; font-size: 14px; flex: 0 0 22px;
}
.win-body { padding: 10px; overflow-y: auto; }
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 12, 25, .55); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.window.modal { position: relative; width: min(360px, calc(100vw - 32px)); }
.tabs { display: flex; gap: 3px; border-bottom: 3px solid var(--navy); margin-bottom: 8px; flex-wrap: wrap; }
.tab {
  font: inherit; font-weight: bold; background: var(--paper-2); border: 2px solid var(--navy); border-bottom: 0; border-radius: 6px 6px 0 0;
  padding: 5px 9px; cursor: pointer; color: var(--navy-2);
}
.tab.active { background: var(--navy); color: var(--yellow); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chip { font: inherit; background: #fff; border: 2px solid #c9c1ad; border-radius: 12px; padding: 3px 9px; cursor: pointer; }
.chip.active { border-color: var(--navy); background: var(--yellow); font-weight: bold; }

/* Navigator */
.nav-toolbar .nav-extra { margin-bottom: 6px; }
.room-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.room-row {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 5px 8px; cursor: pointer;
}
.room-row:hover { border-color: var(--navy); background: #fffbea; }
.room-occupancy {
  width: 36px; height: 22px; border-radius: 4px; border: 2px solid var(--navy); display: flex; align-items: center; justify-content: center;
  font-weight: bold; background: linear-gradient(90deg, #8fe3a4 calc(var(--fill) * 100%), #eee calc(var(--fill) * 100%));
}
.room-row-main { flex: 1; min-width: 0; }
.room-row-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-row-sub { font-size: 10px; color: var(--muted); }
.room-row-go { font-size: 18px; color: var(--navy-3); }
.layout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.layout-option { font: inherit; background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.layout-option.active { border-color: var(--navy); background: #fff5d1; }
.layout-preview { width: 100%; max-width: 120px; height: auto; }

/* Winkel & inventaris */
.shop-layout { display: flex; gap: 10px; }
.shop-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; align-content: start; max-height: 50vh; overflow-y: auto; }
.shop-item {
  font: inherit; position: relative; background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
}
.shop-item.active { border-color: var(--navy); background: #fff5d1; }
.shop-icon { width: 60px; height: 60px; }
.shop-item .count { position: absolute; right: 4px; bottom: 2px; font-weight: bold; color: var(--navy); }
.shop-detail { width: 170px; flex: 0 0 170px; text-align: center; }
.detail-icon { width: 120px; height: 120px; background: var(--paper-2); border-radius: 8px; }
.price { font-weight: bold; white-space: nowrap; }
.price.big { font-size: 14px; }
.clothing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.clothing-item { background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 6px; text-align: center; }
.clothing-preview { width: 60px; height: 90px; background: linear-gradient(#dfe9f3, #b9cbe0); border-radius: 6px; }
.clothing-name { font-weight: bold; }

/* Avatar-editor */
.avatar-editor { display: flex; gap: 12px; }
.avatar-left { display: flex; flex-direction: column; gap: 4px; align-items: stretch; flex: 0 0 160px; }
.avatar-preview { width: 160px; height: 220px; border: 2px solid var(--navy); border-radius: 8px; }
.avatar-right { flex: 1; min-width: 0; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; }
.style-option { font: inherit; background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 6px 4px; cursor: pointer; }
.style-option.active { border-color: var(--navy); background: var(--yellow); font-weight: bold; }
.style-option.locked { opacity: .65; }
.style-option .price { display: block; font-size: 10px; }
.palette { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 24px; height: 24px; border-radius: 5px; border: 2px solid #fff; outline: 1px solid #aaa; cursor: pointer; padding: 0; font-size: 13px; background: #fff; }
.swatch.active { outline: 3px solid var(--navy); }
.swatch.symbol { width: 28px; height: 28px; }

/* Vrienden, groepen, profiel */
.friend-row, .group-row { display: flex; align-items: center; gap: 8px; padding: 5px; border-bottom: 1px solid #e0d9c7; }
.group-row { cursor: pointer; }
.group-row:hover { background: #fffbea; }
.friend-row.online .friend-main::before { content: '● '; color: var(--ok); }
.friend-main { flex: 1; min-width: 0; }
.friend-actions { display: flex; gap: 3px; }
.head-icon { width: 30px; height: 30px; background: var(--paper-2); border-radius: 6px; flex: 0 0 30px; }
.profile { display: flex; gap: 12px; }
.profile-avatar { width: 90px; height: 140px; background: linear-gradient(#dfe9f3, #b9cbe0); border-radius: 8px; border: 2px solid var(--navy); flex: 0 0 90px; }
.profile-info { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tx-list { max-height: 200px; overflow-y: auto; }
.tx-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px; padding: 3px 0; border-bottom: 1px dotted #d8d1bf; }
.tx-amount { color: var(--ok); font-weight: bold; }
.tx-amount.neg { color: var(--bad); }
.member-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.member { display: flex; gap: 4px; align-items: center; }
.member.online::before { content: '●'; color: var(--ok); }

/* Messenger */
.chat-window .win-body { display: flex; flex-direction: column; }
.chat-log { height: 260px; overflow-y: auto; background: #fff; border: 2px solid #d9d2c0; border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.pm { align-self: flex-start; max-width: 80%; background: var(--paper-2); border-radius: 8px 8px 8px 2px; padding: 5px 8px; }
.pm.mine { align-self: flex-end; background: #fff3c4; border-radius: 8px 8px 2px 8px; }
.pm-body { word-wrap: break-word; }
.pm-time { font-size: 9px; color: var(--muted); text-align: right; }

/* Toasts */
#toasts { position: fixed; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2000; max-width: min(340px, calc(100vw - 24px)); }
.toast {
  background: var(--paper); border: 3px solid var(--navy); border-radius: var(--radius); padding: 8px 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
  animation: slidein .2s ease-out; cursor: pointer;
}
.toast.success { border-color: var(--ok); }
.toast.error { border-color: var(--bad); background: #fff0ee; }
.toast-actions { display: flex; gap: 4px; margin-top: 6px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

@media (max-width: 640px) {
  .tool { min-width: 44px; padding: 3px 4px; }
  .tool-label { display: none; }
  .conn { display: none; }
  .shop-layout, .avatar-editor { flex-direction: column; }
  .shop-detail { width: auto; flex: none; }
  .avatar-left { flex: none; align-items: center; }
  .side-panel { left: 12px; right: 12px; width: auto; }
}
