.tools-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

body[data-page^="tool-"] {
  overflow: hidden;
}

body[data-page^="tool-"] .site-header {
  min-height: 58px;
  padding-top: 8px;
  padding-bottom: 8px;
}

body[data-page^="tool-"] .nav-links {
  display: none;
}

body[data-page^="tool-"] .brand img {
  width: 108px;
  height: 34px;
}

body[data-page^="tool-"] .nav-links a,
body[data-page^="tool-"] .nav-action,
body[data-page^="tool-"] .nav-logout {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.tools-cover-hero {
  margin-bottom: 24px;
}

.tool-cover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.tool-cover-card {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 60px rgba(17, 24, 39, 0.08);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.tool-cover-card:hover {
  transform: translateY(-4px);
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.13);
}

.tool-cover-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .9;
  pointer-events: none;
}

.rollcall-cover::before {
  background: radial-gradient(circle at 78% 18%, rgba(147, 197, 253, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(239,246,255,.76));
}

.rollcall-wheel-cover::before {
  background: radial-gradient(circle at 80% 18%, rgba(253, 186, 116, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(255,251,235,.82));
}

.galaxy-cover::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.86), transparent 12%),
    radial-gradient(circle at 80% 18%, rgba(125, 211, 252, .38), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(219,234,254,.78));
}

.timer-cover::before {
  background: radial-gradient(circle at 80% 18%, rgba(253, 186, 116, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(255,247,237,.78));
}

.wheel-cover::before {
  background: radial-gradient(circle at 80% 18%, rgba(240, 171, 252, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(253,244,255,.78));
}

.group-cover::before {
  background: radial-gradient(circle at 80% 18%, rgba(134, 239, 172, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(240,253,244,.78));
}

.score-cover::before {
  background: radial-gradient(circle at 80% 18%, rgba(196, 181, 253, .34), transparent 34%), linear-gradient(145deg, rgba(255,255,255,.3), rgba(245,243,255,.78));
}

.tool-cover-card > * {
  position: relative;
  z-index: 1;
}

.cover-kicker {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.tool-cover-card h2 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 3.2vw, 44px);
}

.tool-cover-card p {
  color: #555b66;
  line-height: 1.75;
}

.tool-cover-card b {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
}

.cover-visual {
  min-height: 156px;
  display: grid;
  place-items: center;
  margin: 20px 0;
  border: 1px solid rgba(17, 24, 39, .08);
  border-radius: 24px;
  background: rgba(255,255,255,.72);
}

.name-visual strong,
.timer-visual strong {
  display: block;
  color: #111827;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
}

.name-visual em,
.timer-visual em,
.score-visual em {
  color: #6b7280;
  font-style: normal;
}

.wheel-visual {
  position: relative;
  display: block;
}

.wheel-visual i {
  position: absolute;
  inset: 24px;
  border-radius: 999px;
  background: conic-gradient(from 0deg, #fca5a5, #fdba74, #fde68a, #86efac, #93c5fd, #c4b5fd, #f0abfc, #fca5a5);
}

.wheel-visual i:nth-child(2) {
  inset: 54px;
  background: #fff;
}

.wheel-visual i:nth-child(3) {
  top: 12px;
  left: 50%;
  right: auto;
  bottom: auto;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 26px solid #111827;
  border-radius: 0;
  background: transparent;
  transform: translateX(-50%);
}

.wheel-visual span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.rollcall-wheel-visual {
  position: relative;
  display: block;
}

.rollcall-wheel-visual i {
  position: absolute;
  inset: 24px;
  border-radius: 999px;
  background: conic-gradient(#bfdbfe, #fecdd3, #fde68a, #bbf7d0, #ddd6fe, #bfdbfe);
}

.rollcall-wheel-visual i:nth-child(2) {
  inset: 54px;
  background: #fff;
}

.rollcall-wheel-visual i:nth-child(3) {
  top: 12px;
  left: 50%;
  right: auto;
  bottom: auto;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 26px solid #111827;
  border-radius: 0;
  background: transparent;
  transform: translateX(-50%);
}

.rollcall-wheel-visual span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.galaxy-visual {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #e0f2fe, #60a5fa 34%, #1e1b4b 72%);
}

.galaxy-visual i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 20px rgba(255,255,255,.85);
}

.galaxy-visual i:nth-child(1) { top: 22%; left: 25%; }
.galaxy-visual i:nth-child(2) { top: 62%; left: 70%; }
.galaxy-visual i:nth-child(3) { top: 76%; left: 34%; }

.galaxy-visual strong {
  color: #fff;
  font-size: 24px;
}

.group-visual {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}

.group-visual span {
  min-height: 100px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  color: #111827;
  font-weight: 800;
}

.score-visual strong {
  color: #111827;
  font-size: 34px;
}

.score-visual em {
  font-size: 52px;
  font-weight: 900;
}

.single-tool-page {
  width: min(1680px, calc(100% - 12px));
  height: calc(100dvh - 58px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.single-tool-cover {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 24px;
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 34px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.1);
  overflow: hidden;
}

.single-tool-cover h1 {
  max-width: 780px;
}

.single-tool-cover p:not(.eyebrow) {
  max-width: 720px;
  color: #51545d;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.65;
}

.tool-back-link {
  width: fit-content;
  margin-bottom: auto;
  padding: 9px 14px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #374151;
  font-weight: 700;
}

.tool-card-full {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
}

.compact-back-link {
  display: none;
  margin: 0;
}

.tools-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 126, 95, 0.2), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(61, 169, 252, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 247, 255, 0.84));
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.1);
  overflow: hidden;
}

.tools-hero-copy {
  align-self: center;
}

.tools-hero h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(46px, 6vw, 82px);
}

.tools-hero p:not(.eyebrow) {
  max-width: 680px;
  color: #51545d;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.65;
}

.tools-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.tools-live-panel {
  position: relative;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  border-radius: 30px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.88), rgba(42, 50, 70, 0.94)),
    radial-gradient(circle at 50% 20%, rgba(124, 214, 255, 0.5), transparent 42%);
  overflow: hidden;
}

.tools-live-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
}

.live-orb {
  position: absolute;
  top: 62px;
  left: 50%;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,0.95), rgba(111, 199, 255, 0.72) 26%, rgba(93, 79, 255, 0.8) 58%, rgba(8, 16, 32, 0.9) 100%);
  box-shadow: 0 0 70px rgba(74, 158, 255, 0.5);
  transform: translateX(-50%);
  animation: floatOrb 5s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -18px); }
}

.tools-live-panel span,
.tools-live-panel strong,
.tools-live-panel p,
.live-meter {
  position: relative;
  z-index: 1;
}

.tools-live-panel span {
  color: rgba(255,255,255,0.72);
  font-size: 14px;
}

.tools-live-panel strong {
  margin-top: 10px;
  font-size: clamp(38px, 5vw, 64px);
}

.tools-live-panel p {
  margin: 8px 0 24px;
  color: rgba(255,255,255,0.72);
}

.live-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.live-meter i {
  display: block;
  width: 64%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dd3fc, #fda4af, #fde68a);
}

.class-roster-panel,
.tool-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 60px rgba(17, 24, 39, 0.08);
}

.class-roster-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: stretch;
  margin: 24px 0;
  padding: 28px;
}

.class-roster-panel h2,
.tool-card h2 {
  font-size: clamp(25px, 2.6vw, 34px);
}

.class-roster-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.roster-editor textarea,
.wheel-tool textarea {
  width: 100%;
  min-height: 154px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 18px;
  outline: none;
  background: rgba(248, 250, 252, 0.9);
  line-height: 1.7;
}

.roster-actions,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.tool-card-full > .tool-actions {
  margin-top: clamp(6px, 1vh, 12px);
}

.tool-card-full .history-list {
  max-height: 42px;
  overflow: hidden;
}

.tool-data-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.06);
}

.single-tool-page > .tool-data-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  max-width: min(460px, calc(100% - 24px));
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.single-tool-page > .tool-data-actions span {
  display: none;
}

.tool-data-actions div {
  display: grid;
  gap: 4px;
}

.tool-data-actions strong {
  color: #111827;
  font-size: 18px;
}

.tool-data-actions span,
.roster-tip,
.import-status {
  color: var(--muted);
  line-height: 1.65;
}

.quick-tool-select {
  display: grid;
  min-width: 210px;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-tool-select select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  font: inherit;
  outline: none;
}

.roster-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
}

.roster-sheet.is-hidden {
  display: none;
}

.roster-dialog {
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(17, 24, 39, 0.22);
}

.roster-dialog .tool-head {
  margin-bottom: 12px;
}

.roster-library {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0 14px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.86);
}

.roster-library label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.roster-library select,
.roster-library input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font: inherit;
  outline: none;
}

.file-import-button {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 11px 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  color: #111827;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.file-import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-status {
  min-height: 24px;
  margin: 8px 0 0;
  font-size: 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.tool-card {
  min-height: 520px;
  padding: 24px;
}

.tool-card-full {
  width: min(calc(100dvw - 16px), calc((100dvh - 86px) * 16 / 9));
  max-height: calc(100dvh - 70px);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 1.5vw, 22px);
}

.tool-card:nth-child(5) {
  grid-column: 1 / -1;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: clamp(8px, 1.2vh, 14px);
}

.tool-card-full > .tool-head h2 {
  font-size: clamp(22px, 2.2vw, 34px);
}

.tool-card-full > .tool-head .eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

.rollcall-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 212px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 22%, rgba(125, 211, 252, 0.32), transparent 38%),
    linear-gradient(135deg, #f9fafb, #eef4ff);
  text-align: center;
}

.rollcall-stage span {
  color: var(--muted);
  font-size: 14px;
}

.rollcall-stage strong {
  margin: 16px 0;
  font-size: clamp(72px, 11vw, 156px);
  line-height: 1;
}

.rollcall-stage p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--muted);
}

.rollcall-stage.is-rolling strong {
  animation: namePulse 0.12s linear infinite;
}

.rollcall-wheel-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.96), transparent 22%),
    linear-gradient(135deg, #fff7ed, #eff6ff);
}

.rollcall-wheel-stage canvas {
  width: min(78%, 48dvh, 600px);
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto 8px;
  border-radius: 999px;
  filter: drop-shadow(0 24px 42px rgba(17,24,39,.16));
  transition: transform 2.1s cubic-bezier(.12,.76,.18,1);
}

.rollcall-wheel-pointer {
  position: absolute;
  top: clamp(14px, 3.2vh, 34px);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #111827;
  filter: drop-shadow(0 8px 16px rgba(17,24,39,.18));
}

.rollcall-galaxy-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: grab;
  color: #fff;
  perspective: 1100px;
  perspective-origin: 50% 48%;
  background:
    linear-gradient(180deg, rgba(2,6,23,.18), rgba(2,6,23,.44)),
    url("./assets/classroom/galaxy-starfield-20260613.png?v=20260613a") center / cover no-repeat,
    #020617;
}

.rollcall-galaxy-stage::before {
  content: none;
}

.rollcall-galaxy-stage::after {
  content: none;
}

.rollcall-galaxy-stage span,
.rollcall-galaxy-stage p {
  color: rgba(255,255,255,.74);
}

.rollcall-galaxy-stage strong {
  position: absolute;
  left: 50%;
  bottom: 54px;
  z-index: 3;
  display: none;
  margin: 0;
  padding: 12px 22px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(15,23,42,.34);
  backdrop-filter: blur(14px);
  font-size: clamp(30px, 4.2vw, 48px);
  text-shadow: 0 18px 46px rgba(0,0,0,.42);
  transform: translateX(-50%);
}

.rollcall-galaxy-stage.has-result strong {
  display: block;
  animation: galaxyResultIn .42s cubic-bezier(.2,.9,.2,1) both;
}

.galaxy-focus-line {
  position: absolute;
  top: 72px;
  bottom: 96px;
  left: 50%;
  z-index: 2;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(255,255,255,.82), transparent);
  box-shadow: 0 0 26px rgba(125,211,252,.76);
  pointer-events: none;
}

.galaxy-focus-line::before,
.galaxy-focus-line::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 999px;
  transform: translateX(-50%);
}

.galaxy-focus-line::before { top: 36%; }
.galaxy-focus-line::after { top: 62%; }

.galaxy-orbit {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  transition: transform .045s linear;
  will-change: transform;
  --camera-angle: 0deg;
  --camera-pitch: -10deg;
  --galaxy-drift: 0deg;
}

.galaxy-orbit::before {
  content: none;
}

.galaxy-orbit::after {
  content: none;
}

.galaxy-name {
  position: absolute;
  top: 0;
  left: 0;
  min-width: clamp(48px, 5.8vw, 104px);
  padding: clamp(5px, 0.7vw, 10px) clamp(8px, 1vw, 16px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.62), transparent 20%),
    rgba(255,255,255,.12);
  box-shadow: 0 10px 28px rgba(0,0,0,.2), inset 0 0 14px rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  font-size: clamp(14px, 1vw + 1vh, 28px);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  transform:
    translate3d(var(--tx), var(--ty), var(--tz))
    rotateY(calc(-1 * var(--camera-angle)))
    rotateX(calc(-1 * var(--camera-pitch)))
    scale(var(--scale));
  transform-style: preserve-3d;
  cursor: pointer;
  transition: opacity .18s ease, filter .18s ease, box-shadow .18s ease;
}

.galaxy-name:nth-child(3n) {
  background: rgba(125,211,252,.18);
}

.galaxy-name:nth-child(3n + 1) {
  background: rgba(196,181,253,.18);
}

.rollcall-galaxy-stage.is-dragging .galaxy-name {
  cursor: grabbing;
}

.rollcall-galaxy-stage.is-rolling .galaxy-name {
  box-shadow: 0 16px 46px rgba(0,0,0,.3), 0 0 20px rgba(125,211,252,.18);
}

.galaxy-name.is-side {
  opacity: .58;
  filter: saturate(.92) brightness(.86);
}

.galaxy-name.is-back {
  opacity: .24;
  filter: blur(.3px) saturate(.72) brightness(.68);
}

.galaxy-name.is-front {
  z-index: 5;
  opacity: 1;
  border-color: rgba(255,255,255,.76);
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.8), transparent 22%),
    rgba(255,255,255,.24);
  box-shadow: 0 18px 46px rgba(0,0,0,.32), 0 0 34px rgba(125,211,252,.38);
  filter: saturate(1.24) brightness(1.12);
}

@keyframes galaxyResultIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.92); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes namePulse {
  50% { transform: scale(1.04); opacity: 0.82; }
}

.check-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  max-width: 140px;
  line-height: 1.35;
  font-size: 14px;
}

.check-line input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #111827;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.history-list span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 13px;
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: calc(100dvh - 250px);
  border-radius: 26px;
  color: #111827;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244, 247, 255, 0.96)),
    radial-gradient(circle at 50% 10%, rgba(255, 159, 10, 0.28), transparent 38%);
  font-variant-numeric: tabular-nums;
  font-size: clamp(120px, 18vw, 280px);
  font-weight: 800;
  letter-spacing: 0;
}

.tool-card-full:fullscreen,
.tool-card-full:-webkit-full-screen,
.tool-card-full.is-tool-expanded {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: clamp(16px, 2.2vw, 34px);
  border: 0;
  border-radius: 0;
  background: #f6f7fb;
  box-shadow: none;
}

.tool-card-full:fullscreen .tool-head,
.tool-card-full:-webkit-full-screen .tool-head,
.tool-card-full.is-tool-expanded .tool-head {
  flex: 0 0 auto;
  margin-bottom: clamp(10px, 1.5vh, 18px);
}

.tool-card-full:fullscreen .tool-actions,
.tool-card-full:-webkit-full-screen .tool-actions,
.tool-card-full.is-tool-expanded .tool-actions,
.tool-card-full:fullscreen .timer-presets,
.tool-card-full:-webkit-full-screen .timer-presets,
.tool-card-full.is-tool-expanded .timer-presets,
.tool-card-full:fullscreen .timer-custom,
.tool-card-full:-webkit-full-screen .timer-custom,
.tool-card-full.is-tool-expanded .timer-custom {
  flex: 0 0 auto;
}

.rollcall-tool:fullscreen .rollcall-stage,
.rollcall-tool:-webkit-full-screen .rollcall-stage,
.rollcall-tool.is-tool-expanded .rollcall-stage {
  flex: 1 1 auto;
  min-height: 0;
}

.rollcall-tool:fullscreen .rollcall-wheel-stage canvas,
.rollcall-tool:-webkit-full-screen .rollcall-wheel-stage canvas,
.rollcall-tool.is-tool-expanded .rollcall-wheel-stage canvas {
  width: min(70vh, 760px);
  height: min(70vh, 760px);
}

.timer-tool:fullscreen,
.timer-tool:-webkit-full-screen,
.timer-tool.is-tool-expanded {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.96), rgba(238,242,255,.86) 34%, transparent 58%),
    linear-gradient(135deg, #eef2ff, #f8fafc 48%, #fff7ed);
}

.timer-tool:fullscreen .timer-display,
.timer-tool:-webkit-full-screen .timer-display,
.timer-tool.is-tool-expanded .timer-display {
  flex: 1 1 auto;
  min-height: 0;
  margin: clamp(8px, 1.6vh, 18px) 0;
  font-size: clamp(110px, 21vw, 300px);
}

.timer-tool:fullscreen .timer-presets,
.timer-tool:-webkit-full-screen .timer-presets,
.timer-tool.is-tool-expanded .timer-presets,
.timer-tool:fullscreen .timer-custom,
.timer-tool:-webkit-full-screen .timer-custom,
.timer-tool.is-tool-expanded .timer-custom,
.timer-tool:fullscreen .tool-actions,
.timer-tool:-webkit-full-screen .tool-actions,
.timer-tool.is-tool-expanded .tool-actions {
  justify-content: center;
}

.wheel-tool:fullscreen .wheel-stage,
.wheel-tool:-webkit-full-screen .wheel-stage,
.wheel-tool.is-tool-expanded .wheel-stage {
  flex: 1 1 auto;
}

.wheel-tool:fullscreen #rewardWheel,
.wheel-tool:-webkit-full-screen #rewardWheel,
.wheel-tool.is-tool-expanded #rewardWheel {
  width: min(74vh, 820px);
}

.timer-display.is-ending {
  color: #b91c1c;
  animation: timerWarn 1s ease-in-out infinite;
}

@keyframes timerWarn {
  50% { background-color: #fff1f2; }
}

.timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.timer-presets button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  color: #374151;
  background: #fff;
}

.timer-custom,
.group-config,
.score-config {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.timer-custom label,
.group-config label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
}

.timer-custom input,
.group-config input,
.group-config select,
.score-config input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: #fff;
}

.timer-custom input {
  width: 96px;
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 240px);
  margin-bottom: 18px;
  overflow: hidden;
}

#rewardWheel {
  width: min(78%, 48dvh, 600px);
  aspect-ratio: 1 / 1;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(17, 24, 39, 0.12));
  transition: transform 3.2s cubic-bezier(.12,.72,.12,1);
}

.wheel-pointer {
  position: absolute;
  top: clamp(12px, 3vh, 30px);
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #111827;
}

#wheelResult {
  position: absolute;
  bottom: clamp(14px, 3vh, 28px);
  max-width: 76%;
  padding: clamp(10px, 1.4vw, 18px) clamp(16px, 2vw, 28px);
  border-radius: 999px;
  color: #111827;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
  font-size: clamp(24px, 2.8vw, 44px);
  font-weight: 900;
}

.groups-output {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(210px, 22vw, 340px), 1fr));
  gap: clamp(12px, 1.5vw, 22px);
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 240px);
  margin-top: 18px;
  overflow: auto;
}

.group-box,
.score-row {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: #fff;
}

.group-box {
  padding: clamp(16px, 2vw, 28px);
}

.group-box h3 {
  margin-bottom: clamp(10px, 1.5vw, 18px);
  font-size: clamp(26px, 2.8vw, 44px);
}

.group-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: clamp(20px, 1.8vw, 32px);
}

.scoreboard-list {
  display: grid;
  gap: clamp(12px, 1.5vw, 20px);
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 240px);
  margin-top: 18px;
  overflow: auto;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: clamp(10px, 1.4vw, 18px);
  align-items: center;
  padding: clamp(16px, 1.8vw, 26px);
}

.score-row strong {
  font-size: clamp(28px, 2.6vw, 44px);
}

.score-row em {
  min-width: clamp(86px, 8vw, 140px);
  color: #111827;
  font-style: normal;
  font-size: clamp(42px, 4.4vw, 78px);
  font-weight: 800;
  text-align: center;
}

.score-row button {
  width: clamp(50px, 4.8vw, 74px);
  height: clamp(50px, 4.8vw, 74px);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: #f9fafb;
  font-weight: 800;
  font-size: clamp(20px, 2vw, 32px);
}

@media (max-width: 900px) {
  .tools-hero,
  .class-roster-panel,
  .tool-grid,
  .tool-cover-grid,
  .tool-data-actions {
    grid-template-columns: 1fr;
  }

  .tool-data-actions {
    display: grid;
    justify-items: start;
  }

  .roster-library {
    grid-template-columns: 1fr;
  }

  .tool-card:nth-child(5) {
    grid-column: auto;
  }

  .tools-live-panel {
    min-height: 320px;
  }

  .tool-cover-card {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .tools-page {
    width: min(100% - 24px, 1280px);
  }

  .tools-hero,
  .class-roster-panel,
  .tool-card {
    border-radius: 22px;
    padding: 18px;
  }

  .score-row {
    grid-template-columns: 1fr auto;
  }
}
