/* PixelHotel - interfaccia sul modello del client ufficiale (schede blu, corpo grigio chiaro, barra scura in basso) */
:root {
  --bg: #0b0d12;
  --bar: rgba(28, 28, 32, .96);
  --bar-b: #000;
  --card: #dfdfdf;           /* corpo delle finestre */
  --card-b: #283f5d;         /* bordo delle finestre */
  --head: #1e7295;           /* intestazione */
  --head-d: #185d79;
  --pane: #fff;              /* riquadri interni */
  --pane-b: #b6bec5;
  --tab: #cacaca;
  --txt: #1d1d1d;
  --muted: #6b6b6b;
  --primary: #1e7295;
  --success: #00800b;
  --danger: #a81a12;
  --gold: #f2c230;
  --sel: #1e7295;
  --dark: rgba(28, 28, 32, .95);
  --top: 64px;               /* spazio in alto (portafoglio, scheda stanza) */
  --tb: 55px;                /* altezza della barra in basso */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--txt); font: 12px/1.35 'Ubuntu', 'Trebuchet MS', Verdana, sans-serif; overflow: hidden; user-select: none; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
input, button, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* ---------- stanza ---------- */
.room-host { position: absolute; inset: 0 0 var(--tb) 0; overflow: hidden; background: #000; touch-action: none; }
.room-host.dragging { cursor: grabbing !important; }
.room-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.room-canvas { display: block; }
.room-over, .chat-layer { position: absolute; inset: 0; pointer-events: none; }
.name-tag { position: absolute; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap; font-size: 11px; }
.typing-bubble { position: absolute; background: #fff; border: 1px solid #000; border-radius: 8px; padding: 3px 5px; display: flex; gap: 2px; }
.typing-bubble span { width: 4px; height: 4px; background: #333; border-radius: 1px; animation: tb 1s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: .2s; } .typing-bubble span:nth-child(3) { animation-delay: .4s; }
@keyframes tb { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
.chat-bubble { position: absolute; display: flex; align-items: center; min-height: 26px; max-width: 420px; background: #fff; border: 1px solid #000; border-radius: 7px; padding: 2px 9px 2px 34px; box-shadow: 0 2px 0 rgba(0,0,0,.35); transition: top .35s ease; pointer-events: auto; }
.chat-bubble .cb-head { position: absolute; left: 3px; bottom: 1px; width: 28px; height: 30px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.chat-bubble .cb-head canvas { display: block; max-width: 30px; }
.chat-bubble .cb-text { font-size: 12px; line-height: 15px; padding: 3px 0; word-break: break-word; }
.chat-bubble.shout .cb-text { font-weight: 700; font-size: 13px; }
.chat-bubble.whisper { background: #f1f1f1; } .chat-bubble.whisper .cb-text { font-style: italic; color: #555; }
.chat-bubble .cb-tip { position: absolute; bottom: -6px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #000; }
.chat-bubble .cb-tip::after { content: ''; position: absolute; left: -4px; top: -7px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #fff; }
.chat-bubble.sys { background: #fff7cf; }

/* ---------- barra in basso: icone a sinistra, chat al centro, amici a destra ---------- */
#toolbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tb); background: var(--bar); border-top: 1px solid #3a3a40; box-shadow: 0 -1px 0 #000; display: flex; align-items: center; padding: 0 8px; gap: 10px; z-index: 50; }
.tb-group { display: flex; align-items: center; gap: 2px; flex: none; }
.tb-btn { width: 48px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; position: relative; transition: transform .08s; }
.tb-btn:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(1px); }
.tb-btn canvas { display: block; max-width: 44px; max-height: 42px; }
.tb-btn .tip { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 4px; padding: 3px 7px; white-space: nowrap; font-size: 11px; font-weight: 700; display: none; pointer-events: none; }
.tb-btn:hover .tip { display: block; }
.tb-btn .badge { position: absolute; right: 2px; top: 1px; background: var(--danger); color: #fff; border: 1px solid #000; border-radius: 8px; font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 14px; }
.me-head { cursor: pointer; }
#chatbox { flex: 1; display: flex; justify-content: center; min-width: 0; }
#chatbox.hidden { display: flex !important; visibility: hidden; }
#chatbox .inner { display: flex; align-items: center; width: min(560px, 100%); min-width: 0; background: #fff; border: 1px solid #000; border-radius: 6px; height: 34px; padding: 0 6px 0 10px; box-shadow: inset 0 2px 0 #d8d8d8; }
#chatbox input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
#chatbox .cb-style { border: 0; background: #e9e7df; border-radius: 5px; padding: 3px 7px; cursor: pointer; font-size: 11px; font-weight: 700; color: #444; }

/* ---------- portafoglio in alto a destra ---------- */
#purse { position: fixed; right: 10px; top: 10px; z-index: 60; display: flex; align-items: stretch; background: var(--dark); border: 1px solid #000; border-radius: 6px; color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.4); overflow: hidden; }
.pu-cur { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-weight: 700; font-size: 14px; border-right: 1px solid #3a3a40; min-width: 84px; }
.pu-btns { display: flex; }
.pu-btn { background: transparent; border: 0; border-right: 1px solid #3a3a40; color: #fff; font-weight: 700; padding: 0 12px; cursor: pointer; font-size: 12px; }
.pu-btn:last-child { border-right: 0; }
.pu-btn:hover { background: rgba(255,255,255,.1); }
.pu-btn.red:hover { background: var(--danger); }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, #f2c230 45%, #b98a12); border: 1px solid #6e520a; display: inline-block; flex: none; }

/* ---------- notifiche: colonna sotto il portafoglio ---------- */
#notify { position: fixed; right: 10px; top: 54px; z-index: 250; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; width: 280px; }
.note { pointer-events: auto; background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; padding: 8px 11px; max-width: 280px; box-shadow: 0 2px 0 rgba(0,0,0,.4); animation: note-in .3s ease; font-weight: 700; }
.note.click { cursor: pointer; }
.note.out { opacity: 0; transform: translateX(20px); transition: all .25s; }
.note-badge { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.note-title { color: var(--gold); font-weight: 700; font-size: 11px; }
@keyframes note-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- finestre (schede) ---------- */
.win { position: absolute; background: var(--card); border: 1px solid var(--card-b); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.45); display: flex; flex-direction: column; z-index: 100; min-width: 220px; overflow: hidden; }
.win-head { height: 33px; flex: none; background: var(--head); border-bottom: 2px solid var(--head-d); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; position: relative; cursor: move; text-shadow: 0 1px 0 rgba(0,0,0,.45); touch-action: none; padding: 0 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-close { position: absolute; right: 7px; top: 6px; width: 20px; height: 20px; border-radius: 4px; background: var(--danger); border: 1px solid #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 rgba(0,0,0,.4); cursor: pointer; }
.win-close::before, .win-close::after { content: ''; position: absolute; left: 4px; top: 8px; width: 10px; height: 2px; background: #fff; border-radius: 1px; }
.win-close::before { transform: rotate(45deg); } .win-close::after { transform: rotate(-45deg); }
.win-close:hover { filter: brightness(1.15); }
.win-body { padding: 10px; overflow: auto; flex: 1; min-height: 0; }

/* ---------- pulsanti e campi ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 12px; border: 1px solid #000; border-radius: 4px; background: linear-gradient(#f4f4f4, #d6d6d6); box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.25); cursor: pointer; font-weight: 700; color: #222; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:active { box-shadow: inset 0 2px 0 rgba(0,0,0,.15); transform: translateY(1px); }
.btn.green { background: linear-gradient(#1aa126, var(--success)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 rgba(0,0,0,.25); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.red { background: linear-gradient(#cf2d22, var(--danger)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 rgba(0,0,0,.25); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.blue { background: linear-gradient(#2a8cb5, var(--primary)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 rgba(0,0,0,.25); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.field label { font-weight: 700; font-size: 11px; color: #333; }
.inp { border: 1px solid #8a8a8a; border-radius: 4px; padding: 6px 8px; background: #fff; outline: 0; box-shadow: inset 0 2px 0 #e6e6e6; width: 100%; }
.inp:focus { border-color: var(--primary); }
.tabs { display: flex; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid #9ea5ab; flex-wrap: wrap; }
.tab { padding: 6px 12px; border: 1px solid #9ea5ab; border-bottom: 0; border-radius: 5px 5px 0 0; background: var(--tab); cursor: pointer; font-weight: 700; color: #555; margin-bottom: -1px; }
.tab:hover { background: #d6d6d6; }
.tab.on { background: var(--card); color: #111; }
.list { background: var(--pane); border: 1px solid var(--pane-b); border-radius: 4px; overflow: auto; }
.list-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #ececec; cursor: pointer; }
.list-row:nth-child(even) { background: #f5f6f7; }
.list-row:hover { background: #dcecf4; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .s { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occ { min-width: 38px; text-align: center; border-radius: 4px; padding: 2px 5px; font-weight: 700; font-size: 11px; color: #fff; background: #8f969c; border: 1px solid rgba(0,0,0,.35); }
.occ.l1 { background: #3f9c35; } .occ.l2 { background: #d99a1d; } .occ.l3 { background: #c7382b; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; }
.center { text-align: center; }
.small { font-size: 11px; }
.alert-body { padding: 4px 2px 12px; font-size: 13px; white-space: pre-line; }

/* ---------- catalogo / inventario ---------- */
.cat-wrap { display: flex; gap: 10px; height: 100%; min-height: 0; }
.cat-side { width: 160px; flex: none; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.cat-page { padding: 7px 9px; border-radius: 4px; cursor: pointer; font-weight: 700; background: #ececec; border: 1px solid #b6bec5; display: flex; align-items: center; gap: 7px; }
.cat-page:hover { background: #f6f6f6; }
.cat-page.on { background: var(--primary); color: #fff; border-color: #0f4a63; }
.cat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cat-banner { height: 64px; flex: none; border-radius: 4px; background: linear-gradient(135deg, #1e7295, #58b3d6); color: #fff; padding: 10px 12px; margin-bottom: 8px; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,.3); }
.cat-banner h3 { margin: 0; font-size: 16px; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.cat-banner p { margin: 2px 0 0; opacity: .95; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; background: var(--pane); border: 1px solid var(--pane-b); border-radius: 4px; padding: 5px; overflow: auto; align-content: start; min-height: 0; }
.cell { height: 62px; border: 1px solid #d4d8dc; border-radius: 4px; background: #f2f3f4; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; overflow: hidden; }
.cell:hover { border-color: #5fa6c6; background: #e6f2f8; }
.cell.on { border: 2px solid var(--sel); background: #d3e9f4; }
.cell canvas, .cell img { max-width: 58px; max-height: 58px; }
.cell .qty { position: absolute; right: 2px; top: 1px; font-size: 10px; font-weight: 700; background: #fff; border: 1px solid #999; border-radius: 3px; padding: 0 3px; }
.cell .swatch { width: 40px; height: 40px; border-radius: 4px; border: 1px solid #0003; }
.preview { display: flex; gap: 10px; align-items: center; margin-top: 8px; background: var(--pane); border: 1px solid var(--pane-b); border-radius: 4px; padding: 8px; min-height: 110px; flex: none; }
.preview .pv-img { width: 120px; height: 100px; display: flex; align-items: center; justify-content: center; background: radial-gradient(#fafafa, #dcdfe2); border-radius: 4px; flex: none; }
.preview .pv-img canvas, .preview .pv-img img { max-width: 118px; max-height: 98px; }
.preview h4 { margin: 0 0 3px; font-size: 14px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }

/* ---------- editor avatar ---------- */
.ed-wrap { display: flex; gap: 12px; }
.ed-left { width: 150px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ed-stage { width: 150px; height: 210px; border-radius: 6px; background: linear-gradient(#bfe2f5, #e9f5fb 60%, #b9d98a 60%, #8fbf5a); border: 1px solid #6f8f7f; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; }
.ed-right { flex: 1; min-width: 0; }
.ed-parts { display: flex; gap: 3px; margin-bottom: 8px; flex-wrap: wrap; }
.ed-part { padding: 5px 9px; border-radius: 4px; background: #ececec; border: 1px solid #b6bec5; cursor: pointer; font-weight: 700; }
.ed-part.on { background: var(--primary); color: #fff; border-color: #0f4a63; }
.ed-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; margin-bottom: 8px; max-height: 190px; overflow: auto; background: var(--pane); border: 1px solid var(--pane-b); border-radius: 4px; padding: 4px; }
.ed-style { height: 58px; border: 1px solid #d4d8dc; border-radius: 4px; background: #f2f3f4; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.ed-style.on { border: 2px solid var(--sel); background: #d3e9f4; }
.ed-colors { display: flex; flex-wrap: wrap; gap: 3px; }
.ed-color { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #0006; cursor: pointer; }
.ed-color.on { outline: 2px solid #111; outline-offset: 1px; }
.gender { display: flex; gap: 4px; }

/* ---------- scheda informazioni (in basso a destra, sopra la barra) ---------- */
#infostand { position: fixed; right: 10px; bottom: calc(var(--tb) + 8px); width: 200px; background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; padding: 8px; z-index: 60; box-shadow: 0 2px 0 rgba(0,0,0,.4); max-height: calc(100vh - var(--tb) - var(--top) - 70px); overflow: auto; }
#infostand h4 { margin: 0 18px 5px 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#infostand .is-img { display: flex; justify-content: center; align-items: center; min-height: 90px; background: rgba(255,255,255,.06); border-radius: 4px; margin-bottom: 6px; }
#infostand .is-img canvas { image-rendering: pixelated; max-width: 100%; }
#infostand .is-desc { font-size: 11px; color: #c9ccd4; margin-bottom: 6px; word-break: break-word; }
#infostand .is-actions { display: flex; flex-wrap: wrap; gap: 3px; border-top: 1px solid #3a3a40; padding-top: 6px; }
#infostand .btn { padding: 3px 8px; font-size: 11px; }
#infostand .x { position: absolute; right: 7px; top: 5px; cursor: pointer; color: #aaa; font-weight: 700; }
#infostand .x:hover { color: #fff; }

/* ---------- colonna in alto a sinistra: scheda stanza e classifica ---------- */
#lefthud { position: fixed; left: 10px; top: 10px; z-index: 55; display: flex; flex-direction: column; gap: 8px; width: 240px; pointer-events: none; }
#lefthud > * { pointer-events: auto; }
#room-info { background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.4); overflow: hidden; }
.ri-head { display: flex; align-items: center; gap: 6px; padding: 7px 10px; cursor: pointer; background: rgba(255,255,255,.05); }
.ri-name { flex: 1; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-arrow { font-size: 9px; color: #aaa; }
.ri-body { padding: 2px 10px 6px; }
.ri-owner { font-size: 11px; color: #c9ccd4; }
.ri-desc { font-size: 11px; color: #9ea3ad; margin-top: 2px; word-break: break-word; }
.ri-rights { font-size: 11px; color: #8fe38f; margin-top: 2px; }
.ri-tools { display: flex; border-top: 1px solid #3a3a40; }
.ri-tool { flex: 1; background: transparent; border: 0; border-right: 1px solid #3a3a40; color: #fff; font-weight: 700; font-size: 11px; padding: 6px 4px; cursor: pointer; white-space: nowrap; }
.ri-tool:last-child { border-right: 0; }
.ri-tool:hover { background: rgba(255,255,255,.1); }
#room-info.closed .ri-body { display: none; }
#scorehud { background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; padding: 6px 10px; box-shadow: 0 2px 0 rgba(0,0,0,.4); }
#scorehud .sh-title { font-weight: 700; color: var(--gold); margin-bottom: 3px; }
#scorehud .sh-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
#scorehud .sh-row.me { color: #8fe38f; font-weight: 700; }
#place-hint { position: fixed; left: 50%; bottom: calc(var(--tb) + 10px); transform: translateX(-50%); background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; padding: 6px 12px; z-index: 55; white-space: nowrap; }

/* ---------- l'Isola ---------- */
.room-host.island { background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 14px, transparent 14px 44px), linear-gradient(#6fd0ee, #2f9fd0 55%, #1f7fb6); background-size: 200% 200%, 100% 100%; animation: sea 18s linear infinite; }
@keyframes sea { from { background-position: 0 0, 0 0; } to { background-position: 88px 88px, 0 0; } }
#farmhud { background: var(--dark); color: #fff; border: 1px solid #000; border-radius: 6px; padding: 8px; box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.fh-row { display: flex; align-items: center; gap: 8px; }
.fh-lv { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(#ffe38a, #e0a21a); color: #3b2500; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; border: 2px solid #000; flex: none; }
.fh-xp { height: 8px; background: #3a3a40; border-radius: 4px; overflow: hidden; border: 1px solid #000; }
.fh-xp > div { height: 100%; background: linear-gradient(#8fe38f, #3f9c35); }
.fh-coins { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.fh-seeds { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0; }
.fh-seed { position: relative; width: 36px; height: 36px; border-radius: 5px; background: rgba(255,255,255,.08); border: 1px solid #3a3a40; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fh-seed.on { border: 2px solid var(--gold); background: rgba(242,194,48,.18); }
.fh-seed .qty { position: absolute; right: 1px; bottom: 0; font-size: 10px; font-weight: 700; text-shadow: 0 1px 0 #000; }
.muted-l { color: #aab; }
.fh-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.fh-btn { background: rgba(255,255,255,.08); border: 1px solid #3a3a40; color: #fff; font-weight: 700; font-size: 11px; padding: 5px 4px; border-radius: 4px; cursor: pointer; }
.fh-btn:hover { background: rgba(255,255,255,.16); }
.fh-btn.wide { grid-column: 1 / -1; background: linear-gradient(#1aa126, var(--success)); border-color: #000; }
.fh-btn.busy { background: linear-gradient(#d9a441, #a8741a); }
.fh-btn.ready { background: linear-gradient(#1aa126, var(--success)); }
.fh-goal { margin-top: 6px; padding: 6px 7px; border-radius: 4px; background: #f7e7a3; color: #3b2a05; font-size: 11px; line-height: 1.35; border: 1px solid #000; }
.fh-goal b { display: block; font-size: 11px; text-transform: uppercase; color: #8a5a00; }
.fh-goal.ok { background: #bff0a8; }
.fh-goal.ok b { color: #1f6a12; }
canvas.sfl-ico { image-rendering: pixelated; }
.fm-needs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fm-need { display: inline-flex; align-items: center; gap: 3px; background: #eef3e8; border: 1px solid #9bbf8a; border-radius: 4px; padding: 1px 6px 1px 3px; font-weight: 700; font-size: 11px; }
.fm-need.miss { background: #fbe3e1; border-color: #d58a82; color: #a81a12; }
.fm-need canvas, .fm-need img { max-width: 18px; max-height: 18px; }
.farm-pop { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; font-weight: 700; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; font-size: 14px; animation: farmpop 1.3s ease-out forwards; pointer-events: none; }
@keyframes farmpop { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -40px); opacity: 0; } }
/* barra degli oggetti dell'isola (stile Minecraft) sopra la barra in basso */
#hotbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tb) + 8px); z-index: 58; display: flex; gap: 3px; padding: 4px; background: rgba(28,28,32,.9); border: 2px solid #000; border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.4); max-width: calc(100vw - 460px); overflow-x: auto; }
.hb-slot { position: relative; width: 46px; height: 46px; flex: none; background: linear-gradient(#5a5a62, #3e3e45); border: 2px solid #1b1b1f; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hb-slot:hover { filter: brightness(1.15); }
.hb-slot.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold), inset 0 0 0 1px rgba(255,255,255,.3); }
.hb-slot canvas, .hb-slot img { max-width: 32px; max-height: 32px; }
.hb-key { position: absolute; left: 3px; top: 1px; font-size: 9px; color: #ccc; font-weight: 700; }
.hb-qty { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: #fff; font-weight: 700; text-shadow: 1px 1px 0 #000; }
.hb-name { position: absolute; left: 50%; transform: translateX(-50%); bottom: 100%; margin-bottom: 4px; color: #fff; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000; white-space: nowrap; pointer-events: none; }
.hb-empty { color: #ccc; font-size: 11px; padding: 0 10px; align-self: center; }
.fm-row { cursor: default !important; }
.fm-box { background: #fff; border: 1px solid var(--pane-b); border-radius: 4px; padding: 8px; }
@media (max-width: 760px) { #hotbar { max-width: calc(100vw - 12px); bottom: calc(var(--tb) + 4px); } .hb-slot { width: 38px; height: 38px; } }
.tb-ico { display: flex; align-items: center; justify-content: center; }
.tb-ico img, .tb-ico canvas { max-width: 40px; max-height: 38px; }

/* ---------- vista dell'hotel e accesso ---------- */
#hotelview { position: absolute; inset: 0 0 var(--tb) 0; overflow: hidden; background: linear-gradient(#5fb3e6 0%, #9ad2f1 45%, #d9eef9 70%); }
body.guest #hotelview { bottom: 0; }
#hotelview.dusk { background: linear-gradient(#3d5a9e 0%, #d9829a 55%, #f6c48f 80%); }
#hotelview.night { background: radial-gradient(1200px 500px at 50% 110%, #2d4f7d 0%, transparent 70%), linear-gradient(#0b1430 0%, #1b2d5a 55%, #2e4a7c 85%); }
#hotelview.night .cloud { opacity: .18; }
#hotelview .hv-anim { position: absolute; inset: 0; image-rendering: pixelated; }
.hv-logo { position: absolute; left: 18px; top: 10px; text-align: left; pointer-events: none; animation: logo-bob 4s ease-in-out infinite; }
.hv-logo canvas { image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); width: 300px; height: auto; }
.hv-claim { margin: -4px 0 0 12px; color: #fff; font-weight: 700; font-size: 12px; text-shadow: 0 1px 0 #1b2233, 0 2px 3px rgba(0,0,0,.4); }
@keyframes logo-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
#hv-welcome { position: absolute; left: 18px; top: 116px; width: 300px; background: var(--card); border: 1px solid var(--card-b); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.4); overflow: hidden; }
#hv-welcome h2 { margin: 0; padding: 8px 12px; font-size: 14px; color: #fff; background: var(--head); border-bottom: 2px solid var(--head-d); text-shadow: 0 1px 0 rgba(0,0,0,.4); }
#hv-welcome > div { padding: 0 12px; }
#hv-welcome > div:nth-child(2) { padding-top: 8px; }
#hv-welcome > .row { padding-bottom: 10px; }
.cloud { position: absolute; background: #fff; border-radius: 40px; opacity: .92; box-shadow: 0 4px 0 rgba(160,200,230,.6); animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 55%; height: 150%; left: 12%; top: -70%; }
.cloud::after { width: 38%; height: 120%; left: 50%; top: -48%; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(calc(100vw + 300px)); } }

/* l'accesso sta a destra: la piazza con gli omini resta visibile */
#login { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: flex-end; padding-right: 6vw; pointer-events: none; }
#login .panel { pointer-events: auto; width: 330px; background: var(--card); border: 1px solid var(--card-b); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.5); overflow: hidden; max-height: calc(100vh - 20px); overflow-y: auto; }
#login .panel .win-head { cursor: default; height: 36px; font-size: 14px; }
#login .logo { text-align: center; margin: 2px 0 10px; }
#login .logo canvas { image-rendering: pixelated; max-width: 100%; }
#login .err { color: var(--danger); font-weight: 700; min-height: 16px; margin-bottom: 6px; }
.loading { position: fixed; inset: 0; background: #000c; color: #fff; display: flex; align-items: center; justify-content: center; z-index: 400; font-size: 16px; font-weight: 700; }

/* ---------- schermi piccoli (telefono) ---------- */
@media (max-width: 760px) {
  :root { --tb: 50px; }
  #toolbar { padding: 0 4px; gap: 4px; }
  .tb-btn { width: 36px; height: 42px; }
  .tb-btn canvas { max-width: 32px; max-height: 32px; }
  .tb-btn .tip { display: none !important; }
  #chatbox input { font-size: 16px; }
  #chatbox input::placeholder { color: transparent; }
  #purse { top: 6px; right: 6px; }
  .pu-cur { padding: 4px 8px; min-width: 0; font-size: 12px; }
  .pu-btn { padding: 0 8px; }
  #notify { top: 44px; right: 6px; width: 220px; }
  #lefthud { left: 6px; top: 6px; width: 180px; }
  #room-info.closed .ri-tools { display: none; }
  #infostand { width: 160px; right: 6px; }
  .hv-logo { top: 44px; left: 10px; }
  .hv-logo canvas { width: 190px; }
  .hv-claim { display: none; }
  #hv-welcome { left: 8px; right: 8px; top: auto; bottom: 10px; width: auto; }
  #login { justify-content: center; padding-right: 0; }
  #login .panel { width: min(330px, calc(100vw - 16px)); }
  .cat-wrap { flex-direction: column; }
  .cat-side { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .cat-page { padding: 4px 6px; font-size: 11px; }
  .ed-wrap { flex-direction: column; }
  .ed-left { width: 100%; }
}
