/* ================================================================
   Barista (Smjena · Kafeni ćejf) — Probaj Igraonica tema (preko style.css).
   Kiosk: Dela Gothic One je retro naslov, Rubik čitljiv tekst,
   Caveat rukom pisane poruke i PT Mono termalni račun.
   Pult, kiosk i kontrole ostaju netaknuti.
   ================================================================ */
:root {
  --caramel: #ffd23f; --caramel2: #e0a800;
  --f-disp: 'Dela Gothic One', 'Rubik', system-ui, sans-serif;
  --f-head: 'Rubik', system-ui, sans-serif;
  --hard: 0 4px 0 #05070d;
}
button:focus-visible, input:focus-visible { outline-color: #ffe14d; }

/* ulazni ekran */
.boot__t { font-family: var(--f-disp); font-size: 20px; letter-spacing: .01em; text-transform: uppercase; }
.title__kick { font: 600 14px/1.3 var(--f-head); letter-spacing: .1em; color: #ffd23f; }
.title__h { font-family: var(--f-disp); letter-spacing: .005em; text-transform: uppercase; font-size: clamp(54px, 6.8vw, 100px); text-shadow: 0 6px 0 rgba(0, 0, 0, .55); }
.btn { border: 2.5px solid #05070d; box-shadow: var(--hard); border-radius: 14px; font: 600 17px/1 var(--f-head); letter-spacing: .04em; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #05070d; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070d; }
.btn--main { background: var(--caramel); color: #1e2230; }
.btn--main:hover { background: #ffe14d; }
.btn--ghost { background: #0f172be6; color: #e2e8f0; border-color: #05070d; }
.btn--ghost:hover { background: #1d293d; border-color: #05070d; }

/* HUD */
.clock { background: #0f172b; border: 2.5px solid #05070d; box-shadow: var(--hard); border-radius: 12px; }
.clock__led { font-family: var(--f-disp); color: #ffd23f; text-shadow: 0 0 12px rgba(255, 210, 63, .45); }
.clock__led.late { color: #ff8a78; text-shadow: 0 0 12px rgba(255, 90, 69, .5); }
.chip { background: #0f172be6; border: 2.5px solid #05070d; box-shadow: 0 3px 0 #05070d; border-radius: 12px; }
.chip b { font-family: var(--f-head); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.chip svg { color: #ffd23f; }
.chip--btn:hover { background: #1d293d; }
.demo-tag { font: 600 12.5px/1 var(--f-head); letter-spacing: .06em; text-transform: uppercase; background: #0f172be6; color: #ffe14d; border: 2px solid #ffd23f; border-radius: 8px; rotate: -1.5deg; }
.cost { border: 2px solid #05070d; background: #0f172be6; }
.icon-btn { background: #0f172be6; border: 2.5px solid #05070d; box-shadow: 0 3px 0 #05070d; border-radius: 12px; }
.icon-btn:hover { background: #1d293d; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #05070d; }

/* Recepti: ikona u traci + bilježnica na papiru */
.rcp-panel { position: fixed; right: 16px; top: 66px; z-index: 30; width: min(330px, calc(100vw - 24px)); max-height: 70vh; overflow: auto;
  padding: 24px 18px 16px 50px; color: var(--ink); background: #fff7c2; border: 2.5px solid #05070d; border-radius: 6px;
  background-image: linear-gradient(90deg, transparent 0 38px, rgba(192, 40, 27, .45) 38px 40px, transparent 40px), repeating-linear-gradient(180deg, transparent 0 25px, rgba(73, 104, 150, .18) 25px 26px);
  box-shadow: 0 5px 0 #05070d, 0 24px 60px rgba(0, 0, 0, .55); font: 14px/26px var(--f-ui); }
.rcp-panel h3 { margin: 0 0 4px; font: 600 18px/1.3 var(--f-head); letter-spacing: .02em; }
.rcp-panel p { margin: 0; line-height: 26px; }
.rcp-panel small { display: block; margin-top: 8px; line-height: 1.4; color: var(--ink2); }

/* mjerači i račun */
.meters { background: rgba(15, 23, 43, .92); border: 2.5px solid #05070d; border-radius: 14px; box-shadow: 0 4px 0 #05070d; }
.meter__row span { font-family: var(--f-head); letter-spacing: .03em; font-size: 15px; }
.meter i { border: 1px solid #05070d; height: 8px; }
.ticket__paper { border: 2px solid #05070d; }
.ticket__head, .ticket__foot { font-family: var(--f-head); letter-spacing: .08em; }

/* donja traka s radnjama */
.dk { border: 2.5px solid #05070d; border-radius: 14px; background: #0f172bf0; box-shadow: var(--hard); font-family: var(--f-head); letter-spacing: .02em; }
.dk:hover { background: #1d293d; transform: translateY(-2px); box-shadow: 0 6px 0 #05070d; }
.dk:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070d; }
#bNext { background: var(--caramel); color: #1e2230; border-color: #05070d; }
#bNext:hover { background: #ffe14d; }
#bNext b { font: 600 20px/1.1 var(--f-head); }
.dk--serve { background: #fbf6e9; color: #1e2230; }

/* dijalozi i završni račun */
.modal__card { border: 3px solid #05070d; box-shadow: 0 6px 0 #05070d, 0 30px 80px rgba(0, 0, 0, .6); }
.modal__card h2, .final__receipt h2 { font-family: var(--f-disp); text-transform: uppercase; letter-spacing: .005em; }
.fverdict { font-family: var(--f-disp); text-transform: uppercase; }
.final__receipt { border: 2px solid #05070d; }

@media (max-width: 760px) {
  .clock { padding: 4px 9px 5px; border-width: 2px; }
  .clock__led { font-size: 21px; }
  .clock__sub { display: none; }
  .chip { height: 36px; padding: 0 8px; gap: 5px; border-width: 2px; }
  .chip b { font-size: 14px; }
  .chip__of { display: none; }
  .icon-btn { width: 36px; height: 36px; border-width: 2px; }
  .demo-tag { rotate: 0deg; top: 100px; font-size: 11px; border-width: 1.5px; }
  body.demo .meters, body.demo .ticket { top: 128px; }
  .rcp-panel { top: 108px; right: 8px; left: 8px; width: auto; }
  .title__h { font-size: clamp(40px, 13vw, 60px); }
}

/* Zakuhaj ga! · prikaz kampanje i sata na dan utakmice. */
.title__card {
  width: min(510px, calc(100vw - 28px)); max-width: 510px;
  max-height: calc(100dvh - 58px); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column;
  background: rgba(10, 17, 32, .89); border: 3px solid #05070d;
  box-shadow: 0 7px 0 #05070d, 0 24px 60px rgba(0, 0, 0, .3);
  border-radius: 19px; padding: 22px 24px 24px;
}
.title__h { font-size: clamp(40px, 5.1vw, 65px); margin: 8px 0 12px; line-height: 1.08; }
.title__p { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.campaign-intro { padding: 10px 14px; background: #f7edcb; color: #1b2838; border-radius: 12px; border: 2px solid #05070d; display: grid; gap: 5px; line-height: 1.35; margin-bottom: 12px; }
.title__btns { order: 1; margin-bottom: 14px; }
.campaign-shop { order: 3; }
.campaign-intro strong { font: 20px var(--f-head); }
.campaign-intro span { font-size: 13px; }
.campaign-intro small { color: #4f5664; font-weight: 600; }
.campaign-shop { border: 2px solid rgba(255, 210, 63, .48); border-radius: 12px; padding: 10px; background: rgba(6, 12, 24, .55); margin-bottom: 13px; }
.campaign-shop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.campaign-shop__head b { font: 17px var(--f-head); color: #ffe14d; }
.campaign-shop__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.campaign-shop__items button { text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 1px 4px; min-height: 57px; padding: 8px; background: #21304a; border: 2px solid #05070d; border-radius: 8px; color: #fff8e6; }
.campaign-shop__items button:hover:not(:disabled) { background: #344763; border-color: #ffe14d; }
.campaign-shop__items button:disabled { opacity: .62; cursor: default; }
.campaign-shop__items b { font: 13px var(--f-head); line-height: 1.1; }
.campaign-shop__items span { font: 11px var(--f-mono); color: #ffe14d; white-space: nowrap; }
.campaign-shop__items small { grid-column: 1 / -1; font-size: 10px; color: #d2dbe8; line-height: 1.25; }
.campaign-shop__note { font-size: 11px; margin: 7px 0 0; color: #e4d8bf; }
.btn--reset { font-size: 13px; padding: 9px 12px; opacity: .84; }
.chip--day { height: 47px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; line-height: 1.15; }
.chip--day span { font: 11px var(--f-mono); color: #ffe14d; }
.chip--day b { font-size: 14px; }
.stadium-hud { position: fixed; left: 50%; top: 78px; transform: translateX(-50%); z-index: 13; display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100vw - 32px); padding: 8px 14px; color: #fff9e6; background: #101a2bea; border: 2px solid #05070d; border-radius: 10px; font: 12px/1.3 var(--f-ui); box-shadow: 0 3px 0 #05070d; }
.stadium-hud span:first-child { max-width: 360px; }
.stadium-hud span:last-child { color: #ffe14d; white-space: nowrap; font-weight: bold; }
.derby-board { position: fixed; left: 50%; top: 127px; transform: translateX(-50%); z-index: 13; display: flex; align-items: stretch; gap: 0; border-radius: 9px; overflow: hidden; border: 2px solid #070d17; box-shadow: 0 3px 0 #070d17, 0 5px 15px #0006; font: 700 11px/1.2 var(--f-ui); }
.derby-board.hide { display: none; }
.derby-board__team { padding: 7px 11px; display: flex; justify-content: center; align-items: center; min-width: 110px; }
.derby-board__team--home { color: #f9fbff; background: #0759a8; }
.derby-board__team--away { color: #f9fbff; background: #781d3d; }
.derby-board__score { display: grid; place-items: center; background: #f7f5ed; color: #121b2a; padding: 6px 15px; font: 700 16px/1 var(--f-mono); white-space: nowrap; }
/* CPU simulacija je interni alat za testera. Skrivena je prije ponovne provjere
   naloga, a prikazuje se tek nakon potvrde testerske oznake sa servera
   (ili u lokalnom razvojnom okruženju). */
.cpu-pick { display: none; order: 2; margin: 2px 0 12px; padding: 12px; border: 2px solid #4a91e7; border-radius: 12px; background: rgba(13, 30, 53, .9); }
html.cpu-tester .cpu-pick:not([hidden]) { display: block; }
.cpu-pick[hidden] { display: none !important; }
.cpu-pick strong { display: block; color: #f6d86b; font: 18px var(--f-head); }
.cpu-pick p { color: #f1f4ff; font-size: 12px; line-height: 1.45; margin: 5px 0 8px; }
.cpu-pick__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.cpu-pick__actions button { border-radius: 8px; border: 2px solid #05070d; background: #194b8d; color: #fff; font: 14px var(--f-head); padding: 9px 10px; cursor: pointer; }
#bCpuDerby { background: #732443; }
#bTestBosanska { background: #6b4423; }
.cpu-pick__actions button:hover { filter: brightness(1.18); }
.cpu-pick__actions button:focus-visible { outline: 3px solid #ffe14d; }
.cpu-pick__actions button[aria-pressed="true"] { outline: 2px solid #ffe14d; outline-offset: -3px; }
.cpu-pick small { display: block; color: #b7cee8; margin-top: 7px; line-height: 1.35; }
.cpu-overlay { position: fixed; z-index: 35; left: 14px; bottom: 16px; max-width: min(540px, calc(100vw - 28px)); border: 2px solid #070b15; border-radius: 12px; background: #0c1a2eeb; color: #f7f6eb; padding: 10px 12px; box-shadow: 0 4px 0 #060a14, 0 6px 28px #0008; }
.cpu-overlay.hide { display: none; }
.cpu-overlay__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; font: 12px var(--f-ui); margin-bottom: 8px; }
.cpu-overlay__head b { color: #ffdf66; font: 17px var(--f-head); white-space: nowrap; }
.cpu-overlay__live { color: #49c77b; font-size: 11px; margin-left: 4px; }
.cpu-overlay__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cpu-overlay__actions button,.cpu-overlay__actions a { border: 1px solid #6e8db9; border-radius: 7px; color: #fff; background: #213957; font: 12px var(--f-ui); padding: 7px 9px; cursor: pointer; text-decoration: none; }
.cpu-overlay__actions a { background: #53213a; }
.cpu-overlay__actions button:hover,.cpu-overlay__actions a:hover { filter: brightness(1.2); }
@media (max-width: 760px) {
  .title { align-items: flex-end; padding: 0 10px 14px; }
  .title__card { padding: 14px; width: 100%; max-height: 78dvh; }
  .title__h { font-size: clamp(37px, 10vw, 56px); }
  .title__p { font-size: 12.5px; }
  .campaign-shop__items b { font-size: 12px; }
  .campaign-shop__items small { font-size: 9.5px; }
  .campaign-shop__items button { padding: 6px; }
  .campaign-shop__head { flex-wrap: wrap; }
  .chip--day { height: 36px; padding: 2px 7px; }
  .chip--day b { font-size: 11px; }
  .chip--day span { font-size: 9px; }
  .stadium-hud { top: 105px; font-size: 10px; padding: 5px 8px; }
  .stadium-hud span:first-child { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .derby-board { top: 137px; max-width: calc(100vw - 16px); font-size: 9px; }
  .derby-board__team { min-width: 75px; padding: 6px; }
  .derby-board__score { padding: 6px 8px; font-size: 14px; }
  .cpu-pick__actions button { flex: 1; font-size: 12px; }
  .cpu-overlay { bottom: 9px; left: 9px; right: 9px; max-width: initial; padding: 8px; }
  .cpu-overlay__head { font-size: 11px; }
  .cpu-overlay__actions button,.cpu-overlay__actions a { padding: 6px; font-size: 11px; }
}

/* Završni račun je svijetli papir: sekundarno dugme mora biti tamno na svijetlom (ranije tamna pozadina i tamno slovo). */
.final__btns .btn--ghost { background: transparent; color: #1e2230; border-color: #1e2230; box-shadow: 0 3px 0 #1e2230; }
.final__btns .btn--ghost:hover { background: #fff3c9; border-color: #1e2230; }
/* Otkaz */
.quit__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn--quit { background: #fff; color: #9b1c1c; border-color: #05070d; }
.btn--quit:hover { background: #ffe3e0; }

/* Na srednjim ekranima zajednička traka Probaja ne smije pokrivati „Posluži“, stanicu ni odgovore:
   postaje jezičak uz desni rub kao na mobitelu (u igri staje ispod stanja, vrh računa game.js). */
@media (min-width: 761px) and (max-width: 1320px) {
  html body .pf-dock { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); flex-direction: column; gap: 3px; padding: 5px 4px;
    border-right: 0; border-radius: 12px 0 0 12px; box-shadow: -3px 0 0 var(--pf-primary), 0 8px 24px #0007; }
  html body .pf-dock .pf-home { padding: 8px 9px; }
  html body .pf-dock .pf-home b { display: none; }
  html body .pf-dock .pf-home span { font-size: 15px; }
  html body .pf-dock .pf-sep { width: auto; height: 1px; align-self: stretch; margin: 0 3px; }
  html body .pf-dock .pf-lang { flex-direction: column; }
  html body .pf-dock .pf-stamp { display: none; }
  html body .pf-dock .pf-acct { flex-direction: column; gap: 4px; padding: 6px 4px; max-width: none; }
  html body .pf-dock .pf-acct-name { display: none; }
  html body .pf-dock .pf-acct b { font-size: 9.5px; padding: 3px 4px; }
  html body .pf-dock.zk-dock-low { transform: none; }
}
.derby-board__score.goal { animation: zk-goal 1.6s ease-out; }
@keyframes zk-goal { 0%, 30% { background: #ffd23f; transform: scale(1.18); } 100% { background: #f7f5ed; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .derby-board__score.goal { animation: none; } }
/* Između mobilnog i širokog prikaza HUD prelazi u dva reda; stadionska traka ide ispod njega. */
@media (min-width: 761px) and (max-width: 1180px) {
  .stadium-hud { top: 112px; }
  .derby-board { top: 161px; }
}

/* ================================================================
   Raspored po širinama (mobitel, tablet, desktop).
   Recenzije i obavještenja stoje u desnoj koloni (ispod stanja, a na užim
   ekranima preko njega; vrh računa `placePanels` u game.js), pa ne pokrivaju
   replike kupaca u sredini. Oblačići ih uz to zaobilaze kao prepreku.
   ================================================================ */
.toasts { left: auto; right: 16px; transform: none; width: min(300px, calc(100vw - 32px)); }
.toast { font-size: 13.5px; }
.toast:nth-child(n+3) { display: none; }

/* Tablet i manji desktop: gornja traka u dva čista reda (sat lijevo kroz oba reda). */
@media (min-width: 761px) and (max-width: 1180px) {
  .hud { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "clock day . right" "clock chips chips chips"; gap: 8px 10px; }
  .clock { grid-area: clock; }
  .chip--day { grid-area: day; }
  .chips { grid-area: chips; flex-wrap: nowrap; }
  .hud__right { grid-area: right; min-width: 0; }
  .cost { display: none; }
  .meters__cost { display: block; }
  body.demo .meters__cost { display: none; }
  .demo-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; font-size: 11px; }
  .ticket, .meters, .call { top: 118px; }
  .panel { top: 118px; max-height: calc(100% - 228px); }
  .rcp-panel { top: 118px; }
  .stadium-hud { top: 118px; max-width: max(220px, calc(100vw - 580px)); }
  .stadium-hud span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .derby-board { top: 162px; }
  .derby-board__team { min-width: 0; padding: 6px 8px; font-size: 10px; }
  .derby-board__score { padding: 6px 10px; font-size: 15px; }
  .toasts { width: 250px; }
  /* račun lijevo je visok: stanica, odgovori i sanduk stoje desno od njega, ne preko */
  .station, .reply, .drawer { left: 280px; right: 16px; width: auto; max-width: 640px; margin-left: auto; transform: none; }
  @keyframes rise { from { transform: translateY(16px); opacity: 0; } }
}

/* Mobitel: dva reda gornje trake, sitni paneli, krupna dugmad bez preklapanja.
   Ispod trake redom: demo oznaka, stanje utakmice, rezultat derbija, pa račun i stanje. */
@media (max-width: 760px) {
  body { --zk-safe: max(8px, env(safe-area-inset-top)); --zk-demo: 0px; --zk-stad: 0px; --zk-derby: 0px; }
  body.demo { --zk-demo: 26px; }
  body:has(#stadiumHud:not(.hide)) { --zk-stad: 30px; }
  body:has(#derbyBoard:not(.hide)) { --zk-derby: 34px; }
  .hud { top: var(--zk-safe); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "clock day right" "chips chips chips"; gap: 6px; align-items: center; }
  .clock { grid-area: clock; height: 36px; justify-content: center; }
  .chip--day { grid-area: day; justify-self: start; max-width: 100%; min-width: 0; overflow: hidden; }
  .chip--day b, .chip--day span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud__right { grid-area: right; justify-self: end; margin-left: 0; }
  .chips { grid-area: chips; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .chips .chip { width: 100%; justify-content: center; min-width: 0; overflow: hidden; }
  .chips .chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { width: 40px; height: 36px; }
  .demo-tag { top: calc(var(--zk-safe) + 84px); left: 8px; right: 8px; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
  .stadium-hud { top: calc(var(--zk-safe) + 84px + var(--zk-demo)); max-width: calc(100vw - 16px); }
  .derby-board { top: calc(var(--zk-safe) + 84px + var(--zk-demo) + var(--zk-stad)); }
  .ticket, .meters, body.demo .ticket, body.demo .meters, .call, body.demo .call { top: calc(var(--zk-safe) + 84px + var(--zk-demo) + var(--zk-stad) + var(--zk-derby)); }
  .panel, body.demo .panel { top: calc(var(--zk-safe) + 84px + var(--zk-demo)); max-height: calc(100% - 200px); }
  .rcp-panel { top: calc(var(--zk-safe) + 84px + var(--zk-demo)); }
  .ticket { width: min(210px, calc(100vw - 182px)); }
  .meters { width: 158px; padding: 7px 9px 6px; }
  .meter { margin-bottom: 5px; }
  .meter__row { margin-bottom: 2px; }
  .meter__row span { font-size: 12.5px; }
  .meter__row b { font-size: 12px; }
  .meter i { height: 6px; }
  .meter--boss { padding-top: 5px; margin-bottom: 2px; }
  .toasts { left: 8px; right: 56px; width: auto; }
  .toast { padding: 7px 11px; font-size: 12.5px; line-height: 1.35; max-height: 76px; overflow: hidden; }
  .toast:nth-child(n+2) { display: none; }
  .dock { bottom: max(8px, env(safe-area-inset-bottom)); }
  .dk { height: 60px; }
  .dk span { line-height: 1.1; text-align: center; }
  .station, .drawer, .reply { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 70px); }
  .station { max-height: calc(100dvh - 330px); overflow: auto; }
  .reply__opts { gap: 6px; }
  .opt { min-height: 44px; padding: 8px 14px; font-size: 13.5px; }
  .drawer { max-height: calc(100dvh - 200px); }
  .drawer__grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  /* traka Probaja: jezičak uz desni rub, ispod stanja (vrh računa game.js) */
  html body .pf-dock.zk-dock-low { transform: none; }
}

/* CPU test (samo tester): kontrole CPU-a zamjenjuju donju traku, paneli ostaju iznad njih. */
body.cpu-test-mode .dock { display: none !important; }
@media (max-width: 760px) {
  body.cpu-test-mode .cpu-overlay { bottom: max(8px, env(safe-area-inset-bottom)); }
  body.cpu-test-mode .station, body.cpu-test-mode .drawer, body.cpu-test-mode .reply { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 84px); }
}
