/* ==========================================================================
   Tagbox AI Academy — Play Wall kit (wall.css)
   LED-wall look for a fixed 1600x1000 stage (4m x 2.5m wall, 400px per meter).
   Dependency-free. Pair with wall.js. Docs: docs/play-wall/_kit/README.md (not deployed).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&family=Rubik:wght@500;600;700;800&display=swap');

:root {
  --wall-navy: #060F1F;
  --wall-navy-2: #0B1730;
  --wall-blue: #38BDF8;
  --wall-indigo: #4F7CF7;
  --wall-violet: #8B5CF6;
  --wall-ink: #F4F7FB;
  --wall-ink-dim: rgba(244, 247, 251, 0.62);
  --wall-ink-faint: rgba(244, 247, 251, 0.28);
  --wall-good: #34D399;
  --wall-bad: #F43F5E;
  --wall-warn: #FBBF24;
  --wall-line: rgba(56, 189, 248, 0.14);
  --wall-glass: rgba(11, 23, 48, 0.72);
  --wall-font-head: 'Rubik', 'Heebo', 'Arial Hebrew', 'Segoe UI', system-ui, sans-serif;
  --wall-font-body: 'Heebo', 'Rubik', 'Arial Hebrew', 'Segoe UI', system-ui, sans-serif;
  --wall-led-opacity: 1;
}

html.wall-root,
html.wall-root body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02060d;
  color: var(--wall-ink);
  font-family: var(--wall-font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html.wall-record,
html.wall-record * { cursor: none !important; }

/* ---------- viewport + stage ---------- */
.wall-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(120% 90% at 50% 50%, #050c19 0%, #010307 100%);
}

.wall-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 1000px;
  transform-origin: 0 0;
  overflow: hidden;
  direction: rtl;
  background:
    radial-gradient(900px 620px at 88% -8%, rgba(79, 124, 247, 0.22), transparent 70%),
    radial-gradient(820px 640px at 6% 108%, rgba(139, 92, 246, 0.20), transparent 70%),
    radial-gradient(700px 500px at 50% 55%, rgba(56, 189, 248, 0.05), transparent 75%),
    var(--wall-navy);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 30px 120px rgba(0, 0, 0, 0.6);
  contain: layout paint;
}

.wall-layer {
  position: absolute;
  inset: 0;
  width: 1600px;
  height: 1000px;
}
.wall-layer.is-passive { pointer-events: none; }

/* blueprint grid in the background layer */
.wall-bg {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
  mask-image: radial-gradient(130% 120% at 50% 45%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(130% 120% at 50% 45%, #000 55%, transparent 100%);
}

/* LED panel look: fine pixel pitch + cabinet seams (8 x 5 cabinets of 50cm) + vignette */
.wall-led {
  pointer-events: none;
  opacity: var(--wall-led-opacity);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.26) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    radial-gradient(140% 120% at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
  background-size: 200px 200px, 200px 200px, 5px 5px, 5px 5px, auto, auto;
}
html.wall-no-led .wall-led { display: none; }

/* ---------- typography helpers ---------- */
.wall-h { font-family: var(--wall-font-head); font-weight: 800; letter-spacing: -0.01em; line-height: 1.04; margin: 0; }
.wall-kicker {
  font-family: var(--wall-font-head);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.06em;
  color: var(--wall-blue);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.wall-kicker::before {
  content: '';
  width: 34px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.wall-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.wall-grad-text {
  background: linear-gradient(90deg, var(--wall-blue), var(--wall-indigo) 45%, var(--wall-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- HUD ---------- */
.wall-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 112px;
  display: grid;
  grid-template-columns: 1fr 360px 1fr;
  align-items: center;
  padding: 0 44px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(4, 10, 22, 0.92), rgba(4, 10, 22, 0.55) 70%, transparent);
  border-bottom: 1px solid rgba(56, 189, 248, 0.10);
  pointer-events: none;
  transition: opacity 400ms ease, transform 400ms ease;
}
.wall-hud.is-hidden { opacity: 0; transform: translateY(-24px); }
.wall-hud-team {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.wall-hud-team.is-end { flex-direction: row-reverse; text-align: left; }
.wall-hud-swatch {
  width: 10px;
  height: 58px;
  border-radius: 6px;
  background: var(--team-color, var(--wall-blue));
  box-shadow: 0 0 18px var(--team-color, var(--wall-blue));
  flex: none;
}
.wall-hud-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wall-hud-name {
  font-family: var(--wall-font-head);
  font-weight: 700;
  font-size: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall-hud-sub {
  font-family: var(--wall-font-body);
  font-weight: 500;
  font-size: 20px;
  color: var(--wall-ink-dim);
  white-space: nowrap;
}
.wall-hud-score {
  font-family: var(--wall-font-head);
  font-weight: 800;
  font-size: 62px;
  line-height: 1;
  color: var(--team-color, var(--wall-ink));
  text-shadow: 0 0 22px color-mix(in srgb, var(--team-color, #38BDF8) 55%, transparent);
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}
.wall-hud-team.is-end .wall-hud-score { margin-inline-start: 0; margin-inline-end: auto; }
.wall-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wall-hud-timer {
  font-family: var(--wall-font-head);
  font-weight: 800;
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0.02em;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  color: var(--wall-ink);
  transition: color 200ms ease, text-shadow 200ms ease;
}
.wall-hud-timer.is-warn { color: var(--wall-warn); text-shadow: 0 0 24px rgba(251, 191, 36, 0.55); }
.wall-hud-timer.is-danger { color: var(--wall-bad); text-shadow: 0 0 26px rgba(244, 63, 94, 0.65); }
.wall-hud-round {
  font-family: var(--wall-font-body);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--wall-ink-dim);
  white-space: nowrap;
}

/* ---------- chrome: brand + simulation badge ---------- */
.wall-chrome { pointer-events: none; }
.wall-brand {
  position: absolute;
  left: 34px;
  bottom: 22px;
  direction: ltr;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--wall-font-head);
  font-size: 17px;
  letter-spacing: 0.18em;
  color: rgba(244, 247, 251, 0.42);
}
.wall-brand b { font-weight: 800; color: rgba(244, 247, 251, 0.72); letter-spacing: 0.16em; }
.wall-brand span { font-weight: 600; color: rgba(56, 189, 248, 0.7); }
.wall-badge {
  position: absolute;
  right: 30px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 18px;
  border-radius: 999px;
  background: rgba(6, 15, 31, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.45);
  font-family: var(--wall-font-body);
  font-weight: 600;
  font-size: 19px;
  color: #FDE7A8;
}
.wall-badge::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wall-warn);
  box-shadow: 0 0 10px var(--wall-warn);
}

/* ---------- FX ---------- */
.wall-fx { pointer-events: none; overflow: hidden; }
.wall-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff 0%, #eef3fa 22%, #c9d4e4 52%, #8494ad 82%, #56657e 100%);
  box-shadow:
    inset -6px -8px 14px rgba(20, 30, 50, 0.35),
    0 0 18px rgba(56, 189, 248, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}
.wall-ball::before {
  content: '';
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 2px solid rgba(79, 124, 247, 0.55);
  border-color: rgba(79, 124, 247, 0.55) transparent rgba(79, 124, 247, 0.55) transparent;
  transform: rotate(var(--seam, 25deg));
}
.wall-ball::after {
  content: '';
  position: absolute;
  width: 26%;
  height: 18%;
  left: 22%;
  top: 16%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(2px);
}
.wall-ball.is-ghost { opacity: 0.18; filter: blur(3px); box-shadow: none; }
.wall-ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  border-radius: 50%;
  border: 4px solid var(--fx-color, var(--wall-blue));
  box-shadow: 0 0 24px var(--fx-color, var(--wall-blue)), inset 0 0 18px var(--fx-color, var(--wall-blue));
  will-change: transform, opacity;
}
.wall-flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, var(--fx-color, #38BDF8) 32%, transparent 70%);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}
.wall-pixel {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--fx-color, var(--wall-blue));
  box-shadow: 0 0 10px var(--fx-color, var(--wall-blue));
  will-change: transform, opacity;
}
.wall-float {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-family: var(--wall-font-head);
  font-weight: 800;
  font-size: 34px;
  white-space: nowrap;
  color: var(--fx-color, var(--wall-ink));
  text-shadow: 0 0 16px var(--fx-color, rgba(56, 189, 248, 0.6)), 0 2px 0 rgba(0, 0, 0, 0.5);
  will-change: transform, opacity;
}
.wall-screen-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 50%, transparent 40%, var(--fx-color, #38BDF8) 140%);
  opacity: 0;
}

/* ---------- overlay: banner / intro / debrief ---------- */
.wall-overlay { pointer-events: none; }
.wall-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 760px;
  max-width: 1220px;
  padding: 44px 70px 48px;
  box-sizing: border-box;
  border-radius: 34px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(14, 28, 58, 0.94), rgba(7, 15, 33, 0.94));
  border: 1px solid color-mix(in srgb, var(--banner-color, #38BDF8) 55%, transparent);
  box-shadow:
    0 0 0 6px rgba(6, 15, 31, 0.55),
    0 0 80px color-mix(in srgb, var(--banner-color, #38BDF8) 35%, transparent),
    0 40px 90px rgba(0, 0, 0, 0.55);
}
.wall-banner .wall-kicker { color: var(--banner-color, var(--wall-blue)); justify-content: center; }
.wall-banner .wall-kicker::after {
  content: '';
  width: 34px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.wall-banner-title { font-size: 88px; margin-top: 16px; }
.wall-banner-sub {
  margin-top: 18px;
  font-family: var(--wall-font-body);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.35;
  color: var(--wall-ink-dim);
}

.wall-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 140px;
  box-sizing: border-box;
  background:
    radial-gradient(900px 560px at 50% 42%, rgba(79, 124, 247, 0.20), transparent 70%),
    linear-gradient(180deg, rgba(6, 15, 31, 0.86), rgba(6, 15, 31, 0.96));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.wall-card-title { font-size: 150px; margin-top: 26px; padding-bottom: 8px; }
.wall-card-lesson {
  margin-top: 26px;
  max-width: 1120px;
  font-family: var(--wall-font-body);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.38;
  color: rgba(244, 247, 251, 0.86);
}
.wall-card-bar {
  margin-top: 54px;
  width: 420px;
  height: 6px;
  border-radius: 6px;
  background: rgba(244, 247, 251, 0.10);
  overflow: hidden;
}
.wall-card-bar > i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 100% 50%;
  background: linear-gradient(270deg, var(--wall-blue), var(--wall-violet));
  box-shadow: 0 0 16px var(--wall-blue);
}

.wall-debrief {
  justify-content: flex-start;
  padding: 92px 150px 0;
  text-align: right;
  align-items: stretch;
}
.wall-debrief-title { font-size: 84px; margin-top: 20px; max-width: 1300px; }
.wall-debrief-lines {
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1300px;
}
.wall-debrief-lines li {
  position: relative;
  padding-inline-start: 38px;
  font-family: var(--wall-font-body);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.38;
  color: rgba(244, 247, 251, 0.88);
}
.wall-debrief-lines li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--wall-blue), var(--wall-violet));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
.wall-debrief-q {
  margin-top: 40px;
  max-width: 1300px;
  padding: 28px 40px 32px;
  border-radius: 26px;
  background: linear-gradient(90deg, rgba(79, 124, 247, 0.20), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.18);
}
.wall-debrief-q-label {
  font-family: var(--wall-font-head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #C4B5FD;
}
.wall-debrief-q-text {
  margin-top: 8px;
  font-family: var(--wall-font-head);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.3;
}
.wall-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.wall-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(244, 247, 251, 0.06);
  border: 1px solid rgba(244, 247, 251, 0.14);
  font-family: var(--wall-font-body);
  font-weight: 600;
  font-size: 22px;
  color: rgba(244, 247, 251, 0.86);
}
.wall-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip-color, var(--wall-blue));
  box-shadow: 0 0 10px var(--chip-color, var(--wall-blue));
}

/* paused indicator */
.wall-paused {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 13, 0.55);
  font-family: var(--wall-font-head);
  font-weight: 800;
  font-size: 72px;
  letter-spacing: 0.04em;
}
html.wall-is-paused .wall-paused { display: flex; }

/* balanced line breaks for multi-line copy (no one-word orphans) */
.wall-banner-title,
.wall-banner-sub,
.wall-card-title,
.wall-card-lesson,
.wall-debrief-title,
.wall-debrief-lines li,
.wall-debrief-q-text { text-wrap: balance; }
