/* Kafeterija – okvir oko Godot platna. Igra je položena (1280×720, širi se), pa platno zauzme sav prostor ispod gornje trake.
   .panel, .bar i .tag su zauzeti u room.css, zato su ovdje .cafe, .cafebar i .meter. */
:root { --top: 64px; }
.page { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 12px 20px; display: flex; flex-direction: column; gap: 10px; }
.cafe { position: relative; width: 100%; height: calc(100svh - var(--top) - 64px); min-height: 320px; border: 2px solid var(--ink); border-radius: 20px;
  background: #2b2320; overflow: hidden; box-shadow: var(--shadow-s); }
.cafe canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.cafe:fullscreen { border: 0; border-radius: 0; height: 100vh; }
.cafe:-webkit-full-screen { border: 0; border-radius: 0; width: 100%; height: 100%; }
/* cijeli ekran bez Fullscreen API-ja (iPhone): okvir prekrije prozor, gumb × u kutu */
body.cafe-full { overflow: hidden; }
body.cafe-full .cafe { position: fixed; inset: 0; z-index: 2000; width: 100vw; height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: #000; }
.fsx { display: none; position: absolute; z-index: 5; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); width: 36px; height: 36px; padding: 0;
  border: 2px solid #161414; border-radius: 12px; background: rgba(255,253,249,.9); color: #161414; cursor: pointer; }
.fsx svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
body.cafe-full .fsx { display: grid; place-items: center; }

/* učitavanje: slika burger bara (loading-bg.webp) i kartica s room539 znakom koji se slaže kocku po kocku */
.cover { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px clamp(14px, 5%, 40px);
  background: #8fd0f5 url(loading-bg.webp) center / cover no-repeat; color: #161414; transition: opacity .5s; }
.cover.gone { opacity: 0; pointer-events: none; }
.cbox { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(340px, 88%); text-align: center; padding: 14px 20px 16px;
  background: rgba(255,253,249,.94); border: 2px solid #161414; border-radius: 18px; box-shadow: 0 6px 0 #161414; }
.cbox b { font-size: clamp(20px, 3vw, 28px); letter-spacing: -.03em; line-height: 1.1; }
.cbox span { font-size: 13px; color: #5c5650; font-weight: 500; }
.cbox span.bad { color: #c0392b; }
.lmark { width: 46px; height: 46px; overflow: visible; }
.lmark rect { fill: #161414; transform-box: fill-box; transform-origin: center; animation: lq 2.4s cubic-bezier(.34,1.56,.64,1) infinite both; }
.lmark .q2 { animation-delay: .15s; }
.lmark .q3 { animation-delay: .3s; }
.lmark .q4 { fill: #c8202b; animation-name: lq4; animation-delay: .45s; }
/* kocke iskoče redom, crvena se nakrivi kao u znaku, pa sve nestanu i ispočetka */
@keyframes lq { 0% { transform: scale(0); } 18%, 78% { transform: scale(1); } 92%, 100% { transform: scale(0); } }
@keyframes lq4 { 0% { transform: scale(0) rotate(0); } 18% { transform: scale(1) rotate(0); } 30%, 78% { transform: scale(1) rotate(12deg); } 92%, 100% { transform: scale(0) rotate(12deg); } }
.meter { display: block; width: 100%; height: 10px; border-radius: 99px; background: rgba(22,20,20,.12); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .2s; }

/* uspravan mobitel: igra je položena */
.rotate { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px;
  text-align: center; background: rgba(43,35,32,.96); color: #f6f0e1; font-weight: 600; }
.rotate p { margin: 0; max-width: 260px; font-size: 16px; line-height: 1.4; }
.rotate .phone { width: 96px; height: 96px; animation: turn 2.4s cubic-bezier(.65,0,.35,1) infinite; }
.rotate .arrow { width: 48px; height: 48px; margin: -112px 0 64px 92px; color: var(--accent); animation: hint 2.4s ease-in-out infinite; }
/* uspravno -> položeno, kratko zastane, pa ispočetka */
@keyframes turn { 0%, 15% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@keyframes hint { 0%, 15% { opacity: 1; } 45%, 100% { opacity: 0; } }
@media (orientation: portrait) and (max-width: 700px) { .rotate { display: flex; } }
@media (prefers-reduced-motion: reduce) { .rotate .phone { animation: none; transform: rotate(-90deg); } .rotate .arrow { display: none; } }

/* novac u igri je $, a room539 novčići bi uz njega zbunjivali: novčanik se ovdje ne prikazuje (zarada samo kratko izleti, coins.js) */
.topbar .coin-chip { display: none !important; }

.cafebar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.cafebar .spacer { flex: 1; }
.cafebar .note { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.save { font-size: 12px; color: var(--muted); }
.save.bad { color: var(--bad); }
@media (max-width: 700px) {
  .page { padding: 0 6px 12px; }
  .cafe { height: calc(100svh - var(--top) - 56px); border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .cover, .meter > i { transition: none; } .lmark rect { animation: none; } .lmark .q4 { transform: rotate(12deg); } }
