/* ══════════════════════════════════════════════════════════════════
   SHARED GAME UI — lobby (.wr-*) + "Set up game" modal (.gm-*)
   One look for every game. Load this AFTER each game's own stylesheet
   (right before </head>) so these rules win the cascade for any class
   name a game's own CSS also defines — nothing else in that file is
   touched.
   ══════════════════════════════════════════════════════════════════ */

/* ── LOBBY (waiting room) ─────────────────────────────────────────── */

.wr-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5,8,14,.88);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}

.wr-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg,#161b22,#1c2128);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  padding: 46px 44px;
  max-width: 540px; width: 100%;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(108,155,255,.07);
  animation: gmFadeIn .35s ease;
}
.wr-card::before {
  content: ''; position: absolute; top: -60%; left: -20%;
  width: 140%; height: 140%;
  background: conic-gradient(from 0deg, rgba(108,155,255,.12), rgba(167,139,250,.10), rgba(227,179,65,.08), rgba(108,155,255,.12));
  animation: gmSpin 16s linear infinite;
  pointer-events: none; z-index: 0;
}
.wr-card > * { position: relative; z-index: 1; }

.wr-icon-img, .wr-card > img { filter: drop-shadow(0 6px 18px rgba(108,155,255,.35)); margin-bottom: 14px !important; }

.wr-title, #wrTitle {
  font-family: 'Syne Mono', monospace !important;
  font-size: clamp(28px, 4.4vw, 38px) !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  text-transform: uppercase;
  margin-bottom: 8px !important;
  background: linear-gradient(120deg, #f4f6fb 15%, #6c9bff 55%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: 0 0 34px rgba(108,155,255,.35);
  line-height: 1.15;
}

.wr-sub, .wr-subtitle, .wr-card .wr-sub {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 13.5px !important;
  color: #9aa4bd !important;
  margin-bottom: 20px !important;
  letter-spacing: .02em;
}

.wr-players, .wr-teams { margin: 6px 0 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.wr-team-box { flex: 1; min-width: 160px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 14px; }
.wr-team-label { font-family: 'Syne Mono', monospace; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }

.wr-player, .wr-player-item, .wr-player-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
  padding: 6px 8px 6px 6px !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 13.5px !important;
  color: #f0f2f8 !important;
}
.wr-avatar {
  width: 28px !important; height: 28px !important;
  border-radius: 50% !important;
  display: flex !important; align-items: center; justify-content: center;
  font-weight: 800 !important; font-size: 13px !important; color: #0d1117 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.wr-pname { font-weight: 600; }

.wr-kick {
  font-size: 12px !important;
  color: rgba(248,113,113,.55) !important;
  background: none !important; border: none !important;
  cursor: pointer !important; padding: 0 2px !important;
  font-family: 'Space Grotesk', sans-serif !important;
  line-height: 1;
}
.wr-kick:hover { color: #f87171 !important; }

.wr-start-btn, .wr-btn, #startBtn, #wrStartBtn {
  font-family: 'Syne Mono', monospace !important;
  background: linear-gradient(135deg,#6c9bff,#a78bfa) !important;
  color: #0b0e14 !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 16px 34px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  cursor: pointer !important;
  width: 100% !important;
  margin-top: 14px !important;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease !important;
  box-shadow: 0 10px 30px rgba(108,155,255,.35) !important;
}
.wr-start-btn:hover:not(:disabled), .wr-btn:hover:not(:disabled), #startBtn:hover:not(:disabled), #wrStartBtn:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 36px rgba(108,155,255,.5) !important;
}
.wr-start-btn:disabled, .wr-btn:disabled, #startBtn:disabled, #wrStartBtn:disabled {
  opacity: .4 !important; cursor: not-allowed !important; box-shadow: none !important; transform: none !important;
}

.btn-howto, .wr-how-btn, .wr-howto-btn, .how-to-play-btn, .wr-card .btn-howto {
  font-family: 'Space Grotesk', sans-serif !important;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #b7bfd6 !important;
  border-radius: 12px !important;
  padding: 9px 20px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  margin-top: 12px !important;
  transition: all .15s ease !important;
}
.btn-howto:hover, .wr-how-btn:hover, .wr-howto-btn:hover, .how-to-play-btn:hover {
  border-color: #6c9bff !important; color: #eef1f8 !important;
  box-shadow: 0 6px 18px rgba(108,155,255,.2) !important;
}

.wr-hist-btn {
  font-family: 'Space Grotesk', sans-serif !important;
  background: none !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #9aa4bd !important;
  border-radius: 12px !important;
  padding: 9px 20px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin-top: 10px !important;
  width: 100%;
  text-decoration: none !important;
  transition: all .15s ease !important;
}
.wr-hist-btn:hover { border-color: #e3b341 !important; color: #e3b341 !important; }

.wr-check-label, .spectator-label, .teacher-join-row, #spectatorLabel, #teacherJoinRow {
  display: flex; align-items: center; justify-content: center; gap: 9px !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 13px !important; color: #9aa4bd !important;
  cursor: pointer !important; user-select: none;
  margin: 12px 0 !important;
}
.wr-check-label input, .spectator-label input, .teacher-join-row input,
#spectatorLabel input, #teacherJoinRow input, #spectatorCheck, #teacherJoinCheck {
  width: 17px !important; height: 17px !important;
  accent-color: #6c9bff !important; cursor: pointer !important;
}

.wr-wait, .wr-waiting, #wrWait, #wrWaiting, #studentWait {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 13px !important; color: #9aa4bd !important;
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px !important;
}
.pulse-dot, .dot-spin {
  width: 9px; height: 9px; border-radius: 50%;
  background: #6c9bff; box-shadow: 0 0 0 rgba(108,155,255,.6);
  animation: gmPulse 1.4s ease-out infinite;
  display: inline-block;
}

.min-players-warn, .min-warn, .min-players-warn, #minWarn {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 12.5px !important; color: #e3b341 !important;
  margin: 6px 0 !important;
}

.player-count-badge, #wrCountBadge {
  display: inline-flex !important; align-items: center; gap: 6px;
  background: rgba(108,155,255,.1) !important;
  border: 1px solid rgba(108,155,255,.25) !important;
  color: #b9c8ff !important;
  border-radius: 999px !important;
  padding: 5px 14px !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 12px !important; font-weight: 700 !important;
  margin-bottom: 14px !important;
}

@keyframes gmFadeIn { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes gmSpin { to { transform: rotate(360deg); } }
@keyframes gmPulse { 0% { box-shadow: 0 0 0 0 rgba(108,155,255,.55); } 70% { box-shadow: 0 0 0 8px rgba(108,155,255,0); } 100% { box-shadow: 0 0 0 0 rgba(108,155,255,0); } }

/* ── SET UP GAME modal ────────────────────────────────────────────── */

.gm-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(5,8,14,.85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.gm-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg,#161b22,#1c2128);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  padding: 40px 46px;
  width: 100%; max-width: 640px;
  max-height: 88vh; overflow-y: auto;
  font-family: 'Space Grotesk', sans-serif;
  box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(108,155,255,.07);
  animation: gmFadeIn .3s ease;
}

/* Wider variant — sets manager and any setup modal with a lot of content
   (item lists, multi-column editors). Occupies most of the viewport. */
.gm-card-wide {
  max-width: min(1080px, 94vw);
}
@media (max-width: 640px) {
  .gm-card { padding: 30px 24px; }
}

.gm-title {
  font-family: 'Syne Mono', monospace;
  font-size: clamp(22px, 3.6vw, 28px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin: 0 0 4px;
  background: linear-gradient(120deg, #f4f6fb 15%, #6c9bff 60%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.gm-desc { font-size: 14.5px; color: #aab4d4; margin: 0 0 22px; line-height: 1.55; }

.gm-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.gm-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  color: #92a0c7;
  margin-bottom: 10px;
  display: block;
}

.gm-select, .gm-input, .gm-textarea {
  width: 100%;
  background: #0d1117;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: #f4f6fb;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.gm-select:focus, .gm-input:focus, .gm-textarea:focus {
  border-color: #6c9bff;
  box-shadow: 0 0 0 3px rgba(108,155,255,.18);
}
.gm-input::placeholder, .gm-textarea::placeholder { color: #5c6690; }
.gm-textarea { resize: vertical; min-height: 70px; line-height: 1.55; font-family: 'Syne Mono', monospace; }
.gm-select { margin-bottom: 10px; cursor: pointer; }
.gm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm-hint { font-size: 12.5px; color: #8592bb; margin-top: 8px; line-height: 1.55; }

.gm-mg-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12.5px; font-weight: 700;
  color: #b7bfd6;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  width: 100%;
  transition: all .15s ease;
}
.gm-mg-btn:hover { border-color: #6c9bff; color: #eef1f8; box-shadow: 0 6px 18px rgba(108,155,255,.18); }

.gm-check-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: #b7bfd6;
  cursor: pointer; user-select: none;
}
.gm-check-row input { width: 17px; height: 17px; accent-color: #6c9bff; cursor: pointer; }

.gm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.gm-btn {
  font-family: 'Syne Mono', monospace;
  border: none; border-radius: 12px;
  padding: 11px 22px;
  font-size: 13.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer;
  transition: all .15s ease;
}
.gm-btn-ghost { background: none; border: 1px solid rgba(255,255,255,.14); color: #9aa4bd; }
.gm-btn-ghost:hover { border-color: rgba(255,255,255,.3); color: #eef1f8; }
.gm-btn-primary {
  background: linear-gradient(135deg,#6c9bff,#a78bfa); color: #0b0e14;
  box-shadow: 0 10px 26px rgba(108,155,255,.35);
}
.gm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(108,155,255,.5); }

.gm-close {
  position: absolute; top: 18px; right: 20px;
  background: none; border: none; color: #6f7aa0;
  font-size: 20px; cursor: pointer; line-height: 1; z-index: 2;
}
.gm-close:hover { color: #eef1f8; }

/* ── SETS MANAGER (create / edit) ─────────────────────────────────── */

.sm-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.sm-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 18px 0; max-height: 58vh; padding-right: 4px; }
.sm-empty { font-size: 14.5px; color: #aab4d4; padding: 30px 10px; text-align: center; line-height: 1.7; }
.sm-empty strong { color: #f4f6fb; }

.sm-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
}
.sm-row-name { font-size: 15.5px; font-weight: 700; color: #f4f6fb; }
.sm-row-desc { font-size: 13.5px; color: #aab4d4; margin-top: 3px; line-height: 1.4; }
.sm-row-count { color: #8592bb; }
.sm-row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.sm-btn { border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: all .15s ease; border: 1px solid rgba(255,255,255,.16); background: none; color: #cdd5ec; }
.sm-btn:hover { border-color: #6c9bff; color: #eef1f8; }
.sm-btn-del { border-color: rgba(248,113,113,.35); color: #f68787; }
.sm-btn-del:hover { border-color: #f87171; color: #ffb0b0; }
.sm-btn-use { background: linear-gradient(135deg,#6c9bff,#a78bfa); color: #0b0e14; border: none; padding: 8px 18px; }
.sm-btn-use:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(108,155,255,.4); }

.sm-item-row { display: flex; align-items: flex-start; gap: 10px; }
.sm-item-col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sm-item-label { font-size: 11px; color: #92a0c7; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.sm-item-summary { font-size: 13px; color: #8592bb; margin-bottom: 2px; }
.sm-item-del { background: none; border: none; cursor: pointer; color: #f68787; font-size: 18px; padding: 0 6px; flex-shrink: 0; margin-top: 20px; font-weight: 700; }
.sm-item-del:hover { color: #f87171; }
.sm-add-row { display: flex; align-items: center; gap: 10px; }
.sm-count-badge { color: #8592bb; font-weight: 400; }

/* ── STUDENTS (user management) ───────────────────────────────────── */

.um-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.um-toolbar .gm-input { flex: 1; }
.um-toolbar .gm-btn { white-space: nowrap; }
.um-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 4px; margin-bottom: 4px; }
.um-empty { font-size: 15px; color: #aab4d4; padding: 34px 10px; text-align: center; line-height: 1.7; }
.um-empty strong { color: #f4f6fb; }

.um-list .um-user-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.09);
}
.um-list .um-user-row:hover { background: rgba(255,255,255,.06); border-color: rgba(108,155,255,.35); }
.um-list .um-avatar { width: 42px; height: 42px; font-size: 17px; }
.um-list .um-user-name { font-size: 16px; font-weight: 700; color: #f4f6fb; }
.um-list .um-user-sub { font-size: 13.5px; color: #aab4d4; }
.um-list .um-user-actions { gap: 8px; }
.um-list .um-edit-btn, .um-list .um-delete-btn {
  border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif; color: #dfe6f5;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.16);
}
.um-list .um-edit-btn:hover { border-color: #6c9bff; color: #fff; background: rgba(108,155,255,.12); }
.um-list .um-delete-btn { border-color: rgba(248,113,113,.4); color: #f68787; }
.um-list .um-delete-btn:hover { border-color: #f87171; color: #ffb0b0; background: rgba(248,113,113,.12); }

.um-pass-row { display: flex; gap: 10px; align-items: stretch; }
.um-pass-row .gm-btn { white-space: nowrap; padding: 0 16px; }
.um-secret-input { flex: 1; font-family: 'Syne Mono', monospace; font-size: 20px; letter-spacing: .12em; }

.um-groups-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.um-archived-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #aab4d4; cursor: pointer; user-select: none; }
.um-archived-toggle input { width: 16px; height: 16px; accent-color: #6c9bff; cursor: pointer; }
.um-group-list {
  max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px 12px;
}
.um-group-list label { display: flex; align-items: center; gap: 10px; font-size: 15px !important; color: #eef1f8 !important; padding: 6px 2px; cursor: pointer; }
.um-group-list input[type="checkbox"] { width: 18px; height: 18px; accent-color: #6c9bff; cursor: pointer; }
#userFormModal .modal-error { color: #ff9b9b; font-size: 14px; margin: 4px 0 0; }

.um-cred { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 8px 20px; margin-bottom: 4px; }
.um-cred-row { display: flex; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.um-cred-row:last-child { border-bottom: none; }
.um-cred-k { width: 90px; flex-shrink: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #92a0c7; }
.um-cred-v { font-size: 17px; color: #f4f6fb; word-break: break-all; }
.um-cred-pass { font-family: 'Syne Mono', monospace; font-size: 24px; letter-spacing: .14em; color: #7dd3fc; }

@media (max-width: 640px) {
  .um-list .um-user-row { flex-wrap: wrap; }
  .um-pass-row { flex-wrap: wrap; }
}

/* ── SETS MANAGER — full-screen, beginner friendly ────────────────── */

.gm-card-full {
  max-width: none; width: 97vw; height: 95vh; max-height: 95vh;
  padding: 28px 40px 22px; display: flex; flex-direction: column; overflow: hidden;
}
.gm-card-full .gm-title { font-size: clamp(22px, 2.6vw, 30px); }
.sm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 40px 18px 0; flex-shrink: 0; }
.sm-topbar .gm-desc { font-size: 15.5px; max-width: 760px; }
.sm-topbar .gm-desc strong { color: #f4f6fb; }
.sm-bigbtn { padding: 14px 26px !important; font-size: 15px !important; white-space: nowrap; }
.sm-body { flex: 1; overflow-y: auto; padding: 4px 8px 12px 2px; }
.sm-footer {
  flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding-top: 16px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1);
}
.sm-status { margin-right: auto; font-size: 14px; color: #fbbf24; }
.sm-list-full { max-height: none; margin: 0; }
.sm-row-big { padding: 18px 22px; }
.sm-row-big .sm-row-name { font-size: 18px; }
.sm-row-big .sm-row-desc { font-size: 14.5px; }
.sm-row-big .sm-btn { padding: 11px 18px; font-size: 14px; }

.sm-step {
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 22px 26px; margin-bottom: 18px;
}
.sm-step-title { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; color: #f4f6fb; margin-bottom: 12px; }
.sm-num {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#6c9bff,#a78bfa); color: #0b0e14; font-size: 15px; font-weight: 800;
}
.sm-step-help { font-size: 15px; color: #c3cce6; line-height: 1.6; margin-bottom: 16px; }
.sm-step .gm-label { font-size: 13px; color: #b6c1e0; }
.sm-step .gm-input, .sm-step .gm-textarea { font-size: 16px; }

.sm-add-box {
  background: rgba(108,155,255,.07); border: 1px dashed rgba(108,155,255,.45);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.sm-add-title { font-size: 15px; font-weight: 700; color: #cfe0ff; margin-bottom: 12px; }
.sm-add-row { display: flex; gap: 12px; align-items: center; }
.sm-add-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sm-add-field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.sm-add-field-short { flex: 0 0 110px; }
.sm-add-note { min-height: 20px; margin-top: 10px; font-size: 14px; color: #86efac; }
.sm-link-btn {
  background: none; border: none; cursor: pointer; margin-top: 12px; padding: 0;
  color: #93b8ff; font-size: 14px; font-family: 'Space Grotesk', sans-serif; text-decoration: underline;
}
.sm-link-btn:hover { color: #cfe0ff; }
.sm-bulk { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sm-bulk .gm-textarea { width: 100%; }
.sm-search { margin-bottom: 14px; }

.sm-items { display: flex; flex-direction: column; gap: 12px; }
.sm-item-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px 16px;
}
.sm-item-card:hover { border-color: rgba(108,155,255,.35); }
.sm-item-num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); color: #c9d4f0; font-size: 14px; font-weight: 700;
}
.sm-item-card .sm-item-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sm-item-label { font-size: 12.5px; color: #b6c1e0; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sm-item-del-btn {
  flex-shrink: 0; cursor: pointer; border-radius: 9px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif; color: #f68787; background: none; border: 1px solid rgba(248,113,113,.4);
}
.sm-item-del-btn:hover { border-color: #f87171; color: #ffb0b0; background: rgba(248,113,113,.12); }

/* ── ALPHABET RING set editor ─────────────────────────────────────── */
.ar-jump { position: sticky; top: -6px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; background: #1a2029; margin-bottom: 10px; }
.ar-jump-btn {
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer; font-family: 'Syne Mono', monospace; font-size: 15px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #dfe6f5;
}
.ar-jump-btn:hover { border-color: #6c9bff; color: #fff; }
.ar-jump-btn.done { background: rgba(52,211,153,.16); border-color: rgba(52,211,153,.55); color: #86efac; }
.ar-letter { display: flex; gap: 18px; align-items: stretch; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.1); scroll-margin-top: 70px; }
.ar-letter-badge { width: 64px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ar-letter-char { font-family: 'Syne Mono', monospace; font-size: 40px; font-weight: 700; color: #f4f6fb; line-height: 1; }
.ar-letter-ok { font-size: 20px; color: #86efac; min-height: 24px; }
.ar-letter-cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.ar-team { display: flex; flex-direction: column; gap: 6px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px 16px; }
.ar-team-name { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ar-team-a .ar-team-name { color: #7dd3fc; }
.ar-team-b .ar-team-name { color: #f9a8d4; }
.ar-lbl { font-size: 12.5px; font-weight: 700; color: #b6c1e0; margin-top: 4px; }
.ar-check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #c9d4f0; margin-top: 6px; cursor: pointer; }
.ar-check input { width: 17px; height: 17px; accent-color: #6c9bff; cursor: pointer; }
.ar-check strong { color: #f4f6fb; }
@media (max-width: 900px) { .ar-letter-cols { grid-template-columns: 1fr; } .ar-letter { flex-direction: column; } .ar-letter-badge { flex-direction: row; width: auto; } }

/* ── GAME INFO (full-screen teacher explanation) ──────────────────── */
.gi-body { display: flex; justify-content: center; }
.gi-wrap { width: 100%; max-width: 1100px; padding: 6px 4px 20px; }
.gi-section { margin-bottom: 26px; padding: 22px 28px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; }
.gi-h { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: #f4f6fb; margin: 0 0 12px; }
.gi-text { font-size: 17px; line-height: 1.75; color: #dfe6f5; margin: 0; }
.gi-list { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 10px; }
.gi-list li { font-size: 16.5px; line-height: 1.7; color: #dfe6f5; padding-left: 4px; }
.gi-list li::marker { color: #93b8ff; font-weight: 700; }

/* ── Group management ── */
.gr-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.gr-tab {
  font-family: inherit; font-size: 15px; font-weight: 700; color: #aab4d4;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 9px 20px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.gr-tab:hover { color: #fff; border-color: rgba(108,155,255,.5); }
.gr-tab.active { color: #fff; background: rgba(108,155,255,.22); border-color: #6c9bff; }
#groupMgmtModal .um-list .um-avatar { font-size: 20px; }

/* ── Who's Guilty case editor ───────────────────────────────────── */
.det-case { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; overflow: hidden; }
.det-case.open { border-color: rgba(108,155,255,.45); }
.det-case-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.det-case-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.det-case-title strong { color: #f4f6fb; font-size: 16px; }
.det-case-title span { color: #92a0c7; font-size: 13px; }
.det-case-body { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.det-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.det-row .det-field { flex: 1 1 260px; }
.det-row .det-short { flex: 0 1 200px; }
.det-field { display: flex; flex-direction: column; gap: 6px; }
.det-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.det-chip { background: rgba(108,155,255,.14); border: 1px solid rgba(108,155,255,.4); color: #cfe0ff; border-radius: 8px; padding: 4px 10px; font-family: 'Syne Mono', monospace; font-size: 12px; cursor: pointer; }
.det-chip:hover { background: rgba(108,155,255,.28); }
.det-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.det-tab { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #c3cce6; border-radius: 10px; padding: 9px 16px; font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }
.det-tab.active { background: linear-gradient(135deg,#6c9bff,#a78bfa); color: #0b0e14; border-color: transparent; }
.det-tab-g:not(.active) { border-color: rgba(248,113,113,.5); color: #fca5a5; }
.det-pane { display: flex; flex-direction: column; gap: 12px; }
.sm-add-field:has(textarea) { flex: 1 1 100%; }
.sm-step .gm-textarea { resize: vertical; line-height: 1.5; }

/* Ludo multiple-choice editor */
.mc-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mc-opt { display: flex; gap: 10px; align-items: center; }
.mc-opt .gm-input { flex: 1; }
.mc-correct { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #c6cfe6; white-space: nowrap; cursor: pointer; }
.mc-correct input { width: 18px; height: 18px; accent-color: #4ade80; }

/* ── Normalized lobby (2026-09) ─────────────────────────────────────────── */
/* No group id / "X players in lobby" texts in any lobby */
.wr-group-id, #wrGroupId, .player-count-badge, #playerCountBadge, #wrCountBadge { display: none !important; }
/* Teacher-only "I'm playing, too." row: hidden unless the page is the teacher's */
.wr-teacher-play { display: none; }
body.is-teacher .wr-teacher-play { display: flex; }
/* Kick ✕ at the top-right of the player's avatar chip (taboo style) */
.wr-player, .wr-player-item, .wr-player-chip { position: relative; }
.wr-kick, .wr-player-kick {
  position: absolute !important; top: -4px !important; right: -4px !important;
  background: rgba(248,81,73,.85) !important; border: none !important; border-radius: 50% !important;
  width: 18px !important; height: 18px !important; padding: 0 !important;
  font-size: .6rem !important; line-height: 1 !important; color: #fff !important; cursor: pointer !important;
  display: flex !important; align-items: center; justify-content: center; margin: 0 !important;
}
.wr-kick:hover, .wr-player-kick:hover { background: #f85149 !important; color: #fff !important; }
/* Big, unmissable current-turn banner */
.ep-turn-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 10px auto; padding: 12px 22px; max-width: 640px;
  border-radius: 14px; border: 2px solid #e3b341;
  background: rgba(227,179,65,.12); color: #fde68a;
  font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 800;
  text-align: center; box-shadow: 0 0 22px rgba(227,179,65,.25);
}
.ep-turn-banner.mine { border-color: #3fb950; background: rgba(63,185,80,.14); color: #bbf7d0; animation: epTurnPulse 1.6s ease-in-out infinite; }
@keyframes epTurnPulse { 0%,100% { box-shadow: 0 0 10px rgba(63,185,80,.25); } 50% { box-shadow: 0 0 30px rgba(63,185,80,.55); } }

/* Sets shared with the institute (sharedWithInstitute) */
.sm-shared-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; color: #b9f5d0; background: rgba(52,211,153,.14); border: 1px solid rgba(52,211,153,.4); }
.sm-share-toggle { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13px; color: #cdd5ec; cursor: pointer; user-select: none; }
.sm-share-toggle input { accent-color: #34d399; width: 15px; height: 15px; cursor: pointer; }
.sm-section-title { margin: 18px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8592bb; }
.sm-row-shared { border-color: rgba(52,211,153,.25); }

/* Sets that aren't yours (shared with your institute): shown in a different colour instead of a badge */
.sm-name-shared { color: #7dd3fc !important; }
option.opt-shared { color: #7dd3fc; }

/* Guess Who sets manager: optional card image */
.gw-img-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gw-img-thumb { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.gw-img-ctl .sm-link-btn:disabled { opacity: .6; cursor: wait; }
