/* ============================================================================
   TEACH + JOIN — the class-challenge pages (teach.html, join.html).
   Builds on site.css: same tokens, buttons and header. Green is the action
   colour, pink the detail colour, coin yellow only for the top of the board.
   ============================================================================ */

/* Short pages (join) would otherwise stop the body's gradient halfway down. */
body { min-height: 100vh; }

/* Several blocks here set display, which would beat the hidden attribute. */
.teach [hidden] { display: none !important; }

.teach-header .site-nav a.here { color: var(--green); }

.teach { padding-top: 26px; padding-bottom: 80px; max-width: 880px; }
.teach h1, .teach h2 { font-family: var(--font-display); }
.teach h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.3; margin: 0 0 12px; }
.teach h1 span { color: var(--green); }
.teach h2 { font-size: 18px; margin: 0 0 16px; }

.t-hero { text-align: center; padding: 20px 0 28px; }
.t-lead { color: #c3cfdc; font-size: 17px; max-width: 620px; margin: 0 auto; line-height: 1.55; }

.t-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.t-mode {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 18px 18px 6px;
}
.t-mode h3 { margin: 0 0 6px; color: var(--pink); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.t-mode p { color: #c3cfdc; font-size: 14.5px; line-height: 1.5; margin: 0 0 12px; }

.t-card {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 22px; margin-bottom: 22px;
}
.t-small { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 12px 0 0; }
.t-error { color: #ff8a9a; font-weight: 600; margin: 12px 0 0; }
.t-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--pink); border: 1px solid rgba(255, 91, 196, .45); border-radius: 999px; padding: 1px 8px; margin-left: 4px;
}

.t-field { display: block; margin: 0 0 16px; border: 0; padding: 0; }
.t-field > span, .t-field > legend { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.t-field input, .t-field select, .t-radio select, .j-input {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: #0b111b; border: 1px solid var(--panel-edge); border-radius: 10px; padding: 11px 12px;
}
.t-field input:focus, .t-field select:focus, .j-input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.t-radio label { display: block; color: #c3cfdc; margin: 0 0 8px; cursor: pointer; }
.t-radio select { width: auto; padding: 5px 8px; font-size: 15px; margin-left: 4px; }
.t-radio input, .t-check input { accent-color: var(--green); }
.t-radio input { width: auto; padding: 0; margin: 0 6px 0 0; vertical-align: -2px; }
.t-check { display: flex; gap: 10px; align-items: flex-start; color: #c3cfdc; font-size: 14.5px; margin: 4px 0 20px; cursor: pointer; }
.t-check input { margin-top: 4px; }

.t-mylist { list-style: none; margin: 0; padding: 0; }
.t-mylist li { border-top: 1px solid var(--panel-edge); }
.t-mylist li:first-child { border-top: 0; }
.t-mylist a { display: block; padding: 11px 2px; color: var(--text); text-decoration: none; }
.t-mylist a:hover b { color: var(--green); }
.t-mylist code { color: var(--muted); margin-left: 6px; letter-spacing: 1px; }
.t-contact p { color: #c3cfdc; margin: 0; line-height: 1.55; }

/* ---------------- teacher plan ---------------- */
.t-plan { border-color: rgba(255, 212, 71, .35); }
.t-plan h2 span { color: var(--coin); }
.t-plan-lead { color: #c3cfdc; line-height: 1.55; margin: 0 0 18px; }
.t-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.t-price {
  position: relative; text-align: center; padding: 20px 14px 16px;
  border: 1px solid var(--panel-edge); border-radius: var(--radius); background: #0b111b;
}
.t-price-best { border-color: rgba(255, 212, 71, .55); box-shadow: 0 0 24px rgba(255, 212, 71, .12); }
.t-price-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--coin); color: var(--ink); font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .8px; padding: 2px 10px; border-radius: 999px;
}
.t-price-amt { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.t-price-amt small { font-family: "Poppins", sans-serif; font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.t-price .btn { width: 100%; }
.t-havecode { margin-top: 20px; border-top: 1px solid var(--panel-edge); padding-top: 16px; }
.t-havecode label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.t-codebox { display: flex; gap: 8px; }
.t-codebox input { flex: 1; min-width: 0; letter-spacing: 1px; text-transform: uppercase; }
.t-planon { margin-top: 20px; border-top: 1px solid var(--panel-edge); padding-top: 16px; }
.t-planon p:first-child { margin: 0; color: var(--text); }
.t-planon code { color: var(--muted); margin-left: 4px; }
.t-linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.t-linkbtn:hover { color: var(--text); }

.d-plan { margin: -6px 0 18px; color: var(--muted); font-size: 14.5px; }
.d-plan.on { color: var(--coin); }
.d-plan.on b { color: var(--coin); }
.d-plan.lapsed { color: #ff8a9a; }
.d-plan .btn { margin-left: 6px; vertical-align: middle; }
body.projector .d-plan { display: none; }

/* ---------------- dashboard ---------------- */
.d-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.d-top h1 { margin: 0; }
.d-top .t-small { margin-top: 4px; }
.d-topbtns { display: flex; gap: 8px; flex-wrap: wrap; }

.d-join {
  margin: 22px 0 18px; text-align: center; padding: 20px 16px;
  background: radial-gradient(ellipse at top, rgba(51, 238, 110, .10), transparent 70%), var(--panel);
  border: 1px solid rgba(51, 238, 110, .35); border-radius: var(--radius);
}
.d-join-how { color: #c3cfdc; font-size: 16px; }
.d-join-how b { color: var(--text); }
.d-code {
  font-family: var(--font-display); font-weight: 700; color: var(--green);
  font-size: clamp(40px, 9vw, 72px); letter-spacing: .14em; margin: 4px 0 2px;
  text-shadow: 0 0 28px rgba(51, 238, 110, .45);
}
.d-join-meta { color: var(--muted); font-size: 14px; }

.d-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.d-state { color: var(--muted); margin: 12px 0 18px; font-size: 14.5px; }
.d-state.on { color: var(--green); font-weight: 600; }
.d-state.on::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); margin-right: 8px; vertical-align: 1px; animation: d-pulse 1.4s ease-in-out infinite;
}
@keyframes d-pulse { 50% { opacity: .25; } }

/* Coin yellow: the one reward state on this page. */
.d-champ {
  display: flex; align-items: baseline; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius); text-align: center;
  background: radial-gradient(ellipse at center, rgba(255, 212, 71, .12), transparent 75%), var(--panel);
  border: 1px solid rgba(255, 212, 71, .4);
}
.d-champ-label { color: var(--coin); font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; }
.d-champ-score {
  font-family: var(--font-display); font-weight: 700; color: var(--coin); font-size: clamp(26px, 5vw, 38px);
  text-shadow: 0 0 22px rgba(255, 212, 71, .45);
}
.d-champ-name { color: var(--text); font-weight: 700; font-size: 17px; }

.d-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.d-tabs button {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--panel-edge); border-radius: 999px; padding: 7px 14px;
}
.d-tabs button.on { color: var(--ink); background: var(--green); border-color: var(--green); }

.d-boardwrap { overflow-x: auto; }
.d-board { width: 100%; border-collapse: collapse; font-size: 15px; }
.d-board th {
  text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--panel-edge);
}
.d-board td { padding: 10px; border-bottom: 1px solid rgba(29, 41, 65, .6); white-space: nowrap; }
.d-board td:nth-child(2) { white-space: normal; font-weight: 600; }
.d-board td:first-child { color: var(--muted); font-weight: 700; width: 2.5em; }
.d-board tr.top1 td:first-child, .d-board tr.top1 td:nth-child(2) { color: var(--coin); }
.d-board tr.top2 td:first-child, .d-board tr.top3 td:first-child { color: var(--text); }
.d-x { width: 1%; text-align: right; }
.d-x button {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px;
}
.d-x button:hover { color: #ff8a9a; background: rgba(255, 100, 120, .1); }
.d-board.by-score td:nth-child(6) { color: var(--coin); font-weight: 700; }
.d-board.by-score td:nth-child(3) { font-weight: 400; }
.d-empty { color: var(--muted); text-align: center; padding: 26px 0; margin: 0; }

.d-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.d-danger { color: #ff8a9a; border-color: rgba(255, 100, 120, .4); }
.d-keynote { margin-top: 16px; }

/* ---------------- projector view: just the code and the board, big ---------------- */
body.projector .site-header, body.projector .site-footer,
body.projector .d-controls, body.projector .d-foot, body.projector .d-keynote,
body.projector .d-x, body.projector #d-back { display: none !important; }
body.projector .d-champ-score { font-size: 64px; }
body.projector .d-champ-name { font-size: 30px; }
body.projector .d-champ-label { font-size: 20px; }
body.projector .teach { max-width: 1400px; padding-top: 18px; }
body.projector .d-top { align-items: center; }
body.projector .d-join { display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap; padding: 14px 20px; }
body.projector .d-join-how { font-size: 26px; }
body.projector .d-code { font-size: 84px; margin: 0; }
body.projector .d-board { font-size: 26px; }
body.projector .d-board td { padding: 12px 14px; }
body.projector .d-board th { font-size: 15px; }
body.projector .d-state { font-size: 18px; }

/* ---------------- join page ---------------- */
.j-wrap { max-width: 480px; margin: 0 auto; text-align: center; }
.j-wrap .t-card { text-align: left; }
.j-code {
  font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: .3em;
  text-align: center; text-transform: uppercase; padding: 14px 8px 14px 18px !important;
}
.j-class { text-align: center; margin-bottom: 18px; }
.j-class h2 { margin: 0 0 4px; }
.j-class p { color: var(--muted); margin: 0; }
.j-nick {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-display); font-size: 24px; color: var(--green); margin: 4px 0 6px; min-height: 40px;
}
.j-reroll {
  font-size: 20px; line-height: 1; background: none; border: 1px solid var(--panel-edge); color: var(--text);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
}
.j-reroll:hover { border-color: var(--green); }
.j-or { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0 8px; }
.j-wrap .btn { width: 100%; margin-top: 16px; }
.j-done .j-nick { font-size: 22px; }
.j-leave { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; margin-top: 14px; }

@media (max-width: 700px) {
  .t-modes { grid-template-columns: 1fr; }
  .t-prices { grid-template-columns: 1fr; gap: 18px; }
  .d-board th:nth-child(4), .d-board td:nth-child(4) { display: none; }
}
@media (max-width: 480px) {
  .d-board th:nth-child(5), .d-board td:nth-child(5) { display: none; }
  .d-board td { padding: 9px 6px; }
}
