/* =========================================================================
 *  AETHERIA — style interfejsu (anime fantasy)
 * ========================================================================= */
:root {
  --gold: #e8c56a;
  --gold-dim: #a68b45;
  --ink: #0d0b14;
  --panel: rgba(20, 17, 30, 0.94);
  --panel-2: rgba(30, 26, 44, 0.96);
  --border: #4a4058;
  --border-lit: #8a7a5a;
  --text: #e8e4f0;
  --text-dim: #a9a3bb;
  --hp: #d84a5a;
  --mp: #4a7ad8;
  --st: #6fdc7a;
  --exp: #b48fff;
  --good: #6fdc7a;
  --warn: #ffb038;
  --bad: #ff5a6a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #06050a;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#game-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #14101e 0%, #06050a 75%);
}

/* CELOWNIK (2026-09-02): systemowy krzyżyk gubił się na jasnym tle (śnieg,
   marmur, pustynia). Własny kursor SVG: czerwony celownik w czarnej obwódce,
   widoczny na każdym tle. Punkt trafienia to środek (hotspot 16 16). */
canvas#game {
  display: block;
  image-rendering: auto;
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Cg%20fill='none'%20stroke='%230a0a0a'%20stroke-opacity='.9'%20stroke-width='4.5'%20stroke-linecap='round'%3E%3Ccircle%20cx='16'%20cy='16'%20r='6.5'/%3E%3Cpath%20d='M16%201.5v5M16%2025.5v5M1.5%2016h5M25.5%2016h5'/%3E%3C/g%3E%3Cg%20fill='none'%20stroke='%23ff2f2f'%20stroke-width='2.2'%20stroke-linecap='round'%3E%3Ccircle%20cx='16'%20cy='16'%20r='6.5'/%3E%3Cpath%20d='M16%201.5v5M16%2025.5v5M1.5%2016h5M25.5%2016h5'/%3E%3C/g%3E%3Ccircle%20cx='16'%20cy='16'%20r='1.5'%20fill='%23ff2f2f'%20stroke='%230a0a0a'%20stroke-width='1'/%3E%3C/svg%3E") 16 16, crosshair;
  max-width: 100%; max-height: 100%;
  box-shadow: 0 0 60px rgba(0,0,0,0.9);
}

/* ---------- Nakładki ---------- */
.overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 4, 12, 0.86);
  z-index: 50;
  overflow: auto;              /* nigdy nie chowaj treści poza ekranem */
  padding: 10px;
}
.overlay.show { display: flex; }

/* KOLEJNOŚĆ WARSTW — panel MUSI być nad ekranem startowym i ekranem śmierci.
   Wcześniej #panel-overlay dziedziczył z .overlay z-index: 50, a #title-screen
   ma 100 — więc „Wczytaj Grę” otwierało panel SCHOWANY POD ekranem tytułowym:
   nic nie było widać i żadne kliknięcie do niego nie docierało. */
#panel-overlay { z-index: 120; }

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(232,197,106,0.15), 0 18px 50px rgba(0,0,0,0.7);
  padding: 16px 18px;
  max-width: 94vw; max-height: 92vh;
  overflow: auto;
  position: relative;
}
.panel::before {
  content: ''; position: absolute; inset: 3px;
  border: 1px solid rgba(232,197,106,0.14);
  border-radius: 7px; pointer-events: none;
}

.panel h2 {
  margin: 0 0 12px; font-size: 20px; letter-spacing: 1px;
  color: var(--gold);
  font-family: "Cinzel", Georgia, serif;
  text-shadow: 0 2px 8px rgba(232,197,106,0.25);
  border-bottom: 1px solid rgba(232,197,106,0.2);
  padding-bottom: 8px;
}
.panel h3 { margin: 12px 0 6px; font-size: 14px; color: var(--gold-dim); letter-spacing: .5px; }

.close-x {
  position: absolute; top: 10px; right: 12px;
  cursor: pointer; color: var(--text-dim); font-size: 20px; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
}
.close-x:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-block; cursor: pointer;
  background: linear-gradient(180deg, #3a3350, #262034);
  border: 1px solid var(--border);
  color: var(--text); padding: 7px 14px; border-radius: 6px;
  font-size: 13px; letter-spacing: .4px;
  transition: all .12s;
}
.btn:hover { border-color: var(--gold); color: #fff; background: linear-gradient(180deg, #4a4166, #2e2740); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #6a5a2a, #4a3d18); border-color: var(--gold-dim); color: #ffeec0; }
.btn.primary:hover { background: linear-gradient(180deg, #8a7438, #5c4d20); }
.btn.danger { background: linear-gradient(180deg, #6a2a34, #47181f); border-color: #8a3a44; }
.btn.disabled, .btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { padding: 4px 9px; font-size: 11px; }

/* ---------- Ekran startowy ---------- */
#title-screen { z-index: 100; background: radial-gradient(ellipse at center, #1a1430 0%, #06040a 70%); }
/* Kontener treści menu. W trybie wyboru klasy ma sztywną wysokość, żeby panel
   klasy mógł się w nim rozłożyć i żeby przycisk startu ZAWSZE był widoczny. */
#title-screen .title-inner {
  display: flex; flex-direction: column; align-items: center;
  max-height: 100%; overflow: auto; padding: 20px; box-sizing: border-box;
}
#title-screen.class-mode .title-inner {
  height: 100%; overflow: hidden; padding: 12px 16px; width: 100%;
}
#title-screen.class-mode .title-main { font-size: 34px; letter-spacing: 5px; margin-bottom: 0; }
#title-screen.class-mode .title-sub { font-size: 11px; letter-spacing: 3px; margin-bottom: 10px; }
#title-screen.class-mode .menu-list { display: none; }
#title-screen.class-mode #title-extra {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; justify-content: center; align-items: center;
}
#title-screen .title-main {
  font-family: "Cinzel", Georgia, serif;
  font-size: 62px; letter-spacing: 8px; color: var(--gold);
  text-shadow: 0 0 30px rgba(232,197,106,0.5), 0 6px 0 #3a2a10;
  margin-bottom: 4px; text-align: center;
}
#title-screen .title-sub {
  text-align: center; color: var(--text-dim); letter-spacing: 5px;
  font-size: 15px; margin-bottom: 34px; text-transform: uppercase;
}
#title-screen .menu-list { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#title-screen .menu-item {
  cursor: pointer; font-size: 19px; padding: 9px 46px; letter-spacing: 2px;
  color: var(--text); border: 1px solid transparent; border-radius: 6px;
  transition: all .14s; font-family: "Cinzel", Georgia, serif;
}
#title-screen .menu-item:hover {
  color: var(--gold); border-color: var(--border-lit);
  background: rgba(232,197,106,0.07); letter-spacing: 4px;
}
.version-tag { position: absolute; bottom: 12px; right: 16px; color: #4a4458; font-size: 11px; }

/* ---------- Wybór klasy ---------- */
/* Panel: nagłówek + przewijalna siatka kart + STAŁY pasek akcji na dole.
   Dzięki temu „Rozpocznij przygodę” jest widoczny w każdym rozmiarze okna. */
.class-panel {
  display: flex; flex-direction: column;
  max-height: 100%; min-height: 0; overflow: hidden;
  margin-top: 0 !important;
}
.class-panel > h2 { flex: 0 0 auto; }
.class-panel .class-grid {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  align-content: flex-start; padding: 2px 6px 6px 2px;
}
.class-actions {
  flex: 0 0 auto;
  border-top: 1px solid rgba(232,197,106,0.18);
  margin: 10px -18px -16px; padding: 12px 18px;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.class-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.class-card {
  width: 220px; background: var(--panel-2); border: 2px solid var(--border);
  border-radius: 9px; padding: 12px; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; align-items: center;
}
.class-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.55); }
.class-card.selected { border-color: var(--gold); background: rgba(232,197,106,0.08); }
.class-card canvas { display: block; margin-bottom: 6px; }
.class-card .cname { font-family: "Cinzel", Georgia, serif; font-size: 18px; color: var(--gold); }
.class-card .crole { font-size: 11px; color: var(--text-dim); margin: 3px 0 7px; text-align: center; }
.class-card .cdesc { font-size: 12px; color: var(--text); line-height: 1.45; text-align: center; }
.class-card .cdiff { font-size: 11px; margin-top: 7px; color: var(--warn); }
.class-card .cquote { font-size: 11px; color: #8a84a0; font-style: italic; margin-top: 8px; text-align: center; }

/* Niskie okna (laptopy) — kompaktowe karty, żeby wszystko zmieściło się bez przewijania */
@media (max-height: 820px) {
  #title-screen.class-mode .title-main { font-size: 28px; }
  .class-card { width: 200px; padding: 9px; }
  .class-card canvas { height: 100px; margin-bottom: 2px; }
  .class-card .cname { font-size: 16px; }
  .class-card .cquote { display: none; }
}
@media (max-height: 680px) {
  #title-screen.class-mode .title-main { font-size: 22px; letter-spacing: 3px; }
  #title-screen.class-mode .title-sub { display: none; }
  .class-card { width: 180px; padding: 8px; }
  .class-card canvas { height: 78px; }
  .class-card .cdesc { font-size: 11px; line-height: 1.35; }
  .class-card .crole { margin: 2px 0 5px; }
}

/* Widoczny pasek przewijania — inaczej użytkownik nie wie, że treść ma ciąg dalszy */
.class-grid::-webkit-scrollbar, .overlay::-webkit-scrollbar,
.panel::-webkit-scrollbar, .scroll-box::-webkit-scrollbar,
.title-inner::-webkit-scrollbar { width: 10px; height: 10px; }
.class-grid::-webkit-scrollbar-track, .overlay::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track, .scroll-box::-webkit-scrollbar-track,
.title-inner::-webkit-scrollbar-track { background: rgba(0,0,0,0.35); border-radius: 6px; }
.class-grid::-webkit-scrollbar-thumb, .overlay::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb, .scroll-box::-webkit-scrollbar-thumb,
.title-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6a5a2a, #4a3d18);
  border-radius: 6px; border: 1px solid rgba(232,197,106,0.3);
}
.class-grid, .overlay, .panel, .scroll-box, .title-inner { scrollbar-color: #6a5a2a rgba(0,0,0,0.35); scrollbar-width: thin; }

/* ---------- Ekwipunek / panele siatkowe ---------- */
.tabs { display: flex; gap: 5px; margin-bottom: 10px; flex-wrap: wrap; }
.tab {
  padding: 6px 13px; cursor: pointer; font-size: 12.5px; border-radius: 5px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-dim);
}
.tab:hover { color: var(--text); }
.tab.active { background: rgba(232,197,106,0.14); color: var(--gold); border-color: var(--gold-dim); }

.inv-layout { display: flex; gap: 16px; align-items: flex-start; }
.equip-panel { width: 250px; flex-shrink: 0; }
.equip-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot {
  width: 100%; aspect-ratio: 1; background: rgba(10,8,18,0.75);
  border: 1px solid var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; transition: border-color .12s;
}
.slot:hover { border-color: var(--gold); }
.slot .slot-label { position: absolute; bottom: 2px; font-size: 8.5px; color: #5a5470; letter-spacing: .3px; }
.slot canvas { image-rendering: auto; }
.slot .plus { position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--gold); font-weight: 700; }

.inv-grid { display: grid; grid-template-columns: repeat(10, 44px); gap: 4px; }
.inv-cell {
  width: 44px; height: 44px; background: rgba(10,8,18,0.7);
  border: 1px solid var(--border); border-radius: 5px; position: relative; cursor: pointer;
}
.inv-cell:hover { border-color: var(--gold); background: rgba(232,197,106,0.06); }
.inv-cell .count { position: absolute; bottom: 1px; right: 3px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.inv-cell .plus { position: absolute; top: 1px; right: 3px; font-size: 9px; color: var(--gold); font-weight: 700; }
.inv-cell .up-arrow { position: absolute; top: 1px; left: 3px; font-size: 11px; color: var(--good); }

/* Sloty mikstur pod klawiszami F/G/H (rząd nad plecakiem). Osobna klasa,
   a nie `.inv-cell`, żeby kod (i testy) szukające przedmiotów w plecaku
   nie trafiały najpierw na pasek mikstur. */
.pot-slot {
  width: 46px; height: 46px; background: rgba(10,8,18,0.7);
  border: 1px solid var(--border); border-radius: 5px; position: relative; cursor: pointer;
}
.pot-slot:hover { border-color: var(--gold); background: rgba(232,197,106,0.06); }
.pot-slot.pusty { border-style: dashed; opacity: 0.75; }
.pot-slot .count { position: absolute; bottom: 1px; right: 3px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.pot-slot .klawisz { position: absolute; top: 1px; left: 3px; font-size: 9px; color: var(--gold); font-weight: 700; }

/* ---------- Tooltip ---------- */
#tooltip {
  position: absolute; z-index: 200; pointer-events: none; display: none;
  max-width: 330px; background: rgba(12, 10, 20, 0.97);
  border: 1px solid var(--border-lit); border-radius: 7px; padding: 9px 11px;
  font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 8px 26px rgba(0,0,0,.7);
}
#tooltip .t-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
#tooltip .t-type { color: var(--text-dim); font-size: 11px; margin-bottom: 6px; }
#tooltip .t-stat { color: #9fd8ff; }
#tooltip .t-stat.neg { color: #ff8a8a; }
#tooltip .t-desc { color: #a9a3bb; font-style: italic; margin-top: 6px; font-size: 11.5px; }
#tooltip .t-special { color: var(--gold); margin-top: 5px; font-size: 11.5px; }
#tooltip .t-use { color: var(--good); margin-top: 6px; font-size: 11.5px; }
#tooltip .t-req { color: var(--bad); margin-top: 4px; font-size: 11.5px; }
#tooltip hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 6px 0; }

/* ---------- Drzewko umiejętności ---------- */
.tree-wrap { display: flex; gap: 14px; }
.tree-col { min-width: 250px; }
.tree-col h3 { text-align: center; letter-spacing: 1px; }
.tree-grid { position: relative; height: 420px; z-index: 0; }
.tree-lvl {
  position: absolute; left: 0; right: 0; font-size: 9px; letter-spacing: 1px; color: var(--gold-dim);
  border-top: 1px dashed rgba(232,197,106,.28); padding-top: 1px; text-align: right; z-index: 0; pointer-events: none;
}
.tree-lvl.locked { color: #6a6478; border-top-color: rgba(120,110,140,.3); }
.tree-node.keystone { border-radius: 50%; border-width: 3px; }
.tree-node.keystone.available { box-shadow: 0 0 16px rgba(232,197,106,.6); }
.tree-node.ultimate { width: 54px; height: 54px; border-width: 3px; box-shadow: 0 0 18px rgba(255,215,106,.45); }
.tree-node.mastery { border-style: double; border-width: 4px; }
.tree-node {
  position: absolute; width: 46px; height: 46px; border-radius: 8px;
  background: rgba(10,8,18,0.9); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 19px; transition: all .12s; z-index: 2;
}
.tree-node:hover { transform: scale(1.1); }
.tree-node.available { border-color: var(--gold); box-shadow: 0 0 12px rgba(232,197,106,.4); }
.tree-node.maxed { border-color: var(--good); background: rgba(111,220,122,.15); }
.tree-node.learned { border-color: #7a9ad0; }
.tree-node.locked { opacity: .42; }
.tree-node canvas { display: block; pointer-events: none; }
.tree-node .rank {
  position: absolute; bottom: -6px; right: -4px; font-size: 10px;
  background: var(--ink); border: 1px solid var(--border); border-radius: 4px; padding: 0 3px;
}
.tree-line { position: absolute; background: var(--border); z-index: 1; opacity: .85; }
.skill-pick { display: inline-flex; align-items: center; gap: 6px; }
.skill-pick canvas { display: block; pointer-events: none; }

/* ---------- Dialog ---------- */
#dialog-box {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 24px; width: min(880px, 92vw);
  background: linear-gradient(180deg, rgba(20,17,30,.97), rgba(12,10,18,.97));
  border: 2px solid var(--border); border-radius: 10px;
  padding: 14px 16px 12px 118px; display: none; z-index: 60;
  box-shadow: 0 -4px 40px rgba(0,0,0,.7), inset 0 0 0 1px rgba(232,197,106,.12);
}
#dialog-box.show { display: block; }
#dialog-portrait {
  position: absolute; left: 10px; bottom: 10px; width: 96px; height: 108px;
  background: rgba(8,6,14,.9); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
#dialog-name { color: var(--gold); font-family: "Cinzel", Georgia, serif; font-size: 16px; margin-bottom: 2px; }
#dialog-title { color: var(--text-dim); font-size: 11px; margin-bottom: 8px; }
#dialog-text { font-size: 14.5px; line-height: 1.62; min-height: 52px; color: #ece8f6; }
#dialog-choices { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.dchoice {
  cursor: pointer; padding: 5px 10px; border-radius: 5px; font-size: 13.5px;
  border: 1px solid transparent; color: var(--text);
}
.dchoice:hover { background: rgba(232,197,106,.1); border-color: var(--border-lit); color: #fff; }
#dialog-more { position: absolute; right: 16px; bottom: 10px; color: var(--gold); font-size: 12px; animation: bob 1s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(3px);} }

/* ---------- Toasty i powiadomienia ---------- */
/* nad panelem (120) — potwierdzenia typu „Zapisano w slocie 2” muszą być widoczne
   także wtedy, gdy okno zapisu/wczytywania jest otwarte */
/* nad panelem (120) — potwierdzenia typu „Zapisano w slocie 2” muszą być widoczne
   także wtedy, gdy okno zapisu/wczytywania jest otwarte */
#toasts { position: absolute; left: 50%; transform: translateX(-50%); top: 82px; z-index: 130; pointer-events: none; }
.toast {
  background: rgba(14,11,22,.92); border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 6px 14px; border-radius: 5px; margin-bottom: 5px; font-size: 13px;
  animation: toastIn .25s ease-out; text-align: center;
}
.toast.good { border-left-color: var(--good); }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.boss { border-left-color: #ff3a5a; color: #ffbcc8; font-size: 15px; letter-spacing: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px);} to { opacity: 1; transform: none;} }

#quest-popup {
  position: absolute; left: 50%; transform: translateX(-50%); top: 130px;
  z-index: 70; text-align: center; pointer-events: none; display: none;
}
#quest-popup .qp-kind { color: var(--gold); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; }
#quest-popup .qp-name { font-family: "Cinzel", Georgia, serif; font-size: 26px; color: #fff; text-shadow: 0 0 18px rgba(232,197,106,.5); }

#big-message {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%);
  z-index: 71; text-align: center; pointer-events: none; display: none;
  font-family: "Cinzel", Georgia, serif; font-size: 44px; letter-spacing: 4px;
  text-shadow: 0 0 40px currentColor;
}

#map-title {
  position: absolute; left: 50%; transform: translateX(-50%); top: 60px;
  z-index: 68; text-align: center; pointer-events: none; display: none;
}
#map-title .mt-name { font-family: "Cinzel", Georgia, serif; font-size: 30px; color: var(--gold); text-shadow: 0 2px 20px rgba(0,0,0,.9); }
#map-title .mt-region { font-size: 13px; color: var(--text-dim); letter-spacing: 3px; text-transform: uppercase; }

#pickup-log { position: absolute; right: 16px; bottom: 130px; z-index: 60; text-align: right; pointer-events: none; }
.pickup-line { font-size: 12.5px; margin-bottom: 2px; text-shadow: 0 1px 3px #000; animation: toastIn .2s; }

#rare-banner {
  position: absolute; left: 50%; transform: translateX(-50%); top: 200px;
  z-index: 72; display: none; text-align: center; pointer-events: none;
}
#rare-banner .rb-label { font-size: 12px; letter-spacing: 5px; text-transform: uppercase; }
#rare-banner .rb-name { font-family: "Cinzel", Georgia, serif; font-size: 30px; text-shadow: 0 0 30px currentColor; }

/* ---------- Ekran śmierci ---------- */
#death-screen { z-index: 90; background: rgba(30, 4, 10, .72); flex-direction: column; }
#death-screen .dtitle {
  font-family: "Cinzel", Georgia, serif; font-size: 66px; color: #d84a5a;
  letter-spacing: 10px; text-shadow: 0 0 46px rgba(216,74,90,.65); margin-bottom: 10px;
}
#death-screen .dinfo { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; text-align: center; line-height: 1.8; }

/* ---------- Sklep / crafting ---------- */
.shop-layout { display: flex; gap: 16px; }
.shop-col { width: 380px; }
.list-row {
  display: flex; align-items: center; gap: 9px; padding: 5px 7px;
  border: 1px solid transparent; border-radius: 5px; cursor: pointer;
}
.list-row:hover { background: rgba(255,255,255,.05); border-color: var(--border); }
.list-row .lr-name { flex: 1; font-size: 13px; }
.list-row .lr-price { color: var(--gold); font-size: 12.5px; }
.list-row canvas { flex-shrink: 0; }
.scroll-box { max-height: 430px; overflow-y: auto; padding-right: 5px; }
.scroll-box::-webkit-scrollbar { width: 8px; }
.scroll-box::-webkit-scrollbar-track { background: rgba(0,0,0,.3); border-radius: 4px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.mat-req { font-size: 12px; }
.mat-req.ok { color: var(--good); }
.mat-req.missing { color: var(--bad); }

/* ---------- Questlog ---------- */
.quest-item { padding: 8px 10px; border-left: 3px solid var(--border); margin-bottom: 8px; background: rgba(255,255,255,.03); border-radius: 0 5px 5px 0; }
.quest-item.main { border-left-color: var(--gold); }
.quest-item.complete { border-left-color: var(--good); }
.quest-item .qi-name { font-size: 14px; color: #fff; margin-bottom: 3px; }
.quest-item .qi-type { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.quest-item .qi-desc { font-size: 12px; color: var(--text-dim); margin: 4px 0 6px; line-height: 1.5; }
.quest-item .qi-obj { font-size: 12px; color: #b8cfe0; }
.quest-item .qi-obj.done { color: var(--good); text-decoration: line-through; opacity: .7; }
.quest-item .qi-rew { font-size: 11.5px; color: var(--gold-dim); margin-top: 5px; }

/* ---------- Statystyki ---------- */
.stat-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.stat-row .sv { color: #9fd8ff; }
.stat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

/* ---------- Debug ---------- */
#debug-panel {
  position: absolute; left: 8px; top: 8px; z-index: 80; display: none;
  background: rgba(8,6,14,.94); border: 1px solid #4a4058; border-radius: 6px;
  padding: 10px; font-size: 12px; width: 250px; font-family: monospace;
}
#debug-panel.show { display: block; }
#debug-panel .dbg-row { display: flex; gap: 6px; margin-bottom: 4px; align-items: center; }
#debug-panel input, #debug-panel select {
  background: #14111e; border: 1px solid #4a4058; color: #e8e4f0;
  border-radius: 4px; padding: 3px 5px; font-size: 11px; width: 100%;
}
#debug-panel .dbg-btn { cursor: pointer; padding: 3px 6px; border: 1px solid #4a4058; border-radius: 4px; font-size: 11px; }
#debug-panel .dbg-btn:hover { background: rgba(255,255,255,.08); }
#debug-panel .dbg-btn.on { background: rgba(111,220,122,.2); border-color: #6fdc7a; }

.hint { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.kbd {
  display: inline-block; background: #241f34; border: 1px solid #4a4058;
  border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px;
  color: var(--gold); margin: 0 1px;
}
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.gold-text { color: var(--gold); }
.dim { color: var(--text-dim); }

/* =========================================================================
 *  MULTIPLAYER — czat, poczekalnia, przeglądarka pokoi
 *  (dopięte na końcu; singleplayer nie korzysta z tych klas)
 * ========================================================================= */
.text-input {
  background: #14111e; border: 1px solid #4a4058; color: #e8e4f0;
  border-radius: 5px; padding: 7px 12px; font-size: 13.5px;
  font-family: inherit; outline: none; min-width: 120px;
}
.text-input:focus { border-color: #8a78b8; }
.room-code-input {
  text-transform: uppercase; letter-spacing: 5px; font-weight: 700;
  width: 120px; min-width: 120px; text-align: center; font-size: 17px;
}
.list-row .lr-sub { color: #8a8296; font-size: 11px; margin: 0 10px; }

.room-code-box {
  display: flex; align-items: center; gap: 14px;
  background: rgba(232, 197, 106, .07); border: 1px dashed rgba(232, 197, 106, .4);
  border-radius: 8px; padding: 10px 16px; margin: 8px 0 14px;
}
.room-code-box .rc-label { color: #b8ab8a; font-size: 12px; flex: 1; }
.room-code-box .rc-value {
  font-size: 26px; font-weight: 800; letter-spacing: 7px; color: #ffe9a8;
  font-family: 'Consolas', monospace;
}

/* =========================================================================
 *  NOWE MENU TYTUŁOWE
 *  Wszystkie selektory są ograniczone do #title-screen, aby nie zmieniać
 *  paneli ekwipunku, sklepu i HUD-u.
 * ========================================================================= */
#title-screen {
  --tm-bg: #070a11;
  --tm-panel: rgba(15, 21, 33, .94);
  --tm-panel-raised: rgba(23, 32, 49, .97);
  --tm-line: rgba(177, 193, 214, .16);
  --tm-line-lit: rgba(215, 181, 109, .58);
  --tm-gold: #d7b56d;
  --tm-gold-bright: #f0d38f;
  --tm-blue: #78b7db;
  --tm-text: #eee8db;
  --tm-dim: #a8b0c0;
  z-index: 100;
  padding: 0;
  overflow: hidden;
  background: #05070c url('../assets/ui/aetheria-menu-bg.png') center / cover no-repeat;
  color: var(--tm-text);
}
#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 6, 12, .92) 0%, rgba(5, 8, 14, .47) 47%, rgba(3, 5, 10, .8) 100%),
    linear-gradient(180deg, rgba(3, 5, 10, .2), rgba(3, 5, 10, .82));
  pointer-events: none;
}
#title-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 160px 42px rgba(0, 0, 0, .74);
}
#title-screen .title-atmosphere {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: .42;
  background:
    radial-gradient(circle at 22% 24%, rgba(120, 183, 219, .12), transparent 24%),
    radial-gradient(circle at 71% 76%, rgba(215, 181, 109, .08), transparent 18%);
  animation: tmBreathe 9s ease-in-out infinite alternate;
}
#title-screen .title-inner {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100vw - 48px));
  height: min(880px, calc(100dvh - 58px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: block;
  border: 1px solid rgba(185, 201, 224, .18);
  border-radius: 18px;
  background: rgba(5, 8, 14, .68);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(215, 181, 109, .06) inset;
  backdrop-filter: blur(8px);
}
#title-screen .title-loading {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--tm-dim);
  letter-spacing: .12em;
}
#title-screen .version-tag {
  z-index: 3;
  right: 22px;
  bottom: 12px;
  color: rgba(206, 214, 226, .48);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#title-screen .tm-shell {
  display: grid;
  grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
#title-screen .tm-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(28px, 4vw, 64px);
  border-right: 1px solid var(--tm-line);
  background:
    linear-gradient(160deg, rgba(9, 14, 24, .92), rgba(8, 11, 19, .76)),
    radial-gradient(circle at 16% 10%, rgba(120, 183, 219, .12), transparent 35%),
    url('../assets/ui/aetheria-menu-bg.png') center / cover no-repeat;
  overflow: hidden;
}
#title-screen .tm-brand::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  left: -120px;
  bottom: 8%;
  border: 1px solid rgba(215, 181, 109, .12);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(215, 181, 109, .025),
    0 0 0 76px rgba(120, 183, 219, .018);
  pointer-events: none;
}
#title-screen .tm-brand-mark {
  display: flex;
  align-items: center;
  gap: 16px;
}
#title-screen .tm-rune {
  width: 52px;
  height: 60px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(215, 181, 109, .55);
  color: var(--tm-gold-bright);
  background: linear-gradient(180deg, rgba(215, 181, 109, .12), rgba(30, 36, 48, .28));
  clip-path: polygon(50% 0, 94% 20%, 84% 82%, 50% 100%, 16% 82%, 6% 20%);
  font-family: "Cinzel", Georgia, serif;
  font-size: 26px;
  text-shadow: 0 0 18px rgba(215, 181, 109, .55);
}
#title-screen .tm-brand-names { min-width: 0; }
#title-screen .tm-logo {
  color: var(--tm-gold-bright);
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: .95;
  letter-spacing: .14em;
  text-shadow: 0 5px 22px rgba(0, 0, 0, .9), 0 0 28px rgba(215, 181, 109, .18);
}
#title-screen .tm-subtitle {
  margin-top: 8px;
  color: var(--tm-dim);
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
}
#title-screen .tm-brand-copy {
  max-width: 420px;
  margin: clamp(44px, 8vh, 92px) 0 0;
  color: rgba(231, 234, 240, .82);
  font-family: Georgia, serif;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.72;
}
#title-screen .tm-omen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: rgba(168, 176, 192, .62);
  font-size: 9px;
  letter-spacing: .15em;
  white-space: nowrap;
}
#title-screen .tm-omen-line {
  width: 26px;
  height: 1px;
  background: rgba(215, 181, 109, .38);
}
#title-screen .tm-brand-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
#title-screen .tm-online-note {
  color: rgba(168, 176, 192, .62);
  font-size: 11px;
}

#title-screen .tm-workspace {
  min-width: 0;
  min-height: 0;
  padding: clamp(26px, 3.6vw, 54px);
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(145deg, rgba(12, 17, 28, .92), rgba(7, 10, 17, .88)),
    radial-gradient(circle at 100% 0, rgba(120, 183, 219, .07), transparent 34%);
  animation: tmViewIn .26s ease-out both;
  scrollbar-color: rgba(215, 181, 109, .45) rgba(0, 0, 0, .2);
  scrollbar-width: thin;
}
#title-screen .tm-header { margin-bottom: clamp(22px, 3.5vh, 38px); }
#title-screen .tm-header .tm-button.back { margin-bottom: 22px; }
#title-screen .tm-kicker {
  color: var(--tm-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
#title-screen .tm-heading {
  margin: 7px 0 7px;
  color: var(--tm-text);
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .025em;
}
#title-screen .tm-lead {
  max-width: 820px;
  margin: 0;
  color: var(--tm-dim);
  font-size: 13px;
  line-height: 1.6;
}

#title-screen .tm-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(177, 193, 214, .24);
  border-radius: 7px;
  outline: none;
  color: var(--tm-text);
  background: linear-gradient(180deg, rgba(45, 56, 75, .82), rgba(27, 35, 50, .9));
  box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
  font: 600 12px/1 inherit;
  letter-spacing: .035em;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s, transform .18s, box-shadow .18s;
}
#title-screen .tm-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(215, 181, 109, .52);
  background: linear-gradient(180deg, rgba(58, 70, 91, .9), rgba(31, 40, 56, .96));
}
#title-screen .tm-button:focus-visible,
#title-screen button:focus-visible,
#title-screen input:focus-visible {
  outline: 2px solid var(--tm-blue);
  outline-offset: 2px;
}
#title-screen .tm-button.primary {
  border-color: #c69f52;
  color: #17130a;
  background: linear-gradient(180deg, #f0d38f, #c79d51);
  box-shadow: 0 10px 30px rgba(215, 181, 109, .17), inset 0 1px rgba(255, 255, 255, .42);
}
#title-screen .tm-button.primary:hover:not(:disabled) {
  border-color: #f7dda0;
  background: linear-gradient(180deg, #f5dda2, #d6ae63);
  box-shadow: 0 12px 34px rgba(215, 181, 109, .27);
}
#title-screen .tm-button.ghost,
#title-screen .tm-button.back {
  background: rgba(22, 30, 44, .44);
  box-shadow: none;
}
#title-screen .tm-button.back { min-height: 34px; padding: 0 12px; color: var(--tm-dim); }
#title-screen .tm-button.compact { min-height: 36px; padding: 0 13px; font-size: 11px; }
#title-screen .tm-button.selected {
  color: var(--tm-gold-bright);
  border-color: rgba(215, 181, 109, .62);
  background: rgba(215, 181, 109, .12);
}
#title-screen .tm-button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
#title-screen .tm-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid rgba(177, 193, 214, .24);
  border-radius: 7px;
  outline: none;
  color: var(--tm-text);
  background: rgba(6, 10, 17, .72);
  font: 500 13px inherit;
  transition: border-color .18s, box-shadow .18s;
}
#title-screen .tm-input:focus {
  border-color: rgba(120, 183, 219, .74);
  box-shadow: 0 0 0 3px rgba(120, 183, 219, .08);
}
#title-screen .tm-input::placeholder { color: rgba(168, 176, 192, .5); }

#title-screen .tm-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
#title-screen .tm-mode-card {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid var(--tm-line);
  border-radius: 13px;
  outline: none;
  text-align: left;
  color: var(--tm-text);
  background: linear-gradient(155deg, rgba(31, 42, 60, .92), rgba(14, 20, 31, .96));
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
#title-screen .tm-mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .7;
  background: radial-gradient(circle at 100% 0, rgba(120, 183, 219, .16), transparent 43%);
  pointer-events: none;
}
#title-screen .tm-mode-card.multi::before {
  background: radial-gradient(circle at 100% 0, rgba(215, 181, 109, .17), transparent 43%);
}
#title-screen .tm-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--tm-line-lit);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}
#title-screen .tm-mode-icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  border: 1px solid rgba(120, 183, 219, .4);
  border-radius: 50%;
  color: var(--tm-blue);
  background: rgba(120, 183, 219, .08);
  font-size: 24px;
}
#title-screen .tm-mode-card.multi .tm-mode-icon {
  border-color: rgba(215, 181, 109, .45);
  color: var(--tm-gold-bright);
  background: rgba(215, 181, 109, .08);
}
#title-screen .tm-mode-label {
  position: relative;
  z-index: 1;
  margin: 28px 0 8px;
  color: var(--tm-gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .19em;
}
#title-screen .tm-mode-card strong {
  position: relative;
  z-index: 1;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
}
#title-screen .tm-mode-copy {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--tm-dim);
  font-size: 12px;
  line-height: 1.55;
}
#title-screen .tm-mode-meta {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  color: rgba(233, 237, 243, .76);
  font-size: 11px;
}
#title-screen .tm-continue {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  background: rgba(15, 22, 34, .78);
}
#title-screen .tm-continue-info {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}
#title-screen .tm-continue-info strong { font-family: "Cinzel", Georgia, serif; color: var(--tm-text); }
#title-screen .tm-continue-info > span:last-child { color: var(--tm-dim); font-size: 11px; }

#title-screen .tm-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
#title-screen .tm-section-count { color: var(--tm-dim); font-size: 11px; }
#title-screen .tm-save-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 92px;
}
#title-screen .tm-hero-card {
  min-width: 0;
  min-height: 148px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  outline: none;
  color: var(--tm-text);
  text-align: left;
  background: rgba(19, 27, 41, .78);
  cursor: pointer;
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
#title-screen .tm-hero-card:hover { transform: translateY(-1px); border-color: rgba(120, 183, 219, .42); }
#title-screen .tm-hero-card.selected {
  border-color: var(--tm-line-lit);
  background: linear-gradient(145deg, rgba(46, 48, 45, .9), rgba(24, 31, 43, .92));
  box-shadow: 0 0 0 1px rgba(215, 181, 109, .08) inset, 0 12px 30px rgba(0, 0, 0, .22);
}
#title-screen .tm-hero-portrait {
  width: 96px;
  height: 116px;
  flex: 0 0 auto;
  border-right: 1px solid var(--tm-line);
}
#title-screen .tm-hero-data {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
#title-screen .tm-hero-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--tm-text);
  font-family: "Cinzel", Georgia, serif;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#title-screen .tm-hero-class { color: #d7deea; font-size: 12px; }
#title-screen .tm-hero-detail { color: var(--tm-dim); font-size: 10px; line-height: 1.35; }
#title-screen .tm-source-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(120, 183, 219, .25);
  border-radius: 999px;
  color: #a9d7ef;
  background: rgba(120, 183, 219, .08);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
#title-screen .tm-source-badge.multi { color: #f0d38f; border-color: rgba(215, 181, 109, .28); background: rgba(215, 181, 109, .08); }
#title-screen .tm-source-badge.new { color: #a6ddb6; border-color: rgba(105, 200, 138, .28); background: rgba(105, 200, 138, .08); }
#title-screen .tm-sticky-action {
  position: sticky;
  z-index: 4;
  bottom: -1px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 -10px -10px;
  padding: 16px 10px 10px;
  border-top: 1px solid var(--tm-line);
  background: linear-gradient(180deg, rgba(12, 17, 28, 0), rgba(12, 17, 28, .98) 24%);
}
#title-screen .tm-action-summary { flex: 1; min-width: 0; color: var(--tm-dim); font-size: 11px; }
#title-screen .tm-empty-state {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px dashed rgba(177, 193, 214, .2);
  border-radius: 12px;
  text-align: center;
  background: rgba(14, 20, 31, .55);
}
#title-screen .tm-empty-symbol { color: var(--tm-gold); font-size: 42px; }
#title-screen .tm-empty-state h2 { margin: 15px 0 4px; font-family: "Cinzel", Georgia, serif; }
#title-screen .tm-empty-state p { max-width: 430px; margin: 0 0 20px; color: var(--tm-dim); }

#title-screen .tm-class-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
#title-screen .tm-class-card {
  min-width: 0;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px 18px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  outline: none;
  color: var(--tm-text);
  text-align: center;
  background: rgba(18, 26, 39, .8);
  cursor: pointer;
  transition: transform .18s, border-color .18s, background .18s;
}
#title-screen .tm-class-card:hover { transform: translateY(-2px); border-color: rgba(120, 183, 219, .4); }
#title-screen .tm-class-card.selected { border-color: var(--tm-line-lit); background: rgba(49, 47, 39, .72); }
#title-screen .tm-class-card canvas { width: 130px; height: 150px; margin-bottom: 2px; }
#title-screen .tm-class-card strong { font: 600 19px "Cinzel", Georgia, serif; }
#title-screen .tm-class-role {
  min-height: 28px;
  color: var(--tm-gold);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#title-screen .tm-class-copy { min-height: 32px; margin-top: 7px; color: var(--tm-dim); font-size: 10px; line-height: 1.45; }
#title-screen .tm-difficulty { margin-top: auto; padding-top: 12px; color: rgba(231, 235, 242, .72); font-size: 9px; }
#title-screen .tm-character-create {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  background: rgba(14, 20, 31, .84);
}
#title-screen .tm-field { display: flex; flex-direction: column; gap: 6px; color: var(--tm-dim); font-size: 10px; }
#title-screen .tm-create-summary { display: flex; flex-direction: column; gap: 2px; }
#title-screen .tm-create-summary strong { font: 600 16px "Cinzel", Georgia, serif; }
#title-screen .tm-create-summary > span:last-child { color: var(--tm-dim); font-size: 10px; }

#title-screen .tm-multi-grid {
  display: grid;
  grid-template-columns: minmax(290px, 35%) minmax(0, 1fr);
  gap: 14px;
  min-height: 590px;
}
#title-screen .tm-multi-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--tm-line);
  border-radius: 11px;
  background: rgba(15, 22, 34, .84);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}
#title-screen .tm-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#title-screen .tm-panel-heading h2 {
  margin: 3px 0 0;
  color: var(--tm-text);
  font: 600 19px "Cinzel", Georgia, serif;
}
#title-screen .tm-selected-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(215, 181, 109, .25);
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(50, 48, 41, .62), rgba(18, 26, 39, .72));
}
#title-screen .tm-selected-hero canvas { width: 124px; height: 148px; flex: 0 0 auto; }
#title-screen .tm-selected-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
#title-screen .tm-selected-info strong {
  max-width: 100%;
  overflow: hidden;
  font: 600 18px "Cinzel", Georgia, serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#title-screen .tm-selected-info > span:not(.tm-source-badge) { color: var(--tm-dim); font-size: 10px; }
#title-screen .tm-character-list {
  max-height: 245px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 3px;
  overflow-y: auto;
}
#title-screen .tm-character-row {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  color: var(--tm-text);
  text-align: left;
  background: rgba(7, 11, 19, .45);
  cursor: pointer;
}
#title-screen .tm-character-row:hover { border-color: rgba(120, 183, 219, .26); background: rgba(24, 34, 50, .72); }
#title-screen .tm-character-row.selected { border-color: rgba(215, 181, 109, .46); background: rgba(215, 181, 109, .08); }
#title-screen .tm-class-sigil {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--tm-line);
  border-radius: 50%;
  color: var(--tm-gold);
  background: rgba(15, 22, 34, .9);
  font: 600 13px "Cinzel", Georgia, serif;
}
#title-screen .tm-character-row-data { min-width: 0; display: flex; flex: 1; flex-direction: column; }
#title-screen .tm-character-row-data strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#title-screen .tm-character-row-data span { color: var(--tm-dim); font-size: 9px; }
#title-screen .tm-character-row-data small { color: rgba(168, 176, 192, .58); font-size: 8px; }
#title-screen .tm-mini-creator {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--tm-line);
}
#title-screen .tm-class-pills { display: flex; flex-wrap: wrap; gap: 5px; }

#title-screen .tm-server-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(105, 200, 138, .2);
  border-radius: 8px;
  background: rgba(105, 200, 138, .055);
}
#title-screen .tm-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #69c88a;
  box-shadow: 0 0 11px rgba(105, 200, 138, .7);
}
#title-screen .tm-server-status.error { border-color: rgba(217, 101, 112, .28); background: rgba(217, 101, 112, .06); }
#title-screen .tm-server-status.error .tm-status-dot { background: #d96570; box-shadow: 0 0 11px rgba(217, 101, 112, .62); }
#title-screen .tm-server-status > span:last-child { min-width: 0; display: flex; flex-direction: column; }
#title-screen .tm-server-status strong { font-size: 11px; }
#title-screen .tm-server-status small { color: var(--tm-dim); font-size: 9px; }
#title-screen .tm-room-list {
  min-height: 236px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
  overflow-y: auto;
}
#title-screen .tm-room-card {
  min-width: 0;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--tm-line);
  border-radius: 8px;
  outline: none;
  color: var(--tm-text);
  text-align: left;
  background: rgba(8, 13, 22, .55);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
#title-screen .tm-room-card:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(120, 183, 219, .38); background: rgba(22, 32, 48, .72); }
#title-screen .tm-room-card.selected { border-color: rgba(215, 181, 109, .58); background: rgba(215, 181, 109, .075); }
#title-screen .tm-room-card:disabled { opacity: .46; cursor: not-allowed; }
#title-screen .tm-room-main { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 4px; }
#title-screen .tm-room-title { min-width: 0; display: flex; align-items: center; gap: 8px; }
#title-screen .tm-room-title strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#title-screen .tm-room-title code {
  color: var(--tm-gold);
  background: transparent;
  font: 700 9px Consolas, monospace;
  letter-spacing: .12em;
}
#title-screen .tm-room-meta { color: var(--tm-dim); font-size: 9px; }
#title-screen .tm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
#title-screen .tm-tag {
  padding: 2px 5px;
  border: 1px solid rgba(177, 193, 214, .14);
  border-radius: 999px;
  color: rgba(210, 217, 228, .72);
  background: rgba(177, 193, 214, .045);
  font-size: 7px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
#title-screen .tm-tag.pvp { color: #e9a6ad; border-color: rgba(217, 101, 112, .24); background: rgba(217, 101, 112, .06); }
#title-screen .tm-room-count { min-width: 50px; display: flex; flex-direction: column; align-items: center; }
#title-screen .tm-room-count strong { color: var(--tm-gold-bright); font-size: 17px; }
#title-screen .tm-room-count small { color: var(--tm-dim); font-size: 8px; }
#title-screen .tm-room-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px dashed var(--tm-line);
  border-radius: 8px;
  color: var(--tm-dim);
  text-align: center;
}
#title-screen .tm-room-empty strong { color: var(--tm-text); font: 600 15px "Cinzel", Georgia, serif; }
#title-screen .tm-room-empty span { max-width: 370px; margin-top: 5px; font-size: 10px; line-height: 1.5; }
#title-screen .tm-room-skeleton {
  height: 76px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(25, 34, 50, .55) 25%, rgba(45, 58, 79, .55) 42%, rgba(25, 34, 50, .55) 62%);
  background-size: 220% 100%;
  animation: tmSkeleton 1.4s linear infinite;
}
#title-screen .tm-room-tools {
  display: grid;
  grid-template-columns: auto 92px auto;
  gap: 7px;
  margin-top: 9px;
}
#title-screen .tm-code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .18em;
  font: 700 14px Consolas, monospace;
}
#title-screen .tm-create-room {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid rgba(120, 183, 219, .18);
  border-radius: 8px;
  background: rgba(120, 183, 219, .035);
}
#title-screen .tm-create-room > .tm-button.primary,
#title-screen .tm-create-room > input[type=password] { grid-column: 1 / -1; }
#title-screen .tm-toggle-row { display: flex; flex-wrap: wrap; gap: 5px; }
#title-screen .tm-join-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--tm-line);
  border-radius: 0 0 11px 11px;
  background: rgba(7, 11, 19, .62);
}
#title-screen .tm-join-summary { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
#title-screen .tm-join-summary strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
#title-screen .tm-join-summary > span:last-child { color: var(--tm-dim); font-size: 8px; }
#title-screen .tm-join-summary .tm-input { min-height: 34px; margin-top: 3px; padding: 6px 9px; }

#title-screen .tm-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#title-screen .tm-help-card {
  padding: 17px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  background: rgba(16, 24, 37, .78);
}
#title-screen .tm-help-card h2 { margin: 0 0 14px; color: var(--tm-gold); font: 600 16px "Cinzel", Georgia, serif; }
#title-screen .tm-key-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 10px; margin: 8px 0; }
#title-screen .tm-key-row kbd {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid rgba(177, 193, 214, .24);
  border-bottom-color: rgba(177, 193, 214, .42);
  border-radius: 5px;
  color: #dfe7f1;
  background: rgba(6, 10, 17, .75);
  font: 700 9px Consolas, monospace;
}
#title-screen .tm-key-row span { color: var(--tm-dim); font-size: 10px; line-height: 1.35; }
#title-screen .tm-combat-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 2px solid var(--tm-gold);
  color: var(--tm-dim);
  background: rgba(215, 181, 109, .055);
  font-size: 11px;
}
#title-screen .tm-combat-note strong { color: var(--tm-text); font-family: "Cinzel", Georgia, serif; }

@keyframes tmViewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes tmBreathe {
  from { transform: scale(1); opacity: .32; }
  to { transform: scale(1.035); opacity: .5; }
}
@keyframes tmSkeleton {
  to { background-position-x: -220%; }
}

@media (max-width: 1120px) {
  #title-screen .title-inner { width: calc(100vw - 28px); height: calc(100dvh - 38px); }
  #title-screen .tm-shell { grid-template-columns: 260px minmax(0, 1fr); }
  #title-screen .tm-brand { padding: 30px 24px; }
  #title-screen .tm-rune { display: none; }
  #title-screen .tm-logo { font-size: 31px; }
  #title-screen .tm-brand-copy { font-size: 16px; }
  #title-screen .tm-class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #title-screen .tm-character-create { grid-template-columns: 1fr 1fr; }
  #title-screen .tm-character-create > .tm-button { grid-column: 1 / -1; }
  #title-screen .tm-help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #title-screen { overflow-x: hidden; overflow-y: auto; }
  #title-screen .title-atmosphere { inset: 0; }
  #title-screen .title-inner { width: calc(100vw - 18px); height: calc(100dvh - 24px); border-radius: 12px; }
  #title-screen .tm-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  #title-screen .tm-brand { min-height: 112px; padding: 18px 22px; border-right: 0; border-bottom: 1px solid var(--tm-line); }
  #title-screen .tm-brand-copy, #title-screen .tm-omen { display: none; }
  #title-screen .tm-brand-bottom { position: absolute; right: 18px; bottom: 16px; margin: 0; }
  #title-screen .tm-online-note { display: none; }
  #title-screen .tm-workspace { padding: 24px; }
  #title-screen .tm-multi-grid { grid-template-columns: 1fr; }
  #title-screen .tm-character-list { max-height: 190px; }
}
@media (max-width: 620px) {
  #title-screen .tm-logo { font-size: 25px; }
  #title-screen .tm-subtitle { letter-spacing: .18em; }
  #title-screen .tm-workspace { padding: 18px 14px; }
  #title-screen .tm-mode-grid, #title-screen .tm-save-grid, #title-screen .tm-class-grid { grid-template-columns: 1fr; }
  #title-screen .tm-mode-card { min-height: 230px; }
  #title-screen .tm-section-toolbar, #title-screen .tm-continue,
  #title-screen .tm-sticky-action, #title-screen .tm-character-create,
  #title-screen .tm-join-action { align-items: stretch; flex-direction: column; }
  #title-screen .tm-character-create { display: flex; }
  #title-screen .tm-room-tools { grid-template-columns: 1fr 92px; }
  #title-screen .tm-room-tools > .tm-button:first-child { grid-column: 1 / -1; }
  #title-screen .tm-create-room { grid-template-columns: 1fr; }
  #title-screen .tm-toggle-row { grid-column: 1; }
  #title-screen .tm-brand-bottom { display: none; }
}
@media (max-height: 720px) and (min-width: 861px) {
  #title-screen .title-inner { height: calc(100dvh - 20px); }
  #title-screen .tm-brand { padding-top: 26px; padding-bottom: 26px; }
  #title-screen .tm-brand-copy { margin-top: 36px; }
  #title-screen .tm-workspace { padding-top: 24px; padding-bottom: 24px; }
  #title-screen .tm-header { margin-bottom: 18px; }
  #title-screen .tm-mode-card { min-height: 260px; }
  #title-screen .tm-multi-grid { min-height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  #title-screen *, #title-screen *::before, #title-screen *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

#chat-box {
  position: absolute; left: 14px; bottom: 130px; width: 340px;
  z-index: 40; pointer-events: none; font-size: 12.5px;
}
#chat-box.typing { pointer-events: auto; }
#chat-log {
  max-height: 150px; overflow-y: auto; display: flex;
  flex-direction: column; justify-content: flex-end;
}
#chat-box.typing #chat-log { background: rgba(8, 6, 14, .72); border-radius: 6px; padding: 6px 8px; }
.chat-line {
  color: #e8e4f0; padding: 1px 4px;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, .8);
  word-wrap: break-word;
}
.chat-line .chat-who { color: #9fd8ff; font-weight: 700; }
#chat-input {
  display: none; width: 100%; margin-top: 4px; box-sizing: border-box;
  background: rgba(14, 11, 22, .92); border: 1px solid #4a4058; color: #e8e4f0;
  border-radius: 5px; padding: 7px 10px; font-size: 13px; font-family: inherit;
  outline: none;
}

/* =========================================================================
 *  KOSZ NA KARTACH MENU — usuwanie zapisów, postaci i pokoi
 *  Siedzi w prawym rogu karty i budzi się dopiero pod kursorem, żeby nie
 *  krzyczeć czerwienią z całej listy.
 * ========================================================================= */
#title-screen .tm-trash {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(168, 176, 192, .5);
  background: rgba(0, 0, 0, .18);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: .45;
  transition: opacity .16s, color .16s, border-color .16s, background .16s;
}
#title-screen .tm-hero-card:hover .tm-trash,
#title-screen .tm-character-row:hover .tm-trash,
#title-screen .tm-room-card:hover .tm-trash { opacity: 1; }
#title-screen .tm-trash:hover,
#title-screen .tm-trash:focus-visible {
  border-color: rgba(200, 74, 90, .55);
  color: #ff9aa6;
  background: rgba(200, 74, 90, .16);
  opacity: 1;
  outline: none;
}

/* Notka pod przełącznikami tworzenia pokoju (np. opis serwera PvP). */
#title-screen .tm-room-note {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(200, 120, 90, .28);
  border-left-width: 3px;
  border-radius: 6px;
  color: var(--tm-dim);
  background: rgba(120, 60, 50, .14);
  font-size: 10px;
  line-height: 1.55;
}

/* =========================================================================
 *  PLAN OKOLICY (klawisz M) — mapa bieżącej lokacji z pozycjami graczy
 * ========================================================================= */
.map-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 12px;
}
.map-plan-canvas {
  max-width: 100%;
  align-self: center;
  border: 1px solid rgba(215, 181, 109, .28);
  border-radius: 6px;
  background: #0a0810;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  image-rendering: pixelated;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: center;
  color: #a8b0c0;
  font-size: 10px;
}
.map-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.map-legend-item i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, .55);
  border-radius: 50%;
}

/* =========================================================================
 *  KONTO — logowanie w panelu wyboru bohatera
 * ========================================================================= */
#title-screen .tm-konto {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--tm-line);
  border-radius: 8px;
  background: rgba(7, 11, 19, .45);
}
#title-screen .tm-konto-row { display: flex; align-items: center; gap: 9px; }
#title-screen .tm-konto-badge { color: #7ae08a; font-size: 11px; flex: 0 0 auto; }
#title-screen .tm-konto-badge.off { color: rgba(168, 176, 192, .5); }
#title-screen .tm-konto-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
#title-screen .tm-konto-info strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#title-screen .tm-konto-info small { color: var(--tm-dim); font-size: 9px; line-height: 1.4; }
#title-screen .tm-konto-form { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--tm-line); }
#title-screen .tm-konto-note { color: rgba(168, 176, 192, .6); font-size: 9px; line-height: 1.5; }

/* Tryby trudności: wybór w menu (zablokowane przyciski przygaszone). */
#title-screen .tm-modes { display: flex; flex-direction: column; gap: 6px; }
#title-screen .tm-button.locked { opacity: .55; }
#title-screen .tm-tag.mode { font-weight: 700; letter-spacing: .04em; }

/* =========================================================================
 *  MENU GŁÓWNE v2 — logowanie, pięć pozycji, ustawienia, credits
 * ========================================================================= */
#title-screen .tm-main-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, 100%);
  margin-top: 6px;
}
#title-screen .tm-menu-btn {
  min-height: 56px;
  padding: 0 26px;
  text-align: left;
  font: 600 17px "Cinzel", Georgia, serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 9px;
}
#title-screen .tm-menu-btn:not(.primary) {
  background: linear-gradient(90deg, rgba(31, 41, 58, .88), rgba(18, 25, 38, .82));
}
#title-screen .tm-menu-btn.locked { opacity: .55; }
#title-screen .tm-home-konto { width: min(420px, 100%); margin-top: 22px; }
#title-screen .tm-lang-switch { display: flex; gap: 5px; }
#title-screen .tm-lang-switch .tm-button { min-height: 30px; padding: 0 10px; font-size: 10px; }
#title-screen .tm-brand-bottom .tm-online-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* logowanie */
#title-screen .tm-login { width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; }
#title-screen .tm-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--tm-line);
  border-radius: 12px;
  background: var(--tm-panel);
}
#title-screen .tm-login-form .tm-toggle-row { margin-top: 4px; }
#title-screen .tm-login-form .tm-toggle-row .tm-button { flex: 1; min-height: 42px; }
#title-screen .tm-login-status { min-height: 16px; color: var(--tm-dim); font-size: 11px; line-height: 1.5; }
#title-screen .tm-login-status.error { color: #ff9a9a; }
#title-screen .tm-offline-note { display: flex; flex-direction: column; gap: 9px; }

/* ustawienia */
#title-screen .tm-settings { display: flex; flex-direction: column; gap: 12px; width: min(720px, 100%); }
#title-screen .tm-settings-card h2 { margin-bottom: 10px; }
#title-screen .tm-settings-note { margin: 6px 0 0; color: var(--tm-dim); font-size: 10px; }
#title-screen .tm-settings-card h2 { margin: 0 0 8px; font: 600 15px "Cinzel", Georgia, serif; color: var(--tm-gold); }
#title-screen .tm-settings-card, #title-screen .tm-credits-card { padding: 14px 16px; }
#title-screen .tm-credits-card h2 { margin: 0 0 6px; font: 600 15px "Cinzel", Georgia, serif; color: var(--tm-gold); }
#title-screen .tm-slider-row { margin: 5px 0; }
#title-screen .tm-slider-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin: 7px 0;
  color: var(--tm-dim);
  font-size: 11px;
}
#title-screen .tm-slider-row .tm-button { justify-self: start; }
#title-screen .tm-slider { width: 100%; accent-color: var(--tm-gold); cursor: pointer; }
#title-screen .tm-slider-val { text-align: right; color: var(--tm-text); font-size: 11px; }

/* credits */
#title-screen .tm-credits { display: flex; flex-direction: column; gap: 12px; width: min(720px, 100%); }
#title-screen .tm-credit-row { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
#title-screen .tm-credit-row strong { color: var(--tm-text); font-size: 13px; }
#title-screen .tm-credit-row span { color: var(--tm-dim); font-size: 10px; line-height: 1.45; }
@media (max-width: 860px) {
  #title-screen .tm-slider-row { grid-template-columns: 100px 1fr 40px; }
}

/* Pasek synchronizacji kronik z kontem (widok Singleplayer) */
#title-screen .tm-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  background: rgba(15, 21, 33, .8);
}
#title-screen .tm-sync span:not(.tm-status-dot) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
#title-screen .tm-sync strong { font-size: 12px; }
#title-screen .tm-sync small { color: var(--tm-dim); font-size: 10px; line-height: 1.4; }
#title-screen .tm-sync.error .tm-status-dot { background: #ff6a7a; box-shadow: 0 0 8px rgba(255, 106, 122, .7); }


/* ---------- Dziennik zadań: trop i przełącznik pobocznych (2026-09-03) ---------- */
.quest-hint {
  border: 1px solid rgba(143, 212, 255, 0.35);
  background: linear-gradient(180deg, rgba(28, 40, 62, 0.75), rgba(16, 20, 34, 0.75));
  border-radius: 8px; padding: 9px 12px; margin: 2px 0 12px;
}
.quest-hint .qh-label {
  font-size: 10px; letter-spacing: 2px; color: #8fd4ff; margin-bottom: 3px;
}
.quest-hint .qh-text { font-size: 13.5px; color: #e8e4f0; line-height: 1.35; }
.quest-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px;
}
.quest-item .btn.small.danger { margin-top: 8px; }

/* Nazwa gracza w multiplayerze — pole z błędem (2026-09-03) */
.tm-input.zla { border-color: #d84a5a; box-shadow: 0 0 0 1px rgba(216, 74, 90, 0.35) inset; }

/* ---------------------------------------------------------------------------
   OSIĄGNIĘCIA (panel pod klawiszem O)
   Wiersz = ikona + treść. Zdobyte świecą złotem i mają pełny pasek; niezdobyte
   pokazują, ile brakuje. Kolory z tej samej palety co dziennik zadań.
--------------------------------------------------------------------------- */
.os-head { text-align: center; margin: 2px 0 10px; }
.os-suma { font-family: 'Cinzel', Georgia, serif; font-size: 26px; color: #e8c56a; line-height: 1.1; }
.os-pas { position: relative; height: 8px; margin: 8px 0 0; border-radius: 4px;
  background: rgba(10, 8, 16, 0.6); overflow: hidden; }
.os-pas.maly { height: 5px; margin: 5px 0 3px; }
.os-pas-fill { height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #b9862f, #e8c56a); }
.os-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 5px 0;
  border-radius: 6px; background: rgba(20, 16, 30, 0.55);
  border-left: 3px solid rgba(120, 110, 150, 0.5); }
.os-item.zdobyte { background: rgba(58, 44, 20, 0.55); border-left-color: #e8c56a; }
.os-ikona { font-size: 20px; line-height: 1.2; width: 26px; text-align: center; flex: 0 0 26px;
  filter: grayscale(0.75); opacity: 0.7; }
.os-item.zdobyte .os-ikona { filter: none; opacity: 1; }
.os-tresc { flex: 1 1 auto; min-width: 0; }
.os-nazwa { font-size: 14px; color: #ddd6ea; }
.os-item.zdobyte .os-nazwa { color: #ffd76a; }
.os-opis { font-size: 12px; color: #a49cb8; margin-top: 1px; }
.os-postep { font-size: 11px; color: #8f88a4; }
.os-postep.zdobyte { color: #e8c56a; letter-spacing: 1px; margin-top: 4px; }
.os-ukryte { font-size: 12px; color: #7d7590; font-style: italic;
  padding: 6px 10px; margin: 4px 0 2px; }

/* ---------------------------------------------------------------------------
   RANKING ŚWIATA (panel pod klawiszem R)
   Tabela: miejsce, postać, cztery liczby. Kolumna, po której sortujemy,
   jest podświetlona; własny wiersz obramowany, podium złote.
--------------------------------------------------------------------------- */
.rank-tabs { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rank-tab { margin-top: 6px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 5px; background: rgba(20, 16, 30, 0.5); margin: 3px 0; font-size: 13px; }
.rank-row.glowa { background: none; color: #8f88a4; font-size: 11px; letter-spacing: 1px;
  padding-bottom: 2px; margin-bottom: 0; }
.rank-row.podium { background: rgba(58, 44, 20, 0.5); }
.rank-row.ja { outline: 1px solid #7fd8ff; }
.rk-nr { flex: 0 0 26px; text-align: right; color: #8f88a4; }
.rank-row.podium .rk-nr { color: #e8c56a; font-weight: 600; }
.rk-nazwa { flex: 1 1 auto; min-width: 0; color: #ddd6ea;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-nazwa .dim { margin-left: 6px; font-size: 11px; }
.rk-lb { flex: 0 0 58px; text-align: right; color: #a49cb8; font-variant-numeric: tabular-nums; }
.rk-lb.wg { color: #ffd76a; font-weight: 600; }
