@font-face { font-family: Saranai; src: url("assets/font/SaranaiGame-Bold.ttf") format("truetype"); font-display: swap; }
/* Saranai nema č ć š ž đ: za ta slova koristi najbliži podebljani sistemski font */
@font-face { font-family: SaranaiHr; unicode-range: U+0106-0107, U+010C-010D, U+0110-0111, U+0160-0161, U+017D-017E;
  src: local("Arial Rounded MT Bold"), local("Arial Black"), local("Roboto Black"), local("Segoe UI Black"), local("Impact"); }

:root {
  color-scheme: dark;
  --gold: #ffd54a;
  --gold-dark: #b6741b;
  --wood: #4a2a1d;
  --wood-dark: #2a140d;
  --ink: #fff6dc;
  --green: #25c548;
  --cell: min(21vw, 21vh, 230px);
  font-family: Saranai, SaranaiHr, "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { overflow-x: hidden; overflow-y: auto; color: var(--ink); background: #060b1d url("assets/bg_main.jpg") center / cover; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; padding: 0; background: none; }
button:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.7); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }

.game { position: relative; display: grid; grid-template-rows: auto 1fr auto auto; height: 100%; max-width: 1500px; margin: 0 auto; }

/* gornja traka */
.topbar { display: flex; align-items: center; gap: clamp(6px, 1.4vw, 18px); padding: 8px clamp(8px, 2vw, 20px); background: linear-gradient(#5b3424, #3a1f15); border-bottom: 3px solid #1f0f09; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.lobby-btn img { height: clamp(34px, 6vh, 52px); width: auto; }
.wallet { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; height: clamp(34px, 6vh, 48px); padding: 0 14px 0 4px; border-radius: 99px; background: #26110b; box-shadow: inset 0 3px 8px rgba(0,0,0,.7); }
.wallet img { height: 135%; width: auto; margin-left: -4px; }
.wallet strong { font-size: clamp(1.1rem, 3vw, 1.7rem); font-weight: 400; letter-spacing: .02em; }
.level { display: flex; align-items: center; gap: 6px; flex: 0 1 300px; }
.level > img { width: clamp(30px, 5vh, 44px); margin-right: -2px; position: relative; z-index: 1; }
.level b { position: relative; z-index: 1; min-width: 30px; font-weight: 400; font-size: 1rem; text-shadow: 0 2px 0 #0007; }
.level-bar { position: relative; flex: 1; height: clamp(24px, 4vh, 32px); overflow: hidden; border-radius: 99px; background: #14243f; box-shadow: inset 0 3px 6px #000a; }
.level-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(45deg, #2f83ff 0 10px, #4b9bff 10px 20px); transition: width .6s ease; }
.level-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; text-shadow: 0 1px 0 #0008; }
.round-btn img { height: clamp(34px, 6vh, 52px); width: auto; }
.round-btn:active img, .step-btn:active img { transform: scale(.94); }

/* središnji dio */
.stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 8px; }
.machine { position: relative; padding: clamp(8px, 1.6vw, 18px); border-radius: 22px; background: var(--frame, linear-gradient(#e7b34a, #8a4e14)); box-shadow: 0 0 0 4px #3a1f15, 0 18px 50px rgba(0,0,0,.65), 0 0 60px rgba(var(--glow, 255,190,60), .3); }
.reels { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), var(--cell)); gap: 3px; padding: 3px; border-radius: 12px; background: #000; box-shadow: inset 0 0 0 2px #000; }
.reel { position: relative; height: calc(var(--cell) * 3); overflow: hidden; background: var(--reel-bg, radial-gradient(ellipse at 50% 50%, #1a1a2a, #020208 78%)); }
.reel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#000c, transparent 18%, transparent 82%, #000c); }
.reel + .reel { box-shadow: inset 2px 0 0 #26263a; }
.strip { position: absolute; left: 0; width: 100%; top: 0; will-change: transform; }
.strip img { display: block; width: 100%; height: var(--cell); padding: 7%; object-fit: contain; }
.strip.blur img { filter: blur(3px) brightness(1.1); }
.reel.anticipate { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 40px rgba(255,213,74,.6); animation: pulse .4s ease-in-out infinite alternate; }
.reel .win-glow { position: absolute; left: 0; width: 100%; top: calc(var(--cell)); height: var(--cell); pointer-events: none; z-index: 2; border: 4px solid var(--gold); border-radius: 12px; box-shadow: inset 0 0 26px var(--gold), 0 0 30px var(--gold); animation: pulse .35s ease-in-out infinite alternate; }
.win-banner { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%) scale(.6); z-index: 4; min-width: 40%; padding: 8px 26px; border-radius: 99px; text-align: center; font-size: clamp(1.1rem, 3.6vw, 1.9rem); color: #fff; background: linear-gradient(#e0225a, #8d0f35); box-shadow: 0 0 0 3px #ffd54a, 0 8px 24px #000a; opacity: 0; transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .2s; pointer-events: none; white-space: nowrap; }
.win-banner.show { opacity: 1; transform: translateX(-50%) scale(1); }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* donja traka */
.bottombar { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1.4vw, 16px); padding: 10px clamp(8px, 2vw, 20px); background: linear-gradient(#5b3424, #3a1f15); border-top: 3px solid #1f0f09; box-shadow: 0 -4px 14px rgba(0,0,0,.5); }
.bet-box { display: flex; align-items: center; gap: clamp(4px, 1vw, 10px); }
.step-btn img { height: clamp(46px, 8vh, 70px); width: auto; }
.panel { min-width: clamp(100px, 18vw, 220px); padding: 6px 14px 8px; border-radius: 10px; text-align: center; background: #26110b; box-shadow: inset 0 3px 8px #000b, 0 0 0 2px #6b3e29; }
.panel span { display: block; font-size: clamp(.65rem, 1.5vw, .9rem); color: var(--gold); letter-spacing: .06em; }
.panel strong { display: block; font-size: clamp(1.2rem, 3.2vw, 2rem); font-weight: 400; line-height: 1.1; }
.win-panel { flex: 1; max-width: 380px; }
.win-panel.flash strong { animation: winflash .3s ease-in-out 6 alternate; }
.gold-btn { min-width: clamp(60px, 9vw, 96px); height: clamp(52px, 9vh, 76px); padding: 0 10px; border-radius: 12px; line-height: .95; font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -5px 0 #b8741b, 0 0 0 3px #6b3e29; text-shadow: 0 1px 0 #fff8; }
.gold-btn:active:not(:disabled) { transform: translateY(2px); }
.spin-btn { position: relative; min-width: clamp(120px, 20vw, 230px); height: clamp(58px, 10.5vh, 92px); border-radius: 99px; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: .02em; color: var(--gold); text-shadow: 0 3px 0 #8a4e14, 0 0 12px #000a; background: radial-gradient(ellipse at 50% 0, #46e46a, #19902f 70%); box-shadow: inset 0 -6px 0 #0d5a1f, inset 0 3px 0 #9fffb2, 0 0 0 4px #5d3b79, 0 0 24px rgba(60,230,100,.45); transition: transform .08s; }
.spin-btn:not(:disabled) { animation: breathe 1.8s ease-in-out infinite; }
.spin-btn:active:not(:disabled) { transform: scale(.96); }

.statusbar { display: flex; justify-content: center; gap: 18px; padding: 3px 10px calc(3px + env(safe-area-inset-bottom)); font-size: .7rem; letter-spacing: .06em; color: #c9b894; background: #1b0d08; }
.statusbar b { color: var(--ink); font-weight: 400; }

/* big win */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(circle, rgba(70,10,40,.55), rgba(0,0,0,.85)); }
.overlay[hidden] { display: none; }
.bigwin-card { display: grid; justify-items: center; gap: clamp(8px, 2vh, 22px); animation: pop .6s cubic-bezier(.2,1.5,.4,1); }
.bigwin-card h2 { margin: 0; font-size: clamp(3.2rem, 13vw, 9rem); font-weight: 400; line-height: .9; letter-spacing: .02em; text-align: center; background: linear-gradient(#fff7c2 15%, #ffd23c 55%, #ff8d19); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 3px #b3122f; paint-order: stroke fill; filter: drop-shadow(0 8px 0 #6b0a1e) drop-shadow(0 0 28px rgba(255,200,60,.7)); animation: shake 1.2s ease-in-out infinite; }
.bigwin-amount { display: flex; align-items: center; gap: 12px; padding: 6px 34px 6px 10px; border-radius: 99px; background: linear-gradient(#e0225a, #8d0f35); box-shadow: 0 0 0 4px #ffd54a, 0 10px 40px #000a; }
.bigwin-amount img { height: clamp(40px, 8vw, 70px); width: auto; }
.bigwin-amount b { font-size: clamp(1.8rem, 7vw, 4rem); font-weight: 400; }
.collect img { width: clamp(180px, 40vw, 278px); }
.collect:active img { transform: scale(.96); }

/* dijalozi */
dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 3px solid #d99824; border-radius: 18px; color: var(--ink); background: linear-gradient(#4a2a1d, #2a140d); box-shadow: 0 25px 90px #000; }
dialog::backdrop { background: rgba(0,0,0,.75); }
dialog form { padding: 22px; }
dialog h2 { margin: 0 0 12px; font-weight: 400; font-size: 2rem; color: var(--gold); text-shadow: 0 2px 0 #0008; }
dialog p { margin: 0 0 12px; line-height: 1.5; color: #f1e3c5; font-family: system-ui, sans-serif; font-size: .9rem; }
dialog .amount, dialog .amount b { color: var(--gold); font-family: inherit; font-size: 1.3rem; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dialog-actions button, .dialog-actions a, .menu-item { display: block; min-height: 46px; padding: 10px 18px; border-radius: 10px; font-size: 1.1rem; text-decoration: none; text-align: center; color: var(--ink); background: #6b3e29; box-shadow: inset 0 -3px 0 #3a1f15; }
.dialog-actions .primary { color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -3px 0 #b8741b; }
.menu-item { width: 100%; margin-top: 8px; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 1.2rem; border-bottom: 1px solid #ffffff22; }
.toggle input { width: 26px; height: 26px; accent-color: var(--green); }
.paytable { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; text-align: center; }
.paytable img { width: 70%; margin: 0 auto; }
.paytable b { display: block; color: var(--gold); font-size: 1.5rem; font-weight: 400; }
.paytable span { font: .72rem system-ui, sans-serif; color: #d9c8a4; }
table { width: 100%; border-collapse: collapse; font: .8rem system-ui, sans-serif; }
th, td { padding: 5px 3px; border-bottom: 1px solid #ffffff1a; text-align: left; }
th:nth-child(n+2), td:nth-child(n+2) { text-align: right; }

@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: inset 0 -6px 0 #0d5a1f, inset 0 3px 0 #9fffb2, 0 0 0 4px #5d3b79, 0 0 38px rgba(60,230,100,.8); } }
@keyframes winflash { to { color: var(--gold); text-shadow: 0 0 14px var(--gold); } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
@keyframes shake { 0%,100% { transform: rotate(-1deg) scale(1); } 50% { transform: rotate(1deg) scale(1.04); } }

@media (max-width: 720px) {
  :root { --cell: min(28vw, 24vh); }
  .level { display: none; }
  .bottombar { flex-wrap: wrap; row-gap: 8px; }
  .bet-box { order: 1; flex: 1 1 100%; justify-content: center; }
  .bet-box .panel { flex: 0 1 200px; }
  .win-panel { order: 2; flex: 1 1 30%; min-width: 0; }
  .gold-btn { order: 3; }
  .spin-btn { order: 4; flex: 1; min-width: 0; }
  .statusbar { gap: 8px; font-size: .56rem; letter-spacing: .02em; }
  .statusbar span { white-space: nowrap; }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root { --cell: min(20vh, 22vw); }
  .statusbar { display: none; }
}

/* Smanjeno kretanje: gase se samo beskonačne ukrasne animacije; bubnjevi, dobitci i brojanje salda ostaju vidljivi */
@media (prefers-reduced-motion: reduce) {
  .spin-btn:not(:disabled), .overlay::before { animation: none !important; }
}

/* shop */
.shop-btn { height: clamp(34px, 6vh, 48px); padding: 0 16px; border-radius: 10px; font-size: 1.1rem; color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -4px 0 #b8741b; }
.shop-btn:active { transform: translateY(2px); }
body { background-image: var(--bg, url("assets/bg_main.jpg")); }
dialog h3 { margin: 14px 0 8px; font-weight: 400; font-size: 1.2rem; }
#shopDialog { width: min(560px, calc(100% - 28px)); max-height: 92vh; overflow: auto; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.shop-item { display: grid; gap: 6px; padding: 8px; border-radius: 12px; text-align: center; background: #26110b; box-shadow: 0 0 0 2px #6b3e29; }
.shop-item.active { box-shadow: 0 0 0 3px var(--green); }
.shop-item .thumb { height: 64px; border-radius: 8px; background-size: cover; background-position: center; }
.shop-item span { font-size: .95rem; }
.shop-item button { min-height: 36px; border-radius: 8px; font-size: .95rem; color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -3px 0 #b8741b; }
.shop-item button:disabled { filter: grayscale(.8); opacity: .6; }
.shop-msg { min-height: 1.4em; color: var(--gold); }
@media (max-width: 720px) { .shop-btn { padding: 0 10px; font-size: .95rem; } }

.toggle.range input { width: 55%; height: auto; accent-color: var(--gold); }
.gold-btn[aria-pressed="true"] { color: #fff; background: linear-gradient(#e0225a, #8d0f35); box-shadow: inset 0 -5px 0 #5d0820, 0 0 0 3px #ffd54a; text-shadow: none; }
.max-btn { min-width: clamp(54px, 8vw, 80px); }
@media (max-width: 720px) {
  .bottombar { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
  .bet-box { grid-column: 1 / -1; order: 1; }
  .win-panel { grid-column: 1 / -1; order: 2; max-width: none; padding: 4px 10px 6px; }
  .auto-btn { order: 3; } .bottombar #allInButton { order: 4; } .spin-btn { order: 5; }
  .gold-btn, .spin-btn { height: clamp(56px, 9vh, 76px); min-width: 0; }
  .topbar { gap: 6px; }
  .wallet strong { font-size: 1.1rem; }
}
@media (max-width: 380px) { .shop-btn { padding: 0 8px; font-size: .85rem; } .lobby-btn img { height: 30px; } .round-btn img { height: 32px; } }
@media (max-height: 520px) and (orientation: landscape) {
  .game { grid-template-rows: auto 1fr auto; }
  .bottombar { display: flex; padding: 4px 10px; } .bet-box, .win-panel { order: 0; grid-column: auto; }
  .step-btn img { height: 40px; } .gold-btn, .spin-btn { height: 46px; }
  .panel strong { font-size: 1.1rem; } .panel { padding: 2px 10px 4px; min-width: 90px; }
  .topbar { padding: 4px 10px; } .stage { padding: 4px; }
}
@media (max-width: 560px) {
  .topbar { padding: 6px 8px; gap: 5px; }
  .lobby-btn img { height: 30px; }
  .round-btn img { height: 34px; }
  .shop-btn { height: 34px; padding: 0 9px; font-size: .9rem; }
  .wallet { min-width: 96px; padding-right: 8px; }
  .wallet img { height: 120%; }
  .wallet strong { font-size: 1.05rem; white-space: nowrap; }
}

/* 5 bubnjeva */
body[data-reels="5"] { --cell: min(15vw, 20vh, 170px); }
@media (max-width: 720px) { body[data-reels="5"] { --cell: min(17.5vw, 21vh); } body[data-reels="5"] .reels { gap: 2px; padding: 2px; } }
@media (max-height: 520px) and (orientation: landscape) { body[data-reels="5"] { --cell: min(17vh, 12vw); } }
body[data-reels="5"] .win-banner { font-size: clamp(1rem, 3vw, 1.6rem); }

/* naredbe i obavijesti */
.cmd-log { height: 180px; margin-bottom: 10px; padding: 8px 10px; overflow-y: auto; border-radius: 10px; background: #14090a; box-shadow: inset 0 2px 8px #000a; font: .82rem/1.5 ui-monospace, Menlo, monospace; color: #e8dcc0; }
.cmd-in { color: var(--gold); }
.cmd-err { color: #ff8b9b; }
#cmdInput { width: 100%; min-height: 46px; padding: 8px 12px; border: 2px solid #6b3e29; border-radius: 10px; color: var(--ink); background: #1b0d08; font: 1rem ui-monospace, Menlo, monospace; }
#cmdInput:focus { outline: none; border-color: var(--gold); }
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 99px; background: #26110b; box-shadow: 0 0 0 2px var(--gold), 0 8px 24px #000a; opacity: 0; transform: translate(-50%, 12px); transition: .25s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.menu-item:disabled { opacity: .55; }
#menuDialog { max-height: 94vh; overflow: auto; }


/* linije dobitka */
.lines { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); z-index: 3; pointer-events: none; overflow: visible; }
.lines .pl { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px currentColor); }
.strip img { transition: filter .25s; }

/* donja traka s linijama */
.stepper { display: flex; align-items: center; gap: clamp(4px, .8vw, 8px); }
.stepper .panel { min-width: clamp(84px, 11vw, 150px); }
.total-panel { min-width: clamp(96px, 11vw, 150px); }
.total-panel.over strong { color: #ff8b9b; }
.bottombar { gap: clamp(5px, .9vw, 12px); }
.win-panel { max-width: 300px; min-width: clamp(100px, 13vw, 200px); }
.gold-btn { min-width: clamp(54px, 6.4vw, 84px); }
.win-banner { font-size: clamp(.95rem, 3vw, 1.7rem); }
table.pay { margin-bottom: 10px; }
table.pay img { width: 38px; height: 38px; object-fit: contain; }
table.pay th { font-size: .75rem; vertical-align: bottom; } table.pay th, table.pay td { text-align: center; } table.pay td { font-size: .85rem; }

@media (max-width: 1100px) and (min-width: 721px) {
  .bottombar { flex-wrap: wrap; row-gap: 8px; }
  .win-panel { order: 3; }
}
@media (max-width: 720px) {
  .bottombar { display: grid; grid-template-columns: 1fr 1fr 1fr 1.6fr; gap: 7px; padding: 8px; }
  .lines-box { grid-column: 1 / 3; order: 1; flex: none; justify-content: space-between; }
  .bet-box { grid-column: 3 / 5; order: 2; flex: none; justify-content: space-between; }
  .total-panel { grid-column: 1 / 3; order: 3; }
  .win-panel { grid-column: 3 / 5; order: 4; max-width: none; min-width: 0; }
  .auto-btn { order: 5; } #maxButton { order: 6; } .bottombar #allInButton { order: 7; } .spin-btn { order: 8; flex: none; }
  .stepper .panel { min-width: 0; flex: 1; padding: 3px 4px 5px; }
  .step-btn img { height: 40px; }
  .panel span { font-size: .6rem; }
  .panel strong { font-size: 1.1rem; }
  .gold-btn { min-width: 0; font-size: 1rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bottombar { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; padding: 4px 8px; }
  .step-btn img { height: 34px; } .gold-btn, .spin-btn { height: 42px; }
  .gold-btn { min-width: 48px; font-size: .9rem; } .spin-btn { min-width: 110px; font-size: 1.4rem; }
  .stepper .panel { min-width: 74px; } .panel span { font-size: .55rem; } .panel strong { font-size: .95rem; }
  .total-panel, .win-panel { min-width: 82px; }
  .lines-box, .bet-box, .total-panel, .win-panel, .auto-btn, #maxButton, #allInButton, .spin-btn { order: 0; grid-column: auto; }
}

/* popravak: gumbi +/− se ne smiju stiskati */
.step-btn { flex: none; }
.step-btn img { height: clamp(40px, 6.5vh, 58px); width: auto; max-width: none; }
.stepper .panel { min-width: clamp(86px, 8.5vw, 124px); padding-left: 6px; padding-right: 6px; }
.stepper .panel span { white-space: nowrap; font-size: clamp(.55rem, .9vw, .75rem); }
.total-panel { min-width: clamp(90px, 9vw, 130px); flex: none; }
.total-panel span { white-space: nowrap; font-size: clamp(.55rem, .9vw, .75rem); }
.win-panel { flex: 1 1 110px; min-width: 100px; }
.gold-btn { flex: none; min-width: clamp(52px, 5.4vw, 74px); }
.spin-btn { flex: none; min-width: clamp(110px, 15vw, 200px); }
.bottombar { flex-wrap: wrap; row-gap: 8px; }
.panel strong { font-size: clamp(1.05rem, 1.9vw, 1.7rem); white-space: nowrap; }
@media (max-width: 720px) { .step-btn img { height: 40px; } .stepper .panel { min-width: 0; } .total-panel { min-width: 0; } .win-panel { min-width: 0; } .gold-btn { min-width: 0; } .spin-btn { min-width: 0; } }
#infoDialog { max-height: 94vh; overflow: auto; }

/* besplatni okretaji */
.free-badge { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 6px 18px; border-radius: 99px; white-space: nowrap; font-size: clamp(.85rem, 2.4vw, 1.2rem); color: #fff; background: linear-gradient(#e0225a, #8d0f35); box-shadow: 0 0 0 3px #ffd54a, 0 6px 18px #0009; animation: breathe 1.6s ease-in-out infinite; }
.free-badge[hidden] { display: none; }
.free-badge b { color: var(--gold); }
body.free-mode .reels { box-shadow: inset 0 0 35px #000, 0 0 30px rgba(255, 213, 74, .5); }
.spin-btn.free { background: radial-gradient(ellipse at 50% 0, #ff5f8d, #b0124a 70%); box-shadow: inset 0 -6px 0 #6b0a2c, inset 0 3px 0 #ffc0d4, 0 0 0 4px #ffd54a, 0 0 24px rgba(255,80,130,.55); font-size: clamp(1.3rem, 3.6vw, 2.2rem); }

/* računi, statistika, ljestvica */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { flex: 1; min-height: 42px; border-radius: 10px; font-size: 1.05rem; color: var(--ink); background: #3a1f15; box-shadow: inset 0 -3px 0 #1f0f09; }
.tab.active { color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -3px 0 #b8741b; }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; margin-bottom: 4px; font-size: .9rem; color: var(--gold); }
.field input { width: 100%; min-height: 46px; padding: 8px 12px; border: 2px solid #6b3e29; border-radius: 10px; color: var(--ink); background: #1b0d08; font: 1rem system-ui, sans-serif; }
.field input:focus { outline: none; border-color: var(--gold); }
.hint { font-size: .8rem; color: #d9c8a4; }
.form-error { min-height: 1.3em; margin: 0 0 8px; color: #ff8b9b; font: .9rem system-ui, sans-serif; }
.wide { width: 100%; }
button.primary.wide { min-height: 48px; border-radius: 10px; font-size: 1.15rem; color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); box-shadow: inset 0 -3px 0 #b8741b; }
.or { margin: 12px 0 8px; text-align: center; color: #d9c8a4; font-size: .85rem; }
#googleBtn { display: flex; justify-content: center; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { padding: 8px 12px; border-radius: 99px; font-size: .9rem; background: #3a1f15; box-shadow: inset 0 -2px 0 #1f0f09; }
.chip.active { color: #4a2606; background: linear-gradient(#ffe58a, #f0a526); }
.board { margin: 0 0 10px; padding: 0; list-style: none; max-height: 46vh; overflow: auto; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #ffffff1a; font-size: 1.05rem; }
.board li.me { background: rgba(255, 213, 74, .14); border-radius: 8px; }
.board .rank { color: var(--gold); } .board .val { color: var(--gold); }
.board li:nth-child(-n+3) .rank { font-size: 1.3rem; }
.statgrid { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0 0 12px; font-size: 1.05rem; }
.statgrid dt { color: #d9c8a4; } .statgrid dd { margin: 0; text-align: right; color: var(--gold); }
.statgrid h3 { grid-column: 1 / -1; margin: 10px 0 0; }
.special { display: grid; gap: 10px; margin: 6px 0 12px; }
.special > div { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
.special img { width: 48px; height: 48px; object-fit: contain; } .special p { margin: 0; font-size: .82rem; }
#accountDialog, #statsDialog, #freeDialog { max-height: 94vh; overflow: auto; }

/* Saranai je font samo s velikim slovima: sve velikim slovima da se rezervna slova (č ć š ž đ) slažu; dugi tekstovi ostaju normalni */
body { text-transform: uppercase; }
dialog p, .hint, .form-error, table, th, td, .special p, .cmd-log, input, .dialog-actions a:not(.x) { text-transform: none; }
dialog .amount, dialog .amount b { text-transform: uppercase; }
button { text-transform: uppercase; }

/* ---- animacije ---- */
.shop-item .thumb.glyph { display: grid; place-items: center; font-size: 2rem; color: #2a140d; text-shadow: 0 1px 0 #fff6; }
.strip img.win-pop { animation: winpop .5s cubic-bezier(.3,1.6,.5,1) 3; }
@keyframes winpop { 0%,100% { transform: scale(1); } 45% { transform: scale(1.16) rotate(-2deg); filter: brightness(1.35) drop-shadow(0 0 12px #ffd54a); } }
.lines.reveal { animation: reveal .55s cubic-bezier(.3,.7,.3,1) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.machine.thud { animation: thud .24s cubic-bezier(.3,1.5,.5,1); }
@keyframes thud { 0% { transform: translateY(0); } 35% { transform: translateY(3px) scale(.995); } 100% { transform: translateY(0); } }
#balance.bump { display: inline-block; animation: bump .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); color: var(--gold); text-shadow: 0 0 14px var(--gold); } 100% { transform: scale(1); } }
dialog[open] { animation: dlgIn .24s cubic-bezier(.2,.9,.3,1.15); }
dialog[open]::backdrop { animation: fadeIn .22s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay { overflow: hidden; }
.overlay::before { content: ""; position: absolute; inset: -60%; z-index: 0; pointer-events: none; background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .17) 0 7deg, transparent 7deg 14deg); animation: rays 16s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 0 22%, transparent 62%); mask-image: radial-gradient(circle, #000 0 22%, transparent 62%); }
.bigwin-card { position: relative; z-index: 1; }
@keyframes rays { to { transform: rotate(360deg); } }
.win-banner.show { animation: bannerIn .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes bannerIn { from { transform: translateX(-50%) translateY(18px) scale(.7); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.spin-btn:not(:disabled):hover { filter: brightness(1.1); }
.gold-btn:not(:disabled):hover, .shop-item button:not(:disabled):hover, .tab:hover { filter: brightness(1.08); }

#brokeLogin[hidden] { display: none; }

/* mobitel: dodirne mete najmanje oko 44 px. Slike ostaju iste veličine, a nevidljivi rub proširuje područje dodira, da bubnjevi ne izgube mjesto. */
html { touch-action: manipulation; }
.lobby-btn, .round-btn, .shop-btn, .step-btn { position: relative; }
.lobby-btn::after, .round-btn::after, .shop-btn::after { content: ""; position: absolute; inset: -6px -3px; }
.lobby-btn::after { inset: -10px -3px; }
.step-btn::after { content: ""; position: absolute; inset: -4px -6px; }
.toggle[hidden] { display: none; }
.toggle.range input { height: 44px; }
.tab, .chip, .shop-item button { min-height: 44px; }
.dialog-actions { flex-wrap: wrap; }
.dialog-actions > * { flex: 1 1 auto; }
#balance { white-space: nowrap; }
@media (max-width: 720px) {
  /* dugačak natpis dobitka lomi se u retke umjesto da ga odreže rub ekrana */
  .win-banner { width: max-content; max-width: calc(100vw - 28px); min-width: 0; padding: 6px 16px; white-space: normal; line-height: 1.15; }
}
@media (max-width: 400px) {
  /* traka stane na 320 px, a saldo se vidi cijeli */
  .topbar { gap: 4px; padding: 6px; }
  .lobby-btn img { height: 25px; }
  .shop-btn { padding: 0 6px; font-size: .78rem; }
  .round-btn { display: grid; place-items: center; min-width: 38px; }
  .wallet { min-width: 0; gap: 5px; padding: 0 6px 0 2px; }
  .wallet img { height: 100%; margin-left: -2px; }
  .wallet strong { font-size: .98rem; }
  .wallet strong.long { font-size: .78rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* donja traka ima dva reda: bubnjevi dobivaju samo mjesto koje preostane, da ne prekriju gumbe */
  :root, body[data-reels="5"] { --cell: calc((100dvh - 176px) / 3); }
  .machine { padding: 6px; }
}
/* Saranai nema malo đ: ova poveznica mora biti velikim slovima kao ostali gumbi */
#brokeDialog .dialog-actions a { text-transform: uppercase; }

/* tekst o igri za tražilice (lib/seo.js ga dodaje ispod igre): stranica se pomiče samo do njega */
.about { box-sizing: border-box; width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 16px 48px; text-transform: none; color: #e8dcc0; font: 15px/1.6 system-ui, "Segoe UI", sans-serif; background: #0b0b14cc; }
.about h2 { margin: 0 0 10px; font-size: 18px; color: var(--gold); }
.about p { margin: 0 0 12px; }
.about details { border-bottom: 1px solid #ffffff22; padding: 10px 0; }
.about summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.about details p { margin: 8px 0 2px; }

/* razine dobitka: big (zlatna), mega (narančasta), super (ljubičasto-zlatna) */
.win-banner[data-tier="big"] { background: linear-gradient(#ffd54a, #e08a10); color: #4a1d00; }
.win-banner[data-tier="mega"] { background: linear-gradient(#ff9a3c, #d2230f); }
.win-banner[data-tier="super"] { background: linear-gradient(#b05cff, #5a1dbd); box-shadow: 0 0 0 3px #ffd54a, 0 0 26px #b05cff, 0 8px 24px #000a; }
#bigWin[data-tier="mega"] .bigwin-card h2 { filter: drop-shadow(0 8px 0 #6b0a1e) drop-shadow(0 0 40px rgba(255,120,40,.9)); }
#bigWin[data-tier="super"] .bigwin-card h2 { background: linear-gradient(#fff 10%, #e2b8ff 45%, #ffd23c); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke-color: #4b1596; filter: drop-shadow(0 8px 0 #2a0a66) drop-shadow(0 0 46px rgba(176,92,255,.95)); }
#bigWin[data-tier="super"] .bigwin-amount { background: linear-gradient(#b05cff, #5a1dbd); }
