/* Tutor Live (public/tutor/). */
:root {
  --tl-bg: #0f1726;
  --tl-panel: #182238;
  --tl-line: #2b3a59;
  --tl-text: #f2f6ff;
  --tl-dim: #a9b6d0;
  --tl-accent: #26d6bd;
  --tl-max: #8f4fe0;
  --tl-danger: #e5484d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--tl-bg); color: var(--tl-text); font-family: Arial, Helvetica, sans-serif; }
[hidden] { display: none !important; }

/* In the room the top bar is everything: no floating Home button, footer or
   Feedback button over the game (the tutor's End button ends the session). */
html.tl-in-room #zbHomeButton, html.tl-in-room .zb-site-footer, html.tl-in-room #zb-feedback { display: none !important; }
html.tl-in-room, html.tl-in-room body { overflow: hidden; }

.tl-card { background: var(--tl-panel); border: 1px solid var(--tl-line); border-radius: 22px; padding: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0;
  background: var(--tl-accent); color: #062a26; font: 800 15px/1 Arial, Helvetica, sans-serif; text-decoration: none; cursor: pointer; }
.tl-btn:disabled { opacity: .45; cursor: not-allowed; }
.tl-btn.ghost { background: transparent; color: var(--tl-text); border: 2px solid var(--tl-line); }
.tl-btn.big { width: 100%; padding: 15px; font-size: 18px; margin-top: 8px; }
.tl-msg { min-height: 1.3em; color: #ffd166; font-weight: 700; margin: 10px 0 0; }
.tl-max { display: inline-block; vertical-align: middle; padding: 3px 10px; border-radius: 999px; background: var(--tl-max); color: #fff; font-size: 13px; font-weight: 900; letter-spacing: .05em; }
.tl-big { font-size: 54px; line-height: 1; }
.tl-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Gate */
.tl-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 70px 16px 40px; text-align: center; }
.tl-gate .tl-card { max-width: 520px; }
.tl-logo { width: 240px; max-width: 80%; height: auto; }
.tl-brand { margin: 0 0 12px; text-align: center; line-height: 0; }
.tl-brand img { width: 100%; max-width: 380px; height: auto; }
.tl-gate h1 { margin: 8px 0; }
.tl-gate p { color: var(--tl-dim); line-height: 1.5; }

/* Setup */
.tl-setup { min-height: 100vh; display: flex; justify-content: center; padding: 70px 16px 60px; }
.tl-setup-card { width: min(640px, 100%); }
.tl-setup h1 { margin: 0 0 6px; font-size: 30px; }
.tl-sub { color: var(--tl-dim); line-height: 1.45; margin: 0 0 18px; }
.tl-field { display: block; margin: 14px 0 0; font-weight: 800; font-size: 15px; }
.tl-field select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--tl-line);
  background: #0b1220; color: var(--tl-text); font-size: 16px; }
.tl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.tl-mode { text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--tl-line); background: #0b1220; color: var(--tl-text); cursor: pointer; font: inherit; }
.tl-mode strong { display: block; font-size: 15px; }
.tl-mode small { display: block; color: var(--tl-dim); margin-top: 4px; line-height: 1.35; font-weight: 400; }
.tl-mode.is-on { border-color: var(--tl-accent); background: rgba(38,214,189,.1); }
.tl-mode:disabled { opacity: .5; cursor: not-allowed; }
.tl-hint { color: var(--tl-dim); font-size: 13px; line-height: 1.4; margin: 8px 0 14px; }
.tl-hint a { color: #8ee8d8; font-weight: 700; }
.tl-resume { padding: 14px; border-radius: 14px; background: rgba(255,209,102,.1); border: 2px solid #ffd166; margin-bottom: 8px; }
.tl-resume p { margin: 0 0 10px; font-weight: 700; }
@media (max-width: 560px) { .tl-modes { grid-template-columns: 1fr; } }

/* Room */
.tl-room { position: fixed; inset: 0; display: flex; flex-direction: column; }
.tl-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 8px 12px; background: #0b1220; border-bottom: 1px solid var(--tl-line); }
.tl-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.tl-title strong { font-size: 17px; }
.tl-pill { padding: 5px 10px; border-radius: 999px; background: rgba(38,214,189,.16); color: #9ff3e6; font-size: 13px; font-weight: 800; white-space: nowrap; }
.tl-pill.is-away { background: rgba(255,209,102,.16); color: #ffd166; }
.tl-pill-soft { background: rgba(255,255,255,.08); color: var(--tl-dim); }
.tl-pill-timer { background: #ffcf3f; color: #2a1600; font-weight: 800; }
.tl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-tutor-only { display: contents; }
html.tl-student .tl-tutor-only { display: none !important; }
.tl-tool { padding: 8px 12px; border-radius: 12px; border: 2px solid var(--tl-line); background: var(--tl-panel); color: var(--tl-text);
  font: 800 14px/1 Arial, Helvetica, sans-serif; cursor: pointer; white-space: nowrap; }
.tl-tool:hover { border-color: #46608f; }
.tl-tool[aria-pressed="true"] { background: var(--tl-accent); border-color: var(--tl-accent); color: #062a26; }
.tl-tool.tl-danger { border-color: rgba(229,72,77,.6); color: #ffb3b5; }
.tl-tool.tl-danger:hover { background: var(--tl-danger); color: #fff; }
#freezeBtn[aria-pressed="true"] { background: #7cc4ff; border-color: #7cc4ff; color: #04223d; }

.tl-toolbox { position: absolute; left: 10px; top: 70px; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px; border-radius: 16px; background: rgba(11,18,32,.94); border: 1px solid var(--tl-line); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.tl-t { width: 42px; height: 42px; border-radius: 12px; border: 2px solid transparent; background: var(--tl-panel); font-size: 20px; cursor: pointer; }
.tl-t.is-on { border-color: var(--tl-accent); background: rgba(38,214,189,.18); }
.tl-colors { display: flex; flex-direction: column; gap: 5px; padding: 4px 0; }
.tl-color { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #0b1220; box-shadow: 0 0 0 2px var(--tl-line); cursor: pointer; padding: 0; }
.tl-color.is-on { box-shadow: 0 0 0 3px #fff; }

.tl-stage { position: relative; flex: 1 1 auto; overflow: hidden; background: #070c16; }
/* The game area is always laid out at 1280x800 per game (2600x800 for two side
   by side) and scaled to fit, so both screens line up. */
.tl-frame { position: absolute; left: 50%; top: 50%; width: 1280px; height: 800px; transform-origin: center center; }
.tl-pane { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#paneB { left: 1320px; }
#labelB { left: 1960px; }
.tl-pane-label { position: absolute; left: 640px; top: 4px; transform: translateX(-50%); z-index: 5; padding: 6px 16px; border-radius: 999px;
  background: #182238; color: #f2f6ff; font: 800 22px/1.2 Arial, Helvetica, sans-serif; white-space: nowrap; }
.tl-frame.is-duel .tl-pane { top: 50px; }
.tl-frame.is-duel { height: 850px; }
.tl-pane > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.tl-replay { position: absolute; inset: 0; background: #fff; overflow: hidden; }
.tl-replay-root { position: absolute; inset: 0; }
.tl-replay-root .replayer-wrapper { position: absolute; left: 0; top: 0; }
.tl-replay-root iframe { border: 0; pointer-events: none; }
.tl-replay-root .replayer-mouse { display: none; }
.tl-replay-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6b7a99;
  font: 800 26px/1.3 Arial, Helvetica, sans-serif; text-align: center; padding: 40px; }
.tl-capture { position: absolute; inset: 0; z-index: 3; outline: none; cursor: pointer; touch-action: none; }
.tl-capture.is-driving { cursor: crosshair; box-shadow: inset 0 0 0 6px #26d6bd; }
.tl-capture span { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
  background: rgba(11,18,32,.82); color: #fff; font: 800 18px/1.2 Arial, Helvetica, sans-serif; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.tl-capture.show-hint span { opacity: 1; }
/* Take over: one tap at a time (tutor.js wireTakeOver). In game pixels (1280x800). */
.tl-capture.is-pending { cursor: progress; }
.tl-act-mark { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; pointer-events: none; z-index: 4;
  border: 7px solid #ffd166; box-shadow: 0 0 0 3px rgba(11,18,32,.55), inset 0 0 0 3px rgba(11,18,32,.35); box-sizing: border-box; }
.tl-act-mark.is-sending { border-top-color: transparent; animation: tl-act-spin .7s linear infinite; }
.tl-act-mark.is-done { border-color: #2fd47f; animation: tl-act-pop .7s ease-out forwards; }
.tl-act-mark.is-warn { border-color: #ff6b6b; }
.tl-act-pill { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5; max-width: 92%; pointer-events: none;
  padding: 10px 20px; border-radius: 999px; background: rgba(11,18,32,.92); color: #fff; border: 3px solid #ffd166;
  font: 800 22px/1.25 Arial, Helvetica, sans-serif; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.tl-act-pill.is-done { border-color: #2fd47f; color: #b9ffd9; }
.tl-act-pill.is-warn { border-color: #ff6b6b; color: #ffd4d4; white-space: normal; }
.tl-act-pill.is-nudge { animation: tl-act-shake .35s ease-in-out; }
@keyframes tl-act-spin { to { transform: rotate(360deg); } }
@keyframes tl-act-pop { 0% { transform: scale(.8); opacity: 1; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes tl-act-shake { 0%,100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 10px)); } 75% { transform: translateX(calc(-50% + 10px)); } }
.tl-block { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; cursor: not-allowed; }
.tl-block span { padding: 8px 16px; border-radius: 999px; background: rgba(11,18,32,.82); color: #fff; font: 800 18px/1.2 Arial, Helvetica, sans-serif; opacity: 0; transition: opacity .2s; }
.tl-block.show-hint span { opacity: 1; }
.tl-wait { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: #0f1726; color: var(--tl-dim); font: 800 26px/1.3 Arial, Helvetica, sans-serif; text-align: center; padding: 40px; }
.tl-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.tl-ink.is-on { pointer-events: auto; }

.tl-board { position: absolute; z-index: 20; display: flex; flex-direction: column; min-width: 260px; min-height: 200px;
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 16px 50px rgba(0,0,0,.55); border: 2px solid #26d6bd; }
.tl-board-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 12px;
  background: #0b1220; color: #fff; cursor: move; user-select: none; touch-action: none; }
.tl-board-actions { display: flex; gap: 6px; }
.tl-mini { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--tl-panel); color: #fff; font: 800 13px/1 Arial, Helvetica, sans-serif; cursor: pointer; }
.tl-board-ink { flex: 1 1 auto; width: 100%; min-height: 0; display: block; }
.tl-resize { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, #26d6bd 50%); }

/* Freeze keeps the screen bright: the cover is see-through, and the note shows
   for a moment (and again if they tap while frozen). */
.tl-freeze { position: fixed; inset: 0; z-index: 100; background: transparent; cursor: not-allowed; }
.tl-freeze-note { position: fixed; left: 50%; top: 70px; z-index: 101; transform: translateX(-50%); padding: 10px 20px; border-radius: 999px;
  background: rgba(11,18,32,.9); color: #fff; font: 800 17px/1.2 Arial, Helvetica, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  pointer-events: none; white-space: nowrap; animation: tlNote 2.6s ease forwards; }
@keyframes tlNote { 0% { opacity: 0; transform: translate(-50%, -8px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.tl-dialog { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(7,12,22,.7); padding: 16px; text-align: center; }
.tl-dialog .tl-card { width: min(460px, 100%); text-align: left; }
#endedCover .tl-card { text-align: center; }
