/* Atre Simulator – UI ve stylu raidového HUDu. */
:root {
  --gold: #e8c26a;
  --gold-2: #b98b3a;
  --gold-dim: rgba(232, 194, 106, 0.38);
  --gold-faint: rgba(232, 194, 106, 0.14);
  --fel: #74ff8e;
  --fel-dim: #2f8a45;
  --blood: #e0442c;
  --ember: #ff9a3c;
  --violet: #b06cff;
  --ink: #f3ead6;
  --muted: #a39b88;
  --panel: rgba(7, 13, 14, 0.82);
  --panel-2: rgba(14, 22, 22, 0.92);
  --twitch: #a970ff;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #040b0b;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { touch-action: none; user-select: none; -webkit-user-select: none; }
input { user-select: text; -webkit-user-select: text; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff1c4; text-decoration: underline; }
button { font: inherit; color: inherit; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  margin: 0 0.12em;
  border: 1px solid var(--gold-dim);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1a1f1e;
  font: 700 0.78em/1.4 var(--body);
  color: var(--gold);
  text-align: center;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#scene.cursor-interact { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='%23e8c26a' stroke='%23140d08' stroke-width='1.5'%3E%3Cpath d='M16 3l2.2 3.6 4.1-1 .6 4.2 4 1.4-1.6 3.9 2.6 3.3-3.6 2.2.3 4.2-4.2-.1-1.7 3.9-3.3-2.6-3.3 2.6-1.7-3.9-4.2.1.3-4.2-3.6-2.2 2.6-3.3-1.6-3.9 4-1.4.6-4.2 4.1 1z'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='4.5' fill='%23b06cff' stroke='%23140d08' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, pointer; }
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: #ffb060; mix-blend-mode: screen; }

/* ----------------------------- panely a tlačítka ---------------------------- */
.panel, .title-panel, .top-card, .unit-frame, .boss-frame, .score-panel, .tracker, .loading-box {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 28, 28, 0.9), var(--panel));
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel::before, .title-panel::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-faint);
  border-radius: 4px;
  pointer-events: none;
}
.panel::after, .title-panel::after {
  content: '◆';
  position: absolute;
  top: -0.62em;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
  text-shadow: 0 0 8px rgba(232, 194, 106, 0.6);
}
h2 {
  margin: 0 0 0.6em;
  font: 700 1.7rem/1.1 var(--display);
  letter-spacing: 0.06em;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(232, 194, 106, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.55em 1.3em;
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  background: linear-gradient(180deg, #232b2a, #121817);
  font: 700 0.95rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #000;
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--gold); color: #fff3cf; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(232, 194, 106, 0.25), 0 2px 0 #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; filter: grayscale(0.4); }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, .action:focus-visible { outline: 2px solid var(--fel); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(180deg, #a3261a, #5a0d08 60%, #3d0805);
  border-color: var(--gold);
  color: #ffe9b0;
  text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), inset 0 -6px 12px rgba(0, 0, 0, 0.35), 0 2px 0 #000, 0 0 24px rgba(200, 40, 20, 0.25);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.45), 0 0 26px rgba(255, 120, 60, 0.45), 0 2px 0 #000; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn-row .btn { flex: 1 1 140px; }
.chip {
  padding: 0.4em 0.8em;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font: 600 0.85rem/1 var(--body);
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--gold-dim); }

.field { display: grid; gap: 6px; text-align: left; }
.field span { font: 600 0.78rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
input[type='text'] {
  width: 100%;
  min-height: 44px;
  padding: 0.5em 0.8em;
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font: 700 1.1rem/1 var(--body);
  letter-spacing: 0.02em;
}
input[type='text']::placeholder { color: #6d675a; }

/* ------------------------------- obrazovky ---------------------------------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--gutter) 70px;
  z-index: 20;
  animation: screen-in 0.45s ease both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
.panel { width: min(460px, 100%); padding: 28px 26px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-height: calc(100vh - 110px); overflow: auto; }
.panel.wide { width: min(760px, 100%); }

/* načítání */
#screen-loading { background: radial-gradient(80% 60% at 50% 40%, #0d2421 0%, #040b0b 70%); z-index: 40; }
.loading-box { width: min(420px, 100%); padding: 30px; text-align: center; display: grid; gap: 18px; }
.loading-bar { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--gold-faint); overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--fel-dim), var(--fel)); box-shadow: 0 0 12px var(--fel); transition: width 0.25s; }
.loading-text { color: var(--muted); font-size: 0.95rem; }

/* titulka */
#screen-title { justify-content: flex-start; align-items: center; padding-left: clamp(16px, 6vw, 110px); background: linear-gradient(90deg, rgba(3, 8, 8, 0.75) 0%, rgba(3, 8, 8, 0.25) 42%, transparent 60%); }
.title-panel { width: min(430px, 100%); padding: 32px 28px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; text-align: center; background: linear-gradient(180deg, rgba(10, 18, 18, 0.72), rgba(5, 10, 10, 0.86)); }
.logo {
  font: 900 clamp(2.1rem, 4.4vw, 3.1rem)/0.95 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff5d6 0%, #f0cf7a 38%, #b07f2c 62%, #f6dc94 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 22px rgba(120, 255, 140, 0.25));
}
.logo span { display: block; font-size: 1.32em; letter-spacing: 0.08em; }
.logo.small { font-size: 1.8rem; }
.subtitle { font: 700 0.76rem/1 var(--display); letter-spacing: 0.2em; white-space: nowrap; text-transform: uppercase; color: var(--fel); text-shadow: 0 0 14px rgba(116, 255, 142, 0.45); margin-top: -4px; }
.tagline { margin: 2px 0 4px; color: var(--muted); font-style: italic; }
#btn-play { min-height: 56px; font-size: 1.25rem; letter-spacing: 0.18em; }
.settings-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.best-local { font-size: 0.88rem; color: var(--muted); min-height: 1.2em; }
.best-local b { color: var(--gold); }

.top-card { position: absolute; right: clamp(16px, 4vw, 60px); bottom: 84px; width: 300px; padding: 16px 18px; background: linear-gradient(180deg, rgba(10, 18, 18, 0.72), rgba(5, 10, 10, 0.86)); }
.card-head { font: 700 0.9rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; text-align: center; }
.mini-board { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: rank; }
.mini-board li { display: flex; align-items: baseline; gap: 8px; font-size: 0.98rem; counter-increment: rank; }
.mini-board li::before { content: counter(rank); min-width: 1.2em; font: 700 0.85rem var(--display); color: var(--gold-2); text-align: left; }
.mini-board li.muted::before { content: ''; }
.mini-board .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board .s { font: 700 0.95rem var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.mini-board li:first-child .n { color: #fff3cf; }

/* jak hrát */
.steps { margin: 0; padding: 0 0 0 1.3em; display: grid; gap: 10px; line-height: 1.45; }
.steps li::marker { font: 700 1rem var(--display); color: var(--gold); }
.steps b { color: #fff3cf; }
.steps em { color: var(--ember); font-style: normal; font-weight: 700; }
.touch-only { display: none; }

/* síň slávy */
.table-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--gold-faint); border-radius: 5px; }
.table-wrap.short { max-height: 30vh; }
table.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th, .board td { padding: 8px 10px; text-align: left; white-space: nowrap; }
.board th { position: sticky; top: 0; background: #0f1818; font: 700 0.72rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.board tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.board td:first-child { font: 700 0.9rem var(--display); color: var(--gold-2); width: 3em; }
.board td.score { font: 700 1rem var(--display); color: var(--gold); }
.board tr.me { background: rgba(116, 255, 142, 0.12) !important; box-shadow: inset 3px 0 0 var(--fel); }
.board tr.top1 td:nth-child(2) { color: #ffd76a; }
.board-note { text-align: center; margin: -6px 0 0; font-size: 0.9rem; }

/* pauza */
.settings-col { display: grid; gap: 12px; justify-items: center; margin-bottom: 6px; }
.slider { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.slider input { width: 180px; accent-color: var(--gold); }

/* konec hry */
.gameover { text-align: center; }
.go-head h2 { margin-bottom: 0.2em; font-size: 2.2rem; color: #ff7a5a; text-shadow: 0 2px 0 #000, 0 0 24px rgba(255, 80, 40, 0.35); }
.go-reason { color: var(--ember); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 460px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 10px 8px; border: 1px solid var(--gold-faint); border-radius: 5px; background: rgba(0, 0, 0, 0.3); }
.stat b { display: block; font: 700 1.45rem/1.1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat.hero b { font-size: 2rem; color: #fff1c4; }
.go-quote { margin: 0; color: var(--muted); font-style: italic; }
.submit-row { display: flex; gap: 8px; }
.submit-row input { flex: 1; }
.submit-status { min-height: 1.3em; font-size: 0.92rem; color: var(--fel); }
.submit-status.err { color: #ff8a6a; }

/* -------------------------------- titulky ----------------------------------- */
#credits {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
  padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom));
  font-size: 0.88rem;
  color: var(--muted);
  background: linear-gradient(0deg, rgba(2, 6, 6, 0.85), transparent);
}
#credits b { color: var(--ink); }
#credits .sep { color: var(--gold-2); font-size: 0.6em; }
#credits .twitch { color: var(--twitch); font-weight: 700; white-space: nowrap; }
#credits .twitch svg { width: 1em; height: 1em; margin-right: 3px; vertical-align: -0.14em; }
body.playing #credits { display: none; }

/* ---------------------------------- HUD ------------------------------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; animation: screen-in 0.6s ease both; }
.hud-tl { position: absolute; top: 14px; left: var(--gutter); display: flex; gap: 10px; align-items: flex-start; }
.unit-frame { display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; min-width: 210px; transition: opacity 0.25s, transform 0.25s; }
.portrait { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold-2); background: radial-gradient(circle at 40% 35%, #26403c, #0b1413); display: grid; place-items: center; box-shadow: 0 0 0 2px #000, 0 0 12px rgba(0, 0, 0, 0.6); flex: none; }
.portrait svg { width: 34px; height: 34px; }
.boss-portrait { border-color: #a32c1c; background: radial-gradient(circle at 40% 35%, #3b1a12, #120705); }
.shaman-portrait { border-color: #3d9bff; box-shadow: 0 0 0 2px #000, 0 0 14px rgba(61, 155, 255, 0.55); }
.uf-class { margin-left: 8px; font: 700 0.68rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: #3d9bff; vertical-align: 1px; }
.uf-body { display: grid; gap: 5px; min-width: 130px; }
.uf-name { font: 700 1rem/1 var(--display); color: #fff3cf; letter-spacing: 0.03em; }
.uf-name .lvl { display: inline-block; padding: 1px 5px; margin-right: 4px; border-radius: 3px; background: #5a1209; color: #ffd0a0; font: 700 0.7rem/1.3 var(--body); vertical-align: 2px; }
.uf-hint { font-size: 0.72rem; color: var(--ember); letter-spacing: 0.04em; }
.lives { display: flex; gap: 5px; }
.lives i { width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px; background: linear-gradient(135deg, #e3b8ff, #8a3ad8 55%, #3a0f6a); box-shadow: 0 0 10px rgba(176, 108, 255, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.35); transition: all 0.4s; }
.lives i.lost { background: #1d1a22; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.target-frame { border-color: rgba(214, 64, 40, 0.55); }
.target-frame.off { opacity: 0; transform: translateY(-6px) scale(0.97); }
.bar { position: relative; height: 12px; border-radius: 3px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(0, 0, 0, 0.9); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, #e8492d, #8f150b); transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hud-tc { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: min(460px, 46vw); display: grid; gap: 8px; }
.boss-frame { padding: 8px 12px 10px; }
.bf-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bf-name { font: 900 1.05rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: #ffd9a0; text-shadow: 0 0 12px rgba(255, 100, 40, 0.35); }
.bf-meta { font: 700 0.72rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.boss-bar { height: 18px; }
.boss-bar span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 0.75rem/1 var(--display); color: #fff; text-shadow: 0 1px 2px #000; }
.timer-bar { display: flex; align-items: center; gap: 8px; }
.tb-icon { width: 30px; height: 30px; flex: none; border: 1px solid var(--gold-dim); border-radius: 4px; background: radial-gradient(circle at 50% 55%, #ffd36a 0%, #ff6a1c 35%, #6a1205 70%, #1a0402 100%); box-shadow: 0 0 10px rgba(255, 120, 40, 0.5); }
.tb-track { position: relative; flex: 1; height: 26px; border-radius: 4px; overflow: hidden; background: rgba(5, 9, 10, 0.85); border: 1px solid rgba(0, 0, 0, 0.9); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.tb-track i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, #4f86d8, #1d3f86); transition: background 0.4s; }
.timer-bar.warn .tb-track i { background: linear-gradient(180deg, #f2a43a, #9a4a0c); }
.timer-bar.crit .tb-track i { background: linear-gradient(180deg, #ff5a3a, #8f150b); }
.timer-bar.unsure .tb-track { animation: unsure 0.5s ease-in-out infinite alternate; }
@keyframes unsure { to { box-shadow: inset 0 0 0 1px rgba(255, 160, 80, 0.6), 0 0 14px rgba(255, 110, 40, 0.5); } }
.tb-label, .tb-time { position: absolute; top: 50%; transform: translateY(-50%); font: 700 0.92rem/1 var(--body); text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.tb-label { left: 10px; }
.tb-time { right: 10px; font-variant-numeric: tabular-nums; font-family: var(--display); }
.cast-bar { padding: 3px; border: 1px solid var(--gold-dim); border-radius: 5px; background: rgba(0, 0, 0, 0.7); box-shadow: 0 0 22px rgba(255, 120, 40, 0.35); animation: cast-pulse 0.35s ease-in-out infinite alternate; }
@keyframes cast-pulse { to { box-shadow: 0 0 34px rgba(255, 150, 40, 0.65); } }
.cb-track { position: relative; height: 24px; border-radius: 3px; overflow: hidden; background: #140906; }
.cb-track i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #ffd86a, #e0801c 55%, #a8420c); box-shadow: 6px 0 12px rgba(255, 230, 150, 0.8); }
.cb-track span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 0.95rem/1 var(--display); letter-spacing: 0.06em; color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px #000; }

.score-panel { position: absolute; top: 14px; right: var(--gutter); width: 190px; padding: 10px 14px 12px; text-align: right; }
.sp-score { font: 900 2rem/1 var(--display); color: #fff1c4; font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(232, 194, 106, 0.3); transition: transform 0.15s; }
.sp-score.bump { transform: scale(1.12); }
.sp-mult { font: 700 0.95rem/1.3 var(--display); color: var(--fel); min-height: 1.3em; }
.sp-rows { display: grid; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--gold-faint); font-size: 0.86rem; }
.sp-rows div { display: flex; justify-content: space-between; color: var(--muted); }
.sp-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }

.tracker { position: absolute; right: var(--gutter); top: 178px; width: 250px; padding: 10px 14px; background: linear-gradient(180deg, rgba(10, 16, 16, 0.72), rgba(5, 10, 10, 0.6)); }
.tr-head { font: 700 0.78rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.tracker ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.tracker li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.95rem; line-height: 1.25; color: #ffd75a; transition: color 0.2s; }
.tracker li i { flex: none; width: 15px; height: 15px; margin-top: 2px; border: 1px solid var(--gold-dim); border-radius: 3px; background: rgba(0, 0, 0, 0.5); }
.tracker li.done { color: #8fd88f; }
.tracker li.done i { background: var(--fel-dim); border-color: var(--fel); box-shadow: 0 0 8px rgba(116, 255, 142, 0.5); }
.tracker li.done i::after { content: '✓'; display: block; font: 900 12px/13px var(--body); color: #eaffea; text-align: center; }
.tracker li.hot { color: #fff; text-shadow: 0 0 10px rgba(255, 210, 90, 0.8); }
.tracker li.idle { color: var(--muted); }

.chat { position: absolute; left: var(--gutter); bottom: 96px; width: min(440px, 44vw); display: flex; flex-direction: column; gap: 2px; font-size: 0.94rem; line-height: 1.3; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.chat div { animation: chat-in 0.25s ease both; transition: opacity 1.2s; }
.chat div.old { opacity: 0; }
@keyframes chat-in { from { opacity: 0; transform: translateX(-6px); } }
.chat .msg-yell { color: #ff4a3a; }
.chat .msg-emote { color: #ff9a3c; }
.chat .msg-raid { color: #ff7a2a; font-weight: 700; }
.chat .msg-system { color: #ffe36a; }
.chat .msg-say { color: #f4f4f4; }
.chat .msg-loot { color: #c98aff; }
.chat .msg-fail { color: #ff6a5a; font-weight: 700; }

.action-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: auto; }
.action {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid #3a3226;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 35%, #2a3332, #0b1110);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 106, 0.25), 0 3px 10px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s;
}
.action svg { width: 40px; height: 40px; margin-top: 2px; }
.action kbd { position: absolute; top: 2px; right: 3px; margin: 0; padding: 0 3px; min-width: 0; border: 0; background: none; font-size: 0.66rem; color: #fff; text-shadow: 0 1px 2px #000; }
.action span { position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%); font-size: 0.7rem; white-space: nowrap; color: var(--muted); text-shadow: 0 1px 2px #000; }
.action.flash { transform: scale(0.92); box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px rgba(232, 194, 106, 0.6); }
.action.ready { box-shadow: inset 0 0 0 2px var(--fel), 0 0 16px rgba(116, 255, 142, 0.55); }
.action.used { filter: grayscale(0.7) brightness(0.7); }

.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); font: 900 2.4rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0; transition: opacity 0.15s; text-shadow: 0 3px 0 #000, 0 0 24px currentColor; }
.prompt.wait { opacity: 1; color: #ffc34a; animation: pulse-soft 0.8s ease-in-out infinite alternate; }
.prompt.click { opacity: 1; color: #7dff7a; animation: pulse-hard 0.16s ease-in-out infinite alternate; }
@keyframes pulse-soft { to { transform: translateX(-50%) scale(1.06); } }
@keyframes pulse-hard { to { transform: translateX(-50%) scale(1.15); } }

/* ------------------------------- oznámení ----------------------------------- */
#raid-warning { position: fixed; left: 0; right: 0; top: 23%; z-index: 12; text-align: center; pointer-events: none; padding: 0 var(--gutter); }
#raid-warning div { display: inline-block; font: 900 clamp(1.6rem, 3.6vw, 2.6rem)/1.1 var(--display); letter-spacing: 0.05em; color: #ff8a2a; text-shadow: 0 2px 0 #000, 0 0 2px #000, 0 0 22px rgba(255, 90, 20, 0.6); animation: rw 3s ease both; }
#raid-warning div.swap { color: #ff4a3a; }
@keyframes rw { 0% { opacity: 0; transform: scale(1.6); } 8% { opacity: 1; transform: scale(0.96); } 12% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
#big-text { position: fixed; left: 0; right: 0; top: 36%; z-index: 12; text-align: center; pointer-events: none; padding: 0 var(--gutter); }
#big-text div { display: inline-block; font: 900 clamp(2rem, 5vw, 3.4rem)/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; animation: big 1.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; text-shadow: 0 3px 0 #000, 0 0 30px currentColor; }
#big-text small { display: block; margin-top: 8px; font: 700 1rem/1.2 var(--body); letter-spacing: 0.04em; text-transform: none; color: var(--ink); text-shadow: 0 1px 2px #000; }
@keyframes big { 0% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.big-perfect { color: #ffd35a; }
.big-great { color: #8dff7a; }
.big-good { color: #9ad8ff; }
.big-close { color: #ffab6a; }
.big-ready { color: #ffd35a; }
.big-kill { color: #b8ff6a; animation-duration: 3.4s !important; }
#error-text { position: fixed; left: 0; right: 0; top: 17%; z-index: 12; text-align: center; pointer-events: none; font: 700 1.25rem/1 var(--body); color: #ff3a2a; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#error-text div { animation: err 1.6s ease both; }
@keyframes err { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

#loot-toast { position: fixed; right: var(--gutter); bottom: 110px; z-index: 12; pointer-events: none; }
.loot { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border: 1px solid #a335ee; border-radius: 6px; background: linear-gradient(90deg, rgba(40, 10, 60, 0.95), rgba(10, 6, 16, 0.92)); box-shadow: 0 0 24px rgba(163, 53, 238, 0.45); animation: loot 4.5s ease both; }
.loot .ico { width: 42px; height: 42px; border: 2px solid #a335ee; border-radius: 5px; background: radial-gradient(circle at 45% 40%, #6aa04a, #2a4a1a 60%, #0d160a); display: grid; place-items: center; font-size: 22px; }
.loot .t { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.loot .n { font-weight: 800; color: #c77dff; }
@keyframes loot { 0% { opacity: 0; transform: translateX(30px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

#wipe-overlay { position: fixed; inset: 0; z-index: 11; display: grid; place-content: center; text-align: center; pointer-events: none; background: radial-gradient(70% 60% at 50% 50%, rgba(70, 0, 0, 0.35), rgba(10, 0, 0, 0.6)); animation: screen-in 0.5s ease both; }
.wipe-title { font: 900 clamp(4rem, 14vw, 9rem)/0.9 var(--display); letter-spacing: 0.12em; color: #ff4a2a; text-shadow: 0 4px 0 #000, 0 0 50px rgba(255, 60, 20, 0.6); animation: big 3.2s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-name: wipe-in; }
@keyframes wipe-in { 0% { opacity: 0; transform: scale(1.8); letter-spacing: 0.4em; } 15% { opacity: 1; transform: scale(1); letter-spacing: 0.12em; } }
.wipe-reason { margin-top: 10px; font: 700 clamp(1.2rem, 3vw, 1.8rem)/1.2 var(--display); color: #ffd0b0; text-shadow: 0 2px 0 #000; }
.wipe-lives { margin-top: 8px; color: var(--muted); }

/* jmenovky a plovoucí texty */
#plates { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.plate { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); font: 700 0.9rem/1 var(--body); white-space: nowrap; text-shadow: 0 1px 2px #000, 0 0 3px #000, 0 0 3px #000; will-change: transform; }
.plate-player { color: #7dff7a; font-size: 1rem; }
.plate-raider { opacity: 0.9; font-size: 0.82rem; }
.float-score { position: absolute; transform: translate(-50%, -50%); font: 900 1.9rem/1 var(--display); color: #ffe06a; text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 200, 80, 0.7); animation: float-up 1.4s ease-out both; }
@keyframes float-up { 0% { opacity: 0; margin-top: 10px; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -70px; } }

#joystick { position: fixed; z-index: 15; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(232, 194, 106, 0.35); background: radial-gradient(circle, rgba(232, 194, 106, 0.08), rgba(0, 0, 0, 0.25)); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
#joystick.on { opacity: 1; }
#joystick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6dc94, #8a6a2a); box-shadow: 0 0 12px rgba(0, 0, 0, 0.6); }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #040b0b; color: var(--ink); font-size: 1.2rem; z-index: 99; }

/* ------------------------------- responzivita ------------------------------- */
@media (max-width: 1100px) {
  .tracker { top: auto; bottom: 120px; right: var(--gutter); width: 230px; }
  .chat { width: min(360px, 40vw); }
}
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  #screen-title { justify-content: center; align-items: flex-start; padding-top: 18px; background: linear-gradient(180deg, rgba(3, 8, 8, 0.6), rgba(3, 8, 8, 0.15) 60%); overflow: auto; }
  .top-card { display: none; }
  .hud-tc { top: 6px; left: var(--gutter); right: var(--gutter); width: auto; transform: none; gap: 5px; }
  .boss-frame { padding: 6px 10px 8px; }
  .bf-name { font-size: 0.9rem; }
  .boss-bar { height: 14px; }
  .tb-track, .cb-track { height: 22px; }
  .tb-icon { width: 24px; height: 24px; }
  .hud-tl { top: 96px; left: var(--gutter); right: var(--gutter); gap: 6px; flex-direction: row; }
  .unit-frame { flex: 1 1 0; min-width: 0; padding: 4px 8px 4px 4px; gap: 6px; }
  .portrait { width: 32px; height: 32px; }
  .portrait svg { width: 22px; height: 22px; }
  .uf-body { min-width: 0; flex: 1; }
  .uf-name { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .uf-hint { display: none; }
  .lives i { width: 12px; height: 12px; }
  .subtitle { letter-spacing: 0.16em; }
  .logo { font-size: 2.2rem; }
  #raid-warning { top: 26%; }
  .score-panel { top: auto; bottom: 96px; right: var(--gutter); width: auto; padding: 6px 10px; }
  .sp-score { font-size: 1.4rem; }
  .sp-rows { display: none; }
  .tracker { display: none; }
  .chat { bottom: 100px; width: 58vw; font-size: 0.82rem; }
  .chat div:nth-last-child(n + 4) { display: none; }
  .action { width: 58px; height: 58px; }
  .prompt { font-size: 1.8rem; bottom: 170px; }
  #credits { font-size: 0.78rem; }
  .board th, .board td { padding: 6px 7px; }
  .hide-sm { display: none; }
  .submit-row { flex-direction: column; }
}
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  .action kbd { display: none; }
  #act-esc { width: 76px; height: 76px; }
}
@keyframes fade-only { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #raid-warning div, #big-text div, .wipe-title, .float-score { animation-name: fade-only !important; }
  .prompt.wait, .prompt.click, .cast-bar, .timer-bar.unsure .tb-track, .screen, #hud { animation: none !important; }
}
