@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Rethink+Sans:wght@400;500;600;700&display=swap");

/* ── Design tokens (Antalgija × RKL — iš Quiz RKL / colors_and_type) ── */
:root {
  --green-50: #e9f5ec;
  --green-500: #249a48;
  --green-700: #156132;
  --tan-400: #ca9b5e;
  --tan-50: #f8f1e7;
  --stone-50: #ffffff;
  --stone-100: #f5f3ef;
  --stone-200: #ecece8;
  --stone-500: #888881;
  --stone-600: rgba(31, 42, 36, 0.7);
  --stone-800: #1f2a24;
  --stone-900: #0e1612;
  --danger-500: #b23a3a;
  --white: #fff;

  --font-sans: "Rethink Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "Rethink Sans", system-ui, sans-serif;

  --radius-lg: 12px;
  --radius-xl: 18px;
  --shadow-md: 0 1px 2px rgba(21, 97, 50, 0.05), 0 8px 24px rgba(21, 97, 50, 0.07);
}

@keyframes qz-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--stone-800);
  background: var(--stone-100);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--stone-900);
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

.hidden {
  display: none !important;
}

/* ── App shell ── */
.qz-app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0)) calc(16px + env(safe-area-inset-right, 0))
    calc(16px + env(safe-area-inset-bottom, 0)) calc(16px + env(safe-area-inset-left, 0));
}

.qz-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.qz-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qz-brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green-500);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
}

.qz-brand__lines {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.qz-brand__ant {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-800);
}

.qz-brand__rkl {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-600);
  margin-top: 2px;
}

.qz-meta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stone-600);
  text-align: right;
  margin: 0;
}

/* ── Generic panels (idle, registracija, lobby, lyderiai) ── */
.qz-panel {
  background: var(--stone-50);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(21, 97, 50, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qz-eyebrow {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-500);
  margin: 0 0 6px;
}

.qz-title-page {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--stone-900);
  margin: 0 0 8px;
}

.qz-lede {
  font-size: 0.9375rem;
  color: var(--stone-600);
  margin: 0 0 8px;
  line-height: 1.5;
}

.muted {
  color: var(--stone-600);
}

#status {
  font-size: 0.875rem;
  margin-top: 10px;
  min-height: 1.25em;
}

/* ── VARIANT C · Tabloas — klausimo ekranas ── */
.qz-screen--question {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0 -16px;
  width: calc(100% + 32px);
  max-width: none;
}

.qz-board {
  position: relative;
  background: var(--stone-900);
  color: var(--white);
  padding: calc(10px + env(safe-area-inset-top, 0)) 20px 18px;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  overflow: hidden;
}

.qz-board__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.03) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
}

.qz-board__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.qz-board .qz-brand__ant,
.qz-board .qz-brand__rkl {
  color: var(--white);
}

.qz-board .qz-brand__rkl {
  color: rgba(255, 255, 255, 0.7);
}

.qz-board .qz-brand__mark {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.qz-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--danger-500);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qz-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  animation: qz-pulse 1s infinite;
}

.qz-board__timer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.qz-board__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.qz-board__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  margin-top: 4px;
  letter-spacing: -0.015em;
}

.qz-board__num span {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 800;
}

.qz-countdown {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 12vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--tan-400);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(202, 155, 94, 0.25);
  transition: color 0.2s, text-shadow 0.2s;
}

.qz-countdown--warn {
  color: var(--danger-500);
  text-shadow: 0 0 30px rgba(178, 58, 58, 0.45);
}

.qz-timer-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.qz-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--tan-400);
  transition: width 0.12s linear, background 0.2s;
}

.qz-timer-fill--warn {
  background: var(--danger-500);
}

.qz-question-body {
  padding: 22px 22px 12px;
}

.qz-question-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 4.2vw, 1.5rem);
  line-height: 1.2;
  color: var(--stone-900);
  text-wrap: pretty;
}

.qz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 18px 12px;
  flex: 1;
}

.qz-answer {
  display: flex;
  align-items: stretch;
  min-height: 60px;
  padding: 0;
  margin: 0;
  border: 1.5px solid rgba(31, 42, 36, 0.08);
  border-radius: 10px;
  background: var(--stone-50);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  font-family: var(--font-sans);
}

.qz-answer:active {
  transform: scale(0.99);
}

.qz-answer__letter {
  width: 56px;
  flex-shrink: 0;
  background: var(--stone-900);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.qz-answer__label {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--stone-800);
}

.qz-answer--picked {
  background: var(--green-50);
  border-color: var(--green-500);
}

.qz-answer--picked .qz-answer__letter {
  background: var(--green-500);
}

.qz-bottom-bar {
  margin-top: auto;
  background: var(--stone-900);
  color: var(--white);
  padding: 14px 20px;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qz-bottom-bar__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.qz-bottom-bar__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--tan-400);
  font-variant-numeric: tabular-nums;
}

/* ── Form controls ── */
input,
select {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(31, 42, 36, 0.12);
  background: var(--stone-50);
  color: var(--stone-800);
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

label {
  font-size: 0.875rem;
  color: var(--stone-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.qz-btn-primary {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--green-500);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;
}

.qz-btn-primary:hover {
  background: var(--green-700);
}

/* Leaderboard */
#leaderboardList {
  margin: 0;
  padding-left: 1.1rem;
}

#leaderboardList li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-weight: 600;
}

#leaderboardList strong {
  font-family: var(--font-display);
  color: var(--green-700);
}

/* Admin shell (legacy .container / .card classes) */
.qz-admin.container {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top, 0)) calc(16px + env(safe-area-inset-right, 0))
    calc(16px + env(safe-area-inset-bottom, 0)) calc(16px + env(safe-area-inset-left, 0));
}

.qz-admin .card {
  background: var(--stone-50);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(21, 97, 50, 0.08);
  margin-bottom: 14px;
}

.qz-admin .card h2 {
  margin-top: 0;
}

.qz-admin .card input,
.qz-admin .card select,
.qz-admin .card button {
  font-family: inherit;
}

.qz-admin .card button {
  margin-top: 4px;
}

/* Admin */
.qz-admin .adminStatus {
  min-height: 2.5rem;
  padding: 12px 14px;
  margin: 0 0 14px;
  border-radius: var(--radius-lg);
  background: var(--tan-50);
  border: 1px solid rgba(202, 155, 94, 0.35);
  color: var(--stone-800);
  font-size: 0.875rem;
}

.qz-admin .qz-panel {
  margin-bottom: 12px;
}

.qz-admin h1 {
  font-size: 1.5rem;
}

#questionsList .row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.qz-admin a {
  color: var(--green-700);
  font-weight: 600;
}
