/* Self-hostovane fonty (Inter + Cinzel) - nahrazuje @import z fonts.googleapis.com.

   latin-ext MUSI byt PRED latin v poradi pravidel, jinak by prohlizec pro ceskou

   diakritiku (c,s,z,r...) mohl vybrat 'latin' variantu, ktera tyhle znaky neobsahuje. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/inter-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/inter-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/inter-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/inter-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/inter-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url('/fonts/inter-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url('/fonts/inter-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url('/fonts/inter-latin-ext-900-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url('/fonts/inter-latin-900-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/cinzel-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/cinzel-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* =========================================================================
   DESIGN SYSTEM v2 - moderní, sans-serif, plochý (Material/iOS inspirovaný)
   Cinzel (dekorativní serif) zůstává JEN jako logotyp appky na úvodní
   obrazovce - všude jinde (tlačítka, nadpisy, popisky) je Inter, stejně jako
   to dělá skoro každá appka na Androidu i iOS. Herní plsť na stole je jediné
   místo, kde si appka nechává barevnou identitu karetní hry - i tu jsem ale
   zbavil těžké dřevěné textury a ozdobných mosazných rámů.
   ========================================================================= */
:root {
  color-scheme: dark;
  /* Povrchy - stupně "elevace" jako v Material Designu, žádná textura, jen
     jemně odstupňované odstíny tmavé báze. */
  --bg: #121014;
  --surface-1: #1c191f;
  --surface-2: #242028;
  --surface-3: #2d2832;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);

  /* Herní plsť (jen stůl) */
  --felt-dark: #163024;
  --felt: #1f4433;
  --felt-light: #2b5c44;

  --text: #f2eef5;
  --text-dim: rgba(242,238,245,0.62);
  --text-faint: rgba(242,238,245,0.38);

  --primary: #e0574a;
  --primary-hover: #ea6a5d;
  --primary-tonal: rgba(224,87,74,0.16);
  --accent: #e3b64d;
  --accent-tonal: rgba(227,182,77,0.16);

  --surface-text: var(--text);
  --accent-text: var(--accent);
  --center-label-color: rgba(255,255,255,0.3);
  --bubble-bg: rgba(255,255,255,0.07);
  --bubble-bg-hover: rgba(255,255,255,0.13);
  --input-bg: rgba(255,255,255,0.06);

  /* zpětná kompatibilita se zbytkem appky - staré proměnné teď ukazují na nové ploché barvy */
  --wood-dark: var(--bg);
  --wood: var(--surface-1);
  --wood-light: var(--surface-2);
  --cream: #faf7f2;
  --ink: #201c24;
  --brass: var(--accent);
  --brass-bright: var(--accent);
  --ember: var(--primary);
  --ember-bright: var(--primary-hover);
  --lamp: var(--accent);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --shadow-1: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-2: 0 6px 20px rgba(0,0,0,0.35);
  --shadow-3: 0 16px 40px rgba(0,0,0,0.45);
  --shadow-inset-brass: none;

  --ease: cubic-bezier(.25,.9,.4,1);
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f2f7;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f0edf4;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);

  --felt-dark: #cfe3d6;
  --felt: #e1f0e6;
  --felt-light: #eef8f1;

  --text: #201c24;
  --text-dim: rgba(32,28,36,0.62);
  --text-faint: rgba(32,28,36,0.4);

  --primary: #c9463a;
  --primary-hover: #b23c31;
  --primary-tonal: rgba(201,70,58,0.1);
  --accent: #9c7418;
  --accent-tonal: rgba(156,116,24,0.12);

  --surface-text: var(--text);
  --accent-text: var(--accent);
  --center-label-color: rgba(32,28,36,0.25);
  --bubble-bg: rgba(0,0,0,0.045);
  --bubble-bg-hover: rgba(0,0,0,0.08);
  --input-bg: rgba(0,0,0,0.035);

  --wood-dark: var(--bg);
  --wood: var(--surface-1);
  --wood-light: var(--surface-3);
  --ink: var(--text);
  --brass: var(--accent);
  --brass-bright: var(--accent);
  --ember: var(--primary);
  --ember-bright: var(--primary-hover);
  --lamp: var(--accent);

  --shadow-1: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-2: 0 6px 20px rgba(0,0,0,0.1);
  --shadow-3: 0 16px 40px rgba(0,0,0,0.16);
}

/* ---------- barva plsti stolu - nezávislé na světlém/tmavém motivu appky ---------- */
:root[data-felt="blue"] {
  --felt-dark: #162430;
  --felt: #1f3644;
  --felt-light: #2b4a5c;
}
:root[data-felt="burgundy"] {
  --felt-dark: #301620;
  --felt: #441f2c;
  --felt-light: #5c2b3a;
}
:root[data-theme="light"][data-felt="blue"] {
  --felt-dark: #cfd8e3;
  --felt: #e1e8f0;
  --felt-light: #eef2f8;
}
:root[data-theme="light"][data-felt="burgundy"] {
  --felt-dark: #e3d0d5;
  --felt: #f0e1e6;
  --felt-light: #f8eef1;
}

.felt-picker { display: flex; gap: 8px; padding: 6px 14px 10px; }
.felt-swatch {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent;
  padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.felt-swatch[data-felt="green"] { background: #1f4433; }
.felt-swatch[data-felt="blue"] { background: #1f3644; }
.felt-swatch[data-felt="burgundy"] { background: #441f2c; }
.felt-swatch.active { border-color: var(--accent); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--surface-text);
  font-family: var(--font-ui);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100vh; padding: 8px 14px; padding-bottom: 44px; max-width: 1100px; margin: 0 auto; }
h1, h2, .disp { font-family: var(--font-ui); letter-spacing: -0.01em; }

button, input, select { font-family: var(--font-ui); }
button, .seat-box, .pcard-wrap, .avatar-swatch, .room-item, .chat-msg {
  transition: transform 0.15s var(--ease), background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.my-name-banner {
  text-align: center; font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.01em; margin-bottom: 4px;
}
.takeover-banner {
  max-width: 560px; margin: 0 auto 12px; padding: 14px 18px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--accent);
  box-shadow: var(--shadow-2);
  font-size: 13px; text-align: center; animation: takeover-pulse 1.6s infinite;
}
.takeover-banner p { margin: 0 0 10px; line-height: 1.4; color: var(--text); }
.takeover-actions { display: flex; gap: 10px; justify-content: center; }
.takeover-actions .btn { width: auto; padding: 10px 20px; }
@keyframes takeover-pulse {
  0%, 100% { box-shadow: var(--shadow-2); }
  50% { box-shadow: 0 0 0 4px var(--accent-tonal), var(--shadow-2); }
}

.main-col { flex: 1; min-width: 0; }

/* ---------- chat ---------- */
.chat-log { flex: 1; overflow-y: auto; font-size: 13px; min-height: 160px; max-height: 55vh; margin-bottom: 8px; padding-right: 2px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg {
  max-width: 82%; padding: 9px 14px; border-radius: var(--r-lg); border-bottom-left-radius: 4px;
  line-height: 1.4; word-break: break-word; align-self: flex-start;
  background: var(--surface-3);
}
.chat-msg.mine {
  align-self: flex-end; background: var(--primary); color: #fff;
  border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: 4px;
}
.chat-msg .who { display: block; font-weight: 700; font-size: 10px; opacity: 0.7; margin-bottom: 2px; color: var(--accent-text); }
.chat-time { font-size: 9px; opacity: 0.55; margin-left: 4px; white-space: nowrap; transition: opacity 0.15s ease; cursor: default; }
.chat-msg:hover .chat-time { opacity: 0.85; }
.emoji-toggle-btn {
  flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill);
  width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}
.emoji-toggle-btn:hover { background: var(--surface-3); }
.emoji-picker {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.emoji-opt {
  background: none; border: none; font-size: 19px; padding: 4px; border-radius: var(--r-sm); cursor: pointer;
}
.emoji-opt:hover { background: var(--bubble-bg); }
.chat-msg.mine .who { display: none; }
.chat-msg.system {
  align-self: center; background: none; max-width: 90%; text-align: center;
  font-size: 11px; font-style: italic; opacity: 0.6; padding: 2px 8px;
}
.chat-msg.advisor {
  align-self: center; max-width: 92%; background: var(--accent-tonal);
  border: 1px solid var(--accent); color: var(--surface-text);
}
.chat-msg.advisor .who { color: var(--accent-text); display: block; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 11px 16px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--surface-text);
  font-size: 14px;
}
.chat-form input::placeholder { color: var(--text-faint); }
.chat-form button {
  padding: 10px 20px; border-radius: var(--r-pill); border: none; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.chat-form button:hover { background: var(--primary-hover); }
.chat-form button:active { transform: scale(0.96); }
.chat-toolbar { display: flex; gap: 6px; padding: 0 12px 10px; }
.chat-toolbar .tb-btn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 6px; font-size: 11px; }
.chat-slowmode-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-abandon-btn { background: rgba(224,87,74,0.14); color: var(--primary-hover); border-color: transparent; }
.chat-abandon-btn:hover { background: var(--primary); color: #fff; }

.chat-bubble {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  background: var(--primary); color: #fff; border: none; border-radius: var(--r-pill);
  padding: 13px 22px; font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow-2);
}
.chat-bubble:hover { background: var(--primary-hover); box-shadow: var(--shadow-3); }
.chat-bubble:active { transform: scale(0.96); }
.chat-bubble .badge {
  display: inline-block; background: #fff; color: var(--primary); border-radius: 50%;
  width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; margin-left: 6px; font-weight: 800;
}
.chat-panel {
  position: fixed; right: 18px; bottom: 82px; z-index: 50; width: 320px; max-width: calc(100vw - 36px);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; max-height: 62vh; overflow: hidden;
  backdrop-filter: blur(20px) saturate(1.6);
}
.chat-panel-head {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; color: var(--surface-text);
}
.chat-panel-head button { background: none; border: none; color: var(--surface-text); font-size: 18px; cursor: pointer; opacity: 0.5; border-radius: var(--r-pill); width: 28px; height: 28px; }
.chat-panel-head button:hover { opacity: 1; background: var(--bubble-bg); }
.chat-panel .chat-log { padding: 12px 14px 0; margin-bottom: 0; flex: 1; max-height: none; }
.chat-panel .chat-form { padding: 12px 14px; }

/* ---------- video hovor - jedno tlačítko (zapnout/vypnout) + volně plovoucí okno pro každého
   účastníka, zakotvené výchozí polohou hned u jeho místa u stolu (getSeatAnchorPos v app.js).
   Okna appka připojuje přímo do <body>, ne do žádného ohraničeného panelu, ať se s nimi dá
   hýbat po celé stránce. ---------- */
.video-bubble {
  position: fixed; left: 18px; bottom: 18px; z-index: 50;
  background: var(--accent); color: var(--bg); border: none; border-radius: var(--r-pill);
  padding: 13px 22px; font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow-2);
}
.video-bubble:hover { filter: brightness(1.08); box-shadow: var(--shadow-3); }
.video-bubble:active { transform: scale(0.96); }
.video-tile {
  position: absolute; z-index: 60; width: 200px; height: 150px; min-width: 120px; min-height: 90px;
  resize: both; overflow: hidden; border-radius: 8px; background: #111;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55); display: flex; flex-direction: column;
}
.video-tile video { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #000; }
.video-tile-head {
  display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; cursor: move; user-select: none; flex-shrink: 0;
}
.video-tile-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-tile-max, .video-tile-min, .video-tile-mute { background: none; border: none; color: #fff; cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1.4; }
.video-tile-max:hover, .video-tile-min:hover, .video-tile-mute:hover { opacity: 0.7; }
.video-tile.maximized { position: fixed !important; left: 4vw !important; top: 4vh !important; width: 92vw !important; height: 92vh !important; resize: none; z-index: 90; }

/* Skryté video okno - appka ho jen schová (display:none), tlačítko v přihrádce dole ho zase
   otevře. Hovor mezitím dál běží na pozadí (přihrádka není "ukončit", jen "schovat"). */
#videoTray {
  position: fixed; right: 12px; bottom: 70px; z-index: 61;
  display: flex; flex-direction: column-reverse; gap: 6px;
}
#videoTray:empty { display: none; }
.video-tray-chip {
  background: var(--surface-2); color: var(--surface-text); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 8px 16px; font-size: 12px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-2); white-space: nowrap;
}
.video-tray-chip:hover { filter: brightness(1.1); }

/* Mobil - žádné plovoucí/přetahovatelné okno, jen vodorovný pruh malých náhledů nahoře. */
#videoMobileStrip {
  position: sticky; top: 0; z-index: 60;
  display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto;
  background: var(--bg); backdrop-filter: blur(6px);
}
#videoMobileStrip:empty { display: none; }
.video-tile-mobile {
  position: relative; flex-shrink: 0; width: 72px; height: 96px; resize: none;
  border-radius: 8px; overflow: hidden; background: #111; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.video-tile-mobile video { width: 100%; height: 100%; object-fit: cover; }
.video-tile-mobile .video-tile-mute {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.5); border: none; border-radius: 4px;
  color: #fff; font-size: 11px; padding: 1px 3px; cursor: pointer;
}
.video-tile-mobile .video-tile-label {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 9px; padding: 1px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================= ADMIN PAGE ================= */
.admin-shell { max-width: 960px; margin: 32px auto; padding: 0 16px; font-family: var(--font-ui); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { font-size: 20px; font-weight: 800; color: var(--surface-text); margin: 0; letter-spacing: -0.01em; }
.admin-logout-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--surface-text);
  padding: 9px 20px; border-radius: var(--r-pill); font-size: 13px; cursor: pointer; font-weight: 600;
}
.admin-logout-btn:hover { background: var(--surface-3); }

.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.admin-tab {
  background: none; border: none; color: var(--surface-text); opacity: 0.5; padding: 12px 4px; margin-right: 26px;
  font-size: 14px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.admin-tab:hover { opacity: 0.8; }
.admin-tab.active { opacity: 1; border-bottom-color: var(--primary); color: var(--surface-text); }

.admin-panel {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px 22px; margin-bottom: 16px;
}
.admin-panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--surface-text); }
.admin-panel .hint { margin-top: 0; }

.admin-field { display: flex; flex-direction: column; gap: 4px; }
.admin-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; font-weight: 600; }
.admin-field input, .admin-field select {
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--surface-text); font-size: 14px;
}

.admin-btn { padding: 9px 18px; border-radius: var(--r-pill); border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-btn:active { transform: scale(0.96); }
.admin-btn-primary { background: var(--primary); color: #fff; }
.admin-btn-primary:hover { background: var(--primary-hover); }
.admin-btn-sm { padding: 6px 14px; font-size: 11.5px; }
.admin-btn-ghost { background: var(--surface-2); color: var(--surface-text); border: 1px solid var(--border); }
.admin-btn-ghost:hover { background: var(--surface-3); }
.admin-btn-danger { background: rgba(224,87,74,0.14); color: #ff9c8f; border: none; }
.admin-btn-danger:hover { background: var(--primary); color: #fff; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; color: var(--surface-text); }
.admin-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.45;
  padding: 8px 10px 8px 0; font-weight: 700;
}
.admin-table td { padding: 12px 10px 12px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.league-member-chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 3px 4px 3px 10px; font-size: 12px; margin: 2px 3px 2px 0;
}
.league-member-chip-x {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 15px; line-height: 1;
  padding: 2px 6px; border-radius: 50%;
}
.league-member-chip-x:hover { background: rgba(224,87,74,0.18); color: #ff9c8f; }

@media (max-width: 640px) {
  .admin-shell { margin: 18px auto; }
  .admin-tab { margin-right: 14px; }
}

/* ---------- join screen s výpisem stolů ---------- */
.join-shell { display: flex; gap: 16px; align-items: flex-start; max-width: 1100px; margin: 20px auto; flex-wrap: wrap; justify-content: center; }
.join-side-col { display: flex; flex-direction: column; gap: 16px; }
.site-footer { text-align: center; font-size: 11px; opacity: 0.4; margin: 18px 0 6px; }
.rooms-panel {
  width: 320px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-2);
}
.rooms-panel h2 { font-family: var(--font-ui); font-size: 15px; color: var(--surface-text); font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.rooms-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; }
.rooms-sort-select { font-size: 12px; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--surface-text); }
.rooms-list-scroll { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.room-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px;
}
.room-item:hover { border-color: var(--border-strong); }
.room-item .code { font-weight: 800; color: var(--surface-text); font-size: 15px; letter-spacing: -0.01em; }
.room-item .meta { font-size: 11.5px; opacity: 0.65; color: var(--surface-text); }
.room-item button { flex-shrink: 0; padding: 8px 16px; border-radius: var(--r-pill); border: none; background: var(--primary); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; }
.room-item button:hover { background: var(--primary-hover); }
.rooms-empty { font-size: 13px; opacity: 0.6; color: var(--surface-text); margin-bottom: 10px; }

.league-row { margin-bottom: 10px; }
.league-row-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px;
  color: var(--surface-text); font-family: var(--font-ui); font-size: 14px; font-weight: 700; cursor: pointer; text-align: left;
}
.league-row-toggle:hover { border-color: var(--border-strong); }
.league-member-count { font-size: 11.5px; font-weight: 500; opacity: 0.65; flex-shrink: 0; }
.league-standings { background: var(--surface-2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--r-md) var(--r-md); padding: 12px 14px; margin-top: -1px; }

@media (max-width: 480px) {
  .stovka-row { margin-top: 38px; }
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--cream); color: var(--ink); border-radius: var(--r-lg); padding: 24px;
  max-width: 340px; width: 100%; box-shadow: var(--shadow-3);
}
.modal-title { font-weight: 800; margin: 0 0 14px; font-size: 17px; letter-spacing: -0.01em; }
.modal-box input[type=text] { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions .btn { width: auto; padding: 10px 18px; }

@media (max-width: 480px) {
  .modal-box { padding: 16px; }
}

@media (max-width: 720px) {
  .join-shell { flex-direction: column; align-items: stretch; margin: 20px auto; }
  .rooms-panel { width: 100%; }
  .join-side-col { width: 100%; }
  .chat-panel { left: 18px; right: 18px; width: auto; }
}

/* Přihlašovací karta - jediné místo s logotypem appky (Cinzel), zbytek Inter */
.card-panel {
  background: var(--cream); color: var(--ink); border-radius: var(--r-xl); padding: 28px;
  max-width: 380px; margin: 40px auto;
  border: none; box-shadow: var(--shadow-3);
}
.title {
  font-family: 'Cinzel', var(--font-ui); font-size: 28px; font-weight: 700; color: var(--ink);
  margin: 0 0 6px; letter-spacing: 0.02em;
}
.subtitle { font-size: 14px; opacity: 0.6; margin: 0 0 20px; }
label.field-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; font-weight: 700; }
.opt-label { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; cursor: pointer; color: inherit; }
.opt-label input[type=checkbox] { margin-top: 3px; flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--primary); }
.opt-text { display: flex; flex-direction: column; gap: 1px; }
.opt-title { font-size: 13.5px; font-weight: 600; }
.opt-desc { font-size: 11px; opacity: 0.55; }
input[type=text], input[type=password] {
  width: 100%; margin: 5px 0 14px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1.5px solid #00000018; font-size: 15px; font-family: var(--font-ui); background: #ffffff;
  color: var(--ink); color-scheme: light;
}
input[type=text]:focus, input[type=password]:focus { border-color: var(--primary); outline: none; }
.oauth-buttons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.oauth-btn { text-decoration: none; }
.oauth-divider { text-align: center; font-size: 12px; opacity: 0.5; margin: 0 0 12px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #00000008; padding: 4px; border-radius: var(--r-pill); }
.auth-tab {
  flex: 1; padding: 9px; border-radius: var(--r-pill); border: none; background: none;
  color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.auth-tab.active { background: #fff; box-shadow: var(--shadow-1); font-weight: 700; }

/* ---------- horní panel s tlačítky ---------- */
.top-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.join-account-bar { display: flex; justify-content: flex-end; gap: 10px; max-width: 1100px; margin: 0 auto 10px; }
.tb-item { position: relative; }
.tb-spacer { flex: 1; }
.tb-btn {
  background: var(--surface-2); color: var(--surface-text); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 7px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tb-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.tb-btn:active { transform: scale(0.96); }
@keyframes online-btn-flash-pulse {
  0%, 100% { background: var(--surface-2); border-color: var(--border); }
  50% { background: var(--accent-tonal); border-color: var(--accent); }
}
.online-btn-flash { animation: online-btn-flash-pulse 0.9s ease-in-out infinite; }
#mobileInfoToggle { display: none; }
.tb-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 45;
  width: 240px; max-width: calc(100vw - 24px); max-height: 60vh; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; font-size: 13px; box-shadow: var(--shadow-3);
  backdrop-filter: blur(20px) saturate(1.6);
}
.tb-dropdown.open { display: block; animation: tb-dropdown-in 0.15s var(--ease); }
@keyframes tb-dropdown-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- boční lišta (přepínatelná v ⚙️ Nastavení) - přeskládává STEJNOU lištu, žádná
   duplicitní struktura/logika, jen jiné CSS uspořádání téhož ---------- */
#sidebarToggleBtn { display: none; }
#sidebarPinToggleBtn { display: none; }
[data-nav="sidebar"] #sidebarToggleBtn {
  display: flex; align-items: center; justify-content: center; position: fixed; top: 14px; left: 14px;
  z-index: 71; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--surface-text); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-2);
}
[data-nav="sidebar"] .top-toolbar, [data-nav="sidebar"] .join-account-bar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: 240px; max-width: 82vw;
  flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap;
  background: var(--surface-1); border-right: 1px solid var(--border); box-shadow: var(--shadow-3);
  padding: 60px 12px 16px; margin: 0; overflow-y: auto; gap: 8px;
  transform: translateX(-100%); transition: transform 0.2s var(--ease);
}
[data-nav="sidebar"] .top-toolbar.sidebar-open, [data-nav="sidebar"] .join-account-bar.sidebar-open {
  transform: translateX(0);
}
[data-nav="sidebar"] .tb-item { width: 100%; }
[data-nav="sidebar"] .tb-btn { width: 100%; text-align: left; }
[data-nav="sidebar"] .tb-dropdown {
  position: static !important; width: 100% !important; max-width: none; box-shadow: none;
  backdrop-filter: none; background: var(--surface-2); margin-top: 4px;
}
[data-nav="sidebar"] .tb-spacer { display: none; } /* v svislé liště appka mezeru na konec neroztahuje */
/* Overlay za boční lištou na mobilu, ať jde zavřít klikem mimo - jen když je otevřená a NENÍ připnutá */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 69; }
[data-nav="sidebar"]:not([data-nav-pinned="1"]) .sidebar-backdrop.open { display: block; }
/* "Připnout natrvalo" má vizuální efekt jen od 900px šířky - stejná hranice, kde appka vůbec
   ukazuje tlačítko na odepnutí. Bez týhle podmínky by appka mohla zůstat "uvízlá" s natrvalo
   otevřenou lištou na úzké obrazovce (např. po zúžení okna z desktopu), bez viditelné cesty ven,
   protože tlačítko na odepnutí by tam vůbec nebylo vidět. */
@media (min-width: 900px) {
  [data-nav="sidebar"] #sidebarPinToggleBtn { display: flex !important; }
  [data-nav="sidebar"][data-nav-pinned="1"] .modal-overlay { left: 254px; } /* lišta zůstává mimo overlay, viditelná a klikací */
  [data-nav="sidebar"][data-nav-pinned="1"] #sidebarToggleBtn { display: none; } /* připnuto = lišta pořád vidět, hamburger zbytečný */
  [data-nav="sidebar"][data-nav-pinned="1"] .top-toolbar, [data-nav="sidebar"][data-nav-pinned="1"] .join-account-bar {
    transform: translateX(0);
  }
  [data-nav="sidebar"][data-nav-pinned="1"] #root {
    /* Appka chce #root (max-width 1100px, jako běžně) vycentrovat v prostoru VPRAVO od 240px
       lišty, ne přes celou obrazovku. 430 = 550 (polovina 1100) - 120 (polovina běžného
       odsazení #root vlevo/vpravo, 2×14px/2) - appka to spočítala numerickou simulací
       (viz komentář v deploy skriptu/changelogu), ne jen z hlavy - na 5 různých šířkách okna
       vychází vlevo i vpravo od obsahu stejná mezera. max(240px, ...) je pojistka, ať obsah
       nikdy nezaleze pod lištu na užších oknech - appka tam pak prostě využije celou zbylou
       šířku bez centrování (na to už tam není místo).
       Nahrazuje předchozí pokus s pevným padding-left+max-width, který fungoval jen na jedné
       konkrétní šířce okna a jinde nechal appku "přilepenou" vlevo s prázdným pruhem vpravo. */
    margin-left: max(240px, calc(50vw - 430px));
    margin-right: auto;
  }
}
.tb-dropdown-head { font-weight: 800; font-size: 12px; letter-spacing: 0.02em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 10px; }
.tb-dropdown-link { display: block; color: var(--surface-text); text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 500; }
.tb-dropdown-link:hover { background: var(--bubble-bg); }
.tb-dropdown-subhead { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.45; margin: 10px 0 2px 10px; }
.online-list { max-height: 220px; overflow-y: auto; }
.online-row { padding: 6px 10px; font-size: 13px; color: var(--surface-text); }
.online-league-badge { font-size: 11px; }
.online-table-badge { font-size: 11px; opacity: 0.85; }
.online-guest-row { opacity: 0.55; font-style: italic; border-top: 1px solid var(--border); margin-top: 2px; padding-top: 8px; }

.lfp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--surface-text);
}
.lfp-row:first-of-type { border-top: none; }
.lfp-row .lfp-invite-btn { width: auto; padding: 6px 14px; font-size: 12px; flex-shrink: 0; }

#incomingInviteBox { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.invite-card {
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow-3); min-width: 260px; text-align: center;
}
.invite-card p { margin: 0 0 10px; font-size: 14px; color: var(--surface-text); }
.invite-card-actions { display: flex; gap: 8px; }
.invite-card-actions .btn { width: auto; flex: 1; padding: 8px 14px; font-size: 13px; }
.tb-dropdown-sublink { padding-left: 20px; font-size: 12.5px; }
.tb-dropdown-btn {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--surface-text); font-size: 14px; font-weight: 500; padding: 10px; border-radius: var(--r-sm);
}
.tb-dropdown-btn:hover { background: var(--bubble-bg-hover); }
.tb-dropdown-btn.active { color: var(--primary); font-weight: 700; }
.support-unread-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-left: 4px; }
.tb-dropdown-btn-danger { color: #ff8a70; }
.tb-dropdown-btn-danger:hover { background: rgba(224,87,74,0.18); }
#gameMenuDropdown { min-width: 200px; }
.tb-dropdown ul { margin: 0 0 6px; padding-left: 16px; opacity: 0.8; }
.tb-dropdown li { margin-bottom: 5px; line-height: 1.4; }
.tb-dropdown .scoresheet-table { font-size: 11px; }
.tb-dropdown .scoresheet-table th, .tb-dropdown .scoresheet-table td { padding: 5px 7px; }
.log-talie-details {
  margin: 0 0 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgba(255,255,255,0.02); overflow: hidden;
}
.log-talie-details summary {
  cursor: pointer; list-style: none; padding: 10px 12px; user-select: none; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-tonal); color: var(--accent-text);
}
.log-talie-details summary:hover { filter: brightness(1.15); }
.log-talie-details summary::-webkit-details-marker { display: none; }
.log-talie-details summary::after { content: '⌄'; font-size: 13px; opacity: 0.7; margin-left: 6px; transition: transform 0.15s ease; }
.log-talie-details[open] summary::after { transform: rotate(180deg); }
.log-talie-details ul { margin: 0 0 6px; padding-left: 16px; }
.log-talie-details > ul { padding: 0 12px 6px; margin: 6px 0 0; }
.log-game-details { margin: 0; border-top: 1px solid var(--border); }
.log-game-details summary {
  cursor: pointer; list-style: none; padding: 8px 12px; user-select: none; font-weight: 700; font-size: 11.5px;
  display: flex; align-items: center; justify-content: space-between; opacity: 0.85;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.log-game-details summary:hover { background: var(--bubble-bg); }
.log-game-details summary::-webkit-details-marker { display: none; }
.log-game-details summary::after { content: '⌄'; font-size: 11px; opacity: 0.55; margin-left: 6px; transition: transform 0.15s ease; }
.log-game-details[open] summary::after { transform: rotate(180deg); }
.log-game-details ul { margin: 0; padding: 0 12px 10px 26px; }
.log-game-label { font-size: 10.5px; font-weight: 700; opacity: 0.55; text-transform: uppercase; letter-spacing: 0.04em; margin: 8px 0 2px; }

/* Modal (avatar, "moje hry", "o appce") má vždycky světlé krémové pozadí bez ohledu na
   zvolený motiv appky - .log-talie-details/.log-game-label jsou jinak laděné na tmavý
   dropdown, tady je potřeba je přebarvit, ať zůstanou čitelné. */
.about-changelog { color: var(--ink); font-size: 13px; }
.about-changelog .log-talie-details { border-color: rgba(0,0,0,0.12); background: rgba(0,0,0,0.025); }
.about-changelog .log-talie-details summary { background: rgba(156,116,24,0.14); color: #8a6a25; }
.about-changelog .log-game-label { color: rgba(32,28,36,0.55); }
.about-changelog .log-talie-details ul { color: var(--ink); }
.about-changelog code { background: rgba(0,0,0,0.08); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; font-family: 'Menlo', 'Consolas', monospace; }
.about-changelog a { color: var(--primary); }

/* ---------- tlačítka - plná, bez ozdobných rámů, jako v Material/iOS ---------- */
.btn {
  display: block; width: 100%; text-align: center; padding: 13px 16px; border-radius: var(--r-md);
  border: none; font-weight: 700; font-size: 15px; cursor: pointer; font-family: var(--font-ui);
  letter-spacing: -0.005em;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(224,87,74,0.35); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: #00000009; color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: #00000014; }
.btn-danger-full { background: rgba(224,87,74,0.1); color: var(--primary); }
.btn-danger-full:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-on-dark { background: var(--bubble-bg); color: var(--surface-text); border: none; }
.btn-on-dark:hover { background: var(--bubble-bg-hover); color: var(--surface-text); }
.btn-on-dark.danger { color: #ff9c8f; background: rgba(224,87,74,0.16); }
.btn-on-dark.danger:hover { background: var(--primary); color: #fff; }
.btn-adaptive { background: var(--bubble-bg); color: var(--surface-text); border: none; }
.btn-adaptive:hover:not(:disabled) { background: var(--bubble-bg-hover); }
.btn:disabled { opacity: 0.35; cursor: default; }
.error-text { color: #fff; background: var(--primary); border: none; border-radius: var(--r-md); padding: 10px 14px; font-size: 13px; margin: 0 0 10px; font-weight: 600; }

.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.seat-box { border: 1.5px solid #00000012; border-radius: var(--r-md); padding: 14px; text-align: left; background: #00000004; cursor: pointer; font-family: var(--font-ui); color: var(--ink); }
.seat-box:not(:disabled):hover { background: var(--primary-tonal); border-color: var(--primary); }
.seat-box:disabled { cursor: default; color: var(--ink); } /* přepsat prohlížečovo výchozí "color: GrayText" na :disabled, jinak byl text u obsazeného místa téměř nečitelný */
.seat-box .n { font-size: 11px; opacity: 0.72; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.seat-box .v { font-weight: 700; font-size: 14px; }

.ranking-list { list-style: none; margin: 0 0 20px; padding: 0; }
.ranking-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #00000012; font-weight: 600; }

.game-topbar { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 6px; padding: 0 4px; text-align: center; }
.game-topbar .talie { font-size: 11px; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.game-topbar .game { font-family: var(--font-ui); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--surface-text); line-height: 1.15; }
.maturant-badge {
  margin-top: 6px; font-size: 12.5px; font-weight: 700; padding: 6px 16px;
  background: var(--accent-tonal); color: var(--accent-text);
  border-radius: var(--r-pill);
}
.hint { font-size: 13px; opacity: 0.65; margin: 0 0 4px; padding: 0 4px; }
.stovka-row { text-align: right; margin-bottom: 6px; padding: 0 4px; }
.stovka-btn { background: var(--accent-tonal); color: var(--accent-text); border: none; border-radius: var(--r-pill); padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer; }
.stovka-btn:hover { background: var(--accent); color: var(--bg); }

/* ---------- herní stůl - jediné místo, kde zůstává barevná/plsťová identita ---------- */
.table-frame {
  background: var(--surface-1);
  border-radius: var(--r-xl);
  padding: 5px;
  box-shadow: var(--shadow-2);
  margin-bottom: 6px;
  position: relative;
}
.table-frame::before { content: none; }
.table-felt {
  background: radial-gradient(ellipse at 50% 30%, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.3);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "tl top tr" "left mid right" "bl bottom br";
  min-height: 260px;
  padding: 4px 8px;
  gap: 4px;
}
.seat-top { grid-area: top; justify-self: center; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seat-left { grid-area: left; justify-self: center; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seat-right { grid-area: right; justify-self: center; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seat-bottom { grid-area: bottom; justify-self: center; align-self: end; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.trick-mid { grid-area: mid; display: flex; align-items: center; justify-content: center; position: relative; min-height: 232px; }

.table-ad-banner {
  background: rgba(0,0,0,0.35); color: var(--accent);
  border-radius: var(--r-sm); padding: 5px 14px; margin: 0 0 6px;
  text-align: center; font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
}
.table-ad-banner span { font-weight: 400; opacity: 0.75; margin-left: 8px; }
.table-ad-banner-image { padding: 0; overflow: hidden; }
.table-ad-banner-image img { display: block; width: 100%; max-height: 60px; object-fit: cover; border-radius: var(--r-sm); }

.seat-avatar-badge {
  display: block; width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.85); overflow: hidden;
  box-shadow: var(--shadow-1);
}

/* ---------- postavička u stolu - pohled shora, žádné křeslo, jen postava ---------- */
.seat-figure-img {
  display: block; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.4));
  animation: seat-figure-breathe 4.5s ease-in-out infinite;
  user-select: none;
}
@keyframes seat-figure-breathe {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1.5px) rotate(0.6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .seat-figure-img { animation: none; }
}
/* Vědomě opuštěné místo (viz hiddenName) - žádné "dýchání" jako u živé postavy, jasně
   odlišná (šedá, průhlednější) siluetu bez oblečení, ať je na první pohled zřejmé, že tam
   nikdo nesedí. */
.seat-figure-empty { animation: none !important; opacity: 0.45; filter: grayscale(1) drop-shadow(0 3px 5px rgba(0,0,0,0.4)); }
.seat-figure-rotate { display: block; }
.seat-left .seat-figure-rotate { transform: rotate(-90deg); }
.seat-right .seat-figure-rotate { transform: rotate(90deg); }
.seat-bottom .seat-figure-rotate { transform: rotate(180deg); }
.seat-top .seat-figure-img { width: 30px; height: 30px; }
.seat-left .seat-figure-img, .seat-right .seat-figure-img { width: 38px; height: 38px; }
.seat-bottom .seat-figure-img { width: 54px; height: 54px; }
.seat-figure-photo {
  display: block; border-radius: 50%; background-size: cover; background-position: center;
  box-shadow: 0 3px 5px rgba(0,0,0,0.4), 0 0 0 2px var(--surface-1);
}
.seat-top .seat-figure-photo { width: 30px; height: 30px; }
.seat-left .seat-figure-photo, .seat-right .seat-figure-photo { width: 38px; height: 38px; }
.seat-bottom .seat-figure-photo { width: 54px; height: 54px; }
.seat-avatar-photo { width: 100%; height: 100%; background-size: cover; background-position: center; }
.seat-avatar-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: #fff; font-weight: 800; font-size: 17px;
}
.seat-avatar-badge-lg { width: 74px; height: 74px; border-width: 3px; }
.seat-avatar-badge-lg .seat-avatar-fallback { font-size: 26px; }

.plaque {
  background: var(--surface-2);
  color: var(--surface-text); border-radius: var(--r-sm); padding: 4px 10px;
  text-align: center; box-shadow: var(--shadow-1);
  min-width: 68px; border: 1px solid var(--border);
}
.plaque.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3), var(--shadow-2); }
.plaque.maturant { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }
.plaque .nm { font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.plaque .pt { font-size: 13px; font-weight: 800; line-height: 1.2; }
.plaque .conn { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.plaque .conn.off { background: #b0554d; }
.plaque .conn.on { background: #5db06a; }
.plaque.mine { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-1); }
.plaque .tricks-won { font-size: 8px; opacity: 0.7; margin-top: 0; line-height: 1.2; }

.opp-cards { display: flex; justify-content: center; margin: 3px 0; height: 26px; position: relative; }
.opp-cards .back-mini {
  width: 17px; height: 24px; border-radius: 4px; position: absolute; top: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  background: var(--primary);
  border: 1.5px solid rgba(255,255,255,0.6);
}
.opp-count-badge {
  position: absolute; bottom: -5px; right: -7px; background: var(--surface-1); color: var(--surface-text);
  font-size: 9px; font-weight: 800; border-radius: 50%; width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong);
}

/* ---------- avatar modal ---------- */
.avatar-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
  backdrop-filter: blur(4px);
}
.avatar-modal {
  background: var(--cream); color: var(--ink); border-radius: var(--r-xl);
  padding: 24px 26px; width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
  box-shadow: var(--shadow-3);
}
.avatar-modal-layout { display: flex; align-items: center; gap: 16px; margin: 14px 0 14px; }
.avatar-crop-stage { margin: 0 0 16px; }
.avatar-crop-window {
  width: 220px; height: 220px; margin: 0 auto; border-radius: var(--r-lg); overflow: hidden;
  background: #00000015; box-shadow: inset 0 0 0 2px var(--border-strong);
  cursor: grab; touch-action: none; position: relative;
}
.avatar-crop-window.dragging { cursor: grabbing; }
.avatar-crop-window img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.avatar-clothes-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.avatar-swatch {
  aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer;
}
.avatar-swatch:hover { transform: scale(1.08); }
.avatar-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(224,87,74,0.25); }
.avatar-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- zdvih na stole ---------- */
.trick-slot { position: absolute; text-align: center; width: 66px; }
.trick-slot.pos-top { top: 4px; left: 50%; transform: translateX(-50%); }
.trick-slot.pos-left { left: 6px; top: 50%; transform: translateY(-50%); }
.trick-slot.pos-right { right: 6px; top: 50%; transform: translateY(-50%); }
.trick-slot.pos-bottom { bottom: 4px; left: 50%; transform: translateX(-50%); }
.trick-slot .who { font-size: 9px; opacity: 0.75; margin-top: 1px; line-height: 1.2; color: #fff; }
.renonc-report-btn {
  display: block; margin: 3px auto 0; padding: 3px 10px; font-size: 9px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--r-pill);
  cursor: pointer; font-weight: 700; letter-spacing: 0.02em;
}
.renonc-report-btn:hover { background: var(--primary-hover); }
.trick-slot .pcard-wrap { box-shadow: 0 0 0 2px rgba(0,0,0,0.55); border-radius: var(--r-sm); }
.trick-slot.led-card .pcard-wrap { box-shadow: 0 0 0 3px var(--accent), 0 0 10px 2px rgba(227,182,77,0.5); border-radius: var(--r-sm); }
.trick-slot .led-tag {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--bg); background: var(--accent); border-radius: 4px; padding: 1px 6px;
  display: inline-block; margin-bottom: 2px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box;
}

.trick-card-anim { transition: transform 0.5s var(--ease), opacity 0.4s ease; }
.kvarty-fly-in { animation: kvarty-fly-in 0.45s var(--ease) backwards; }
@keyframes kvarty-fly-in {
  from { transform: translateY(-18px) scale(0.6); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.trick-card-anim.fly-in-start { transform: var(--fly-from, translateY(-26px) scale(0.5)); opacity: 0; }
.trick-card-anim.fly-in-end { transform: translate(0,0) scale(1); opacity: 1; }
.trick-card-anim.collect-start { transform: translate(0, 0) scale(1); opacity: 1; }
.trick-card-anim.collect-end { transform: var(--collect-to, translate(0,0)) scale(0.4); opacity: 0; }
.center-label { color: var(--center-label-color); font-size: 13px; text-align: center; letter-spacing: 0.02em; font-weight: 500; }

.mid-info { color: #fff; font-size: 13px; text-align: center; max-width: 260px; }
.mid-info .row { margin-bottom: 3px; }

.hand-tray {
  background: var(--surface-1);
  border-radius: var(--r-lg); padding: 10px 10px 8px;
  box-shadow: var(--shadow-2);
}
.hand-tray .box-label { font-size: 11px; opacity: 0.55; margin-bottom: 8px; text-align: center; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.hand-fan { display: flex; justify-content: center; flex-wrap: wrap; padding-bottom: 6px; }
.hand-fan .card-slot { margin: 0 -6px; transition: transform 0.15s var(--ease); }
.hand-fan .card-slot:hover { z-index: 5; }

.turn-row { display: flex; justify-content: center; align-items: center; margin-bottom: 8px; font-size: 13.5px; opacity: 0.9; font-weight: 700; letter-spacing: -0.005em; }
.turn-row.mine { color: var(--primary); }

.action-row { text-align: center; margin-bottom: 10px; }
.action-row .btn { display: inline-block; width: auto; padding: 10px 22px; margin: 0 4px; }

.desitky-seq-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; justify-items: center; margin-bottom: 10px; }
@media (min-width: 601px) {
  .desitky-seq-cards .pcard-wrap.sz-mini { width: 46px; height: 87px; }
  .kvarty-run-row .pcard-wrap.sz-mini { width: 46px; height: 87px; }
}
.desitky-seq-item { text-align: center; }
.desitky-seq-item .lbl { font-size: 10.5px; opacity: 0.65; margin-bottom: 4px; font-weight: 600; color: #fff; }
.desitky-seq-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; }
.desitky-seq-cards .pcard-wrap, .desitky-seq-cards .pcard-img { border-radius: 3px; }
.desitky-seq-cards .pcard-wrap + .pcard-wrap { margin-left: -10px; }
.desitky-seq-empty { width: 34px; height: 48px; border: 2px dashed rgba(255,255,255,0.3); border-radius: var(--r-sm); }

.log-box { margin-top: 16px; font-size: 12px; opacity: 0.65; }
.log-box summary { cursor: pointer; font-weight: 700; }
.log-box ul { margin: 8px 0 0; padding-left: 18px; }
.log-box li { margin-bottom: 3px; }

.played-cards-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.scoresheet-box { opacity: 1; overflow-x: auto; }
.scoresheet-table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 13px; }
.scoresheet-table th, .scoresheet-table td { padding: 8px 8px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.scoresheet-table th:first-child, .scoresheet-table td:first-child { text-align: left; white-space: normal; word-break: break-word; }
.results-table { table-layout: auto; }
.results-table td { white-space: normal; }
.scoresheet-table thead th { font-weight: 700; opacity: 0.6; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; }
.scoresheet-table tfoot td { font-weight: 800; border-top: 2px solid var(--border-strong); border-bottom: none; }
.scoresheet-total {
  background: var(--accent-tonal); border: 1px solid var(--accent); border-radius: var(--r-sm);
  margin-bottom: 4px;
}
.scoresheet-total th, .scoresheet-total td { border-bottom: none; }
.scoresheet-total td { font-weight: 800; color: var(--accent-text); }
.log-talie-details .scoresheet-table { margin: 0 12px 10px; width: calc(100% - 24px); }

.footnote { margin-top: 22px; font-size: 10.5px; opacity: 0.35; line-height: 1.5; text-align: center; }

.pcard-wrap { display: inline-block; border-radius: var(--r-sm); overflow: hidden; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4)); background: none; border: none; padding: 0; cursor: default; transition: transform 0.15s var(--ease); vertical-align: top; position: relative; }
.rank-badge {
  position: absolute; top: 2px; left: 2px; z-index: 2;
  background: rgba(0,0,0,0.72); color: #fff;
  font-weight: 800; font-size: 11px; line-height: 1;
  padding: 2px 5px; border-radius: 5px; pointer-events: none;
}
.pcard-wrap + .pcard-wrap { margin-left: -16px; }
.pcard-wrap.sz-hand { width: 70px; height: 132px; margin-left: 0; }
.pcard-wrap.sz-trick { width: 66px; height: 125px; }
.pcard-wrap.sz-mini { width: 32px; height: 60px; }
.pcard-wrap.playable { cursor: pointer; }
.pcard-wrap:disabled { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)) grayscale(0.55) brightness(0.75); }
.pcard-wrap.playable:hover { transform: translateY(-10px) scale(1.04); }
.pcard-wrap.renonc-risk { cursor: pointer; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4)) sepia(0.4) hue-rotate(-40deg) saturate(1.6); }
.pcard-wrap.renonc-risk:hover { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--primary); }
.pcard-wrap.staged { transform: translateY(-14px); filter: drop-shadow(0 8px 14px rgba(0,0,0,0.5)) drop-shadow(0 0 0 2px var(--accent)); }
.pcard-img { width: 100%; height: 100%; object-fit: contain; display: block; background: #F7F0E1; border-radius: var(--r-sm); }
.pcard-placeholder {
  width: 100%; height: 100%; border-radius: var(--r-sm); border: 2px solid; background: #F7F0E1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pcard-placeholder .ph-rank { font-size: 20px; font-weight: 800; }
.pcard-placeholder .ph-suit { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; }
.back-img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }

.turn-countdown {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px;
  border-radius: var(--r-pill); background: rgba(0,0,0,0.5); border: none;
  color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle;
}
.turn-countdown--warn { background: var(--primary); color: #fff; animation: turn-countdown-pulse 1s infinite; }
@keyframes turn-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ================= MOBIL / ÚZKÁ OBRAZOVKA ================= */
@media (max-width: 600px) {
  #root { display: flex; flex-direction: column; }
  .my-name-banner { order: 1; }
  .main-col { order: 2; }
  .top-toolbar { order: 3; margin-top: 14px; margin-bottom: 0; }
  .top-toolbar .tb-dropdown { top: auto; bottom: calc(100% + 6px); }
  .chat-bubble {
    position: static; order: 4; width: auto; height: auto;
    margin: 10px auto 0; padding: 12px 26px; font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .chat-bubble .badge { position: static; }
  .video-bubble {
    position: static; order: 5; width: auto; height: auto;
    margin: 8px auto 0; padding: 12px 26px; font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }

  #mobileInfoToggle { display: inline-block; }
  .my-name-banner, .game-topbar .talie, .stovka-row, .game-rule-hint {
    display: none !important;
  }
  body.mobile-info-open .my-name-banner { display: block !important; }
  body.mobile-info-open .game-topbar .talie { display: block !important; }
  body.mobile-info-open .stovka-row { display: block !important; }
  body.mobile-info-open .game-rule-hint { display: block !important; }

  .my-name-banner { font-size: 15px; margin-bottom: 8px; }
  .game-topbar {
    margin-bottom: 6px; position: sticky; top: 0; z-index: 30;
    background: var(--bg); padding: 6px 4px 4px; margin-left: -14px; margin-right: -14px;
    box-shadow: var(--shadow-1);
  }
  .game-topbar .talie { font-size: 10px; }
  .game-topbar .game { font-size: 21px; }

  .table-frame { padding: 5px; border-radius: var(--r-lg); }
  .table-felt { min-height: 220px; padding: 5px 3px; gap: 3px; }
  .trick-mid { min-height: 180px; }
  .trick-slot .who { font-size: 8px; }

  .trick-slot { width: 48px; }
  .pcard-wrap.sz-trick { width: 48px; height: 91px; }
  .pcard-wrap.sz-hand { width: 49px; height: 92px; }
  .pcard-wrap.sz-mini { width: 22px; height: 42px; }

  .seat-top .seat-figure-img { width: 22px; height: 22px; }
  .seat-left .seat-figure-img, .seat-right .seat-figure-img { width: 26px; height: 26px; }
  .seat-bottom .seat-figure-img { width: 36px; height: 36px; }
  .seat-top .seat-figure-photo { width: 22px; height: 22px; }
  .seat-left .seat-figure-photo, .seat-right .seat-figure-photo { width: 26px; height: 26px; }
  .seat-bottom .seat-figure-photo { width: 36px; height: 36px; }

  .plaque { min-width: 54px; padding: 2px 7px; }
  .plaque .nm { font-size: 9px; max-width: 70px; }
  .plaque .pt { font-size: 11px; }
  .plaque .tricks-won { font-size: 7px; }

  .opp-cards { height: 20px; margin: 2px 0; }
  .opp-cards .back-mini { width: 14px; height: 20px; }
  .opp-count-badge { width: 12px; height: 12px; font-size: 7px; bottom: -3px; right: -5px; }

  .table-ad-banner { font-size: 10px; padding: 4px 8px; }
  .table-ad-banner span { margin-left: 4px; }

  .hand-tray { padding: 8px 6px 6px; }
  .hand-tray .box-label { font-size: 10px; margin-bottom: 5px; }

  .desitky-seq-box { gap: 10px 12px; }
  .desitky-seq-cards .pcard-wrap + .pcard-wrap { margin-left: -8px; }
  .desitky-seq-empty { width: 24px; height: 34px; }

  .tb-dropdown { width: calc(100vw - 24px); max-width: 300px; }
  #scorePanel.tb-dropdown, #historyPanel.tb-dropdown {
    position: fixed; top: 8vh; left: 12px; right: 12px; bottom: auto;
    width: auto; max-width: none; max-height: 84vh;
  }
}

/* ================= NÍZKÉ OKNO (bez ohledu na šířku) =================
   Řeší desktopové prohlížeče s menším/nemaximalizovaným oknem (různé prohlížeče mají různě
   velké vlastní UI navíc - adresní řádek, lišty), kde se i na širokém displeji nemusí karty v
   ruce vejít bez scrollování. Na rozdíl od mobilní media query výš tohle NEPŘESKUPUJE layout
   (na desktopu by to vypadalo divně), jen zmenší to, co zabírá nejvíc místa. */
@media (max-height: 850px) and (min-width: 601px) {
  .top-toolbar { margin-bottom: 2px; }
  .tb-btn { padding: 5px 12px; font-size: 11.5px; }
  .my-name-banner { font-size: 12px; margin-bottom: 2px; }
  .game-topbar { margin-bottom: 3px; }
  .game-topbar .game { font-size: 20px; }
  .game-topbar .talie { font-size: 10px; }
  .hint { margin: 0 0 3px; font-size: 12px; }
  .table-ad-banner { padding: 3px 12px; margin-bottom: 4px; }
  .table-frame { padding: 4px; }
  .table-felt { min-height: 200px; padding: 3px 6px; gap: 3px; }
  .trick-mid { min-height: 175px; }
  .seat-top .seat-figure-img { width: 24px; height: 24px; }
  .seat-left .seat-figure-img, .seat-right .seat-figure-img { width: 28px; height: 28px; }
  .seat-bottom .seat-figure-img { width: 36px; height: 36px; }
  .seat-top .seat-figure-photo { width: 24px; height: 24px; }
  .seat-left .seat-figure-photo, .seat-right .seat-figure-photo { width: 28px; height: 28px; }
  .seat-bottom .seat-figure-photo { width: 36px; height: 36px; }
  .trick-slot { width: 52px; }
  .pcard-wrap.sz-trick { width: 52px; height: 98px; }
  .pcard-wrap.sz-hand { width: 56px; height: 106px; }
  .turn-row { margin-bottom: 4px; font-size: 12px; }
  .hand-tray { padding: 7px 8px 6px; }
  .hand-tray .box-label { font-size: 10px; margin-bottom: 4px; }
}
