/**
 * Student dashboard, reuses classroom character display; no teacher menu.
 */

.student-dashboard-view.classroom-view #app,
.student-dashboard-view #app {
  height: calc(100dvh - var(--header-height, 96px));
  max-height: calc(100dvh - var(--header-height, 96px));
  min-height: 0;
}

@supports not (height: 100dvh) {
  .student-dashboard-view.classroom-view #app,
  .student-dashboard-view #app {
    height: calc(100vh - var(--header-height, 96px));
    max-height: calc(100vh - var(--header-height, 96px));
  }
}

.student-dashboard-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.student-dashboard-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.student-dashboard-classroom-name {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.student-dashboard-self-slot {
  border-bottom: 2px solid var(--color-border);
  padding: 8px 0 4px;
}

.student-dashboard-teammates-header {
  padding: 12px 20px 4px;
}

.student-dashboard-teammates-header h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.student-dashboard-teammates-hint {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.student-list-item--self {
  background: var(--color-selection-hover);
}

.student-dashboard-you-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-left: 6px;
}

.student-dashboard-impersonation-banner,
.student-dashboard-viewonly-banner,
.student-dashboard-lock-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  z-index: 30;
  position: relative;
  flex-shrink: 0;
}

.student-dashboard-impersonation-banner.hidden,
.student-dashboard-viewonly-banner.hidden,
.student-dashboard-lock-banner.hidden {
  display: none;
}

.student-dashboard-impersonation-banner {
  background: linear-gradient(90deg, #5b54d6 0%, #7c73ff 100%);
  color: #fff;
  justify-content: space-between;
}

.student-dashboard-impersonation-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.student-dashboard-impersonation-banner__content i {
  flex-shrink: 0;
}

#student-dashboard-impersonation-text {
  min-width: 0;
  line-height: 1.4;
}

.student-dashboard-impersonation-banner .btn,
.student-dashboard-exit-impersonation-btn {
  color: #333;
  background: #fff;
  border: none;
  flex-shrink: 0;
}

.student-dashboard-viewonly-banner {
  background: #fff8e6;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
}

.student-dashboard-lock-banner {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.student-dashboard-actions--locked .action-btn-small {
  opacity: 0.45;
  pointer-events: none;
}

.student-dashboard-layout .classroom-student-display {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.student-dashboard-layout .student-display-main {
  flex: 1;
  min-height: 0;
  background: var(--color-background-alt);
}

.student-dashboard-layout .stats-overlay,
.student-dashboard-layout .action-overlay {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.student-dashboard-layout .stats-overlay-header {
  border-bottom-color: var(--color-border);
}

.student-dashboard-layout .stats-overlay-header h2 {
  color: var(--color-text);
}

.student-dashboard-layout .action-overlay-header {
  color: var(--color-primary-light);
}

.student-dashboard-layout .stat-bar {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

.student-dashboard-layout .stat-info {
  border-top-color: var(--color-border);
}

.student-dashboard-layout .empty-state {
  color: var(--color-text-secondary);
}

.student-dashboard-hero {
  max-width: 960px;
  margin: 0 auto 2rem;
  text-align: center;
  padding: 2rem 1rem;
}

.student-dashboard-hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
  color: #fff;
}

.student-dashboard-hero p {
  margin: 0;
  color: #a89fff;
  line-height: 1.5;
}

.student-dashboard {
  min-height: calc(100dvh - var(--header-height, 96px));
  padding: 1.5rem;
  background: linear-gradient(180deg, #12121f 0%, #0a0a12 100%);
  color: #f0effa;
}

.student-awards-overlay .student-award-tile-count {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.15rem;
}

.student-awards-overlay .student-award-featured-badge {
  display: inline-block;
  position: relative;
  z-index: 2;
  margin-top: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(124, 115, 255, 0.15);
  color: #4338ca;
}

.student-awards-overlay .student-award-tile--featured {
  cursor: default;
  border-color: #7c73ff;
  box-shadow: 0 0 0 2px rgba(124, 115, 255, 0.25);
}

.student-awards-overlay .give-award-tile:not(.student-award-tile--featured):hover {
  border-color: #7c73ff;
  transform: translateY(-2px);
}

/* ── Student awards hub (collections + showcase) ─────────────────────────── */
.student-awards-hub-panel {
  max-width: min(980px, 96vw);
}

.student-awards-hub-header {
  flex-wrap: wrap;
  gap: 12px;
}

.student-awards-hub-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}

.student-awards-hub-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--color-modal-shell-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.student-awards-hub-tab--active {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
}

.student-awards-hub-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0 18px 20px;
}

.student-awards-hub-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.student-awards-section {
  border: 1px solid var(--color-modal-shell-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
}

.student-awards-section-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--color-primary);
}

.student-awards-section-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.student-awards-section-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.student-awards-section-head--row h3 {
  margin: 0;
}

.student-awards-featured-hero .student-awards-featured-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--color-modal-shell-border);
  background: linear-gradient(180deg, var(--color-surface) 0%, rgba(124, 115, 255, 0.06) 100%);
}

.student-awards-featured-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(124, 115, 255, 0.35);
  background: rgba(124, 115, 255, 0.08);
}

.student-awards-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-awards-featured-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.student-awards-featured-name {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-text);
}

.student-awards-featured-count {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.student-awards-pinned-collection .student-awards-collection-detail {
  border: none;
  padding: 0;
  background: transparent;
}

.student-awards-showcase-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  scroll-snap-type: x mandatory;
}

.student-awards-showcase-slide {
  flex: 0 0 min(220px, 70vw);
  scroll-snap-align: center;
  opacity: 0.72;
  transform: scale(0.94);
  transition: opacity 0.2s, transform 0.2s;
}

.student-awards-showcase-slide.is-center {
  opacity: 1;
  transform: scale(1);
}

.student-award-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-modal-shell-border);
  background: var(--color-surface);
  position: relative;
}

.student-award-chip--locked {
  opacity: 0.65;
}

.student-award-chip-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--color-text-secondary);
}

.student-awards-featured-grid {
  max-height: 320px;
}

.student-awards-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-awards-recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(124, 115, 255, 0.06);
}

.student-awards-recent-row img {
  border-radius: 8px;
  object-fit: cover;
}

.student-awards-recent-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.student-awards-recent-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.student-awards-recent-student {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.student-awards-recent-time {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.student-awards-explore-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 900px) {
  .student-awards-explore-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .student-awards-explore-grid {
    grid-template-columns: 1fr;
  }
}

.student-awards-pinned-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
  border: 2px dashed var(--color-modal-shell-border);
  border-radius: 12px;
  background: rgba(124, 115, 255, 0.04);
}

.student-awards-pinned-empty i {
  font-size: 1.6rem;
  color: var(--color-primary);
}

.student-awards-pinned-empty p {
  margin: 0;
  max-width: 28rem;
  color: var(--color-text-secondary);
}

.student-awards-collection-claim {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.student-awards-collection-claim p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--color-text);
}

.student-awards-explore-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--color-modal-shell-border);
  background: linear-gradient(180deg, var(--color-surface) 0%, rgba(124, 115, 255, 0.05) 100%);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}

.student-awards-explore-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.student-awards-explore-card i {
  font-size: 1.4rem;
  color: var(--color-primary);
}

.student-awards-explore-card strong {
  font-size: 0.95rem;
  color: var(--color-text);
}

.student-awards-explore-card span {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.student-awards-empty-hint {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 24px 12px;
}

.student-awards-collections-shell {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  min-height: min(420px, 55vh);
  border: 1px solid var(--color-modal-shell-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
}

.student-awards-collection-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  border-right: 1px solid var(--color-modal-shell-border);
  background: linear-gradient(180deg, rgba(124, 115, 255, 0.07) 0%, rgba(124, 115, 255, 0.02) 100%);
}

.student-awards-collection-sidebar-title {
  margin: 0 0 4px;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.student-awards-collection-detail-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  background: var(--color-surface);
}

.student-awards-collection-detail-panel .student-awards-collection-detail-mount {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.student-awards-collection-detail-panel .student-awards-pin-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-modal-shell-border);
}

@media (max-width: 720px) {
  .student-awards-collections-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .student-awards-collection-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-modal-shell-border);
    padding-bottom: 12px;
  }

  .student-awards-collection-picker {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .student-awards-collection-pick {
    flex: 0 0 min(220px, 78vw);
  }
}

.student-awards-collection-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-awards-collection-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--color-modal-shell-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.student-awards-collection-pick:hover {
  border-color: rgba(124, 115, 255, 0.45);
  background: var(--color-brand-hover-bg);
}

.student-awards-collection-pick.is-active {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.student-awards-collection-pick--pinned {
  border-color: rgba(124, 115, 255, 0.55);
}

.student-awards-collection-pick-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.student-awards-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.student-awards-pin-actions {
  margin-top: 12px;
}

.student-awards-pin-collection--active {
  opacity: 0.85;
}

.student-awards-collection-pick img {
  border-radius: 6px;
}

.student-awards-collection-pick-progress {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.student-awards-collection-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.student-awards-collection-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--color-text);
}

.student-awards-collection-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.student-awards-collection-progress {
  margin-left: auto;
  text-align: right;
}

.student-awards-collection-progress-label {
  display: block;
  font-weight: 800;
  color: var(--color-primary);
}

.student-awards-collection-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #16a34a;
}

.student-awards-collection-reward {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.student-awards-collection-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-collection-item {
  flex: 0 0 110px;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--color-modal-shell-border);
  background: rgba(0, 0, 0, 0.03);
}

.student-collection-item--earned {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.student-collection-item-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 6px;
}

.student-collection-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.student-collection-item-status {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-modal-shell-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--color-text-secondary);
}

.student-collection-item-status.is-earned {
  border-color: #22c55e;
  color: #16a34a;
}

.student-collection-item-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.student-awards-subpanel {
  border: 1px solid var(--color-modal-shell-border);
  border-radius: 14px;
  background: var(--color-surface);
  overflow: hidden;
}

.student-awards-hub-body--subpanel {
  padding-top: 12px;
}

.student-awards-subpanel-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-modal-shell-border);
  background: var(--color-modal-shell-header, var(--color-surface));
}

.student-awards-hub-overlay .student-awards-back-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0;
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid var(--color-modal-shell-border);
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}

.student-awards-hub-overlay .student-awards-back-main:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
  color: var(--color-primary-light, var(--color-primary));
  transform: translateY(-1px);
}

.student-awards-hub-overlay .student-awards-back-main i {
  font-size: 0.95rem;
}

.student-awards-subpanel-toolbar-text {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.student-awards-subpanel-toolbar-text h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary);
}

.student-awards-subpanel-toolbar-text p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.student-awards-subpanel-body {
  padding: 16px;
}

.student-awards-subpanel-body--collections {
  padding: 0;
}

.student-awards-subpanel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.student-awards-subpanel-head p {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.student-awards-subpanel-head h3 {
  margin: 0;
}

.student-awards-hub-overlay .student-awards-pin-collection {
  color: var(--color-text);
}

.student-awards-hub-overlay .student-awards-pin-collection--active {
  opacity: 1;
  color: var(--color-text-secondary);
}

.student-awards-catalog-grid .student-award-chip {
  height: 100%;
}

.student-dashboard-layout .action-btn-small {
  background: var(--color-background-alt);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
  position: relative;
}

.student-dashboard-layout .student-action-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--color-background-alt, #fff);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.student-dashboard-layout .action-btn-small i {
  color: var(--color-text-secondary);
}

.student-dashboard-layout .action-btn-small:hover {
  background: var(--color-brand-hover-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.student-dashboard-layout .action-btn-small:hover i {
  color: var(--color-primary);
}

.student-dashboard-layout .action-btn-small.action-shop {
  border-left: 3px solid #f59e0b;
}

.student-dashboard-layout .action-btn-small.action-customize-avatar {
  border-left: 3px solid #3ecf8e;
}

.student-dashboard-layout .action-btn-small.action-my-awards {
  border-left: 3px solid #fbbf24;
}

.student-dashboard-layout .action-btn-small.action-campaigns {
  border-left: 3px solid #22c55e;
}

.student-dashboard-layout .action-btn-small.action-dungeons {
  border-left: 3px solid #8b5cf6;
}

.student-dungeon-play-root {
  position: fixed;
  inset: 0;
  z-index: 12050;
}

.student-dungeon-play-root .student-dungeon-battle {
  padding-left: max(1rem, min(240px, 28vw));
}

.student-dungeon-left-panel {
  position: absolute;
  top: 4.75rem;
  left: 1rem;
  z-index: 6;
  width: min(220px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.student-dungeon-player-panel {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.student-dungeon-player-name {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-dungeon-stat + .student-dungeon-stat {
  margin-top: 0.55rem;
}

.student-dungeon-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.student-dungeon-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.student-dungeon-stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.student-dungeon-stat-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.student-dungeon-stat-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.student-dungeon-stat-fill--hp {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.student-dungeon-stat-fill--mp {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.student-dungeon-spells-rack {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.student-dungeon-spells-rack-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.student-dungeon-active-buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.student-dungeon-buff-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(124, 115, 255, 0.25);
  color: #e9d5ff;
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.student-dungeon-spells-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.student-dungeon-spell-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.72);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.student-dungeon-spell-btn:not(:disabled):hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(167, 139, 250, 0.45);
}

.student-dungeon-spell-btn.is-disabled,
.student-dungeon-spell-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.student-dungeon-spell-btn-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.student-dungeon-spell-btn-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.student-dungeon-spell-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.student-dungeon-spell-name {
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-dungeon-spell-meta {
  font-size: 0.68rem;
  color: rgba(96, 165, 250, 0.95);
  font-weight: 600;
}

.student-dungeon-spells-empty {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.8);
}

.student-dungeon-spells-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(79, 70, 229, 0.55);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.student-dungeon-spells-toggle:hover {
  background: rgba(99, 102, 241, 0.75);
  border-color: rgba(196, 181, 253, 0.65);
}

.student-dungeon-spells-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.student-dungeon-spells-sheet {
  position: fixed;
  inset: 0;
  z-index: 12100;
  pointer-events: none;
}

.student-dungeon-spells-sheet--open {
  pointer-events: auto;
}

.student-dungeon-spells-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.student-dungeon-spells-sheet--open .student-dungeon-spells-sheet-backdrop {
  opacity: 1;
}

.student-dungeon-spells-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-bottom: none;
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(105%);
  transition: transform 0.28s ease;
}

.student-dungeon-spells-sheet--open .student-dungeon-spells-sheet-panel {
  transform: translateY(0);
}

.student-dungeon-spells-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.student-dungeon-spells-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
}

.student-dungeon-spells-sheet-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.student-dungeon-spells-sheet-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.student-dungeon-spells-sheet-body {
  overflow-y: auto;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.student-dungeon-spells-sheet-body .student-dungeon-spells-list {
  max-height: none;
}

body.student-dungeon-spells-sheet-open {
  overflow: hidden;
}

.student-dungeon-spell-wrap {
  position: relative;
}

/* Rich floating tooltip for dungeon spells */
.dungeon-spell-tooltip {
  min-width: 240px;
  max-width: min(300px, calc(100vw - 24px));
  border-radius: 14px;
  border: 2px solid rgba(167, 139, 250, 0.5);
  background: linear-gradient(165deg, #1e1b4b 0%, #0f172a 55%, #111827 100%);
  color: #f8fafc;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(167, 139, 250, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  transition:
    opacity 0.16s ease,
    visibility 0.16s ease,
    transform 0.18s ease;
  text-align: left;
  overflow: hidden;
  pointer-events: none;
}

.dungeon-spell-tooltip--floating {
  position: fixed;
  z-index: 12280;
}

.dungeon-spell-tooltip--left {
  transform: translateX(-6px);
}

.dungeon-spell-tooltip--visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.dungeon-spell-tooltip-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35) 0%, rgba(79, 70, 229, 0.12) 100%);
  border-bottom: 1px solid rgba(167, 139, 250, 0.25);
}

.dungeon-spell-tooltip-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: #c4b5fd;
  font-size: 1.15rem;
}

.dungeon-spell-tooltip-icon-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.dungeon-spell-tooltip-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dungeon-spell-tooltip-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.dungeon-spell-tooltip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.dungeon-spell-tooltip-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dungeon-spell-tooltip-chip--mp {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.dungeon-spell-tooltip-chip--level {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.dungeon-spell-tooltip-body {
  padding: 0.7rem 0.85rem 0.75rem;
}

.dungeon-spell-tooltip-desc {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.92);
}

.dungeon-spell-tooltip-desc--empty {
  color: rgba(148, 163, 184, 0.85);
  font-style: italic;
}

.dungeon-spell-tooltip-effects-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.95);
}

.dungeon-spell-tooltip-effects-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dungeon-spell-tooltip-effect + .dungeon-spell-tooltip-effect {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.dungeon-spell-tooltip-effect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dungeon-spell-tooltip-effect-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
}

.dungeon-spell-tooltip-effect-value {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 1px 6px;
  border-radius: 999px;
}

.dungeon-spell-tooltip-effect-desc {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.88);
}

.dungeon-spell-tooltip-no-effects {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
  font-style: italic;
}

.dungeon-spell-tooltip-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
}

.dungeon-spell-tooltip-status--ready {
  color: #86efac;
}

.dungeon-spell-tooltip-status--warn {
  color: #fca5a5;
}

.dungeon-spell-tooltip-status i {
  font-size: 0.7rem;
}

.student-dungeon-battle .raid-battle-prompt-scrim {
  max-width: min(920px, calc(100vw - max(240px, 28vw) - 2rem));
}

/* Block highlight/copy of dungeon questions (answers stay selectable) */
.student-dungeon-battle .raid-battle-question-panel,
.student-dungeon-battle .raid-battle-question-text,
.student-dungeon-battle .raid-battle-attachment {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.student-dungeon-battle .raid-battle-attachment img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.student-dungeon-battle .raid-battle-answers input,
.student-dungeon-battle .raid-battle-answers textarea {
  -webkit-user-select: text;
  user-select: text;
}

.student-dungeon-battle .raid-battle-arena {
  min-height: 280px;
  padding-bottom: 1.25rem;
}

.student-dungeon-battle .raid-battle-enemy-column {
  width: min(82vw, 680px);
}

.student-dungeon-battle .raid-battle-enemy-wrap {
  width: 100%;
  height: min(54vh, 560px);
  max-height: min(54vh, 560px);
}

.student-dungeon-battle .raid-battle-enemy {
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
}

@media (max-width: 720px) {
  .student-dungeon-play-root .student-dungeon-battle {
    padding-left: 0;
    padding-top: 0;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  /* In-flow stack: topbar → stats → question → monster (no absolute overlap) */
  .student-dungeon-left-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 5;
    width: calc(100% - 1rem);
    max-width: none;
    margin: 0 auto 0.45rem;
    flex-shrink: 0;
  }

  .student-dungeon-spells-rack--desktop {
    display: none;
  }

  .student-dungeon-spells-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .student-dungeon-player-panel {
    padding: 0.45rem 0.65rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }

  .student-dungeon-player-name {
    display: none;
  }

  .student-dungeon-stat + .student-dungeon-stat {
    margin-top: 0;
  }

  .student-dungeon-stat-header {
    margin-bottom: 0.2rem;
  }

  .student-dungeon-stat-label {
    font-size: 0.62rem;
  }

  .student-dungeon-stat-value {
    font-size: 0.7rem;
  }

  .student-dungeon-stat-bar {
    height: 9px;
  }

  .student-dungeon-battle .raid-battle-topbar {
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem 0.35rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent);
  }

  .student-dungeon-battle .raid-battle-exit-btn {
    width: 36px;
    height: 36px;
  }

  .student-dungeon-battle .raid-battle-monster-progress {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .student-dungeon-battle .raid-battle-stage-badge {
    display: none;
  }

  .student-dungeon-battle .raid-battle-prompt-scrim {
    position: relative;
    z-index: 4;
    max-width: 100%;
    width: calc(100% - 1rem);
    margin: 0 auto;
    padding: 0.7rem 0.8rem 0.8rem;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow-y: visible;
  }

  .student-dungeon-battle .raid-battle-question-text {
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
    line-height: 1.3;
  }

  .student-dungeon-battle .raid-battle-question-meta {
    margin-top: 0.45rem;
  }

  .student-dungeon-battle .raid-battle-wrong-hint {
    font-size: 0.78rem;
  }

  .student-dungeon-battle .raid-battle-answers {
    padding-top: 0.55rem;
  }

  .student-dungeon-battle .raid-battle-answer-grid {
    grid-template-columns: 1fr;
  }

  .student-dungeon-battle .raid-battle-answer-btn {
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
  }

  .student-dungeon-battle .raid-battle-text-answer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .student-dungeon-battle .raid-battle-text-answer input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.7rem 0.85rem;
  }

  .student-dungeon-battle .raid-battle-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .student-dungeon-battle .raid-battle-arena {
    flex: 1 1 auto;
    min-height: 140px;
    padding: 0.15rem 0.5rem max(0.5rem, env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    justify-content: center;
  }

  .student-dungeon-battle .raid-battle-enemy-column {
    width: min(94vw, 480px);
    max-width: 100%;
    height: auto;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  .student-dungeon-battle .raid-battle-enemy-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .student-dungeon-battle .raid-battle-enemy {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .student-dungeon-battle .raid-battle-boss-hp--under-boss {
    margin-top: 0.4rem;
    flex-shrink: 0;
  }

  .student-dungeon-battle .raid-battle-boss-hp--under-boss .raid-battle-boss-hp-bar {
    height: 12px;
  }

  .student-dungeon-spells-toggle-label {
    display: inline;
  }
}

@media (max-width: 420px) {
  .student-dungeon-spells-toggle {
    padding: 0.4rem 0.55rem;
  }

  .student-dungeon-spells-toggle-label {
    display: none;
  }
}

.student-dungeon-complete-card {
  position: relative;
  z-index: 2;
  margin: auto;
  max-width: 28rem;
  padding: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.student-dungeon-complete-card i {
  font-size: 2.5rem;
  color: #7c73ff;
  margin-bottom: 0.75rem;
}

.student-dungeon-complete-card h2 {
  margin: 0 0 0.5rem;
}

.student-dungeon-complete-card p {
  margin: 0 0 1rem;
  color: var(--color-text-secondary);
}

.student-dungeon-complete-curse {
  color: #b91c1c;
  font-weight: 600;
}

.raid-complete-card .student-dungeon-complete-curse {
  margin: 0.35rem 0 0;
}

.raids-content-tabs {
  padding: 0 1.25rem;
}

.student-dashboard-layout .action-btn-small.action-message-board {
  border-left: 3px solid #ec4899;
}

.student-dashboard-layout .action-btn-small.action-seasonal-event {
  border-left: 3px solid var(--season-accent, #e91e8c);
  color: var(--season-accent, #e91e8c);
}

.student-dashboard-layout .action-btn-small.action-seasonal-event i {
  color: var(--season-accent, #e91e8c);
}

.student-dashboard-layout .action-btn-small.action-halloween-claim {
  border-left: 3px solid #ea580c;
  color: #ea580c;
}

.student-dashboard-layout .action-btn-small.action-halloween-claim i {
  color: #ea580c;
}

/* ── Student dashboard: mobile layout ─────────────────────────────────────── */

.student-mobile-topbar,
.student-mobile-stats,
.student-mobile-actions,
.student-mobile-viewonly-pill,
.student-mobile-team-sheet,
.student-mobile-sheet-backdrop {
  display: none;
}

.student-dashboard-layout--mobile {
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.student-dashboard-layout--mobile .student-dashboard-desktop-only {
  display: none !important;
}

.student-dashboard-layout--mobile .student-mobile-topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 14px;
  background: linear-gradient(135deg, #5b54d6 0%, #7c73ff 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(91, 84, 214, 0.25);
  z-index: 20;
}

.student-dashboard-layout--mobile .student-mobile-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.student-dashboard-layout--mobile .student-mobile-topbar-main {
  min-width: 0;
  flex: 1;
}

.student-dashboard-layout--mobile .student-mobile-classroom-name {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
}

.student-dashboard-layout--mobile .student-mobile-character-name {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-dashboard-layout--mobile .student-mobile-team-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.student-dashboard-layout--mobile .student-mobile-team-btn:active {
  transform: scale(0.97);
}

.student-dashboard-layout--mobile .student-mobile-featured {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  min-width: 0;
}

.student-dashboard-layout--mobile .student-mobile-featured.hidden {
  display: none;
}

.student-dashboard-layout--mobile .student-mobile-featured-label {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.85;
  line-height: 1;
}

.student-dashboard-layout--mobile .student-mobile-featured-badge-wrap {
  min-width: 0;
  width: 100%;
}

.student-mobile-featured-active-award-badge,
.student-mobile-featured-featured-collection-badge {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  width: 100%;
  text-align: left;
  pointer-events: auto;
  overflow: hidden;
}

.student-mobile-featured-active-award-medal,
.student-mobile-featured-featured-collection-medal {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.student-mobile-featured-active-award-thumb,
.student-mobile-featured-featured-collection-thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

.student-mobile-featured-active-award-thumb img,
.student-mobile-featured-featured-collection-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.student-mobile-featured-active-award-stack-count {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  min-width: 1.35em;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.student-mobile-featured-active-award-name,
.student-mobile-featured-featured-collection-name {
  display: block;
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  line-height: 1.25 !important;
  color: #fff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  hyphens: none;
}

/* Length tiers are for the desktop character badge, not the mobile chip */
.student-mobile-featured .featured-badge-name--len-sm,
.student-mobile-featured .featured-badge-name--len-md,
.student-mobile-featured .featured-badge-name--len-lg,
.student-mobile-featured .featured-badge-name--len-xl {
  font-size: 0.82rem !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}

.student-dashboard-layout--mobile .classroom-student-display {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.student-dashboard-layout--mobile .student-display-main {
  flex: 0 0 auto;
  min-height: min(42vh, 360px);
  max-height: min(46vh, 400px);
  position: relative;
  background: var(--color-background-alt);
}

.student-dashboard-layout--mobile .character-container,
.student-dashboard-layout--mobile .character-display,
.student-dashboard-layout--mobile .character-background {
  height: 100%;
}

.student-dashboard-layout--mobile .character-display--student-mobile .character-sprite img,
.student-mobile-character-img {
  max-width: min(240px, 68vw);
  max-height: min(34vh, 280px);
  width: auto;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.student-dashboard-layout--mobile .character-display--student-mobile .student-mobile-character-fallback,
.student-mobile-character-fallback {
  font-size: min(220px, 62vw);
  color: #333;
}

.student-dashboard-layout--mobile .character-pet--mobile {
  position: absolute;
  left: 58%;
  bottom: 6px;
  transform: translateX(-10%);
  z-index: 20;
}

.student-dashboard-layout--mobile .character-pet--mobile img {
  max-width: min(120px, 32vw);
  max-height: min(120px, 18vh);
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.student-dashboard-layout--mobile .student-overlay-stack {
  display: none !important;
}

.student-dashboard-layout--mobile .student-mobile-viewonly-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #fff8e6;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
  font-size: 0.82rem;
  font-weight: 600;
}

.student-dashboard-layout--mobile .student-mobile-viewonly-pill.hidden {
  display: none;
}

.student-dashboard-layout--mobile .student-mobile-back-to-self {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: #fff;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.student-dashboard-layout--mobile .student-mobile-stats {
  display: block;
  padding: 12px 12px 4px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.student-dashboard-layout--mobile .student-mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.student-dashboard-layout--mobile .student-mobile-stat-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-background-alt);
}

.student-dashboard-layout--mobile .student-mobile-stat-card--meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.student-dashboard-layout--mobile .student-mobile-stat-head,
.student-dashboard-layout--mobile .student-mobile-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-dashboard-layout--mobile .student-mobile-stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.student-dashboard-layout--mobile .student-mobile-level-btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.student-dashboard-layout--mobile .student-mobile-level-btn .student-mobile-stat-label {
  color: var(--color-primary-text, var(--color-primary));
}

.student-dashboard-layout--mobile .student-mobile-level-btn:hover,
.student-dashboard-layout--mobile .student-mobile-level-btn:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
  outline: none;
}

.student-dashboard-layout--mobile .student-mobile-stat-value,
.student-dashboard-layout--mobile .student-mobile-meta-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.student-dashboard-layout--mobile .student-mobile-stat-bar {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
}

.student-dashboard-layout--mobile .student-mobile-stat-fill {
  height: 100%;
  border-radius: inherit;
}

.student-dashboard-layout--mobile .student-mobile-stat-fill--hp {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.student-dashboard-layout--mobile .student-mobile-stat-fill--mp {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.student-dashboard-layout--mobile .student-mobile-stat-fill--xp {
  background: linear-gradient(90deg, #10b981, #059669);
}

.student-dashboard-layout--mobile .student-mobile-class-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  border: 1px solid transparent;
}

.student-dashboard-layout--mobile .student-mobile-class-badge[style*="--class-color"] {
  color: var(--class-color) !important;
  background: color-mix(in srgb, var(--class-color) 14%, transparent) !important;
  border-color: color-mix(in srgb, var(--class-color) 35%, transparent) !important;
}

.student-dashboard-layout--mobile .student-mobile-actions {
  display: block;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--color-page-bg);
}

.student-dashboard-layout--mobile .student-mobile-actions[hidden] {
  display: none;
}

.student-dashboard-layout--mobile .student-mobile-actions-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-primary-light);
}

.student-dashboard-layout--mobile .student-mobile-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.student-dashboard-layout--mobile .student-mobile-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid var(--color-border);
  background: var(--color-background-alt);
  color: var(--color-text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  position: relative;
}

.student-dashboard-layout--mobile .student-mobile-action-btn i {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
}

.student-dashboard-layout--mobile .student-mobile-action-btn:active {
  transform: scale(0.96);
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-shop {
  border-left: 3px solid #f59e0b;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-customize-avatar {
  border-left: 3px solid #3ecf8e;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-my-awards {
  border-left: 3px solid #fbbf24;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-campaigns {
  border-left: 3px solid #22c55e;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-dungeons {
  border-left: 3px solid #8b5cf6;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-message-board {
  border-left: 3px solid #ec4899;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-seasonal-event {
  border-left: 3px solid var(--season-accent, #e91e8c);
  color: var(--season-accent, #e91e8c);
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-seasonal-event i {
  color: var(--season-accent, #e91e8c);
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-halloween-claim {
  border-left: 3px solid #ea580c;
  color: #ea580c;
}

.student-dashboard-layout--mobile .student-mobile-action-btn.action-halloween-claim i {
  color: #ea580c;
}

.student-dashboard-layout--mobile .student-dashboard-actions--locked .student-mobile-action-btn {
  opacity: 0.45;
  pointer-events: none;
}

.student-dashboard-layout--mobile .student-dashboard-impersonation-banner {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.student-dashboard-layout--mobile .student-dashboard-impersonation-banner__content {
  align-items: flex-start;
}

.student-dashboard-layout--mobile .student-dashboard-impersonation-banner .student-dashboard-exit-impersonation-btn {
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 8px 12px;
}

.student-dashboard-layout--mobile .student-dashboard-lock-banner {
  font-size: 0.82rem;
  padding: 8px 12px;
}

.student-mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12040;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.student-mobile-sheet-backdrop:not([hidden]) {
  display: block;
}

.student-mobile-sheet-backdrop.student-mobile-sheet-backdrop--visible,
.student-mobile-team-sheet--open + .student-mobile-sheet-backdrop,
.student-dashboard-layout--mobile .student-mobile-sheet-backdrop:not([hidden]) {
  opacity: 1;
}

.student-mobile-team-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12050;
  max-height: min(78vh, 640px);
  border-radius: 18px 18px 0 0;
  background: var(--color-surface);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.22);
  transform: translateY(105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.student-dashboard-layout--mobile .student-mobile-team-sheet {
  display: flex;
}

.student-mobile-team-sheet--open {
  transform: translateY(0);
}

.student-mobile-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--color-border);
}

.student-mobile-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--color-border);
}

.student-mobile-sheet-header h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.student-mobile-sheet-hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.student-mobile-sheet-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-background-alt);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.student-mobile-sheet-body {
  overflow-y: auto;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
}

.student-mobile-sheet-section + .student-mobile-sheet-section {
  margin-top: 12px;
}

.student-mobile-sheet-section h3 {
  margin: 0 0 6px;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.student-mobile-self-slot .student-list-item,
.student-mobile-teammate-list .student-list-item {
  border-radius: 12px;
  margin-bottom: 6px;
}

body.student-mobile-sheet-open {
  overflow: hidden;
}

@media (max-width: 420px) {
  .student-dashboard-layout--mobile .student-mobile-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Student onboarding styles: see student-onboarding.css */

.custom-modal.change-classroom-modal {
  width: min(1120px, calc(100vw - 2rem));
  max-width: min(1120px, calc(100vw - 2rem));
  min-width: min(320px, calc(100vw - 2rem));
}

.change-classroom-modal .modal-body {
  max-height: min(75vh, 720px);
  overflow-y: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.change-classroom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (max-width: 1024px) {
  .change-classroom-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .custom-modal.change-classroom-modal {
    width: min(100%, calc(100vw - 1.25rem));
    max-width: min(100%, calc(100vw - 1.25rem));
  }

  .change-classroom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (max-width: 420px) {
  .change-classroom-grid {
    grid-template-columns: 1fr;
  }
}

.change-classroom-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--color-surface, #fff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.change-classroom-card:hover:not(.change-classroom-card--active) {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}

.change-classroom-card--active {
  border-color: var(--color-primary, #6366f1);
  box-shadow: 0 0 0 1px var(--color-primary, #6366f1), 0 8px 22px rgba(99, 102, 241, 0.2);
  cursor: default;
}

.change-classroom-card__scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a2e;
}

.change-classroom-card__bg {
  position: absolute;
  inset: 0;
  background-color: var(--color-text);
  background-size: cover;
  background-position: center top;
}

.change-classroom-card__portrait {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8%;
  z-index: 1;
}

.change-classroom-card__portrait-img {
  max-width: 88%;
  max-height: 92%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.change-classroom-card__portrait-fallback {
  font-size: 4.5rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.change-classroom-card__level {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--color-surface, #fff);
  border: 2px solid var(--color-primary, #6366f1);
  color: var(--color-primary, #6366f1);
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.change-classroom-card__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0.15rem 0.25rem;
}

.change-classroom-card__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text, #111827);
  line-height: 1.25;
  word-break: break-word;
}

.change-classroom-card__classroom {
  font-size: 0.78rem;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.2;
  word-break: break-word;
}

.change-classroom-card__class {
  margin-top: 0.15rem;
}

.change-classroom-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--color-primary, #6366f1);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.student-profile-switch-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.student-profile-switch-item {
  margin: 0;
}

.student-profile-switch-item .btn-block {
  width: 100%;
  text-align: left;
}

.student-profile-switch-item--active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

.student-profile-switch-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-color, #6366f1);
  white-space: nowrap;
}

