/* Hotel 539 – izgled. Na mobitelu je igra jedan ekran (vrata gore, trgovina dolje s vlastitim pomicanjem),
   na širem ekranu dva stupca. .panel i .bar su zauzeti u room.css, zato su ploče trgovine .pane, a trake .meter. */
:root { --top: 64px; --gold: #e0a400; --gold-soft: #fff3c4; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 12px 28px; display: flex; flex-direction: column; gap: 14px; }
.hotel { display: grid; grid-template-columns: minmax(330px, 420px) 1fr; gap: 16px; height: calc(100svh - var(--top) - 14px); min-height: 520px; }
.desk, .shop { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow-s); min-height: 0; }
.desk { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.deskTop { position: absolute; top: 10px; left: 12px; right: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save { font-size: 12px; color: var(--muted); transition: opacity .4s; }
.save.bad { color: var(--bad); }
.iconbtn { width: 36px; height: 36px; border-radius: 11px; border: 2px solid var(--ink); background: var(--bg); font-size: 17px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.money { display: flex; flex-direction: column; align-items: center; line-height: 1.05; margin-top: 18px; text-align: center; }
.money b { font-size: clamp(30px, 5.4vw, 44px); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.money small { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.money .cps { margin-top: 4px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.buffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 0; }
.buffs span { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 2px solid var(--ink); background: var(--gold-soft); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.05); } }

/* vrata, roboti sa strane i natpisi */
.stageDoor { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.door { position: relative; height: clamp(150px, 34svh, 300px); aspect-ratio: 200 / 270; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; filter: drop-shadow(4px 4px 0 rgba(22,20,20,.9)); transition: transform .08s; }
.door svg { width: 100%; height: 100%; display: block; }
.door:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 16px; }
.door .tilt { transform-origin: 100px 236px; transform: rotate(-8deg); }
.robots { display: flex; flex-direction: column; gap: 4px; width: 34px; align-items: center; }
.robots span { font-size: 24px; line-height: 1; display: inline-block; transition: transform .12s; }
.robots.left span.tap { transform: translateX(7px) rotate(12deg); }
.robots.right span.tap { transform: translateX(-7px) rotate(-12deg) scaleX(-1); }
.robots.right span { transform: scaleX(-1); }
.fx { position: absolute; inset: -40px -10px; pointer-events: none; overflow: visible; }
.fx span { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 17px; white-space: nowrap; color: var(--ink); text-shadow: 0 1px 0 var(--paper), 0 0 6px var(--paper); animation: rise .9s var(--ease-out) forwards; }
.fx span.auto { font-size: 12px; font-weight: 600; color: var(--muted); }
.fx span.crit { color: var(--accent); font-size: 23px; }
.fx span.jack { color: #b37f00; font-size: clamp(26px, 7vw, 38px); animation: boom 1.6s var(--ease-out) forwards; z-index: 2; }
.fx i { position: absolute; width: 9px; height: 9px; border-radius: 2px; animation: conf 1.2s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes rise { from { opacity: 1; transform: translate(-50%, -50%) scale(.8); } 15% { transform: translate(-50%, -60%) scale(1.08); } to { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes boom { from { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -70%) scale(1); } to { opacity: 0; transform: translate(-50%, -120%) scale(.95); } }
@keyframes conf { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
.jack { width: min(100%, 300px); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.meter { width: 100%; height: 9px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--bg); }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.jack .meter i { background: linear-gradient(90deg, #ffd23c, #e0a400); }
.mini { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 12px; }
.mini span { padding: 3px 9px; border-radius: 99px; background: var(--soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.guest { font-size: 12px; color: var(--muted); text-align: center; max-width: 340px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* zlatna kartica 539 */
.gold { position: absolute; z-index: 5; width: 74px; height: 48px; border: 2px solid var(--ink); border-radius: 9px; padding: 0; cursor: pointer;
  background: linear-gradient(135deg, #fff2b0 0%, #ffd23c 40%, #e0a400 60%, #ffe680 100%); box-shadow: 3px 3px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 4px; font-family: inherit; touch-action: manipulation; animation: float 2.4s ease-in-out infinite, glow 1s ease-in-out infinite alternate; }
.gold b { font-size: 18px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.gold span { font-size: 16px; }
.gold.fade { opacity: .45; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-9px) rotate(5deg); } }
@keyframes glow { from { box-shadow: 3px 3px 0 var(--ink), 0 0 0 0 rgba(255,210,60,.0); } to { box-shadow: 3px 3px 0 var(--ink), 0 0 18px 6px rgba(255,210,60,.75); } }

/* trgovina */
.shop { display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 2px solid var(--ink); flex: none; }
.tabs button { position: relative; border: 0; background: none; font: inherit; padding: 9px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; min-width: 0; }
.tabs button + button { border-left: 2px solid var(--line); }
.tabs button i { font-style: normal; font-size: 18px; line-height: 1.2; }
.tabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs button.sel { color: var(--ink); background: var(--soft); }
.tabs .badge { position: absolute; top: 5px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }
.shop .pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: none; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.shop .pane.sel { display: flex; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.shop h2 { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.shop h2 small { letter-spacing: 0; text-transform: none; font-weight: 500; }
.shop h2.sub { margin-top: 6px; }
.bulk { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.bulk span { margin-right: 2px; color: var(--muted); }
.bulk button { border: 2px solid var(--ink); background: var(--paper); border-radius: 10px; padding: 4px 10px; font: inherit; cursor: pointer; }
.bulk button.sel { background: var(--ink); color: var(--bg); }
.list { display: flex; flex-direction: column; gap: 7px; }

.item { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 2px solid var(--ink); border-radius: 14px; padding: 7px 10px 7px 7px; background: var(--paper); font: inherit; color: inherit; cursor: pointer; transition: transform .08s, background .15s; touch-action: manipulation; }
.item:not(.can) { cursor: default; }
.item.can { box-shadow: 3px 3px 0 var(--ink); }
.item.can:hover { transform: translate(-1px, -1px); }
.item.can:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.item:not(.can) .cost { color: var(--bad); }
.item .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 25px; position: relative; }
.item .ico em { position: absolute; right: -5px; bottom: -5px; font-style: normal; font-size: 10px; font-weight: 700; background: var(--ink); color: var(--bg); border-radius: 7px; padding: 1px 5px; }
.item .txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .txt b { font-weight: 600; font-size: 15px; line-height: 1.2; }
.item .txt small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.item .cost { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.item .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.item .own { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.item.locked { opacity: .55; cursor: default; border-style: dashed; }
.item.locked .ico { filter: grayscale(1) brightness(.2); }
.item.max { cursor: default; background: var(--ok-soft); }
.item.max .cost { color: var(--ok); }
.item.need .cost { color: var(--muted); }
.lvl .levelline { font-size: 12px; font-weight: 600; }

.bought { display: flex; flex-wrap: wrap; gap: 5px; }
.bought span { width: 32px; height: 32px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 17px; position: relative; }
.bought span em { position: absolute; right: -3px; bottom: -4px; font-style: normal; font-size: 8px; font-weight: 700; background: var(--ink); color: var(--bg); border-radius: 5px; padding: 0 3px; }

.card { border: 2px solid var(--ink); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.starcard { background: linear-gradient(160deg, var(--gold-soft), var(--paper) 70%); }
.starrow { display: flex; align-items: center; gap: 12px; }
.bigstar { font-size: 38px; line-height: 1; }
.starrow b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; display: block; line-height: 1.1; }
.starrow small { font-size: 13px; color: var(--muted); font-weight: 500; }
.starcard .meter i { background: linear-gradient(90deg, #ffd23c, #e0a400); }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.stats dt { color: var(--muted); }
.stats dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.achs button { aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 10px; background: var(--gold-soft); font-size: 19px; padding: 0; cursor: pointer; }
.achs button.no { background: var(--soft); border-color: var(--line); filter: grayscale(1); opacity: .5; }

.lb { list-style: none; display: grid; gap: 2px; }
.lb li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.lb li.me { background: var(--soft); font-weight: 600; }
.lb li i { font-style: normal; font-weight: 600; color: var(--muted); text-align: center; }
.lb li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li b { font-variant-numeric: tabular-nums; }

.toasts { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
.toasts div { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; text-align: center; animation: toast 3.2s var(--ease-out) forwards; box-shadow: 3px 3px 0 rgba(0,0,0,.2); }
.toasts div.win { background: linear-gradient(135deg, #ffe680, #ffd23c); color: var(--ink); border: 2px solid var(--ink); }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } to { opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(22,20,20,.5); display: grid; place-items: center; padding: 16px; }
.mbox { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); padding: 20px; width: min(100%, 400px); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.mbox h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; text-transform: none; color: var(--ink); }
.mbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.loading { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); font-weight: 600; transition: opacity .3s; }
.loading.gone { opacity: 0; pointer-events: none; }
.about { text-align: left; }

/* mobitel: vrata gore (stisnuta), trgovina ispod do dna ekrana */
@media (max-width: 860px) {
  .page { padding: 0 8px 24px; gap: 10px; }
  .hotel { display: flex; flex-direction: column; gap: 8px; height: calc(100svh - var(--top) - 8px); min-height: 480px; }
  .desk { flex: none; gap: 6px; padding: 8px 10px 10px; border-radius: 18px; }
  .deskTop { top: 6px; left: 10px; right: 6px; }
  .iconbtn { width: 32px; height: 32px; font-size: 15px; }
  .money { margin-top: 2px; }
  .money b { font-size: clamp(26px, 8vw, 36px); }
  .money .cps { font-size: 13px; margin-top: 2px; }
  .door { height: clamp(100px, 20svh, 200px); }
  .robots { width: 26px; gap: 1px; }
  .robots span { font-size: 18px; }
  .jack { font-size: 11px; }
  .mini { font-size: 11px; gap: 4px; }
  .guest { font-size: 11px; }
  .shop { flex: 1; border-radius: 18px; }
  .shop .pane { padding: 10px; }
  .item { grid-template-columns: 40px 1fr auto; gap: 8px; padding: 6px 8px 6px 6px; }
  .item .ico { width: 40px; height: 40px; font-size: 22px; }
  .item .txt b { font-size: 14px; }
  .item .txt small { font-size: 11px; }
  .item .own { font-size: 21px; }
}
@media (max-width: 380px) { .tabs button { font-size: 10px; } .tabs button i { font-size: 16px; } }
@media (max-height: 640px) and (max-width: 860px) { .mini, .guest { display: none; } .door { height: clamp(96px, 20svh, 160px); } }
@media (prefers-reduced-motion: reduce) { .gold, .buffs span { animation: none; } .fx span, .fx i { animation-duration: .01s; } }
