  :root { --bg:#0b1119; --panel:#141c29; --line:rgba(255,255,255,.09); --muted:#93a1b5; --accent:#3ddc97; --primary:#1f8f63; --gold:#ffc857; }
  * { box-sizing:border-box; }
  html { touch-action:manipulation; -webkit-text-size-adjust:100%; }
  html, body { margin:0; height:100%; background:var(--bg); color:#eef0f7; font:15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow:hidden; }
  button { font:inherit; color:inherit; cursor:pointer; }
  input { font-size:16px; }   /* iPhone ne zumira polja od 16 px */
  #app { position:fixed; inset:0; display:flex; flex-direction:column; padding-top:env(safe-area-inset-top); }
  #bar { flex:none; height:52px; display:flex; align-items:center; gap:8px; padding:0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
         border-bottom:1px solid var(--line); background:#101722; min-width:0; }
  #bar .t { font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
  #bar .sp { flex:1; }
  .ibtn { flex:none; height:44px; min-width:44px; padding:0 12px; border-radius:10px; border:1px solid var(--line); background:#1a2433; font-weight:600; white-space:nowrap; }
  .ibtn.primary { background:var(--primary); border-color:var(--primary); }
  .wallet { flex:none; text-align:right; line-height:1.1; font-size:12px; color:var(--muted); white-space:nowrap; }
  .wallet b { display:block; color:#fff; font-size:15px; }
  #main { flex:1; min-height:0; position:relative; }
  #lobby { position:absolute; inset:0; overflow-y:auto; padding:16px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  #lobby h1 { margin:0 0 4px; font-size:22px; }
  #lobby .sub { color:var(--muted); margin:0 0 16px; font-size:13px; }
  .tables { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; max-width:980px; }
  .tcard { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:10px; }
  .tcard h3 { margin:0; font-size:18px; display:flex; justify-content:space-between; gap:8px; }
  .tcard h3 small { color:var(--accent); font-weight:600; white-space:nowrap; }
  .tcard .meta { display:flex; flex-wrap:wrap; gap:6px 14px; color:var(--muted); font-size:13px; }
  .tcard .seatsbar { display:flex; gap:4px; }
  .tcard .seatsbar i { flex:1; height:6px; border-radius:3px; background:rgba(255,255,255,.12); }
  .tcard .seatsbar i.on { background:var(--accent); }
  .tcard .ibtn { width:100%; }
  .note { max-width:980px; margin-top:18px; color:var(--muted); font-size:12px; line-height:1.5; }
  .msg { padding:40px 16px; text-align:center; color:var(--muted); }
  weboteka-poker { position:absolute; inset:0; }
  /* dokup za stol */
  #sheet { position:fixed; inset:0; background:rgba(0,0,0,.55); display:grid; place-items:end center; z-index:20; }
  #sheet[hidden] { display:none; }
  #sheet form { width:min(420px, 100%); background:var(--panel); border-radius:16px 16px 0 0; padding:18px 18px max(18px, env(safe-area-inset-bottom)); display:grid; gap:12px; }
  @media (min-width:700px) { #sheet { place-items:center; } #sheet form { border-radius:16px; } }
  #sheet h2 { margin:0; font-size:18px; }
  #sheet p { margin:0; color:var(--muted); font-size:13px; }
  #sheet input[type=range] { width:100%; height:44px; accent-color:var(--accent); }
  #sheet .row { display:flex; gap:8px; }
  #sheet .row > * { flex:1; }
  #sheet .amount { height:44px; border-radius:10px; border:1px solid var(--line); background:#0b111a; color:#fff; padding:0 12px; text-align:right; }
  #toast { position:fixed; left:50%; bottom:calc(90px + env(safe-area-inset-bottom)); transform:translateX(-50%); background:#263244; color:#fff; padding:10px 16px;
           border-radius:10px; font-size:14px; opacity:0; pointer-events:none; transition:opacity .2s; z-index:30; max-width:calc(100% - 32px); text-align:center; }
  #toast.show { opacity:1; }
  .demo #bar { display:none; }
  /* "na redu si" u traci + odbrojavanje zadnjih sekundi */
  #title.turn { flex:none; color:#0b1119; background:var(--gold); padding:4px 10px; border-radius:8px; }
  #title.turn.hurry { background:#ff5a6e; color:#fff; animation:pulse .5s ease-in-out infinite alternate; }
  @keyframes pulse { from { transform:scale(1); } to { transform:scale(1.06); } }
  @media (prefers-reduced-motion: reduce) { #title.turn.hurry { animation:none; } }
  #snd { font-size:18px; padding:0 10px; }
  /* uski zasloni: dok je igrač na potezu, oznaka "na redu si" ima prednost pred novčanikom i "+ Bot" */
  @media (max-width:480px) {
    #back .lbl { display:none; }
    #bar.myturn .wallet { display:none; }
  }
  #menu { font-size:20px; }
  /* izbornik i povijest ruku */
  .msheet { position:fixed; inset:0; background:rgba(0,0,0,.55); display:grid; place-items:end center; z-index:20; }
  .msheet[hidden] { display:none; }
  .msheet .panel { width:min(460px, 100%); max-height:calc(100% - 24px); display:flex; flex-direction:column; gap:12px; background:var(--panel);
                   border-radius:16px 16px 0 0; padding:18px 18px max(18px, env(safe-area-inset-bottom)); }
  .msheet .panel.tall { width:min(640px, 100%); height:min(720px, calc(100% - 24px)); }
  @media (min-width:700px) { .msheet { place-items:center; } .msheet .panel { border-radius:16px; } }
  .msheet h2 { margin:0; font-size:18px; }
  .mlist { display:grid; gap:8px; }
  .mlist .ibtn { width:100%; text-align:left; }
  .mlist .ibtn[hidden] { display:none; }
  .hhead { display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .hlist { flex:1; min-height:0; overflow-y:auto; display:grid; gap:8px; align-content:start; }
  .hand { background:#0b1119; border:1px solid var(--line); border-radius:12px; }
  .hand > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px; padding:10px 12px; min-height:44px; }
  .hand > summary::-webkit-details-marker { display:none; }
  .hand .no { color:var(--muted); font-size:12px; width:44px; flex:none; }
  .hand .cs { display:flex; gap:3px; flex:none; }
  .hand .bd { display:flex; gap:3px; flex:1; min-width:0; overflow:hidden; }
  .hand .net { flex:none; font-weight:700; font-variant-numeric:tabular-nums; }
  .hand .net.p { color:#4fd18b; } .hand .net.m { color:#ff7d8c; }
  .mc { display:inline-grid; place-items:center; width:26px; height:34px; border-radius:5px; background:#fbfbfe; font-weight:800; font-size:13px; line-height:1; }
  .mc.h { color:#d6223a; } .mc.d { color:#1f6fd1; } .mc.c { color:#178a4c; } .mc.s { color:#14142b; }
  .mc.x { background:rgba(255,255,255,.08); }
  .hand .log { padding:0 12px 12px; font-size:13px; color:#c9cbe0; display:grid; gap:2px; }
  .hand .log .st { margin-top:6px; color:var(--accent); font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
  .logo { color:var(--accent); }
  #net { flex:none; font-size:12px; color:#ffb4bf; background:rgba(214,34,58,.18); padding:4px 8px; border-radius:8px; white-space:nowrap; }
  .demo-badge { display:inline-block; font-size:12px; font-weight:700; color:var(--gold); border:1px solid rgba(255,200,87,.5); border-radius:6px; padding:0 6px; margin-left:6px; vertical-align:2px; }
  .tcard .meta .house { color:var(--gold); }
  .tcard .meta .house b { color:#fff; }
  #title .sub2 { color:var(--accent); font-weight:600; letter-spacing:2px; font-size:13px; }
  #title { letter-spacing:1px; }
