/* PixelEiland stijl. Kleuren staan bovenaan als variabelen: pas ze hier aan. */
:root {
  --ink: #1d2330;
  --ink-deep: #0d1118;
  --sea: #1f7893;
  --sea-light: #3aa3bb;
  --sea-deep: #0e4760;
  --driftwood: #8a5a3a;
  --bellhop: #c23f38;
  --bellhop-dark: #8f2b27;
  --brass: #e2aa3b;
  --brass-dark: #a8791f;
  --brass-light: #f3d185;
  --paper: #edf1f0;
  --card: #ffffff;
  --mist: #b8c6c9;
  --line: #7d8d92;
  --muted: #536166;
  --good: #4f9a62;
  --shadow: 4px 4px 0 rgba(10, 20, 25, 0.45);
  --radius: 6px;
  --bar-h: 60px;
  --font: Verdana, "DejaVu Sans", Geneva, Tahoma, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* de zee rondom het eiland, met lichte golfstrepen */
  background:
    repeating-linear-gradient(172deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 37px),
    radial-gradient(ellipse at 50% 38%, var(--sea-light) 0%, var(--sea) 45%, var(--sea-deep) 92%);
  color: var(--ink);
  font: 12px/1.4 var(--font);
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

canvas.pix { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

#room {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
}

/* ------------------------------------------------------------------ knoppen */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--brass);
  color: var(--ink);
  font-weight: bold;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 60ms, box-shadow 60ms, filter 120ms;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.5; box-shadow: none; }
.btn-primary { background: var(--bellhop); color: #fff; }
.btn-danger { background: var(--card); color: var(--bellhop); border-color: var(--bellhop); box-shadow: 0 2px 0 var(--bellhop-dark); }
.btn-small { padding: 3px 9px; font-size: 11px; }
.btn-wide { width: 100%; padding: 9px 12px; font-size: 13px; }
.btn.active { background: var(--ink); color: #fff; }
.btn.tool-door.active { background: var(--brass); color: var(--ink); }
.ok-note { margin: 4px 0; color: var(--good); font-weight: bold; }

.linkbtn {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--bellhop-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

input {
  width: 100%;
  padding: 7px 9px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
input:focus { border-color: var(--ink); outline: 2px solid var(--brass); outline-offset: 0; }
select {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
select:focus { border-color: var(--ink); outline: 2px solid var(--brass); outline-offset: 0; }
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
textarea:focus { border-color: var(--ink); outline: 2px solid var(--brass); outline-offset: 0; }

/* ---------------------------------------------------------- sleutelkaart */
.login {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(8, 40, 54, 0.38);
}

.keycard {
  width: min(360px, 100%);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 rgba(10, 20, 25, 0.5);
  overflow: hidden;
  background: var(--paper);
  animation: card-in 380ms cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes card-in { from { transform: translateY(24px) rotate(-3deg); opacity: 0; } }

.keycard-face {
  position: relative;
  height: 128px;
  padding: 14px 18px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px),
    var(--bellhop);
  border-bottom: 2px solid var(--ink);
  color: #fff;
}
.keycard-brand { display: flex; flex-direction: column; gap: 2px; }
.keycard-label {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.keycard-name {
  font-size: 28px;
  font-weight: bold;
  line-height: 1.1;
  text-shadow: 2px 2px 0 var(--bellhop-dark);
  overflow-wrap: anywhere;
  padding-right: 52px;
}
.keycard-chip {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 28px;
  border: 2px solid var(--brass-dark);
  border-radius: 5px;
  background:
    linear-gradient(var(--brass-dark), var(--brass-dark)) 50% 0 / 2px 100% no-repeat,
    linear-gradient(var(--brass-dark), var(--brass-dark)) 0 50% / 100% 2px no-repeat,
    var(--brass);
}
.keycard-stripe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 22px;
  background: var(--ink);
  border-top: 2px solid var(--ink-deep);
}

.keycard-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; }
.keycard-body label { font-weight: bold; margin-top: 6px; }
.tagline { margin: 0 0 4px; color: var(--muted); }
.form-error { margin: 6px 0 2px; min-height: 1em; color: var(--bellhop); font-weight: bold; }
.form-error:empty { display: none; }
.keycard-body .btn-wide { margin-top: 10px; }
.keycard-body .linkbtn { align-self: center; margin-top: 4px; }
.login-status { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.login-info {
  margin: 0 0 2px;
  padding: 8px 10px;
  background: #fff9ea;
  border: 2px solid var(--brass);
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.45;
}
.login-info.ok { background: #eaf5ec; border-color: var(--good); }
.login-status:empty { display: none; }

/* --------------------------------------------------------------- hotelhal */
.hotelview {
  position: fixed;
  inset: 0 0 calc(var(--bar-h) + var(--safe-b)) 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 40, 54, 0.4);
}
.hv-sign {
  text-align: center;
  color: #fff;
  /* houten bord */
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 22px),
    var(--driftwood);
  border: 3px solid var(--brass);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px 28px 20px;
  max-width: 100%;
}
.hv-name {
  font-size: 30px;
  font-weight: bold;
  color: var(--brass);
  text-shadow: 2px 2px 0 var(--ink-deep);
  overflow-wrap: anywhere;
}
.hv-sign p { margin: 6px 0 14px; color: var(--mist); }

/* ------------------------------------------------------------------- HUD */
.plaque {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  max-width: min(330px, calc(100vw - 170px));
  padding: 8px 16px 10px;
  background: linear-gradient(var(--brass-light), var(--brass) 45%);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.plaque::before, .plaque::after, .plaque-screws::before, .plaque-screws::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass-dark);
}
.plaque::before { top: 4px; left: 4px; }
.plaque::after { top: 4px; right: 4px; }
.plaque-screws::before { bottom: 4px; left: 4px; }
.plaque-screws::after { bottom: 4px; right: 4px; }
.plaque-name { margin: 0; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.plaque-sub { font-size: 11px; color: #5a4210; }
.plaque .btn { margin-top: 6px; background: var(--card); }

.wallet {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  background: var(--ink);
  color: #fff;
  font-weight: bold;
  border: 2px solid var(--ink-deep);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-light) 0 25%, var(--brass) 26%);
  border: 2px solid var(--brass-dark);
}

.placebar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 7px 10px 7px 12px;
  background: var(--ink);
  color: #fff;
  border-left: 4px solid var(--brass);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.infostand {
  position: fixed;
  right: 12px;
  bottom: calc(var(--bar-h) + var(--safe-b) + 12px);
  z-index: 12;
  width: 210px;
  padding: 10px 12px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.info-title { font-weight: bold; font-size: 13px; padding-right: 22px; overflow-wrap: anywhere; }
.info-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  font-weight: bold;
}
.info-img {
  display: grid;
  place-items: center;
  min-height: 90px;
  margin: 8px 0;
  padding: 6px;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
}
.infostand p { margin: 0 0 6px; overflow-wrap: anywhere; }
.info-motto { font-style: italic; }
.muted { color: var(--muted); }
.info-note { color: var(--muted); font-size: 11px; }
.info-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.info-pet { min-height: 76px; }
.pet-cmds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.pet-cmds .btn { padding: 3px 4px; }
.dance-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.dance-btns .btn { padding: 4px; }
.dance-stop-btn { grid-column: 1 / -1; color: var(--bellhop); }
.infostand .hint { margin: 8px 0 0; }

/* ------------------------------------------------------------ knoppenbalk */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--bar-h);
  padding: 4px 10px calc(4px + var(--safe-b));
  background: var(--ink);
  border-top: 2px solid var(--ink-deep);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.06) inset;
}
.bar-group { display: flex; gap: 2px; }
.bar-right { margin-left: auto; }
.bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 62px;
  padding: 4px 6px 3px;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: #fff;
  font-size: 10px;
}
.bar-btn svg { width: 32px; height: 32px; color: #f2efe6; }
.bar-btn:hover { background: rgba(255, 255, 255, 0.08); }
.bar-btn:active svg { transform: translateY(1px); }

.chat {
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 540px;
  margin: 0 auto;
}
.chat input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--ink-deep);
  border-radius: 999px;
  padding: 7px 14px;
}
.chat input:disabled { background: #cfd8d7; }
.chat .btn { border-radius: 999px; }
.chat { position: relative; }
.dance-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  border: 2px solid var(--ink-deep);
  border-radius: 999px;
  background: var(--brass);
  color: var(--ink);
}
.dance-btn svg { width: 18px; height: 18px; }
.dance-btn:disabled { background: #6d7686; color: #3a4250; }
.dance-btn[aria-expanded="true"] { background: #fff; }
.dance-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dance-title { padding: 0 4px 4px; font-weight: bold; }
.dance-item {
  padding: 7px 10px;
  border: 2px solid var(--mist);
  border-radius: 6px;
  background: var(--card);
  text-align: left;
  font-weight: bold;
}
.dance-item:hover, .dance-item:focus-visible { border-color: var(--ink); }
.dance-item.active { background: var(--brass); border-color: var(--ink); }
.dance-stop { color: var(--bellhop); }

/* ---------------------------------------------------------------- vensters */
.win {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - var(--bar-h) - 40px);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: win-in 140ms ease-out;
}
.win:focus { outline: none; }
@keyframes win-in { from { transform: scale(0.96); opacity: 0; } }
.win-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px 6px 12px;
  background: var(--bellhop);
  color: #fff;
  border-bottom: 2px solid var(--ink);
  border-radius: 4px 4px 0 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.win.dragging .win-head { cursor: grabbing; }
.win-title { flex: 1; margin: 0; font-size: 13px; text-shadow: 1px 1px 0 var(--bellhop-dark); }
.win-close {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 16px;
  font-size: 16px;
  font-weight: bold;
  background: var(--brass);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.win-body { padding: 12px; overflow: auto; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tab {
  padding: 5px 10px;
  background: #dbe3e2;
  border: 2px solid var(--mist);
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
}
.tab:hover { border-color: var(--line); }
.tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs-small { gap: 3px; }
.tabs-small .tab { padding: 4px 7px; font-size: 10.5px; }

.empty { color: var(--muted); margin: 8px 0 12px; }
.hint { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.warn { margin: 4px 0; color: var(--bellhop-dark); font-weight: bold; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
hr { border: 0; border-top: 2px dashed var(--mist); margin: 12px 0 8px; width: 100%; }

.form { display: flex; flex-direction: column; gap: 5px; }
.form label, .form .label { font-weight: bold; margin-top: 6px; }
.form > .btn { margin-top: 12px; align-self: flex-start; }

/* navigator */
.room-list { display: flex; flex-direction: column; gap: 5px; max-height: min(360px, 50vh); overflow-y: auto; padding: 2px; }
.room-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
}
.room-row:hover { border-color: var(--ink); }
.room-row.current { border-color: var(--brass); background: #fff9ea; }
.room-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-desc { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-owner { color: var(--muted); font-size: 10px; }
.room-count {
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-align: center;
  font-weight: bold;
  font-size: 11px;
  background: var(--mist);
}
.room-count.some { background: var(--good); color: #fff; }
.room-count.busy { background: var(--brass); }
.room-count.full { background: var(--bellhop); color: #fff; }

.layout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.layout-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px 6px;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
  font-size: 11px;
}
.layout-card.active { border-color: var(--ink); background: #fff9ea; font-weight: bold; }
.layout-prev { max-width: 100%; height: auto; }

/* winkel en spullen */
.detail {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
  min-height: 146px;
}
.detail-img {
  flex: 0 0 160px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background:
    linear-gradient(45deg, rgba(29, 35, 48, 0.04) 25%, transparent 25% 75%, rgba(29, 35, 48, 0.04) 75%) 0 0 / 16px 16px,
    #e7eeec;
}
.detail-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.detail-text h3 { margin: 0 0 4px; font-size: 14px; }
.detail-text p { margin: 0 0 10px; color: var(--muted); flex: 1; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
  max-height: min(220px, 34vh);
  overflow-y: auto;
  padding: 2px;
}
.item {
  position: relative;
  display: grid;
  place-items: center;
  height: 66px;
  padding: 2px;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
}
.item:hover { border-color: var(--line); }
.item.active { border-color: var(--ink); background: #fff9ea; }
.item-price, .item-count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  font-weight: bold;
}
.item-price { color: var(--brass-dark); }
.item-named { grid-template-rows: 1fr auto; height: 72px; }
.item-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: bold; }
.detail-text.form { gap: 3px; }
.detail-text.form p { flex: 0; margin-bottom: 2px; }
.detail-text.form input { max-width: 230px; }
.detail-text.form > .btn { margin-top: 10px; }
.item-count { color: var(--ink); }

/* avatar */
.av-grid { display: flex; gap: 12px; }
.av-preview { flex: 0 0 124px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.av-stage {
  width: 124px;
  height: 212px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  border: 2px solid var(--mist);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 40px 10px at 50% calc(100% - 14px), rgba(29, 35, 48, 0.22) 60%, transparent 62%),
    linear-gradient(#e7eeec 60%, #cdd8d6 60%);
}
.av-right { flex: 1; min-width: 0; }
.av-panel { display: flex; flex-direction: column; gap: 10px; }
.styles { display: flex; flex-wrap: wrap; gap: 6px; }
.style {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
}
.style.active { border-color: var(--ink); background: #fff9ea; }
.style .none { font-size: 10px; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid rgba(29, 35, 48, 0.3);
  border-radius: 4px;
}
.swatch:hover { border-color: var(--ink); }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--brass); }
.av-bottom { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 12px; }
.av-bottom label { font-weight: bold; }
.av-account { margin-top: 6px; text-align: right; }

/* ---------------------------------------------------------------- beheer */
.adm-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  background: var(--card);
  border: 2px solid var(--mist);
  border-radius: var(--radius);
}
.adm-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-prev { flex: 0 0 76px; display: grid; place-items: center; }
.adm-prev canvas { max-width: 76px; max-height: 46px; }
.adm-btns { gap: 5px; }
.adm-confirm .warn { font-size: 11px; font-weight: normal; }
.win-admin .room-list { max-height: min(400px, 52vh); margin-top: 10px; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--brass);
  font-size: 9.5px;
  vertical-align: 1px;
}
.adm-form .adm-back { align-self: flex-start; padding-top: 0; }
.form .check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: bold; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--bellhop); }
.npc-head { flex: 0 0 34px; display: grid; place-items: center; padding: 3px; background: #e7eeec; border-radius: 4px; }
.npc-top { display: flex; align-items: center; gap: 14px; }
.npc-preview { flex: none; display: grid; place-items: center; width: 84px; height: 136px; background: #e7eeec; border-radius: 4px; }
.npc-look { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lay-size { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; margin-top: 2px; }
.form .lay-size label { margin-top: 0; font-weight: normal; }
.lay-size input { width: 80px; }
.lay-tools { gap: 5px; margin-top: 4px; }
.lay-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 4px; }
.lay-canvas { touch-action: none; cursor: crosshair; border-radius: 4px; max-width: 100%; }
.lay-preview {
  flex: 1;
  min-width: 140px;
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 6px;
  background: #e7eeec;
  border-radius: 4px;
}

/* ------------------------------------------------------------- meldingen */
.toasts {
  position: fixed;
  bottom: calc(var(--bar-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.toast {
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-left: 4px solid var(--brass);
  border-radius: 4px;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
  transition: opacity 300ms;
}
.toast.out { opacity: 0; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ----------------------------------------------------------------- mobiel */
@media (max-width: 640px) {
  :root { --bar-h: 104px; }
  .bar { flex-wrap: wrap; gap: 4px 6px; padding-top: 6px; }
  .chat { order: -1; flex-basis: 100%; max-width: none; }
  .bar-group { flex: 1; justify-content: space-around; }
  .bar-right { flex: 0 0 auto; margin-left: 0; }
  .bar-btn { min-width: 0; padding: 2px 4px; font-size: 9px; }
  .bar-btn svg { width: 32px; height: 32px; }
  .plaque { top: 8px; left: 8px; padding: 6px 12px 8px; max-width: calc(100vw - 140px); }
  .plaque-name { font-size: 12px; }
  .wallet { top: 8px; right: 8px; padding: 4px 10px 4px 6px; font-size: 11px; }
  .placebar { top: auto; bottom: calc(var(--bar-h) + var(--safe-b) + 10px); flex-wrap: wrap; justify-content: center; }
  .infostand { left: 8px; right: 8px; width: auto; }
  .info-img { min-height: 60px; }
  .win {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100% !important;
    max-width: none;
    max-height: 78vh;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    padding-bottom: var(--safe-b);
    animation: sheet-in 180ms ease-out;
  }
  .win-head { border-radius: 10px 10px 0 0; cursor: default; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  .detail { min-height: 0; }
  .detail-img { flex-basis: 110px; }
  .av-grid { flex-direction: column; align-items: stretch; }
  .av-preview { flex-direction: row; justify-content: center; }
  .av-stage { height: 200px; }
  .av-bottom { grid-template-columns: 1fr; }
  .toasts { bottom: calc(var(--bar-h) + var(--safe-b) + 12px); }
  .keycard-name { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------- telefoon */
/* Eigen pixellettertype voor het LCD-scherm (tools/generate_font.py) */
@font-face {
  font-family: "PixelEiland LCD";
  src: url("../assets/fonts/eiland-lcd.woff") format("woff");
  font-display: block;
}
:root {
  --ph-shell: #3fb6b0;
  --ph-shell-deep: #155a5c;
  --ph-silver: #c9d1d6;
  --ph-lcd: #b9d37c;
  --ph-lcd-dim: #a6c26a;
  --ph-ink: #26361a;
  --ph-ink-soft: #4d6430;
}
.bar-btn { position: relative; }
.bar-badge {
  position: absolute;
  top: 0;
  right: 8px;
  min-width: 18px;
  padding: 1px 4px;
  background: var(--bellhop);
  color: #fff;
  border: 2px solid var(--ink-deep);
  border-radius: 999px;
  font-size: 9px;
  line-height: 12px;
}

/* Het venster zelf is onzichtbaar; de telefoon is het venster */
.win.win-phone {
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
  max-height: none;
}
.win-phone .win-head {
  position: absolute;
  top: 0;
  left: 40px;
  right: 6px;
  z-index: 2;
  height: 36px;
  padding: 6px 4px 0 0;
  background: none;
  border: 0;
}
.win-phone .win-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.win-phone .win-close {
  margin-left: auto;
  width: 24px;
  height: 24px;
  line-height: 18px;
  border-radius: 50%;
  background: linear-gradient(#f2f5f6, #9ea9af);
  border: 2px solid var(--ph-shell-deep);
  color: var(--ph-shell-deep);
}
.win-phone .win-body { padding: 0; overflow: visible; }

.ph {
  position: relative;
  width: 300px;
  padding: 36px 18px 12px;
  /* doorschijnend zeeglas-plastic met een glimlicht */
  background:
    radial-gradient(ellipse 60% 30% at 28% 6%, rgba(255, 255, 255, 0.55), transparent 70%),
    repeating-linear-gradient(90deg, rgba(10, 70, 72, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(10, 70, 72, 0.06) 0 1px, transparent 1px 30px),
    linear-gradient(165deg, rgba(125, 226, 220, 0.97), rgba(52, 168, 164, 0.95) 55%, rgba(24, 120, 124, 0.97));
  border: 2px solid var(--ph-shell-deep);
  border-radius: 48px 48px 40px 40px / 44px 44px 64px 64px;
  box-shadow:
    inset 3px 4px 0 rgba(255, 255, 255, 0.35),
    inset -4px -6px 0 rgba(0, 50, 52, 0.25),
    6px 8px 0 rgba(8, 30, 40, 0.4);
  user-select: none;
}
.ph-ear {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 54px;
  height: 7px;
  margin-left: -27px;
  background: repeating-linear-gradient(90deg, #0e3a3b 0 3px, #1f6f6b 3px 5px);
  border-radius: 4px;
}
.ph-led {
  position: absolute;
  left: -22px;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1d4f4e;
  border: 1px solid #0e3a3b;
}
.ph-led.on { background: #8cff6a; box-shadow: 0 0 6px #8cff6a; animation: ph-blink 1.4s steps(1) infinite; }
@keyframes ph-blink { 50% { background: #1d4f4e; box-shadow: none; } }

.ph-bezel {
  padding: 9px 9px 12px;
  background: linear-gradient(170deg, #f4f7f8, var(--ph-silver) 40%, #8f9aa1);
  border: 2px solid #5d6a71;
  border-radius: 12px 12px 26px 26px;
  box-shadow: inset 0 2px 0 #fff;
}
.ph-lcd {
  display: flex;
  flex-direction: column;
  height: 318px;
  /* Achtergrondverlichting en een heel fijn pixelraster */
  background:
    repeating-linear-gradient(0deg, rgba(38, 54, 26, 0.045) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(38, 54, 26, 0.045) 0 1px, transparent 1px 2px),
    radial-gradient(ellipse at 50% 40%, #c6dd8a, var(--ph-lcd) 70%, var(--ph-lcd-dim));
  color: var(--ph-ink);
  border: 2px solid #3d4a2c;
  border-radius: 4px;
  box-shadow: inset 0 3px 6px rgba(38, 54, 26, 0.35);
  font-family: "PixelEiland LCD", monospace;
  font-size: 20px;
  line-height: 22px;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow: hidden;
  user-select: text;
}
.ph-status {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 2px 6px 0;
}
.ph-clock { margin-left: auto; }
.ph-bars { display: flex; align-items: flex-end; gap: 1px; height: 10px; }
.ph-bars i { width: 3px; background: rgba(38, 54, 26, 0.2); }
.ph-bars i.on { background: var(--ph-ink); }
.ph-batt { display: flex; gap: 1px; padding: 1px; border: 2px solid var(--ph-ink); }
.ph-batt i { width: 3px; height: 6px; background: var(--ph-ink); }
.ph-envelope { display: flex; align-items: center; gap: 3px; }
.ph-icon { width: 14px; height: 14px; flex: none; }
.ph-heading {
  margin: 2px 4px;
  padding: 0 6px;
  background: var(--ph-ink);
  color: var(--ph-lcd);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ph-view {
  flex: 1;
  min-height: 0;
  padding: 2px 4px 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ph-ink) transparent;
}
.ph-soft {
  display: flex;
  justify-content: space-between;
  padding: 0 6px 2px;
  border-top: 2px solid rgba(38, 54, 26, 0.35);
}
.ph-softlabel {
  padding: 0 2px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
}
.ph-softlabel:disabled { visibility: hidden; }

/* Keuzes: geselecteerd = omgekeerde kleuren, zoals op een oud scherm */
.ph-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 2px 4px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}
.ph-item-text { flex: 1; min-width: 0; }
.ph-item-text small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ph-ink-soft);
  font-size: inherit;
}
.ph-item.is-online .ph-item-text::before { content: "• "; }
.ph-item.is-unread .ph-item-text { font-weight: normal; text-decoration: underline 2px; text-underline-offset: 3px; }
.ph-item.is-danger { color: #6b2a10; }
.ph-count { padding: 0 4px; background: var(--ph-ink); color: var(--ph-lcd); font-weight: normal; }
.ph-sel:focus { outline: none; }
.ph-sel:focus-visible, .ph-item:hover, .ph-sel:focus {
  background: var(--ph-ink);
  color: var(--ph-lcd);
}
.ph-sel:focus .ph-item-text small, .ph-item:hover .ph-item-text small { color: var(--ph-lcd-dim); }
.ph-sel:focus .ph-count, .ph-item:hover .ph-count { background: var(--ph-lcd); color: var(--ph-ink); }
.ph-sel:disabled { opacity: 0.45; }

.ph-idle { display: grid; justify-items: center; padding: 10px 0 6px; }
.ph-big { font-size: 40px; line-height: 44px; }
.ph-date { margin-bottom: 8px; }
.ph-palm { width: 120px; height: 54px; color: var(--ph-ink); }
.ph-note { margin: 4px 2px; color: var(--ph-ink-soft); }
.ph-sub { margin: 0 2px 4px; color: var(--ph-ink-soft); }
.ph-label { display: block; margin: 6px 2px 2px; }

.ph-msg {
  margin: 4px 22px 4px 0;
  padding: 2px 6px;
  border: 2px solid var(--ph-ink);
  word-wrap: break-word;
}
.ph-msg.mine { margin: 4px 0 4px 22px; background: var(--ph-ink); color: var(--ph-lcd); }
.ph-msg p { margin: 0; }
.ph-time { display: block; text-align: right; color: var(--ph-ink-soft); }
.ph-msg.mine .ph-time { color: var(--ph-lcd-dim); }
.ph-song { display: grid; gap: 2px; margin: 2px 0; padding: 2px 4px; border: 2px dashed currentColor; }
.ph-song-site { color: inherit; opacity: 0.75; }
.ph-listen {
  justify-self: start;
  padding: 0 6px;
  border: 2px solid currentColor;
  color: inherit;
  text-decoration: none;
}
.ph-msg.mine .ph-listen:focus, .ph-msg.mine .ph-listen:hover { background: var(--ph-lcd); color: var(--ph-ink); }
.ph-older { display: block; width: 100%; margin-bottom: 4px; background: none; border: 2px dotted var(--ph-ink); color: inherit; font: inherit; }

.ph-compose { position: sticky; bottom: -4px; display: flex; gap: 4px; margin-top: 6px; padding: 4px 0; background: var(--ph-lcd); }
.ph-input {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  background: var(--ph-lcd-dim);
  color: var(--ph-ink);
  border: 2px solid var(--ph-ink);
  border-radius: 0;
  font: inherit;
  caret-color: var(--ph-ink);
}
.ph-input::placeholder { color: var(--ph-ink-soft); opacity: 0.8; }
.ph-input:focus { outline: none; background: #c9df92; }
select.ph-input { height: 26px; }
.ph-attach { flex: none; width: 30px; background: none; border: 2px solid var(--ph-ink); color: inherit; font: inherit; }

.ph-card { display: flex; gap: 8px; align-items: center; margin: 4px 2px 6px; }
.ph-card p { margin: 0; }
.ph-card-motto { color: var(--ph-ink-soft); }
.ph-face { width: 52px; height: 52px; flex: none; border: 2px solid var(--ph-ink); image-rendering: pixelated; }
.ph-req { display: flex; gap: 4px; align-items: center; margin: 2px; }
.ph-req-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-yes, .ph-no { padding: 0 5px; background: none; border: 2px solid var(--ph-ink); color: inherit; font: inherit; }

/* Toetsen onder het scherm */
.ph-pad {
  display: grid;
  grid-template-columns: 1fr 78px 1fr;
  grid-template-areas: "sl navi sr" "call navi end";
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
}
.ph-key {
  position: relative;
  height: 26px;
  padding: 0;
  background: linear-gradient(#f6f8f9, var(--ph-silver) 55%, #96a2a9);
  border: 2px solid #4a565d;
  border-radius: 14px;
  box-shadow: 0 3px 0 #2c4b4c;
}
.ph-key:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c4b4c; }
.ph-key:focus-visible { outline: 3px solid var(--brass); outline-offset: 1px; }
.ph-soft-l { grid-area: sl; border-radius: 14px 6px 6px 14px; }
.ph-soft-r { grid-area: sr; border-radius: 6px 14px 14px 6px; }
.ph-soft-l span, .ph-soft-r span { position: absolute; top: 9px; left: 50%; width: 16px; height: 3px; margin-left: -8px; background: #4a565d; }
.ph-call { grid-area: call; background: linear-gradient(#9ee59a, #4caf50 60%, #2e7d32); border-color: #1c4d1f; }
.ph-end { grid-area: end; background: linear-gradient(#ff9a8e, #d9443b 60%, #8f2b27); border-color: #5a1a17; }
.ph-call span, .ph-end span { position: absolute; top: 7px; left: 50%; width: 18px; height: 7px; margin-left: -9px; border: 3px solid #fff; border-bottom: 0; border-radius: 9px 9px 0 0; }
.ph-end span { transform: rotate(180deg); }
.ph-navi {
  grid-area: navi;
  position: relative;
  width: 78px;
  height: 78px;
  border: 2px solid #4a565d;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fbfcfc, var(--ph-silver) 55%, #8a969d);
  box-shadow: 0 3px 0 #2c4b4c;
}
.ph-navi .ph-key {
  position: absolute;
  left: 50%;
  border: 0;
  background: none;
  box-shadow: none;
}
.ph-up { top: 2px; width: 40px; height: 22px; margin-left: -20px; }
.ph-down { bottom: 2px; width: 40px; height: 22px; margin-left: -20px; }
.ph-up span, .ph-down span {
  position: absolute;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
}
.ph-up span { top: 3px; border-bottom-color: #4a565d; }
.ph-down span { bottom: 3px; border-top-color: #4a565d; }
.ph-navi .ph-ok {
  top: 50%;
  width: 34px;
  height: 26px;
  margin: -13px 0 0 -17px;
  border: 2px solid #4a565d;
  border-radius: 50%;
  background: linear-gradient(#ffffff, #b7c1c7);
}
.ph-navi .ph-key:active { transform: none; filter: brightness(0.9); }
.ph-brand {
  margin-top: 10px;
  text-align: center;
  font-family: "PixelEiland LCD", monospace;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 -2px 0 rgba(0, 50, 52, 0.35);
  letter-spacing: 2px;
}

@media (max-width: 640px) {
  .win.win-phone {
    left: 50% !important;
    right: auto;
    width: 300px !important;
    margin-left: -150px;
    padding-bottom: 0;
    border-radius: 0;
    animation: ph-up 200ms ease-out;
  }
  @keyframes ph-up { from { transform: translateY(60px); } }
  .ph { border-radius: 48px 48px 0 0 / 44px 44px 0 0; padding-bottom: calc(10px + var(--safe-b)); }
  /* Op een klein scherm ligt de telefoon over de balk: dan geen doorschijnend plastic */
  .ph {
    background:
      radial-gradient(ellipse 60% 30% at 28% 6%, rgba(255, 255, 255, 0.55), transparent 70%),
      repeating-linear-gradient(90deg, rgba(10, 70, 72, 0.08) 0 1px, transparent 1px 22px),
      linear-gradient(165deg, #7de2dc, #34a8a4 55%, #18787c);
  }
  /* Meldingen boven in beeld zolang de telefoon open is */
  body:has(.win-phone) .toasts { top: 64px; bottom: auto; }
  .ph-lcd { height: min(318px, calc(100vh - 300px)); }
}
@media (prefers-reduced-motion: reduce) {
  .ph-led.on { animation: none; }
}
