html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000000;
  overscroll-behavior: none;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.student-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.78rem;
  border-radius: 999px;
  background: #141519;
  border: 1px solid #262933;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.status-pill.connected .dot {
  background: var(--success);
}

.status-pill.disconnected .dot {
  background: var(--danger);
}

.code-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 9px;
  padding: 0.16rem 0.55rem;
}

/* --- Obrazovka: Lobby / Čekání --- */
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #07080c;
  text-align: center;
}

.center-card {
  width: 100%;
  max-width: 420px;
}

.waiting-lead {
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 0.75rem 0 0.45rem;
}

.waiting-sub {
  color: var(--text-secondary);
  margin: 0 0 1.6rem;
  font-size: 0.98rem;
}

.instruction-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  background: #101219;
  border: 1px solid #222530;
  border-radius: 16px;
  padding: 1.15rem;
}

.instruction-glyph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.instruction-glyph .track {
  width: 3px;
  flex: 1;
  margin: 4px 0;
  border-radius: 2px;
  background: linear-gradient(to top, #1e293b, var(--accent));
}

.instruction-text p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.instruction-text .instruction-tap {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Tep ukázky: Snímání (OLED #000000) --- */
.screen-playing {
  background: #000000;
  padding: 0;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: ns-resize;
}

.slider-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  will-change: height;
}

.slider-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0%;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  will-change: bottom;
}

.tap-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.28);
  transition: opacity 0.26s ease-out;
}

.tap-flash.active {
  opacity: 1;
  transition: none;
}

.oled-hint-top,
.oled-hint-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  pointer-events: none;
}

.oled-hint-top {
  top: max(14px, env(safe-area-inset-top));
}

.oled-hint-bottom {
  bottom: max(14px, env(safe-area-inset-bottom));
}

.oled-code {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* --- Tep ukázky: Osobní výsledek --- */
.screen-result {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  gap: 0.8rem;
  overflow-y: auto;
}

.result-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.result-subtitle {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.code-inline {
  font-family: var(--font-mono);
  color: var(--accent);
}

.result-stats {
  margin-left: 0.45rem;
  color: var(--text-muted);
}

.result-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 230px;
  background: #101218;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

#personal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.result-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.swatch-mine {
  background: var(--accent);
}

.swatch-group {
  border-top: 2px dashed #94a3b8;
  height: 0;
}

.swatch-tap {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.result-question {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- 3 slova (mobil) --- */
.screen-words {
  display: flex;
  flex-direction: column;
  background: #08090e;
  overflow-y: auto;
}

.words-card {
  width: 100%;
  max-width: 460px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.words-prompt {
  margin: 0;
  font-size: 1.38rem;
  line-height: 1.32;
  color: #f8fafc;
}

.words-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.word-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #11131b;
  border: 1px solid #262933;
  border-radius: 14px;
  padding: 0.35rem 0.75rem;
}

.word-field:focus-within {
  border-color: var(--accent);
}

.word-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  width: 1.3rem;
  text-align: center;
}

.word-field input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.65rem 0.25rem;
  font-size: 1.08rem;
  color: var(--text-primary);
}

.word-field input:focus {
  outline: none;
}

.words-submit-btn {
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
  border-radius: 14px;
  margin-top: 0.25rem;
}

.words-feedback {
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.4rem;
  color: var(--text-secondary);
}

.words-feedback.ok {
  color: #86efac;
  font-weight: 500;
}

.words-feedback.locked {
  color: #fde68a;
}

/* --- Teploměr (mobil) --- */
.screen-thermo {
  display: flex;
  flex-direction: column;
  background: #08090e;
  overflow: hidden;
}

.thermo-header {
  text-align: center;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.thermo-prompt {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

.thermo-readout {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0.2rem 0 0.5rem;
  flex-shrink: 0;
}

.thermo-pole {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0;
  flex-shrink: 0;
}

.thermo-pole.top {
  color: #fca5a5;
}

.thermo-pole.bottom {
  color: #7dd3fc;
}

.thermo-track-wrap {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.thermo-track {
  position: relative;
  width: 96px;
  height: 100%;
  max-height: 440px;
  border-radius: 999px;
  background: #12151f;
  border: 2px solid #2e3444;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55);
}

.thermo-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(to top, #38bdf8 0%, #f59e0b 50%, #ef4444 100%);
  pointer-events: none;
}

.thermo-thumb {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 50%;
  height: 10px;
  transform: translateY(50%);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.thermo-frozen-note {
  text-align: center;
  font-size: 0.9rem;
  color: #fde68a;
  margin-top: 0.35rem;
  min-height: 1.25rem;
  flex-shrink: 0;
}


/* --- 4. Mapa pohledu (student) --- */
.screen-gaze {
  display: flex;
  flex-direction: column;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.9rem max(0.85rem, env(safe-area-inset-bottom));
  gap: 0.65rem;
  background: #06070a;
}

.gaze-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gaze-prompt {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.gaze-counter {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--accent);
}

.gaze-stage {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: #0b0d13;
  border: 1px solid var(--border-subtle);
  padding: 0.4rem;
}

.gaze-waiting {
  color: var(--text-secondary);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.95rem;
}

.gaze-frame-wrap {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

#student-gaze-img {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  pointer-events: none;
}

.gaze-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gaze-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #061018;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}

.gaze-pin.order-1 {
  background: #38bdf8;
}

.gaze-pin.order-2 {
  background: #fbbf24;
}

.gaze-pin.order-3 {
  background: #fb7185;
}

.gaze-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.gaze-status {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-height: 1.1em;
}


/* --- 5. 2D kompas (student) --- */
.screen-compass {
  display: flex;
  flex-direction: column;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem max(0.85rem, env(safe-area-inset-bottom));
  gap: 0.6rem;
  background: #06070a;
}

.compass-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.compass-prompt {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.compass-pad-area {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.compass-pole {
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  text-align: center;
}

.compass-mid-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.compass-side {
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
  width: 58px;
  line-height: 1.2;
  word-break: break-word;
}

.compass-side.left {
  text-align: right;
}

.compass-side.right {
  text-align: left;
}

.compass-pad {
  position: relative;
  width: min(68vw, 44vh, 320px);
  height: min(68vw, 44vh, 320px);
  flex-shrink: 0;
  border-radius: 18px;
  background: #0e111a;
  border: 1.5px solid #2b3242;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.compass-axis-x,
.compass-axis-y {
  position: absolute;
  background: rgba(148, 163, 184, 0.35);
  pointer-events: none;
}

.compass-axis-x {
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
}

.compass-axis-y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
}

.compass-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#student-compass-line {
  stroke: rgba(251, 113, 133, 0.75);
  stroke-width: 1.6;
  stroke-dasharray: 3 2;
}

.compass-ghost {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 50%;
  background: rgba(251, 113, 133, 0.3);
  border: 2px dashed rgba(251, 113, 133, 0.85);
  pointer-events: none;
}

.compass-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
  pointer-events: none;
}

.compass-status {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-secondary);
  min-height: 1.2em;
}


/* --- 6. Predikční pauza (student) --- */
.predict-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.predict-form textarea {
  width: 100%;
  resize: none;
  border-radius: 12px;
  background: #0d1018;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.85rem;
  line-height: 1.4;
}

.predict-conf-box {
  background: #0d1018;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.predict-conf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.predict-conf-head strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent);
}

.predict-conf-box input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}

.predict-conf-poles {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.predict-eval {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.predict-recall {
  background: #0d1018;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.4;
}

.predict-eval-q {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
}

.predict-eval-btns {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.predict-eval-btn {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: 1.5px solid var(--border-subtle);
  background: #141824;
  color: var(--text-primary);
}

.predict-eval-btn.selected.hit {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.22);
  color: #a7f3d0;
}

.predict-eval-btn.selected.surprise {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}

.predict-eval-btn.selected.miss {
  border-color: #fb7185;
  background: rgba(251, 113, 133, 0.22);
  color: #fecdd3;
}


/* --- 7. Značkovač pozornosti (OLED 4 kvadranty) --- */
.screen-markers-oled {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  background: #000000;
  gap: 2px;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.oled-quad {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  text-align: center;
  transition: background-color 0.14s ease;
}

.oled-quad-title {
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0.36;
}

.oled-quad-sub {
  font-size: 0.78rem;
  opacity: 0.24;
  color: #cbd5e1;
}

.oled-quad.q-drift .oled-quad-title {
  color: #a78bfa;
}
.oled-quad.q-aha .oled-quad-title {
  color: #38bdf8;
}
.oled-quad.q-detail .oled-quad-title {
  color: #34d399;
}
.oled-quad.q-dissonance .oled-quad-title {
  color: #fb7185;
}

.oled-quad.flash {
  background: rgba(255, 255, 255, 0.12);
}

.markers-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.9rem;
  text-align: left;
}

.markers-summary-item {
  background: #0e111a;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.markers-summary-item span {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.markers-summary-item strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
}


/* --- 8. Před & Po (student) --- */
.ba-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ba-option-btn {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  background: #141824;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
}

.ba-option-btn.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
}

.ba-reflection-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.ba-reflection-form input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #0d1018;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.94rem;
}
