/* Player UI (catalogue, hand, friends, messenger, trade, looks, groups). Same Habbo window chrome as
   index.html; colours come from its :root tokens plus the few below. */
:root {
  --gold: #f2c200;
  --gold-ink: #6b5200;
  --ok: #3f9b3f;
  --ok-2: #2f7a2f;
  --danger: #c0392b;
  --slot: #fff;
  --slot-edge: #b9b9ae;
  --page: #f6f6f1;
}

.pwin { z-index: 25; max-width: calc(100vw - 16px); }
.pwin .body { max-height: none; }
.pwin.front { z-index: 26; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 26px; padding: 3px 10px; border: 1px solid #000; border-radius: 5px; background: linear-gradient(#fdfdfb, #d7d7cf); color: var(--ink); font: 500 12px Ubuntu, sans-serif; cursor: pointer; }
.btn:hover { background: linear-gradient(#fff, #e4e4dc); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.go { background: linear-gradient(#5fbf5f, var(--ok-2)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.go:hover { background: linear-gradient(#6fcf6f, var(--ok)); }
.btn.stop { background: linear-gradient(#e0614f, #9e2a1d); color: #fff; }
.btn.small { min-height: 22px; padding: 1px 7px; font-size: 11px; }
.btn:focus-visible, .pwin input:focus-visible, .pwin select:focus-visible, .pwin textarea:focus-visible, #chatbar input:focus-visible, .slot:focus-visible { outline: 2px solid #ffd400; outline-offset: 1px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 12px; }
.err { color: var(--danger); font-size: 12px; min-height: 16px; }
.pwin input[type=text], .pwin input[type=number], .pwin select, .pwin textarea { font: 13px Ubuntu, sans-serif; border: 1px solid #8a8a80; border-radius: 4px; padding: 4px 6px; background: #fff; color: var(--ink); }
.pwin label { display: grid; gap: 2px; font-size: 12px; color: #444; }
.pwin h3 { margin: 0 0 4px; font-size: 14px; }
.pwin .tabs button { position: relative; }
.badge { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font: 700 10px/16px Ubuntu, sans-serif; text-align: center; }
#toolbar .badge { position: absolute; top: -5px; right: -5px; }
#toolbar button { position: relative; }
.empty { padding: 18px 10px; text-align: center; color: var(--muted); }

/* furni slots (catalogue, hand, trade) */
.slots { display: grid; grid-template-columns: repeat(auto-fill, 54px); gap: 4px; align-content: start; }
.slot { position: relative; width: 54px; height: 54px; background: var(--slot); border: 1px solid var(--slot-edge); border-radius: 4px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.slot:hover { border-color: #000; }
.slot.on { border: 2px solid var(--win-title); background: #eaf4fa; }
.slot.locked { opacity: .45; }
.slot canvas { width: 50px; height: 50px; }
.slot .n { position: absolute; right: 2px; bottom: 1px; font: 700 10px Ubuntu, sans-serif; background: #fff; border: 1px solid #999; border-radius: 3px; padding: 0 2px; }
.slot.emptyslot { cursor: default; background: #ecece5; border-style: dashed; }

/* purse */
#purse { position: fixed; right: 12px; top: 32px; z-index: 15; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; background: rgba(0,0,0,.6); border: 1px solid #000; border-radius: 14px; color: #fff; cursor: pointer; font-weight: 700; }
#purse .coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4a8, var(--gold) 55%, #b88f00); border: 1px solid var(--gold-ink); }
#purse:hover { background: rgba(0,0,0,.75); }

/* chat bar */
#chatbar { display: flex; align-items: center; gap: 4px; flex: 1; max-width: 460px; min-width: 120px; }
#chatbar input { flex: 1; min-width: 0; height: 32px; border-radius: 16px; border: 1px solid #000; padding: 0 12px; font: 13px Ubuntu, sans-serif; background: #fff; color: var(--ink); }
#chatbar input:disabled { background: #bbb; }
#toolbar #chatbar button { height: 32px; padding: 0 8px; }
#toolbar .head { width: 28px; height: 28px; overflow: hidden; border-radius: 4px; }
#toolbar .head img { margin: -6px 0 0 -16px; image-rendering: pixelated; }
#toolbar .checkin { background: linear-gradient(#5fbf5f, var(--ok-2)); }

/* placement hint */
#placehint { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 24; background: rgba(0,0,0,.8); color: #fff; padding: 6px 12px; border-radius: 6px; border: 1px solid #000; display: flex; gap: 8px; align-items: center; }

/* toasts */
#toasts { position: fixed; right: 12px; top: 64px; z-index: 50; display: grid; gap: 6px; width: min(300px, calc(100vw - 24px)); }
.toast { background: var(--win-body); border: 1px solid #000; border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.35); padding: 8px 10px; display: grid; gap: 6px; }
.toast.error { background: #fbe3df; }
.toast .row { justify-content: flex-end; }

/* catalogue */
#w-catalog { width: 600px; left: calc(50% - 300px); top: 40px; }
#w-catalog .body { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 0; }
.cat-nav { background: #dcdcd2; border-right: 1px solid #a9a99f; padding: 8px; display: grid; gap: 3px; align-content: start; max-height: min(560px, 70vh); overflow: auto; }
.cat-nav input { width: 100%; margin-bottom: 4px; }
.cat-nav button { text-align: left; border: 1px solid transparent; background: none; padding: 4px 6px; border-radius: 4px; font: 500 12px Ubuntu, sans-serif; cursor: pointer; color: var(--ink); display: flex; justify-content: space-between; }
.cat-nav button:hover { background: #ecece4; }
.cat-nav button.on { background: #fff; border-color: #000; font-weight: 700; }
.cat-page { padding: 8px 8px 8px 0; display: grid; gap: 8px; align-content: start; max-height: min(560px, 70vh); overflow: auto; }
.cat-head { background: linear-gradient(90deg, var(--win-title), #6fa9cb); color: #fff; border: 1px solid #000; border-radius: 5px; padding: 8px 10px; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.cat-head b { font-size: 16px; display: block; }
.cat-preview { display: grid; grid-template-columns: 170px 1fr; gap: 10px; background: var(--page); border: 1px solid #a9a99f; border-radius: 5px; padding: 8px; }
.stage { width: 170px; height: 150px; border-radius: 4px; border: 1px solid #000; background: linear-gradient(#cfe6f2, #eef7fb 60%, #b9b985 60.5%, #989865); display: grid; place-items: center; }
.stage canvas { width: 160px; height: 140px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold-ink); }
.price .coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4a8, var(--gold) 55%, #b88f00); border: 1px solid var(--gold-ink); }
.giftbox { display: grid; gap: 6px; border-top: 1px dashed #a9a99f; padding-top: 6px; }

/* hand */
#w-hand { width: 420px; left: 12px; bottom: 60px; }
#w-hand .body { display: grid; gap: 8px; }
.hand-grid { max-height: 230px; overflow: auto; padding: 2px; }
.hand-sel { display: grid; grid-template-columns: 90px 1fr; gap: 8px; background: var(--page); border: 1px solid #a9a99f; border-radius: 5px; padding: 6px; }
.hand-sel canvas { width: 88px; height: 88px; }

/* friends + messenger + groups */
#w-friends { width: 320px; right: 12px; top: 64px; }
#w-messenger { width: 440px; right: 340px; top: 64px; }
#w-groups { width: 360px; left: calc(50% - 180px); top: 70px; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: #fff; border: 1px solid #bdbdb3; border-radius: 4px; margin-bottom: 4px; }
.person .face { width: 34px; height: 34px; overflow: hidden; flex: none; border-radius: 4px; background: #e6e6de; }
.person .face img { margin: -8px 0 0 -12px; image-rendering: pixelated; }
.person .who { flex: 1; min-width: 0; }
.person .who b, .person .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who small { color: var(--muted); }
.online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; }
.offline { background: #aaa; }
.list { max-height: 340px; overflow: auto; }
#w-messenger .body { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.convos { display: grid; gap: 3px; align-content: start; max-height: 320px; overflow: auto; }
.convos button { display: flex; align-items: center; gap: 6px; text-align: left; border: 1px solid #bdbdb3; background: #fff; border-radius: 4px; padding: 3px 6px; cursor: pointer; font: 500 12px Ubuntu, sans-serif; color: var(--ink); }
.convos button.on { border-color: #000; background: #eaf4fa; }
.thread { display: grid; grid-template-rows: 1fr auto; gap: 6px; min-height: 280px; }
.msgs { background: #fff; border: 1px solid #a9a99f; border-radius: 4px; padding: 6px; overflow: auto; max-height: 280px; display: grid; gap: 4px; align-content: start; }
.msg { max-width: 85%; padding: 4px 8px; border-radius: 8px; background: #e9e9e1; border: 1px solid #c8c8bd; word-break: break-word; }
.msg.mine { justify-self: end; background: #d8ecf6; border-color: #a8c9da; }
.group { background: #fff; border: 1px solid #bdbdb3; border-radius: 5px; padding: 6px 8px; margin-bottom: 6px; display: grid; gap: 4px; }
.heads { display: flex; flex-wrap: wrap; gap: 2px; }
.heads img { width: 27px; height: 30px; object-fit: cover; object-position: 50% 20%; image-rendering: pixelated; }

/* trade */
#w-trade { width: 480px; left: calc(50% - 240px); top: 90px; }
#w-trade .body { display: grid; gap: 8px; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { background: var(--page); border: 1px solid #a9a99f; border-radius: 5px; padding: 6px; display: grid; gap: 6px; align-content: start; }
.side.ready { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.side h3 { display: flex; justify-content: space-between; }
.side .slots { grid-template-columns: repeat(3, 54px); }
.tick { color: var(--ok); font-weight: 700; font-size: 12px; }

/* looks editor */
#w-looks, #w-checkin { width: 440px; left: calc(50% - 220px); top: 50px; }
.looks { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.looks .preview { width: 130px; height: 190px; border: 1px solid #000; border-radius: 5px; background: linear-gradient(#cfe6f2, #eef7fb 70%, #b9b985 70.5%, #989865); display: grid; place-items: end center; position: relative; overflow: hidden; }
.looks .preview img { image-rendering: pixelated; margin-bottom: 6px; }
.looks .preview .turn { position: absolute; bottom: 4px; }
.looks .preview .turn.l { left: 4px; }
.looks .preview .turn.r { right: 4px; }
.part { display: grid; grid-template-columns: 62px 24px 1fr 24px; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12px; }
.part .btn { padding: 0; min-height: 22px; }
.part .val { text-align: center; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 3px; margin: -1px 0 6px 66px; }
.swatches button { width: 16px; height: 16px; border: 1px solid #555; border-radius: 3px; cursor: pointer; padding: 0; }
.swatches button.on { outline: 2px solid #000; outline-offset: 1px; }
.gender { display: flex; gap: 4px; margin-bottom: 6px; }
.gender .btn.on { background: linear-gradient(#5fa9d6, var(--win-title-2)); color: #fff; }

/* my rooms */
.create-room { display: grid; gap: 6px; background: var(--page); border: 1px solid #a9a99f; border-radius: 5px; padding: 8px; margin-top: 6px; }

/* infostand actions */
#infostand .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; border-top: 1px solid #444; padding-top: 6px; }
#infostand .actions .btn { background: linear-gradient(#5a5a5a, #3a3a3a); color: #fff; }
#infostand .actions .btn:hover { background: linear-gradient(#6a6a6a, #484848); }
#infostand .actions .btn.stop { background: linear-gradient(#b5483a, #7d2419); }

@media (max-width: 640px) {
  #w-catalog .body { grid-template-columns: 1fr; }
  .cat-nav { grid-auto-flow: column; overflow-x: auto; max-height: none; border-right: 0; border-bottom: 1px solid #a9a99f; }
  .cat-nav input { min-width: 120px; }
  .cat-preview { grid-template-columns: 1fr; }
  .pwin { left: 8px !important; right: 8px !important; width: auto !important; }
  #w-messenger .body { grid-template-columns: 1fr; }
  .trade-sides { grid-template-columns: 1fr; }
  .looks { grid-template-columns: 1fr; }
  #chatbar { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .emote, .bubble { transition: none; }
}

/* While playing, the toolbar carries more buttons: icons only (labels stay as tooltips). */
#toolbar.playing .lbl { display: none; }
#toolbar.playing .sp { flex: 0; }
#toolbar.playing #chatbar { flex: 1; max-width: 520px; }
.create-room label { display: grid; gap: 2px; font-size: 12px; color: #444; }
.create-room input, .create-room select { width: 100%; font: 13px Ubuntu, sans-serif; border: 1px solid #8a8a80; border-radius: 4px; padding: 4px 6px; background: #fff; }
.create-room h3 { margin: 0; font-size: 14px; }

/* SVG toolbar icons */
#toolbar .ico { display: inline-flex; }
#chatbar button svg { display: block; }

/* room info strip (players) */
#roomtools { position: fixed; left: 12px; top: 52px; z-index: 14; display: grid; gap: 4px; max-width: 280px; color: #fff; text-shadow: 0 1px 2px #000; }
#roomtools:empty { display: none; }
#roomtools .desc { font-size: 12px; opacity: .9; }
#roomtools .likes { font-weight: 700; }
#navigator { top: 110px; }

/* looks editor (FigureData) */
#w-looks, #w-checkin { width: 560px; left: calc(50% - 280px); }
.looks { grid-template-columns: 140px 1fr; }
.look-side { display: grid; gap: 6px; min-width: 0; }
.look-tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.look-tabs button { border: 1px solid #000; border-radius: 4px; background: #cfcfc6; font: 500 11px Ubuntu, sans-serif; padding: 2px 6px; cursor: pointer; color: var(--ink); }
.look-tabs button.on { background: #fff; font-weight: 700; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, 46px); gap: 3px; max-height: 200px; overflow: auto; background: #fff; border: 1px solid #a9a99f; border-radius: 4px; padding: 3px; }
.look-cell { position: relative; width: 46px; height: 58px; border: 1px solid #d0d0c6; border-radius: 4px; background: #f3f3ee; padding: 0; cursor: pointer; overflow: hidden; display: grid; place-items: center; }
.look-cell img { max-width: 44px; max-height: 56px; image-rendering: pixelated; }
.look-cell.on { border: 2px solid var(--win-title); background: #eaf4fa; }
.look-cell.locked img { opacity: .45; }
.look-cell .hc, .slot .hc.tag { position: absolute; top: 1px; left: 1px; margin: 0; }
.swatches { margin: 0; max-height: 92px; overflow: auto; }
.swatches button.club { box-shadow: inset 0 0 0 2px #f2c200; }
.hc { display: inline-block; padding: 0 4px; border-radius: 3px; background: var(--gold); color: #5a4300; font: 700 10px/14px Ubuntu, sans-serif; }

/* hand: badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; max-height: 340px; overflow: auto; }
.badge-cell { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; background: #fff; border: 1px solid #bdbdb3; border-radius: 4px; padding: 4px; font-size: 12px; }
.badge-cell img { grid-row: span 2; width: 40px; height: 40px; image-rendering: pixelated; }
.badge-cell small { color: var(--muted); }
.badge-cell.locked img { filter: grayscale(1) opacity(.4); }

/* club */
#w-club { width: 360px; left: calc(50% - 180px); top: 90px; }
#w-club .body { display: grid; gap: 8px; }
.club-head { display: flex; gap: 10px; align-items: center; background: linear-gradient(90deg, #3a2a00, #6b5200); color: #fff; border: 1px solid #000; border-radius: 5px; padding: 8px 10px; }
.club-head .crown { color: var(--gold); display: inline-flex; }
.club-head .crown svg { width: 34px; height: 34px; }
.perks { margin: 0; padding-left: 18px; display: grid; gap: 3px; }

/* room settings + wired */
#w-settings { width: 380px; left: calc(50% - 190px); top: 80px; }
#w-wired { width: 340px; right: 12px; top: 120px; }
#w-settings .body, #w-wired .body { display: grid; gap: 8px; }
.pwin textarea { width: 100%; resize: vertical; }
.pwin label.check { display: flex; align-items: center; gap: 6px; }
.toast.wired { background: #23395b; color: #fff; border-color: #000; }

@media (max-width: 640px) {
  .looks { grid-template-columns: 1fr; }
  #roomtools { display: none; }
}

/* navigator search + favourites */
.navsearch { width: 100%; margin-bottom: 6px; font: 13px Ubuntu, sans-serif; border: 1px solid #8a8a80; border-radius: 4px; padding: 4px 6px; }
.room-row .star { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: #9a9a90; padding: 0 2px; }
.room-row .star.on { color: #e3a21a; }

/* profile */
#w-profile { width: 420px; left: calc(50% - 210px); top: 70px; }
#w-profile .body { display: grid; gap: 8px; }
.profile { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.profile .stage { width: 120px; height: 170px; display: grid; place-items: end center; }
.profile .stage img { image-rendering: pixelated; margin-bottom: 4px; }
.profile .who { display: grid; gap: 4px; align-content: start; }
#w-profile .badges { display: flex; gap: 4px; flex-wrap: wrap; }
#w-profile .badges img { width: 40px; height: 40px; image-rendering: pixelated; }
#navigator .tabs button { white-space: nowrap; padding: 4px 2px; font-size: 11px; }
#w-market { width: 380px; left: calc(50% - 190px); top: 80px; }
#w-market .body { display: grid; gap: 8px; }
#w-market .list { max-height: 360px; }

/* room strip: events + Banzai scores */
#roomtools .event { background: rgba(227, 162, 26, .9); color: #2b1d00; text-shadow: none; border: 1px solid #000; border-radius: 5px; padding: 4px 8px; }
#roomtools .banzai .team { display: inline-block; min-width: 26px; text-align: center; border: 1px solid #000; border-radius: 4px; font-weight: 700; color: #fff; text-shadow: 0 1px 0 #000; }
#w-bot, #w-help { width: 380px; left: calc(50% - 190px); top: 80px; }
#w-bot .body, #w-help .body, #w-staff .body { display: grid; gap: 8px; }
#w-staff { width: 440px; right: 12px; top: 70px; }
#w-help details { background: #fff; border: 1px solid #bdbdb3; border-radius: 4px; padding: 4px 8px; }
#w-help summary { cursor: pointer; font-weight: 500; }
#navigator .tabs { flex-wrap: wrap; }
#navigator .tabs button { flex: 1 1 30%; }

/* camera, crafting, Builders Club */
#w-camera { width: 360px; left: calc(50% - 180px); top: 80px; }
#w-camera .body, #w-craft .body { display: grid; gap: 8px; }
.photo-preview { width: 320px; max-width: 100%; height: auto; border: 6px solid #fff; outline: 1px solid #000; box-shadow: 0 2px 0 rgba(0,0,0,.3); image-rendering: auto; }
#w-craft { width: 420px; left: calc(50% - 210px); top: 70px; }
.recipe { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #bdbdb3; border-radius: 5px; padding: 4px 6px; }
.club-head.bc { background: linear-gradient(90deg, #1d3c5a, #3d7ea6); }
.ltd { display: inline-block; justify-self: start; background: #2b1d00; color: #f2c200; border-radius: 4px; padding: 1px 6px; font-weight: 700; font-size: 12px; }

/* Post-its and the mood light */
.swatch { width: 22px; height: 22px; border: 1px solid #555; border-radius: 3px; cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid #000; outline-offset: 1px; }
.note-text { display: block; width: 100%; box-sizing: border-box; min-height: 110px; padding: 8px; border: 1px solid #b8b060; font: 13px/1.4 Verdana, sans-serif; color: #222; white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; }

/* Mannequins and the recycler */
.mannequin-look { display: flex; gap: 8px; align-items: center; margin: 6px 0; grid-column: 1 / -1; }
.mannequin-look img { width: 64px; height: 110px; object-fit: contain; background: rgba(255,255,255,.08); border-radius: 4px; }
.recycle-in { padding: 6px; background: #2f5e2a; border-radius: 6px; margin-bottom: 8px; }
.empty-slot { cursor: default; opacity: .5; }
.mannequin-look > div { flex: 1; min-width: 0; }

/* Trax: the composer grid and the jukebox playlist */
#w-trax { width: min(760px, calc(100vw - 24px)); }
.trax-grid { display: grid; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.trax-row { display: flex; gap: 2px; align-items: center; }
.trax-name { width: 44px; flex: none; font-size: 11px; font-weight: 700; }
.trax-cell { width: 19px; height: 22px; flex: none; padding: 0; border: 1px solid #9a9a8a; border-radius: 2px; background: #e8e8dc; font: 700 10px/1 Ubuntu, sans-serif; color: #fff; cursor: pointer; }
.trax-cell.bar { margin-left: 4px; }
.trax-cell.v1 { background: #d64541; } .trax-cell.v2 { background: #e67e22; } .trax-cell.v3 { background: #d4ac0d; } .trax-cell.v4 { background: #27ae60; }
.trax-cell.v5 { background: #16a085; } .trax-cell.v6 { background: #2e86c1; } .trax-cell.v7 { background: #7d3c98; } .trax-cell.v8 { background: #c0392b; }
.trax-cell:focus-visible { outline: 2px solid #000; outline-offset: 1px; }
.playlist { margin: 6px 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.playlist li { padding: 3px 4px; border-radius: 3px; display: flex; align-items: center; gap: 6px; }
.playlist li.on { background: #fff3b0; font-weight: 700; }
.playlist li > .grow { flex: 1; min-width: 0; }
#w-jukebox { width: min(340px, calc(100vw - 24px)); }

/* Room bundles */
.bundle { display: flex; gap: 12px; align-items: flex-start; padding: 10px; margin-bottom: 8px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 6px; }
.bundle h3 { margin: 0 0 2px; }
.bundle .slots { margin-top: 6px; }
.bundle-buy { display: grid; gap: 4px; justify-items: end; flex: none; }

/* Quests */
.quest { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin-bottom: 6px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 6px; }
.quest img { width: 40px; height: 40px; image-rendering: pixelated; }
.quest img.locked { filter: grayscale(1); opacity: .45; }
.quest ol { margin: 4px 0 0; padding-left: 18px; }
.quest li.ok { color: #3a7a2a; }
.quest li.now { font-weight: 700; }
.quest.done { background: #f2fbe9; }

/* Guides */
.guide-chat { max-height: 220px; overflow-y: auto; display: grid; gap: 4px; padding: 6px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 6px; margin: 6px 0; }
.guide-chat .msg { justify-self: start; max-width: 80%; padding: 4px 8px; border-radius: 8px; background: #e7eef7; overflow-wrap: anywhere; }
.guide-chat .msg.mine { justify-self: end; background: #dff3d4; }
.guide-open { display: grid; gap: 6px; }

/* Trophies */
.inscription { margin: 6px 0; padding: 6px 8px; background: #fff8dc; border: 1px solid #d8c88a; border-radius: 4px; overflow-wrap: anywhere; }
.club-gift { margin-top: 8px; padding: 8px; background: #fff8e1; border: 1px solid #f2c200; border-radius: 6px; display: grid; gap: 4px; }
#w-settings .row > label.grow { flex: 1; min-width: 0; }
#w-settings .row > label.grow > input, #w-settings .row > label.grow > select { width: 100%; box-sizing: border-box; }

/* Groups: badges, settings, forum */
.gbadge { flex: none; }
.group-edit { margin: 6px 0; padding: 8px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 6px; display: grid; gap: 6px; }
.group-edit .swatches { margin: 2px 0 4px; }
.group-edit .swatches button { width: 22px; height: 22px; font-size: 13px; line-height: 1; background: #f4f4ee; }
.group-edit .swatches .sw { display: block; width: 100%; height: 100%; border-radius: 2px; }
.requests { padding: 6px; background: #fff8dc; border-radius: 4px; }
.forum { display: grid; gap: 6px; margin: 6px 0; }
.forum .thread { text-align: left; padding: 6px 8px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 4px; cursor: pointer; }
.forum .post { display: flex; gap: 8px; align-items: flex-start; padding: 6px; background: #fff; border: 1px solid var(--slot-edge); border-radius: 4px; overflow-wrap: anywhere; }

/* Game tables */
.ttt { display: grid; grid-template-columns: repeat(3, 64px); gap: 4px; justify-content: center; margin: 8px 0; }
.ttt .cell { height: 64px; font: 700 34px/1 Ubuntu, sans-serif; background: #fff; border: 2px solid #8a8a7a; border-radius: 6px; cursor: pointer; }
.ttt .cell.x { color: #2f7fd1; } .ttt .cell.o { color: #d23b3b; }
.ttt .cell:disabled { cursor: default; }
.chess { display: grid; grid-template-columns: repeat(8, 38px); justify-content: center; margin: 8px 0; border: 2px solid #5a4630; width: max-content; margin-inline: auto; }
.chess .sq { width: 38px; height: 38px; padding: 0; border: 0; font-size: 28px; line-height: 38px; cursor: pointer; color: #111; }
.chess .sq.light { background: #eedcb3; } .chess .sq.dark { background: #b58863; }
.chess .sq.pick { box-shadow: inset 0 0 0 3px #f2c200; }
.chess .sq:focus-visible { outline: 2px solid #000; outline-offset: -2px; }
.bs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.bs { display: grid; grid-template-columns: repeat(10, 22px); gap: 1px; background: #1d4f7a; padding: 2px; width: max-content; }
.bs .bc { width: 22px; height: 22px; padding: 0; border: 0; background: #3a86c8; color: #fff; font: 700 13px/22px sans-serif; cursor: pointer; }
.bs .bc:disabled { cursor: default; }
.bs .bc.ship { background: #8a8f96; } .bs .bc.hit { background: #d23b3b; } .bs .bc.miss { background: #2a6aa3; color: #cfe4f7; }
#w-game { width: auto; }
.wob { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.wob .bar { width: 140px; height: 10px; background: #ddd; border-radius: 5px; overflow: hidden; }
.wob .bar i { display: block; height: 100%; background: linear-gradient(90deg, #f2c200, #d23b3b); }
.hand { display: flex; gap: 6px; margin: 6px 0; }
.hand .card { width: 46px; height: 64px; background: #fff; border: 1px solid #888; border-radius: 6px; font: 700 18px/1 Ubuntu, sans-serif; color: #222; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.hand .card.red { color: #c0262d; }
.hand .card.swap { transform: translateY(-8px); outline: 2px solid #f2c200; }
.hand .card:disabled { cursor: default; }

/* Wardrobe, worn badges, floor plan editor */
.wardrobe { margin: 6px 0; }
.wardrobe .slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.wardrobe .wslot { display: grid; gap: 2px; justify-items: center; }
.badge-cell.worn { outline: 2px solid #f2c200; background: #fff8dc; }
button.badge-cell { cursor: pointer; font: inherit; }
#w-floorplan { width: min(820px, calc(100vw - 24px)); }
.fp-grid { display: grid; gap: 1px; overflow: auto; max-height: 420px; padding: 4px; background: #222; width: max-content; max-width: 100%; }
.fp { width: 18px; height: 18px; padding: 0; border: 0; font: 700 10px/18px sans-serif; color: #333; cursor: pointer; }
.fp.void { background: #111; }
.fp.h0 { background: #989865; } .fp.h1 { background: #a4a470; } .fp.h2 { background: #b0b07c; } .fp.h3 { background: #bcbc88; } .fp.h4 { background: #c8c894; }
.fp.h5 { background: #d4d4a0; } .fp.h6 { background: #dedeaa; } .fp.h7 { background: #e6e6b4; } .fp.h8 { background: #eeeebe; } .fp.h9 { background: #f6f6c8; }
.fp.door { background: #3a7bd5; color: #fff; }

/* Settings, chat history, achievements, navigator lists */
.bubble-pick { padding: 4px 8px; border: 1px solid #000; border-radius: 7px; background: #fff; cursor: pointer; font: 12px Ubuntu, sans-serif; }
.bubble-pick.on { outline: 2px solid #f2c200; }
.bubble-pick:disabled { opacity: .45; cursor: default; }
.bubble-pick.style-1 { background: #d9f0ff; } .bubble-pick.style-2 { background: #ffe1ec; } .bubble-pick.style-3 { background: #fff2a8; }
.bubble-pick.style-4 { background: #2b2b2b; color: #f2f2f2; } .bubble-pick.style-5 { background: linear-gradient(90deg, #e0f7d4, #d4e9f7); }
.chatlog { max-height: 360px; overflow-y: auto; display: grid; gap: 2px; font-size: 12px; overflow-wrap: anywhere; }
.chatlog .line.shout { font-weight: 700; }
.achievements { margin: 6px 0; }
.achievements summary { cursor: pointer; font-weight: 700; }
.ach { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #ddd; }
.ach img { width: 40px; height: 40px; image-rendering: pixelated; }
.ach img.locked { filter: grayscale(1); opacity: .45; }
.ach .bar { height: 6px; background: #ddd; border-radius: 3px; overflow: hidden; margin-top: 2px; }
.ach .bar i { display: block; height: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip { padding: 2px 8px; border-radius: 10px; border: 1px solid #999; background: #f4f4ee; font-size: 11px; cursor: pointer; }
.chip[aria-pressed="true"] { background: #3a7bd5; color: #fff; border-color: #2b5ea8; }
.btn.rel { min-width: 26px; }
.btn.danger { background: #c0392b; color: #fff; }
.rels { font-size: 12px; }

/* Presents, vouchers, toner */
.wraps button { width: 20px; height: 20px; }
.voucher { margin-top: 4px; }
.toner-swatch { height: 36px; border-radius: 6px; border: 1px solid #000; margin-bottom: 6px; }
