/* Teacher admin (desktop). Plain functional layout; the visual pass comes in F7. */
.t-app { min-height: 100vh; display: flex; flex-direction: column; }
.t-head {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.75rem 1.5rem; border-bottom: var(--line) solid var(--c-ink); background: var(--c-plum);
}
.t-title[data-logo] img { width: auto; height: 64px; margin: 0; }
.t-tabs { display: flex; gap: 0.5rem; flex: 1; }
.t-tab {
  font: 900 1rem var(--font-body); color: var(--c-bone); background: transparent;
  border: 3px solid transparent; border-radius: 10px; padding: 0.35rem 0.9rem; cursor: pointer;
}
.t-tab.on { border-color: var(--c-lantern); color: var(--c-lantern); }
.t-who { display: flex; align-items: center; gap: 0.75rem; color: var(--c-parchment); }
.t-plan {
  font-weight: 900; text-transform: uppercase; font-size: 0.8rem; padding: 0.1rem 0.5rem;
  border: 3px solid var(--c-ink); border-radius: 8px; background: var(--c-parchment); color: var(--c-ink);
}
.t-plan.pro { background: var(--c-lantern); }
.t-link { font: 700 1rem var(--font-body); color: var(--c-toxic); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }

.t-main { flex: 1; padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.t-start { display: flex; flex-direction: column; gap: 0.9rem; }
.t-start h2, .t-start h3 { margin: 0; }
.t-start h3 { color: var(--c-lantern); font-family: var(--font-body); font-weight: 900; }
.t-row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.t-start label, .t-filters label { font-weight: 700; color: var(--c-parchment); display: flex; gap: 0.5rem; align-items: center; }
.t-start select, .t-filters select {
  font: 700 1rem var(--font-body); padding: 0.3rem 0.5rem; border-radius: 8px;
  border: 3px solid var(--c-ink); background: var(--c-bone); color: var(--c-ink);
}
.t-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--c-toxic); }
.t-inline { display: inline-flex !important; margin-left: 1rem; }
.t-warn { margin: 0; min-height: 1.2em; color: var(--c-lantern); font-weight: 700; }

.t-picks, .t-packs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.t-pick, .t-card {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.9rem;
  border: var(--line) solid var(--c-ink); border-radius: 12px; background: var(--c-plum);
}
.t-pick { cursor: pointer; }
.t-pick:has(input:checked) { border-color: var(--c-toxic); }
.t-pick input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--c-toxic); }
.t-card { flex-direction: column; gap: 0.3rem; }
.t-pack-title { font-weight: 900; color: var(--c-bone); }
.t-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; font-size: 0.8rem; font-weight: 700; }
.t-tag { padding: 0 0.45rem; border-radius: 6px; background: var(--c-midnight); color: var(--c-parchment); }
.t-tag.builtin { color: var(--c-lantern); }
.t-empty { color: var(--c-parchment); }
.t-filters { display: flex; gap: 1.5rem; margin-bottom: 1rem; }

.t-dev { position: fixed; right: 1rem; bottom: 1rem; display: flex; gap: 0.75rem; align-items: center; padding: 0.5rem 0.9rem; }

@media (max-width: 700px) {
  .t-head, .t-main { padding: 0.75rem 16px; }
  .t-tabs { order: 3; flex-basis: 100%; }
}

/* Pack tags, card tools */
.t-tag.draft { color: var(--c-lantern); }
.t-tag.ready { color: var(--c-toxic); }
.t-card-tools, .e-card-tools { display: flex; gap: 0.9rem; margin-left: auto; }
.t-link.danger { color: var(--c-blood); }
.t-link:disabled { opacity: 0.4; cursor: not-allowed; }
.t-filters { align-items: center; flex-wrap: wrap; }

/* Shared form fields */
.t-start input:not([type]), .t-start textarea, .t-app .e-head input:not([type]),
.e-card textarea, .e-card input:not([type]), .e-card select, .e-add select {
  font: 700 1rem var(--font-body); padding: 0.4rem 0.55rem; border-radius: 8px;
  border: 3px solid var(--c-ink); background: var(--c-bone); color: var(--c-ink); width: 100%;
}
.t-start textarea { resize: vertical; }

/* New pack: drop zone */
.g-drop { border: 3px dashed var(--c-parchment); border-radius: 12px; padding: 1rem; color: var(--c-parchment); text-align: center; }
.g-drop.over { border-color: var(--c-toxic); color: var(--c-toxic); }
.g-files { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; text-align: left; }
.g-files li { display: flex; gap: 0.6rem; align-items: center; color: var(--c-bone); }

/* Editor */
.e-head { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.25rem; }
.e-title { font-weight: 700; color: var(--c-parchment); display: flex; flex-direction: column; gap: 0.3rem; }
.e-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.e-errors { margin: 0; padding-left: 1.2rem; color: var(--c-blood); font-weight: 700; font-size: 0.9rem; }
.e-sec { margin-bottom: 2rem; }
.e-sec h3 { margin: 0; color: var(--c-lantern); font-family: var(--font-body); font-weight: 900; }
.e-list { list-style: none; margin: 0.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.e-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0.9rem; border: var(--line) solid var(--c-ink); border-radius: 12px; background: var(--c-plum); }
.e-card.bad { border-color: var(--c-blood); }
.e-card-head { display: flex; gap: 0.6rem; align-items: center; }
.e-card-head select { width: auto; }
.e-n { font-weight: 900; color: var(--c-lantern); min-width: 1.5rem; }
.e-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.8rem; }
.e-opt { display: flex; gap: 0.5rem; align-items: center; }
.e-opt input[type="checkbox"] { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; accent-color: var(--c-toxic); }
.e-acc2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.e-card label { color: var(--c-parchment); font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.e-card .e-opt { flex-direction: row; }
.e-add { display: flex; gap: 0.6rem; align-items: center; }
.e-add select { width: auto; }
.e-add .btn { font-size: 1rem; padding: 0.35rem 1rem; }

@media (max-width: 700px) {
  .e-opts, .e-acc2 { grid-template-columns: 1fr; }
}

/* Pro features shown to free teachers: visible, but locked */
.locked { opacity: 0.55; }
.locked::after { content: ' · Pro'; font-size: 0.8em; color: var(--c-lantern); }

/* History */
.h-list { display: flex; flex-direction: column; gap: 0.6rem; }
.h-card { display: block; }
.h-head { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 0.2rem; width: 100%; }
.h-head:focus-visible { outline: 2px solid var(--c-toxic); outline-offset: 4px; }
.h-detail h4 { margin: 0.9rem 0 0.3rem; }
.h-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.h-table th, .h-table td { text-align: left; padding: 0.25rem 0.5rem; border-bottom: 1px solid color-mix(in srgb, var(--c-bone) 20%, transparent); vertical-align: top; }
.e-stat { margin: 0.3rem 0 0; color: var(--c-parchment); }

/* The open room banner */
.t-open-room { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.t-open-room[hidden] { display: none; }

/* Help tips ("?" next to switches and terms; public/js/help.js). Coded UI, tokens only. */
.t-help-pair { display: inline-flex; align-items: center; gap: 0.35rem; }
.help {
  position: relative; flex: 0 0 auto; width: 1.35rem; height: 1.35rem; padding: 0; border-radius: 50%;
  border: 2px solid var(--c-lantern); background: var(--c-midnight); color: var(--c-lantern);
  font: 900 0.8rem/1 var(--font-body); cursor: help;
}
.help:hover, .help:focus-visible, .help.open { background: var(--c-lantern); color: var(--c-ink); outline: none; }
.help::after {
  content: attr(data-help); position: absolute; z-index: 20; left: var(--tip-left, -8rem); bottom: calc(100% + 0.5rem);
  width: var(--tip-w, 18rem); padding: 0.6rem 0.75rem; border-radius: 10px;
  border: 3px solid var(--c-lantern); background: var(--c-plum); color: var(--c-bone);
  font: 600 0.85rem/1.35 var(--font-body); text-align: left; white-space: normal; box-shadow: 0 6px 18px var(--c-ink);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--t-fast) ease;
}
.help:hover::after, .help:focus-visible::after, .help.open::after { opacity: 1; visibility: visible; }
/* Near the top of the page the tip opens downwards. */
.t-head .help::after, .t-tabs .help::after { bottom: auto; top: calc(100% + 0.5rem); }

/* Licence credits (music: Dark Fantasy Studio Premium licence requires the mention). */
.t-credits { text-align: center; padding: 24px 16px; opacity: 0.7; }

/* ---- The staff room (2026-11-11): the picture is the home page, its objects are the menu ---- */
body:has([data-view="app"]:not([hidden])) {
  background: var(--c-midnight) url('/assets/bg/bg_staffroom_blur.webp') center / cover fixed no-repeat;
}
body:has([data-view="app"]:not([hidden]))::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--c-midnight) 55%, transparent);
}
body[data-view="room"]::before { background: color-mix(in srgb, var(--c-ink) 70%, transparent); }
.t-app { position: relative; isolation: isolate; }
.t-head { background: color-mix(in srgb, var(--c-plum) 85%, transparent); backdrop-filter: blur(8px); }
.t-title { display: block; }
.t-tabs { flex-wrap: wrap; }
.t-tab { display: inline-flex; align-items: center; gap: 0.4rem; }
.sr-spot.locked::after, .sr-item.locked::after { content: none; }
.sr-spot.locked { opacity: 1; }
.sr-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sr { padding: 0; }
.sr-scene {
  position: relative; width: min(100%, calc((100vh - 140px) * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9;
  border: var(--line) solid var(--c-ink); border-radius: 20px; overflow: hidden;
  box-shadow: 0 0 0 3px var(--c-plum), 0 20px 50px var(--c-ink);
}
.sr-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-spots { position: absolute; inset: 0; }
.sr-spot {
  position: absolute; background: transparent; border: 4px solid transparent; border-radius: 16px; cursor: pointer; padding: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.sr-spot:hover, .sr-spot:focus-visible {
  outline: none; border-color: var(--c-toxic);
  background: color-mix(in srgb, var(--c-toxic) 10%, transparent);
  box-shadow: var(--glow), 0 0 28px color-mix(in srgb, var(--c-toxic) 55%, transparent), inset 0 0 28px color-mix(in srgb, var(--c-toxic) 30%, transparent);
}
.sr-spot.locked:hover, .sr-spot.locked:focus-visible { border-color: var(--c-parchment); box-shadow: none; }
.sr-label {
  position: absolute; left: 50%; opacity: 0; pointer-events: none;
  --tx: -50%; --ty: -6px; transform: translate(var(--tx), var(--ty));
  display: grid; gap: 0.1rem; text-align: center; white-space: nowrap; z-index: 2;
  background: var(--c-parchment); color: var(--c-ink); border: 3px solid var(--c-ink); border-radius: 10px; padding: 0.35rem 0.8rem;
  box-shadow: 0 6px 16px var(--c-ink); transition: opacity var(--t-fast), transform var(--t-fast);
}
.sr-label.below { top: calc(100% + 8px); }
.sr-label.above { bottom: calc(100% + 8px); --ty: 6px; }
.sr-label.inside { bottom: 12px; --ty: 6px; }
.sr-label.edge-l { left: 8px; --tx: 0px; }
.sr-label.edge-r { left: auto; right: 8px; --tx: 0px; }
.sr-label strong { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.sr-label em, .sr-item em { font-style: normal; font-size: 0.7rem; font-weight: 900; background: var(--c-lantern); color: var(--c-ink); border-radius: 5px; padding: 0 0.3rem; vertical-align: middle; }
.sr-label span { font-weight: 700; font-size: 0.9rem; }
.sr-spot:hover .sr-label, .sr-spot:focus-visible .sr-label { opacity: 1; --ty: 0px; }

.sr-list { display: none; list-style: none; margin: 1rem 0 0; padding: 0; gap: 0.6rem; }
.sr-item {
  width: 100%; display: flex; align-items: center; gap: 0.9rem; text-align: left; cursor: pointer;
  font: 400 1rem var(--font-body); color: var(--c-bone);
  background: color-mix(in srgb, var(--c-plum) 90%, transparent); border: var(--line) solid var(--c-ink); border-radius: 14px; padding: 0.75rem 1rem;
}
.sr-item .sr-icon { width: 34px; height: 34px; color: var(--c-lantern); }
.sr-item strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; color: var(--c-lantern); }
.sr-item span span { color: var(--c-parchment); font-weight: 700; font-size: 0.9rem; }
.sr-item:hover, .sr-item:focus-visible { outline: none; border-color: var(--c-toxic); box-shadow: var(--glow); }

/* small screens: the picture is decoration, the list is the menu; the menu bar shows icons only */
@media (max-width: 800px) {
  .sr-scene { border-radius: 14px; }
  .sr-spots { display: none; }
  .sr-list { display: grid; }
  .t-tab span { display: none; }
  .t-tab { padding: 0.35rem 0.55rem; }
}

.t-account .t-who { margin: 0; }
body[data-view="room"] .t-main { max-width: 1500px; }
@media (max-width: 800px) { .t-title[data-logo] img { height: 44px; } .t-head { gap: 0.75rem; } }

/* The Portrait in the gold frame of the staff room picture (inner canvas, fitted by eye), 2026-11-11. */
.sr-portrait { position: absolute; left: 26.3%; top: 16.2%; width: 10.1%; height: 22.8%; object-fit: cover; pointer-events: none; filter: brightness(0.92); }
