:root {
  --sky: #dff5ff;
  --paper: #fffdf6;
  --ink: #213547;
  --accent: #ff8a5b;
  --accent-deep: #e35f2d;
  --gold: #ffd166;
  --mint: #8bd3c7;
  --berry: #ef476f;
  --sea: #69b7d6;
  --panel-shadow: 0 18px 40px rgba(33, 53, 71, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.55), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 211, 199, 0.45), transparent 25%),
    linear-gradient(180deg, #9bd7ff 0%, var(--sky) 35%, #f9fbff 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  text-align: center;
  padding: 1rem 0 1.5rem;
  animation: float-in 500ms ease-out;
}

.eyebrow {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0.35rem 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.95;
}

.hero-copy {
  width: min(820px, 100%);
  margin: 0 auto;
  font-size: 1.1rem;
}

.sync-status,
.user-badge,
.message-banner {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
}

.sync-status.online,
.message-banner.success {
  color: #176b4d;
}

.sync-status.offline,
.message-banner.error {
  color: #9a4b11;
}

.message-banner {
  margin-bottom: 1rem;
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.feedback-panel {
  width: min(720px, 100%);
  margin: 1rem auto 0;
  padding: 1rem 1.1rem;
  background: rgba(255, 253, 246, 0.92);
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  box-shadow: var(--panel-shadow);
  text-align: left;
}

.feedback-form {
  margin-top: 0.75rem;
}

.view-tabs {
  display: flex;
  gap: 0.65rem;
}

.app-grid,
.auth-grid {
  display: grid;
  gap: 1.5rem;
}

.app-grid {
  grid-template-columns: 300px 1fr;
}

.wide-layout {
  grid-template-columns: 300px minmax(0, 1fr) 360px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  background: rgba(255, 253, 246, 0.88);
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  padding: 1.25rem;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(8px);
}

.panel-heading h2,
#quiz-subject,
.stack-form h3,
.inventory-panel h3 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.9rem;
}

.panel-heading p,
.meta-label,
.progress-text,
.helper-copy {
  margin: 0.35rem 0 0;
}



.stack-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}



.stack-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.stack-form .checkbox-row input {
  width: auto;
  margin: 0;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  border: 2px solid rgba(33, 53, 71, 0.12);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  background: white;
}

.subject-list {
  display: grid;
  gap: 1rem;
  margin-top: 0.8rem;
}

.category-browser-toolbar {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.category-search-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(16, 50, 77, 0.72);
}

.category-search-input {
  width: 100%;
  border: 2px solid rgba(33, 53, 71, 0.12);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.98);
}

.subject-pinned-area,
.subject-group,
.subject-empty-state {
  border: 2px solid rgba(16, 50, 77, 0.08);
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 255, 0.94));
  box-shadow: 0 14px 28px rgba(16, 50, 77, 0.08);
  padding: 0.95rem;
}

.subject-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.subject-group-header h3 {
  margin: 0.15rem 0 0;
  color: var(--navy);
}

.subject-group-header .subject-description {
  margin-top: 0.3rem;
  max-width: 42rem;
}

.subject-group-count {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.26);
  color: var(--navy);
  font-weight: 800;
  text-align: center;
}

.subject-group-grid,
.subject-pinned-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.subject-group-header-pinned {
  margin-bottom: 0.9rem;
}

.pinned-mode-button {
  background: linear-gradient(160deg, rgba(255, 246, 223, 0.98), rgba(255, 255, 255, 0.98));
}

.subject-empty-state {
  text-align: center;
}

.stats-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.mini-card,
.admin-bank-card {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.28), rgba(255, 255, 255, 0.95));
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.mini-card-value {
  margin: 0.2rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
}

.subject-button,
.answer-button,
.primary-button,
.secondary-button,
.inventory-item {
  border: none;
  border-radius: 18px;
  padding: 0.95rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.subject-button,
.inventory-item {
  width: 100%;
  text-align: left;
  background: white;
  box-shadow: 0 10px 20px rgba(33, 53, 71, 0.08);
}

.subject-button:hover,
.subject-button:focus-visible,
.answer-button:hover,
.answer-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.inventory-item:hover,
.inventory-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(33, 53, 71, 0.14);
}

.subject-button.active,
.secondary-button.active,
.inventory-item.active {
  background: linear-gradient(135deg, #fff4d6, #ffffff);
  outline: 3px solid rgba(255, 138, 91, 0.45);
}

.inventory-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.subject-name,
.inventory-name {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
}

.subject-description,
.inventory-state {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.92rem;
  color: rgba(33, 53, 71, 0.82);
}

.quiz-area,
.auth-panel {
  animation: float-in 420ms ease-out;
}

.auth-panel {
  width: min(1020px, 100%);
  margin: -0.4rem auto 0;
  padding: 1.45rem;
}

.auth-panel .panel-heading {
  text-align: center;
}

.auth-panel .panel-heading p {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.auth-grid .stack-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.15rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 245, 255, 0.82));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.auth-grid #login-form {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 221, 0.82));
}

.auth-grid .stack-form .primary-button {
  margin-top: 0.25rem;
}

.mascot-starter-choice {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border-radius: 20px;
  border: 2px solid rgba(33, 53, 71, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.mascot-starter-choice legend {
  padding: 0 0.3rem;
  font-weight: 800;
}

.mascot-starter-choice label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(233, 242, 255, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62);
}

.quiz-area {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  min-height: 100%;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.85rem;
}

.score-card {
  min-width: 88px;
  text-align: right;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.35), rgba(255, 255, 255, 0.9));
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
}

.score-value {
  margin: 0.2rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
}

.progress-row {
  margin: 0.9rem 0;
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-top: 0.45rem;
  background: rgba(33, 53, 71, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), #56c2b1);
  transition: width 220ms ease;
}

.question-card {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  min-height: 0;
  padding: 1rem 1.05rem;
  background: white;
  border-radius: 24px;
  box-shadow: inset 0 0 0 2px rgba(223, 245, 255, 0.95);
  overflow: auto;
}

body.quiz-stage-active .question-card {
  gap: 0.6rem;
}

.question-image-wrap {
  margin-bottom: 0.25rem;
}

.question-audio-wrap {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(233, 242, 255, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 2px rgba(223, 245, 255, 0.95);
}

.question-audio-wrap .helper-copy {
  margin: 0;
  text-align: center;
}

.question-image {
  display: block;
  width: min(100%, 290px);
  max-height: 250px;
  margin: 0 auto;
  border-radius: 20px;
  background: #f7fbff;
  box-shadow: inset 0 0 0 2px rgba(223, 245, 255, 0.95);
  object-fit: contain;
}

body.quiz-stage-active .question-image {
  width: min(100%, 235px);
  max-height: 190px;
}

.question-text {
  margin: 0;
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 800;
}

.answer-list,
.achievement-list,
.inventory-panels {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.inventory-panels {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.achievement-list.reward-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
}

.achievement-list.reward-grid .achievement-card {
  min-height: 100%;
}

.achievement-list.cynthia-outfit-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.answer-button {
  text-align: left;
  background: #eef8ff;
  padding: 0.82rem 0.95rem;
}

.answer-button.correct {
  background: rgba(139, 211, 199, 0.4);
}

.answer-button.lifeline-highlight {
  background: linear-gradient(135deg, rgba(255, 236, 169, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 2px rgba(255, 184, 0, 0.45), 0 10px 22px rgba(255, 184, 0, 0.18);
}

.answer-button.lifeline-dim {
  opacity: 0.42;
  filter: saturate(0.55);
}

.answer-button.incorrect {
  background: rgba(239, 71, 111, 0.18);
}

.answer-button:disabled {
  cursor: default;
  opacity: 0.92;
}

.feedback {
  margin-top: 0.8rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  font-weight: 700;
  background: rgba(255, 209, 102, 0.28);
}

.feedback.success {
  background: rgba(139, 211, 199, 0.32);
}

.feedback.error {
  background: rgba(239, 71, 111, 0.16);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

body.quiz-stage-active .quiz-actions {
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.quiz-stage-shell {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
}

.quiz-stage-ticker {
  padding: 0.7rem 0.95rem;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(16, 50, 77, 0.96), rgba(37, 88, 130, 0.96));
  color: rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.quiz-stage-ticker p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.quiz-stage-active .quiz-stage-ticker p {
  font-size: 0.84rem;
}

.quiz-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.95fr);
  gap: 0.85rem;
  align-items: start;
  min-height: min(72vh, 760px);
}

body.quiz-stage-active .quiz-stage-grid {
  min-height: calc(100vh - 2rem);
}

.quiz-stage-main,
.quiz-stage-side {
  min-width: 0;
  min-height: 0;
}

.quiz-stage-main {
  display: flex;
  height: 100%;
}

.quiz-stage-main .quiz-area {
  flex: 1 1 auto;
}

body.quiz-stage-active .quiz-stage-shell {
  height: 100%;
}

body.quiz-stage-active .quiz-stage-main .quiz-area {
  overflow: hidden;
}

.quiz-stage-side {
  display: grid;
  gap: 0.85rem;
  grid-template-rows: minmax(150px, 0.78fr) minmax(220px, 1fr);
  height: 100%;
}

body.quiz-stage-active .quiz-stage-side {
  grid-template-rows: minmax(120px, 0.56fr) minmax(180px, 0.72fr);
}

.quiz-side-card {
  padding: 0.9rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 246, 255, 0.94));
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 32px rgba(16, 50, 77, 0.08);
  min-height: 0;
}

.quiz-stage-prompt-card {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  min-height: 150px;
}

.ask-grownups-image-wrap {
  margin-top: 0.7rem;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 244, 255, 0.94));
  box-shadow: inset 0 0 0 2px rgba(221, 240, 255, 0.88);
  min-height: 180px;
}

.ask-grownups-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  object-position: center;
}

.ask-grownups-button {
  width: 100%;
  margin-top: 0;
}

.quiz-stage-mascot-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.55rem;
  min-height: 220px;
}

.quiz-stage-mascot-layers {
  width: 100%;
  min-height: 160px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at top center, rgba(255, 213, 77, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(213, 244, 255, 0.96));
}

.quiz-stage-mascot-layers .mascot-image-body {
  width: min(150px, 100%);
}

body.quiz-stage-active .quiz-stage-mascot-layers .mascot-image-body {
  width: min(126px, 100%);
}

.inventory-thumb {
  width: min(100%, 140px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  justify-self: center;
}

.inventory-panels .inventory-item {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 100%;
  padding: 0.8rem 0.75rem;
  text-align: center;
}

.inventory-panels .inventory-name,
.inventory-panels .inventory-state {
  text-align: center;
}

.inventory-panels .inventory-name {
  margin-top: 0.25rem;
  font-size: 1rem;
}

.inventory-panels .inventory-state {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .quiz-stage-grid {
    grid-template-columns: 1fr;
  }

  .quiz-stage-prompt-card,
  .quiz-stage-mascot-card {
    min-height: 0;
  }

  .inventory-panels {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.milestone-panel {
  margin-top: 1.2rem;
}

.achievement-card,
.inventory-panel {
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(233, 242, 255, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, rgba(139, 211, 199, 0.35), rgba(255, 255, 255, 0.98));
}

.achievement-card.locked {
  opacity: 0.72;
}

.achievement-title {
  margin: 0;
  font-weight: 800;
}

.achievement-description {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
}

.achievement-status {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.review-status-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(26, 64, 95, 0.1);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-status-approved {
  background: rgba(74, 191, 143, 0.18);
}

.review-status-needs_review {
  background: rgba(255, 186, 73, 0.24);
}

.review-status-fixed {
  background: rgba(94, 169, 255, 0.2);
}

.review-status-retired {
  background: rgba(29, 44, 61, 0.18);
}

.admin-review-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.admin-review-choice-list {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.3rem;
}

.admin-review-choice.correct {
  font-weight: 800;
}

.admin-review-choice.selected {
  color: #b45309;
}

.admin-review-card .form-action-row,
.admin-library-card .form-action-row {
  margin-top: 0.8rem;
}


.cynthia-outfit-card {
  width: 100%;
  min-width: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  padding: 0.7rem;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.4rem;
  text-align: center;
  cursor: pointer;
}

.cynthia-outfit-card.active {
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.46), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 30px rgba(16, 50, 77, 0.12);
}

.cynthia-outfit-card:disabled {
  cursor: default;
}

.cynthia-outfit-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(226, 239, 255, 0.94));
}

.cynthia-outfit-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mascot-stage {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(213, 244, 255, 0.9));
}

.mascot-open-button {
  width: 100%;
  margin-top: 1rem;
}

.mascot-layers {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}

.mascot-layers-compact {
  min-height: 200px;
}

.mascot-body {
  position: relative;
  width: 240px;
}

.mascot-image-body {
  width: min(260px, 100%);
}

.mascot-base-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(33, 53, 71, 0.16);
  background: transparent;
}

.mascot-overlay-image {
  position: absolute;
  display: block;
  pointer-events: none;
  inset: 0;
  width: 100%;
  height: auto;
}

.hat-overlay {
  z-index: 3;
}

.hat-cowboy-hat {
  inset: 2.5% 2.5% auto 2.5%;
  width: 95%;
}

.glasses-overlay {
  z-index: 4;
}

.shoes-overlay {
  z-index: 2;
}

.mascot-family-wishes .hat-overlay {
  z-index: 3;
}

.mascot-family-wishes .glasses-overlay {
  z-index: 4;
}

.mascot-family-wishes .shoes-overlay {
  z-index: 5;
}

.badge {
  position: absolute;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(33, 53, 71, 0.12);
}

.hat-layer {
  top: 8%;
  left: 36%;
}

.glasses-layer {
  top: 40%;
  left: 35%;
}

.shoes-layer {
  bottom: 8%;
  left: 30%;
}

.inventory-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mascot-workspace {
  margin-top: 1.5rem;
  animation: float-in 420ms ease-out;
}

.mascot-room-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.mascot-room-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.mascot-room-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
  align-items: start;
}

.mascot-room-main {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.mascot-selector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  margin-top: 1rem;
}

.mascot-selector-card {
  padding: 0.95rem 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(228, 245, 255, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.72);
  text-align: center;
}

.mascot-selector-card h3 {
  margin: 0.2rem 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
}

.mascot-selector-card .subject-description {
  margin-top: 0.35rem;
}

.mascot-arrow-button {
  min-width: 56px;
  min-height: 56px;
  padding: 0.75rem;
  font-size: 1.6rem;
  line-height: 1;
}

.mascot-stage-large {
  min-height: 340px;
}

.mascot-room-side {
  min-width: 0;
  max-height: 78vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.mascot-room-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(255, 253, 246, 0.82));
}

.mascot-room-tabs .secondary-button {
  flex: 1 1 120px;
}

.mascot-side-panel {
  margin-top: 0;
}

.equipped-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.equipped-pill {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(233, 242, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.primary-button {
  background: var(--accent);
  color: white;
}

.secondary-button {
  background: #e9f2ff;
  color: var(--ink);
}

.wide-panel {
  min-width: 0;
}

.two-column-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-field {
  grid-column: 1 / -1;
}

.progression-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.compact-panel {
  margin-top: 1rem;
}

.compact-list {
  margin-top: 0.8rem;
}

.level-card {
  display: grid;
  gap: 0.45rem;
}

.secondary-level-card {
  background: linear-gradient(135deg, rgba(105, 183, 214, 0.22), rgba(255, 255, 255, 0.95));
}

.level-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(33, 53, 71, 0.12);
  overflow: hidden;
}

.level-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.mixed-mode-button {
  background: linear-gradient(135deg, rgba(255, 138, 91, 0.18), rgba(255, 209, 102, 0.2), rgba(255, 255, 255, 0.98));
}

.random-mode-button {
  background: linear-gradient(135deg, rgba(109, 212, 168, 0.2), rgba(134, 176, 255, 0.16), rgba(255, 255, 255, 0.98));
}

.mixed-mode-hero {
  position: relative;
  display: block;
  margin-top: 0.75rem;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(33, 53, 71, 0.14);
}

.mixed-mode-image {
  display: block;
  width: 100%;
  min-height: 132px;
  max-height: 180px;
  object-fit: cover;
}

.mixed-mode-image-label {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(18, 42, 66, 0.86);
  color: #fff4dc;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(18, 42, 66, 0.22);
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.hidden {
  display: none;
}

.topbar.hidden,
.persistent-mascot-banner.hidden,
#persistent-mascot-actions.hidden {
  display: none !important;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .wide-layout {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 1200px) {
  .achievement-list.cynthia-outfit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .achievement-list.cynthia-outfit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .achievement-list.cynthia-outfit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-grid,
  .auth-grid,
  .two-column-form,
  .mascot-room-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 1rem, 1320px);
  }

  .quiz-meta,
  .quiz-actions,
  .topbar,
  .view-tabs,
  .mascot-room-header {
    flex-direction: column;
  }

  .mascot-room-main,
  .mascot-room-tabs {
    position: static;
  }

  .mascot-selector {
    grid-template-columns: 1fr;
  }

  .mascot-arrow-button {
    width: 100%;
  }

  .mascot-room-side {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .score-card {
    width: 100%;
    text-align: left;
  }

  .stats-stack {
    grid-template-columns: 1fr;
  }
}










.stack-form {
  display: grid;
  gap: 0.9rem;
}


.difficulty-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.difficulty-filter .secondary-button {
  min-width: 8rem;
}

:root {
  --sky: #d8f0ff;
  --paper: #fffdf7;
  --ink: #1d2f45;
  --accent: #ff6f3c;
  --accent-deep: #c94d1b;
  --gold: #ffd54d;
  --mint: #79d4c0;
  --berry: #eb476d;
  --sea: #52a9d8;
  --navy: #10324d;
  --panel-shadow: 0 20px 48px rgba(16, 50, 77, 0.14);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 213, 77, 0.45), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(82, 169, 216, 0.24), transparent 18%),
    radial-gradient(circle at bottom right, rgba(121, 212, 192, 0.35), transparent 26%),
    linear-gradient(180deg, #7ec8f8 0%, #d7efff 38%, #fff9ef 100%);
}

.page-shell {
  width: min(1380px, calc(100% - 2rem));
  padding: 1.5rem 0 3rem;
}

body.quiz-stage-active .page-shell {
  width: min(1480px, calc(100% - 1rem));
  padding: 0.5rem 0 0.75rem;
}

.hero {
  position: relative;
  padding: 1.25rem;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 247, 214, 0.74)),
    linear-gradient(120deg, rgba(255, 111, 60, 0.12), rgba(82, 169, 216, 0.14));
  box-shadow: 0 28px 60px rgba(16, 50, 77, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

body.quiz-stage-active .hero {
  display: none;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 18rem;
  height: 18rem;
  top: -6rem;
  right: -4rem;
  background: radial-gradient(circle, rgba(255, 213, 77, 0.45), transparent 68%);
}

.hero::after {
  width: 16rem;
  height: 16rem;
  bottom: -7rem;
  left: -5rem;
  background: radial-gradient(circle, rgba(82, 169, 216, 0.28), transparent 68%);
}


.hero.hero-compact .eyebrow,
.hero.hero-compact h1,
.hero.hero-compact .hero-copy,
.hero.hero-compact .hero-callouts,
.hero.hero-compact .hero-scoreboard {
  display: none;
}

.hero.hero-compact .hero-grid {
  display: block;
  gap: 0;
}

.hero.hero-compact .hero-copy-column {
  padding: 0;
  text-align: left;
}

.hero.hero-compact .hero-copy-column .sync-status {
  margin-top: 0;
}

.hero.hero-compact .topbar {
  display: flex;
  margin-top: 0.85rem;
}

.hero.hero-compact .persistent-mascot-banner {
  display: grid;
}

.hero.hero-compact {
  display: grid;
  gap: 0.85rem;
}

.hero.hero-compact .topbar,
.hero.hero-compact .persistent-mascot-banner {
  margin-top: 0;
  padding: 0.9rem 1rem;
  border-radius: 24px;
  background: rgba(255, 253, 246, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 16px 30px rgba(16, 50, 77, 0.08);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.hero-copy-column {
  max-width: 52rem;
  text-align: center;
  justify-self: center;
  padding: 0.35rem 0.2rem 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 24px rgba(16, 50, 77, 0.08);
}

.hero h1 {
  max-width: none;
  margin: 0.6rem 0 0;
  font-size: clamp(2.9rem, 5.8vw, 4.9rem);
  line-height: 0.92;
  color: var(--navy);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
}

.hero-copy {
  max-width: 38rem;
  margin: 0.85rem auto 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--accent-deep);
}

.hero-callouts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-callout {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: rgba(16, 50, 77, 0.9);
  color: white;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 24px rgba(16, 50, 77, 0.16);
}

.sync-status,
.user-badge,
.message-banner {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(16, 50, 77, 0.08);
}

.hero-copy-column .sync-status {
  display: inline-flex;
  margin-top: 0.85rem;
}

.hero-scoreboard {
  display: none;
}

.hero-scoreboard-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 213, 77, 0.95);
}

.hero-scoreboard h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 2.4rem;
  line-height: 0.95;
}

.hero-scoreboard-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.hero-scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-stat-card {
  padding: 0.9rem 0.7rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
}

.hero-stat-value,
.hero-stat-label {
  margin: 0;
}

.hero-stat-value {
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  line-height: 1;
  color: var(--gold);
}

.hero-stat-label {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar {
  position: relative;
  z-index: 1;
  justify-content: flex-start;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(16, 50, 77, 0.12);
}

.topbar,
.persistent-mascot-banner {
  display: none;
}

.panel {
  background: rgba(255, 253, 246, 0.86);
  border: 3px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px;
  box-shadow: var(--panel-shadow);
}

.subject-panel,
.quiz-panel,
.mascot-preview-panel {
  position: relative;
  overflow: hidden;
}

#quiz-home-workspace:not(.hidden),
.quiz-panel:not(.hidden) {
  grid-column: 1 / -1;
}

.subject-panel::before,
.quiz-panel::before,
.mascot-preview-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 8px;
}

.subject-panel::before {
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.quiz-panel::before {
  background: linear-gradient(90deg, var(--sea), var(--mint));
}

.mascot-preview-panel::before {
  background: linear-gradient(90deg, var(--berry), var(--accent));
}

.subject-button,
.inventory-item {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(16, 50, 77, 0.08);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 255, 0.92));
  box-shadow: 0 14px 28px rgba(16, 50, 77, 0.1);
}

.subject-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

.mixed-mode-button::before {
  background: linear-gradient(180deg, var(--berry), var(--accent));
}

.subject-button.active,
.secondary-button.active,
.inventory-item.active {
  background: linear-gradient(160deg, #fff5dd, #ffffff);
  outline: 3px solid rgba(255, 111, 60, 0.3);
}

.subject-name,
.inventory-name {
  font-size: 1.1rem;
  color: var(--navy);
}

.subject-description,
.inventory-state {
  font-weight: 700;
}

.mini-card,
.admin-bank-card {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 213, 77, 0.34), rgba(255, 255, 255, 0.98));
  box-shadow: 0 14px 30px rgba(16, 50, 77, 0.08);
}

.mini-card-value {
  color: var(--navy);
}

.score-card,
.question-card,
.mascot-stage,
.achievement-card,
.inventory-panel {
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.score-card {
  background: linear-gradient(145deg, rgba(255, 213, 77, 0.44), rgba(255, 255, 255, 0.94));
}

.question-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 255, 0.95));
  box-shadow: inset 0 0 0 2px rgba(221, 240, 255, 0.9);
}

.question-text {
  color: var(--navy);
}

.mascot-stage {
  background:
    radial-gradient(circle at top center, rgba(255, 213, 77, 0.26), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(215, 244, 255, 0.96));
}

.mascot-preview-panel .panel-heading p {
  max-width: 20rem;
}

.achievement-card.unlocked {
  background: linear-gradient(145deg, rgba(121, 212, 192, 0.38), rgba(255, 255, 255, 0.98));
}

.achievement-card.locked {
  background: linear-gradient(145deg, rgba(233, 242, 255, 0.88), rgba(255, 255, 255, 0.96));
}

.progression-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.difficulty-filter .secondary-button {
  border: 2px solid rgba(16, 50, 77, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 20px rgba(16, 50, 77, 0.08);
}

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .progression-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 1rem;
  }

  .hero-copy-column {
    text-align: center;
  }

  .hero-callouts,
  .topbar {
    justify-content: center;
  }

  .hero-scoreboard-grid {
    grid-template-columns: 1fr;
  }
}

.wide-layout {
  grid-template-columns: 1fr;
}

.quiz-panel,
.subject-panel {
  grid-column: 1 / -1;
}

.subject-panel {
  margin-top: 0;
}

.quiz-panel {
  min-width: 0;
}

body.quiz-stage-active #app-view {
  margin-top: 0;
}

body.quiz-stage-active #quiz-workspace {
  gap: 0;
}

body.quiz-stage-active .quiz-panel {
  min-height: calc(100vh - 1rem);
}

.persistent-mascot-banner {
  position: relative;
  z-index: 1;
  display: none;
  justify-items: center;
  gap: 0.75rem;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid rgba(33, 53, 71, 0.12);
}

.persistent-mascot-stage {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top center, rgba(255, 213, 77, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(213, 244, 255, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.persistent-mascot-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
}

.persistent-mascot-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.persistent-mascot-banner .mascot-open-button {
  width: min(280px, 100%);
  min-width: 0;
  margin-top: 0;
}

.persistent-mascot-actions .secondary-button {
  min-width: 0;
}

.persistent-mascot-banner .mascot-layers-compact {
  min-height: 140px;
}

.persistent-mascot-banner .mascot-image-body {
  width: min(170px, 100%);
}

.quiz-home-dashboard {
  display: grid;
  gap: 1.15rem;
}

.dashboard-header {
  display: grid;
  gap: 1rem;
}

.dashboard-title-block p {
  max-width: 38rem;
}

.dashboard-utility-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px)) minmax(320px, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.dashboard-badge-card,
.dashboard-difficulty-card,
.category-browser-panel,
.progress-board-panel {
  padding: 1rem 1.05rem;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(236, 246, 255, 0.92));
  box-shadow: 0 14px 28px rgba(16, 50, 77, 0.08);
}

.dashboard-badge-card {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  background: linear-gradient(155deg, rgba(255, 213, 77, 0.3), rgba(255, 255, 255, 0.96));
}

.dashboard-difficulty-card {
  display: grid;
  gap: 0.55rem;
  align-content: center;
}

.dashboard-difficulty-card .difficulty-filter {
  margin-top: 0;
}

.featured-category-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1.05rem;
  border-radius: 28px;
  border: 2px solid rgba(255, 233, 162, 0.92);
  background:
    radial-gradient(circle at top right, rgba(255, 213, 77, 0.3), transparent 30%),
    linear-gradient(135deg, rgba(255, 245, 214, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 18px 36px rgba(161, 119, 28, 0.12);
}

.featured-category-kicker {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a6512;
}

.featured-category-panel h3 {
  margin: 0.18rem 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.75rem;
  color: var(--navy);
}

.featured-category-description {
  margin: 0.3rem 0 0;
  max-width: 40rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(33, 53, 71, 0.86);
}

.featured-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.featured-chip {
  background: rgba(255, 255, 255, 0.85);
}

.featured-category-actions {
  display: grid;
  gap: 0.7rem;
  min-width: 220px;
}

.compact-heading h2 {
  font-size: 1.45rem;
}

.compact-heading p {
  font-size: 0.95rem;
}

.category-browser-panel .subject-list {
  margin-top: 0.8rem;
}

.progress-board {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.95fr;
  gap: 1rem;
}

.progress-board-panel .achievement-list,
.progress-board-panel .progression-overview {
  margin-top: 0.9rem;
}

.account-settings-form {
  margin-top: 0.9rem;
}

.mascot-preview-panel {
  align-self: start;
  position: sticky;
  top: 1rem;
}

.subject-card-top,
.subject-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.subject-card-top {
  justify-content: space-between;
  align-items: center;
}

.subject-chip-row {
  margin-top: 0.45rem;
}

.subject-kicker,
.subject-start,
.subject-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.subject-kicker {
  padding: 0.35rem 0.65rem;
  background: rgba(255, 111, 60, 0.12);
  color: var(--accent-deep);
}

.subject-start {
  padding: 0.35rem 0.7rem;
  background: rgba(16, 50, 77, 0.1);
  color: var(--navy);
}

.subject-chip {
  padding: 0.32rem 0.62rem;
  background: rgba(16, 50, 77, 0.08);
  color: rgba(29, 47, 69, 0.82);
}

.subject-description {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.86rem;
}

.subject-button {
  padding: 0.8rem 0.85rem;
}

.subject-name {
  font-size: 1rem;
}

.subject-kicker,
.subject-start,
.subject-chip {
  font-size: 0.7rem;
}

.subject-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.trophy-workspace {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  animation: float-in 420ms ease-out;
  background:
    linear-gradient(180deg, rgba(73, 48, 29, 0.18), rgba(22, 15, 10, 0.1)),
    linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(238, 229, 210, 0.94));
}

.trophy-workspace.hidden {
  display: none;
}

.trophy-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.trophy-case-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.trophy-detail-card {
  position: sticky;
  top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 216, 122, 0.34), transparent 30%),
    linear-gradient(180deg, rgba(78, 49, 26, 0.98), rgba(48, 30, 17, 0.98));
  color: #fff8ec;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 18px 32px rgba(43, 26, 12, 0.24);
}

.trophy-detail-card h3 {
  margin: 0.35rem 0 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
}

.trophy-detail-description,
.trophy-detail-status {
  margin: 0.6rem 0 0;
}

.trophy-detail-status {
  color: #ffd979;
  font-weight: 800;
}

.trophy-shelves {
  display: grid;
  gap: 1rem;
  margin-top: 0;
}

.trophy-shelf {
  position: relative;
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1rem 1.15rem;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(112, 80, 49, 0.2), rgba(70, 48, 26, 0.1)),
    linear-gradient(180deg, rgba(255, 252, 245, 0.88), rgba(243, 236, 223, 0.95));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.48);
}

.trophy-shelf::after {
  content: "";
  display: block;
  height: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #9a6a3a, #6d4624);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), 0 6px 10px rgba(58, 34, 17, 0.18);
}

.trophy-shelf-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(78, 50, 27, 0.82);
}

.trophy-shelf-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 0.9rem;
  align-items: end;
}

.trophy-slot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  min-height: 178px;
  padding: 0.7rem 0.5rem 0.55rem;
  border: none;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, background 180ms ease;
}

.trophy-slot:hover,
.trophy-slot:focus-visible {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.5);
  outline: 3px solid rgba(255, 209, 102, 0.55);
}

.trophy-slot.is-locked {
  opacity: 0.78;
}

.trophy-slot.is-locked .trophy-object {
  filter: saturate(0.15) brightness(0.58);
}

.trophy-slot.is-locked .trophy-image {
  filter: grayscale(1) saturate(0.1) brightness(0.72);
}

.trophy-object {
  position: relative;
  width: 98px;
  height: 118px;
  display: grid;
  place-items: end center;
  filter: drop-shadow(0 10px 10px rgba(93, 61, 25, 0.18));
}

.trophy-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trophy-slot.is-unlocked .trophy-object {
  animation: trophy-float 3.6s ease-in-out infinite;
}

.trophy-slot.rarity-rare .trophy-object,
.trophy-slot.rarity-legendary .trophy-object {
  animation-duration: 3s;
}

.trophy-object::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 78%;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(66, 42, 18, 0.18);
}

.trophy-cup-core,
.trophy-cup-stem,
.trophy-cup-base,
.trophy-topper,
.trophy-side {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.trophy-cup-core {
  top: 12px;
  width: 54px;
  height: 42px;
  border-radius: 18px 18px 24px 24px;
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid) 55%, var(--metal-deep));
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.trophy-side {
  top: 18px;
  width: 18px;
  height: 24px;
  border: 5px solid var(--metal-mid);
  border-left: none;
  border-bottom: none;
  border-radius: 0 18px 0 0;
}

.trophy-side.left {
  left: 12px;
  transform: scaleX(-1);
}

.trophy-side.right {
  left: auto;
  right: 12px;
  transform: none;
}

.trophy-cup-stem {
  top: 55px;
  width: 18px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--metal-light), var(--metal-deep));
}

.trophy-cup-base {
  top: 78px;
  width: 56px;
  height: 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #775132, #44280f);
}

.trophy-topper {
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: rgba(84, 48, 4, 0.95);
}

.trophy-plaque {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  color: rgba(74, 48, 23, 0.92);
}

.trophy-style-star .trophy-cup-core {
  clip-path: polygon(50% 0%, 62% 34%, 98% 36%, 70% 58%, 79% 93%, 50% 72%, 21% 93%, 30% 58%, 2% 36%, 38% 34%);
  height: 46px;
  width: 50px;
  border-radius: 0;
}

.trophy-style-star .trophy-side {
  display: none;
}

.trophy-style-shield .trophy-cup-core {
  width: 48px;
  height: 50px;
  border-radius: 18px 18px 22px 22px;
  clip-path: polygon(12% 0%, 88% 0%, 100% 18%, 82% 82%, 50% 100%, 18% 82%, 0% 18%);
}

.trophy-style-orb .trophy-cup-core {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.trophy-style-orb .trophy-side {
  display: none;
}

.trophy-style-crown .trophy-cup-core {
  top: 18px;
  width: 56px;
  height: 36px;
  clip-path: polygon(0% 100%, 0% 40%, 18% 62%, 32% 12%, 50% 58%, 68% 12%, 82% 62%, 100% 40%, 100% 100%);
  border-radius: 0 0 14px 14px;
}

.trophy-style-crown .trophy-side {
  display: none;
}

.trophy-style-medal .trophy-cup-core {
  top: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.trophy-style-medal .trophy-side {
  display: none;
}

.trophy-style-medal .trophy-topper {
  top: 0;
  width: 24px;
  height: 22px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ef476f, #8d2247);
  color: transparent;
}

.trophy-style-medal .trophy-topper::before,
.trophy-style-medal .trophy-topper::after {
  content: "";
  position: absolute;
  top: 16px;
  width: 10px;
  height: 26px;
  background: linear-gradient(180deg, #4f8ef7, #2f4fa8);
}

.trophy-style-medal .trophy-topper::before {
  left: 1px;
  transform: skew(-6deg);
}

.trophy-style-medal .trophy-topper::after {
  right: 1px;
  transform: skew(6deg);
}

.trophy-style-flame .trophy-cup-core {
  width: 42px;
  height: 52px;
  clip-path: polygon(50% 0%, 74% 28%, 64% 44%, 82% 54%, 64% 100%, 36% 100%, 18% 54%, 36% 42%, 24% 26%);
  border-radius: 18px;
}

.trophy-style-flame .trophy-side {
  display: none;
}

.trophy-style-flame .trophy-topper {
  color: rgba(122, 38, 7, 0.94);
}

.trophy-slot.rarity-common .trophy-object {
  --metal-light: #ffe7ab;
  --metal-mid: #d8a642;
  --metal-deep: #8b5d1e;
}

.trophy-slot.rarity-rare .trophy-object {
  --metal-light: #d8ebff;
  --metal-mid: #77addb;
  --metal-deep: #366587;
}

.trophy-slot.rarity-epic .trophy-object {
  --metal-light: #ffd9f6;
  --metal-mid: #d48add;
  --metal-deep: #7e3c8f;
}

.trophy-slot.rarity-legendary .trophy-object {
  --metal-light: #fff6c4;
  --metal-mid: #ffcb43;
  --metal-deep: #b87400;
}

@keyframes trophy-float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@media (max-width: 1200px) {
  .dashboard-utility-strip,
  .progress-board {
    grid-template-columns: 1fr;
  }

  .subject-group-grid,
  .subject-pinned-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .trophy-case-layout {
    grid-template-columns: 1fr;
  }

  .trophy-detail-card {
    position: static;
  }

  .persistent-mascot-banner {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .persistent-mascot-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .featured-category-panel,
  .dashboard-header {
    grid-template-columns: 1fr;
  }

  .subject-group-grid,
  .subject-pinned-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-panels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .subject-panel-actions,
  .mascot-room-header-actions,
  .trophy-heading {
    flex-direction: column;
    align-items: stretch;
  }



  .persistent-mascot-banner {
    position: static;
    grid-template-columns: 1fr;
  }

  .persistent-mascot-actions {
    justify-content: stretch;
  }

  .persistent-mascot-banner .mascot-open-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .subject-group-grid,
  .subject-pinned-grid {
    grid-template-columns: 1fr;
  }

  .subject-group-header {
    flex-direction: column;
  }

  .featured-category-actions,
  .dashboard-utility-strip {
    min-width: 0;
  }

  .inventory-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}





