/* ===========================
   Live Table Quiz – Frews-ish UI
   =========================== */

.ltq-root {
  --ltq-accent: #c62828;
  --ltq-accent-strong: #a61d1d;
  --ltq-bg: #fff;
  --ltq-text: inherit;
  --ltq-muted: rgba(0, 0, 0, 0.6);
  --ltq-border: rgba(0, 0, 0, 0.08);
  --ltq-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
  --ltq-shadow-strong: 0 16px 40px rgba(198, 40, 40, 0.18);
  --ltq-radius: 18px;
  --ltq-sticky-offset: 12px;
  --ltq-sticky-top: 0px;

  position: relative;
  color: var(--ltq-text);
  font: inherit;
  background: linear-gradient(180deg, rgba(198, 40, 40, 0.03), transparent 180px), var(--ltq-bg);
  border: 1px solid rgba(198, 40, 40, 0.14);
  border-radius: var(--ltq-radius);
  box-shadow: var(--ltq-shadow);
  padding: 22px;
}

@media (max-width: 640px) {
  .ltq-root {
    padding: 14px;
    --ltq-sticky-offset: 8px;
  }
}

.ltq-header {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.ltq-cover-wrap {
  position: relative;
  margin-bottom: 6px;
}

.ltq-cover-wrap.ltq-coverless {
  min-height: 0;
  margin-bottom: 0;
}

.ltq-label {
  position: absolute;
  top: -14px;
  left: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ltq-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  box-shadow: var(--ltq-shadow-strong);
}

.ltq-cover-wrap.ltq-coverless .ltq-label {
  position: static;
  margin-bottom: 4px;
}

.ltq-cover {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: block;
}

.ltq-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}

.ltq-title-divider {
  width: min(180px, 45%);
  height: 3px;
  margin: -4px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(198, 40, 40, 0.22), var(--ltq-accent), rgba(198, 40, 40, 0.22));
}

.ltq-meta {
  color: var(--ltq-muted);
  font-size: 15px;
  text-align: center;
}

/* původní panel v kartě */
.ltq-sticky-bar {
  display: grid;
  gap: 12px;
}

/* když není připnuto, panel normálně zůstává v kartě */
.ltq-root .ltq-sticky-bar {
  position: relative;
}

/* placeholder, který drží místo v layoutu ve chvíli, kdy panel přesuneme do fixed doku */
.ltq-sticky-placeholder {
  display: none;
}

.ltq-root.ltq-pinned .ltq-sticky-placeholder {
  display: block;
}

/* skutečný horní sticky dock pod headerem webu */
.ltq-floating-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--ltq-sticky-top, 0px) + var(--ltq-sticky-offset, 12px));
  width: min(1280px, calc(100vw - 24px));
  z-index: 9998;
  pointer-events: none;
}

.ltq-floating-dock.is-active {
  display: block;
}

.ltq-floating-dock .ltq-sticky-bar {
  pointer-events: auto;
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(198, 40, 40, 0.14);
}

/* input */
.ltq-global-input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--ltq-border);
  background: #fff;
  font: inherit;
  font-size: 17px;
  line-height: 1.2;
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ltq-global-input:focus {
  border-color: rgba(198, 40, 40, 0.35);
  box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
}

.ltq-global-input:disabled {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.45);
}

/* buttons */
.ltq-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.ltq-btn {
  border: 1px solid var(--ltq-border);
  background: #fff;
  color: inherit;
  padding: 11px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ltq-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.ltq-btn:active {
  transform: translateY(1px);
}

.ltq-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.ltq-btn-start {
  min-width: min(100%, 320px);
  padding: 16px 28px;
  border: none;
  background: linear-gradient(180deg, #d93636, var(--ltq-accent));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--ltq-shadow-strong);
}

.ltq-btn-start:hover {
  background: linear-gradient(180deg, #df4444, var(--ltq-accent-strong));
  box-shadow: 0 18px 36px rgba(198, 40, 40, 0.22);
}

.ltq-root.ltq-has-started .ltq-btn-start {
  min-width: auto;
  padding: 11px 16px;
  font-size: 14px;
  box-shadow: none;
  background: #fff;
  color: inherit;
  border: 1px solid var(--ltq-border);
}

.ltq-btn-danger {
  background: #fff;
  border-color: rgba(220, 38, 38, 0.25);
  color: #b91c1c;
}

.ltq-btn-danger:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.35);
}

.ltq-btn-pin[aria-pressed="true"] {
  background: rgba(198, 40, 40, 0.08);
  border-color: rgba(198, 40, 40, 0.25);
}

.ltq-timer {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--ltq-border);
  background: rgba(0, 0, 0, 0.02);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 700;
}

/* table */
.ltq-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--ltq-border);
  background: #fff;
}

.ltq-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.ltq-table th,
.ltq-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

.ltq-table th {
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.65);
  background: rgba(0, 0, 0, 0.02);
}

.ltq-root.ltq-pinned .ltq-table thead th {
  position: sticky;
  top: calc(var(--ltq-sticky-top, 0px) + 110px);
  z-index: 5;
}

.ltq-table tbody tr:last-child td {
  border-bottom: none;
}

.ltq-answer-cell,
.ltq-correct {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ltq-ok {
  background: rgba(16, 185, 129, 0.06);
}

.ltq-bad {
  background: rgba(239, 68, 68, 0.06);
}

.ltq-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* results */
.ltq-results {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.ltq-score {
  font-size: 16px;
  font-weight: 800;
}

.ltq-avg,
.ltq-note {
  color: rgba(0, 0, 0, 0.7);
  font-size: 14px;
}

.ltq-error {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 900px) {
  .ltq-floating-dock {
    width: calc(100vw - 16px);
  }

  .ltq-floating-dock .ltq-sticky-bar {
    padding: 10px;
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .ltq-label {
    left: 14px;
    top: -10px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 12px;
  }

  .ltq-title {
    font-size: 24px;
  }

  .ltq-btn-start {
    width: 100%;
  }

  .ltq-floating-dock {
    width: calc(100vw - 12px);
  }

  .ltq-root.ltq-pinned .ltq-table thead th {
    top: calc(var(--ltq-sticky-top, 0px) + 138px);
  }
}