/* Menu, ustawienia, panel postaci, okno dialogowe */
/* Overlays */
.overlay{ position:fixed; inset:0; background:rgba(0,0,0,0.55); display:none; align-items:center; justify-content:center; z-index:50; }
.overlay.visible{ display:flex; }
.panel{ background:var(--ui-bg); color:#fff; border-radius:12px; padding:20px 24px; min-width:260px; max-width:90vw; box-shadow:0 8px 30px rgba(0,0,0,0.6); }
.panel h2{ margin-top:0; font-size:18px; color:var(--ui-accent); }
.panel button{ display:block; width:100%; margin:6px 0; padding:10px; border-radius:8px; border:1px solid #ffffff22; background:#ffffff12; color:#fff; font-size:14px; cursor:pointer; }
.panel button:hover{ background:#ffffff26; }
.row{ display:flex; align-items:center; justify-content:space-between; margin:8px 0; font-size:13px; gap:10px; }
.row input[type=range]{ flex:1; }
select{ background:#111; color:#fff; border:1px solid #555; border-radius:6px; padding:4px; color-scheme:dark; }
select option, select optgroup{ background:#111; color:#fff; }

/* Dialog box */
#dialog-box{ position:fixed; left:50%; bottom:18px; transform:translateX(-50%); width:min(560px,92vw); background:var(--ui-bg); color:#fff; border-radius:12px; padding:14px 16px; z-index:40; display:none; border:1px solid #ffffff22; }
#dialog-box.visible{ display:block; }
#dialog-npc-name{ color:var(--ui-accent); font-weight:bold; font-size:13px; margin-bottom:4px; }
#dialog-text{ font-size:14px; margin-bottom:10px; white-space:pre-line; }
#dialog-options button{ display:block; width:100%; text-align:left; margin:4px 0; padding:8px 10px; border-radius:8px; border:1px solid #ffffff22; background:#ffffff10; color:#fff; font-size:13px; cursor:pointer; }
#dialog-options button:hover{ background:#ffffff26; }
#dialog-options button[data-key]::before{ content:attr(data-key); display:inline-block; min-width:18px; margin-right:6px; color:var(--ui-accent); font-weight:700; }
.npc-rel{ font-size:12px; color:#cfe3d4; margin:2px 0 6px; }
#npc-body .npc-rel button{ display:inline-block; width:auto; min-height:0; padding:3px 10px; margin:0 0 0 4px; font-size:12px; }
.npc-under{ color:#ffd479; }

/* Menu i ustawienia (kolumna przewijana, sekcje, klawisze) */
#menu-overlay .panel button.primary{ background:#2e7d4f; border-color:#46b574; font-weight:700; }
#settings-overlay .panel{ width:min(440px,92vw); max-height:88vh; overflow-y:auto; -webkit-overflow-scrolling:touch; }
.set-h{ font-size:13px; color:var(--ui-accent); margin:16px 0 4px; letter-spacing:.04em; text-transform:uppercase; }
.set-hint{ font-size:11px; color:#ffffff99; margin:0 0 8px; }
#keybinds{ display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; }
#keybinds .kb{ display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:12px; }
#keybinds .kb button{ width:auto; min-width:70px; margin:0; padding:5px 8px; font-size:12px; font-weight:700; }
#keybinds .kb button.listening{ background:#c0392b; border-color:#ff8a7a; }
#gm-settings textarea{ width:100%; box-sizing:border-box; background:#0c151d; color:#fff; border:1px solid #ffffff33; border-radius:8px; padding:8px; margin-top:6px; }
#gm-settings .row input[type=range]{ flex:1; }
@media (max-width:520px){ #keybinds{ grid-template-columns:1fr; } }

/* Ogłoszenie GM: baner na górze ekranu */
#announce-banner{ position:fixed; left:50%; top:calc(64px + var(--sa-t, 0px)); transform:translate(-50%,-16px); z-index:40; width:min(560px,92vw); box-sizing:border-box; text-align:center; color:#fff;
  background:linear-gradient(180deg,#5b3a0acc,#2d1b05ee); border:2px solid #ffd27a; border-radius:16px; padding:10px 16px 12px; box-shadow:0 10px 34px #000a, 0 0 22px #ffb30055;
  opacity:0; pointer-events:none; transition:opacity .35s, transform .35s; }
#announce-banner.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
#announce-banner .an-head{ font-size:11px; letter-spacing:.16em; color:#ffd27a; font-weight:800; margin-bottom:4px; }
#announce-banner .an-from{ opacity:.75; letter-spacing:.04em; font-weight:600; }
#announce-banner .an-text{ font-size:18px; font-weight:700; line-height:1.3; text-shadow:0 2px 6px #000; overflow-wrap:anywhere; }
@media (max-height:480px){ #announce-banner{ top:calc(46px + var(--sa-t, 0px)); padding:6px 12px 8px; } #announce-banner .an-text{ font-size:15px; } }

/* blokada wielu kart */
#session-overlay{ position:fixed; inset:0; z-index:100000; display:none; align-items:center; justify-content:center; background:#05080dee; backdrop-filter:blur(6px); padding:16px; }
#session-overlay.on{ display:flex; }
#session-overlay .box{ max-width:420px; background:var(--glass,#10151f); border:1px solid #ffffff30; border-radius:16px; padding:22px; text-align:center; color:#fff; }
#session-overlay h2{ margin:0 0 8px; font-size:20px; } #session-overlay p{ opacity:.85; margin:0 0 16px; line-height:1.4; }
#session-overlay button{ min-height:44px; padding:0 20px; border-radius:12px; border:0; background:#2f6fed; color:#fff; font:600 15px system-ui; cursor:pointer; }

/* v12: ekran ładowania */
#loading{ position:fixed; inset:0; z-index:90; display:none; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:linear-gradient(#0b1530,#142a55); color:#fff; font:500 14px system-ui; text-align:center; padding:16px; box-sizing:border-box; }
#loading.on{ display:flex; }
#loading-logo{ font:700 30px system-ui; }
#loading-bar{ width:min(320px,80vw); height:10px; border-radius:5px; background:#ffffff22; overflow:hidden; }
#loading-fill{ display:block; height:100%; width:0; background:linear-gradient(90deg,#4aa3ff,#9fd0ff); }
#loading-tip{ opacity:.75; max-width:420px; font-size:13px; }
#loading-retry{ padding:8px 16px; border-radius:10px; border:1px solid #fff5; background:#2f6fed; color:#fff; font:600 14px system-ui; cursor:pointer; }
.dialog-input{ display:flex; gap:6px; margin-top:6px; } .dialog-input input{ flex:1; min-width:0; padding:8px 10px; border-radius:8px; border:1px solid #ffffff33; background:#00000040; color:#fff; font:inherit; font-size:14px; }
.dialog-input button{ width:auto !important; margin:0 !important; }
