:root {
  --primary-color: #FF9800;
  --secondary-color: #2196F3;
  --bg-color: #F4F7F6;
  --sidebar-bg: #2C3E50;
  --text-dark: #333333;
  --font-heading: 'Fredoka One', cursive;
  --font-body: 'Roboto', sans-serif;
  --radius: 15px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg-color);
}

a { color: inherit; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), #ffb74d);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.brand-title {
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  font-size: 1.2rem;
}

.btn {
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary-color);
  color: #1f1f1f;
  box-shadow: 0 12px 24px rgba(255, 152, 0, 0.25);
}

.btn-primary:hover { background: #ffa726; }

.btn-secondary {
  background: var(--secondary-color);
  color: #fff;
  box-shadow: 0 12px 24px rgba(33, 150, 243, 0.22);
}

.btn-secondary:hover { background: #1e88e5; }

.btn-ghost {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-danger {
  background: #e53935;
  color: #fff;
  box-shadow: 0 12px 24px rgba(229,57,53,0.18);
}

.btn-danger:hover { background: #d32f2f; }

.input, select.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  outline: none;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

.input:focus, select.input:focus {
  border-color: rgba(33,150,243,0.55);
  box-shadow: 0 0 0 4px rgba(33,150,243,0.12);
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}

.muted { color: rgba(51,51,51,0.65); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.05);
}

.tag.ok { background: rgba(76,175,80,0.15); color: #1b5e20; }
.tag.pending { background: rgba(255,152,0,0.15); color: #8a4b00; }
.tag.neutral { background: rgba(33,150,243,0.12); color: #0d47a1; }

/* Login */
.auth-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
}

.auth-hero {
  padding: 36px 34px;
  background: radial-gradient(circle at 30% 20%, rgba(255,152,0,0.35), transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(33,150,243,0.25), transparent 45%),
              linear-gradient(135deg, #ffffff, #fafafa);
}

.auth-hero h1 {
  margin: 18px 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
}

.auth-hero p { margin: 0 0 18px; max-width: 52ch; }

.mascot-box {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(44,62,80,0.06);
  border: 1px dashed rgba(44,62,80,0.20);
  display: flex;
  gap: 16px;
  align-items: center;
}

.mascot-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--secondary-color), #7ecbff);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-heading);
  box-shadow: 0 18px 35px rgba(33,150,243,0.25);
  flex: none;
}

.auth-form {
  padding: 34px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form h2 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  letter-spacing: 0.2px;
}

.auth-form label { font-weight: 700; font-size: 0.9rem; opacity: 0.95; }
.auth-form .input { border: 0; }

.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.auth-hint { font-size: 0.9rem; opacity: 0.9; line-height: 1.4; }

/* App shell */
.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar .nav {
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: calc(var(--radius) - 5px);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.nav a.active { background: rgba(255,152,0,0.18); border-color: rgba(255,152,0,0.35); }
.nav a:hover { background: rgba(255,255,255,0.10); }

.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }

.main {
  padding: 24px;
}

/* Top navigation shell */
.app-shell.top-nav {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.top-nav-bar {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.top-nav-bar .brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.top-nav-bar .brand-title {
  font-size: 0.98rem;
}

.top-nav-bar .nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav-bar .nav a {
  padding: 6px 10px;
}

.top-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.btn-compact {
  padding: 6px 10px;
  border-radius: calc(var(--radius) - 6px);
  font-size: 0.85rem;
}

.btn-wide {
  min-width: 140px;
  justify-content: center;
}

.app-shell.top-nav .main {
  padding: 10px 12px 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-user-chip {
  white-space: nowrap;
}

.topbar-user-role {
  opacity: 0.9;
}

.topbar.compact {
  margin-bottom: 10px;
}

.topbar.compact .page-title {
  font-size: 1.35rem;
}

.topbar.compact .tag {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.topbar.compact .lang-select {
  padding: 6px 8px;
  min-width: 110px;
}

.game-room-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 6px 8px 0;
}

.game-area {
  grid-row: 1;
  min-height: 480px;
  margin-bottom: 0;
}

.game-slot {
  width: 100%;
  height: 100%;
  min-height: 480px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.game-slot section {
  display: none;
  width: 100%;
  min-height: 420px;
  height: 100%;
  max-width: none;
}

.game-slot section > * {
  width: 100%;
  height: 100%;
}

.garden-stage,
.supergamur-game {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
}

.assignment-area {
  grid-row: 2;
  display: grid;
  gap: 14px;
  padding: 1px;
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: linear-gradient(150deg, rgba(255,152,0,0.08), rgba(33,150,243,0.06)), #fff;
  box-shadow: 0 20px 60px rgba(15,23,42,0.16);
  position: relative;
  overflow: visible;
}

.assignment-area::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,152,0,0.25), transparent 45%),
              radial-gradient(circle at 80% 40%, rgba(33,150,243,0.22), transparent 50%);
  opacity: 0.4;
  pointer-events: none;
}

.assignment-area > * {
  position: relative;
  z-index: 1;
}

.assignment-meta .card {
  background: #fff;
  border-radius: var(--radius);
}

body[data-game-module="garden"] .game-slot .garden-stage,
body[data-game-module="magic_scene"] .game-slot .garden-stage,
body[data-game-module="practice"] .game-slot .garden-stage,
body[data-game-module="runner"] .game-slot .garden-stage {
    display: flex !important;
  }

body[data-game-module="garden"] .game-slot .supergamur-game,
body[data-game-module="magic_scene"] .game-slot .supergamur-game,
body[data-game-module="practice"] .game-slot .supergamur-game,
body[data-game-module="runner"] .game-slot .supergamur-game {
    display: none !important;
  }

body[data-game-module="supergamur"] .game-slot .supergamur-game {
  display: flex !important;
}

body[data-game-module="supergamur"] .game-slot .garden-stage {
  display: none !important;
}

.game-room-topbar {
  margin-bottom: 6px;
}

.lang-select {
  width: auto;
  min-width: 140px;
}

.page-title {
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: 0.2px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card { padding: 16px; }
.stat-value { font-family: var(--font-heading); font-size: 1.8rem; margin-top: 6px; }

.panel { padding: 18px; }

.builder-grid {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.editor-stage {
  display: grid;
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  vertical-align: middle;
}

th { font-size: 0.9rem; opacity: 0.8; }

th.sortable {
  cursor: pointer;
  white-space: nowrap;
}

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.magic-assign-modal {
  border: 2px solid rgba(255,152,0,0.32);
  background: linear-gradient(180deg, rgba(255,252,247,0.98), #ffffff);
}

.magic-assign-modal .panel-header h2 {
  font-size: 17px;
  font-weight: 900;
  color: #1f2937;
}

.magic-assign-modal .panel-header .muted {
  color: #475569;
  font-size: 15px;
}

.magic-assign-modal .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.magic-assign-modal .form-grid > label,
.magic-assign-modal .form-grid > div {
  display: block;
}

.magic-assign-modal .form-grid label > span {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: #1f3a5f;
  margin-bottom: 7px;
}

.magic-assign-modal .form-grid .input,
.magic-assign-modal .form-grid select,
.magic-assign-modal .form-grid textarea {
  font-size: 15px;
  border-color: rgba(33,150,243,0.28);
  background: #f8fbff;
}

.magic-assign-modal .checkbox-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.magic-assign-modal .checkbox-row span {
  white-space: nowrap;
}

.magic-assign-modal .magic-assign-backing-block {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(33,150,243,0.22);
  border-radius: 12px;
  background: rgba(248,251,255,0.9);
}

.magic-assign-modal .magic-assign-backing-block .checkbox-row {
  margin-bottom: 2px;
}

.magic-assign-modal .magic-assign-info {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(33,150,243,0.38);
  background: rgba(33,150,243,0.08);
  color: #1e3a5f;
  font-weight: 700;
}

.magic-assign-modal .magic-assign-backing-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.magic-assign-modal .magic-assign-summary .muted {
  font-size: 15px;
  font-weight: 800;
  color: #1f3a5f;
}

.magic-assign-modal .magic-assign-summary strong,
.magic-assign-modal .magic-assign-display-summary strong {
  font-size: 16px;
  font-weight: 900;
  color: #1f2937;
}

.magic-assign-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.magic-assign-summary > div {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px;
  background: rgba(244,247,246,0.72);
}

.magic-scene-level {
  grid-column: 1 / -1;
  border: 1px solid rgba(33,150,243,0.18);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.magic-scene-level + .magic-scene-level {
  margin-top: 4px;
}

.magic-scene-level summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 900;
  color: var(--text-dark);
  background: linear-gradient(90deg, rgba(255,152,0,0.12), rgba(33,150,243,0.08));
}

.magic-scene-level summary::marker {
  color: var(--secondary-color);
}

.magic-scene-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: rgba(244,247,246,0.55);
}

.scene-group-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.scene-group-tab {
  cursor: pointer;
  text-align: left;
  border: 1px solid rgba(33,150,243,0.18);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.scene-group-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(33,150,243,0.34);
}

.scene-group-tab.is-active {
  border-color: rgba(255,152,0,0.56);
  box-shadow: 0 14px 30px rgba(255,152,0,0.14), 0 0 0 3px rgba(255,152,0,0.10);
  background: linear-gradient(180deg, rgba(255,248,232,0.98), #fff);
}

.scene-group-tab span {
  display: block;
  color: #274060;
  font-weight: 900;
}

.scene-group-tab small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-weight: 700;
  line-height: 1.25;
}

.scene-group-tab::after {
  content: attr(data-count) " sahne";
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0d47a1;
  background: rgba(33,150,243,0.10);
  font-size: 0.76rem;
  font-weight: 900;
}

#sceneFilters {
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  align-items: center;
}

.rhythm-library {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(33,150,243,0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(244,247,246,0.92));
}

.rhythm-card {
  border: 1px solid rgba(44,62,80,0.15);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
}

.rhythm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.rhythm-card-title {
  font-weight: 800;
  color: #1f2937;
}

.rhythm-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rhythm-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.rhythm-card-status {
  font-size: 12px;
  color: #334155;
  min-height: 18px;
}

@media (max-width: 1280px) {
  .scene-group-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #sceneFilters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .scene-group-tabs,
  #sceneFilters {
    grid-template-columns: 1fr;
  }
}

.magic-scene-card-goal {
  color: #0f766e;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(20,184,166,0.10);
}

.magic-song-stage-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 10px;
}

.magic-song-stage-btn {
  appearance: none;
  border: 1px solid rgba(33,150,243,0.22);
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  color: #274060;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  min-height: 38px;
  padding: 7px 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease, background 120ms ease;
}

.magic-song-stage-btn:hover {
  border-color: rgba(33,150,243,0.42);
  transform: translateY(-1px);
}

.magic-song-stage-btn.is-active {
  border-color: rgba(255,152,0,0.62);
  background: rgba(255,248,232,0.98);
  box-shadow: 0 0 0 3px rgba(255,152,0,0.12);
}

.magic-scene-stage::before,
.magic-scene-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.magic-scene-stage::before {
  width: 220px;
  height: 70px;
  left: -80px;
  top: 54px;
  border-radius: 999px;
  background: rgba(255,255,255,0.38);
  filter: blur(2px);
  animation: magicCloudDrift 18s linear infinite;
}

.magic-scene-stage::after {
  inset: auto 0 0;
  height: 42%;
  background: radial-gradient(circle at 50% 100%, rgba(255,255,255,0.55), transparent 62%);
  opacity: 0.42;
  animation: magicAmbientGlow 5s ease-in-out infinite;
}

body[data-game-module="magic_scene"] .magic-scene-stage[data-magic-theme="night_city"]::after {
  height: 32%;
  opacity: 0.95;
  background:
    linear-gradient(to top, rgba(15,23,42,0.96) 0 34%, transparent 35%),
    repeating-linear-gradient(90deg, rgba(30,41,59,0.96) 0 34px, transparent 34px 52px),
    radial-gradient(circle at 82% 8%, rgba(255,199,92,0.95) 0 20px, transparent 22px);
  filter: none;
}

body[data-game-module="magic_scene"] .magic-scene-stage {
  isolation: isolate;
}

body[data-game-module="magic_scene"] .garden-mascot {
  display: none;
}

body[data-game-module="magic_scene"] .game-info-pill,
body[data-game-module="magic_scene"] .garden-target-card,
body[data-game-module="magic_scene"] .garden-progress {
  z-index: 24;
}

.magic-scene-composition {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.magic-scene-bg,
.magic-scene-ground-plane,
.magic-scene-static-props,
.magic-scene-object-layer {
  position: absolute;
  inset: 0;
}

.magic-scene-bg {
  z-index: 1;
  opacity: 0.95;
}

.magic-scene-bg--garden {
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,0.9) 0 22px, transparent 23px),
    radial-gradient(circle at 23% 17%, rgba(255,255,255,0.86) 0 30px, transparent 31px),
    radial-gradient(circle at 68% 16%, rgba(255,255,255,0.8) 0 26px, transparent 27px),
    linear-gradient(180deg, #95d8ff 0%, #dff5ff 45%, #a8df76 100%);
}

.magic-scene-bg--night-city {
  background:
    radial-gradient(circle at 17% 20%, rgba(255,238,166,0.95) 0 30px, transparent 32px),
    radial-gradient(circle at 38% 18%, rgba(255,255,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 13%, rgba(255,255,255,0.75) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.8) 0 2px, transparent 3px),
    linear-gradient(180deg, #0b1129 0%, #1d3476 58%, #111827 100%);
}

.magic-scene-bg--clock {
  background:
    radial-gradient(circle at 75% 24%, rgba(255,244,196,0.9) 0 44px, transparent 46px),
    linear-gradient(180deg, #a8dfff 0%, #f7dfb7 58%, #ad7b4a 100%);
}

.magic-scene-bg--sea {
  background:
    radial-gradient(ellipse at 35% 12%, rgba(255,255,255,0.28) 0 18%, transparent 34%),
    repeating-linear-gradient(178deg, rgba(255,255,255,0.12) 0 8px, transparent 8px 34px),
    linear-gradient(180deg, #76ddf4 0%, #1495c9 54%, #075a7a 100%);
}

.magic-scene-bg--space {
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 48% 14%, rgba(255,255,255,0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 32%, rgba(255,255,255,0.78) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 12%, rgba(255,226,138,0.8) 0 4px, transparent 5px),
    linear-gradient(180deg, #10133d 0%, #33216f 50%, #080b1d 100%);
}

.magic-scene-bg--forest {
  background:
    radial-gradient(circle at 70% 18%, rgba(255,236,160,0.72) 0 42px, transparent 44px),
    linear-gradient(180deg, #b9f6cf 0%, #72c982 56%, #244f2f 100%);
}

.magic-scene-ground-plane {
  z-index: 2;
  top: auto;
  height: 32%;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(34,197,94,0.16));
}

.magic-scene-static-props {
  z-index: 3;
}

.magic-garden-hill,
.magic-flower-bed,
.magic-city-block,
.magic-city-road,
.magic-clock-skyline,
.magic-clock-arch,
.magic-sea-floor,
.magic-sea-grass,
.magic-star-field,
.magic-forest-row {
  position: absolute;
  display: block;
}

.magic-garden-hill {
  bottom: -12%;
  height: 35%;
  border-radius: 50% 50% 0 0;
}

.magic-garden-hill--back {
  left: -8%;
  width: 72%;
  background: #8bd26d;
}

.magic-garden-hill--front {
  right: -12%;
  bottom: -15%;
  width: 82%;
  background: #59b95a;
}

.magic-flower-bed {
  left: 0;
  right: 0;
  bottom: 8%;
  height: 28px;
  background:
    radial-gradient(circle at 12% 50%, #ff8ac7 0 5px, transparent 6px),
    radial-gradient(circle at 22% 35%, #ffd54a 0 5px, transparent 6px),
    radial-gradient(circle at 34% 58%, #ff8ac7 0 5px, transparent 6px),
    radial-gradient(circle at 48% 42%, #ffd54a 0 5px, transparent 6px),
    radial-gradient(circle at 66% 56%, #ff8ac7 0 5px, transparent 6px),
    radial-gradient(circle at 82% 38%, #ffd54a 0 5px, transparent 6px);
}

.magic-city-block {
  bottom: 13%;
  width: 18%;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,213,74,0.9) 18px 28px, transparent 28px 42px),
    linear-gradient(180deg, #27364f, #111827);
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.04);
}

.magic-city-block--a { left: 20%; height: 42%; }
.magic-city-block--b { left: 42%; height: 56%; }
.magic-city-block--c { left: 64%; height: 36%; }
.magic-city-road { left: 0; right: 0; bottom: 0; height: 16%; background: linear-gradient(180deg, #1f2937, #020617); }

.magic-clock-skyline { left: 0; right: 0; bottom: 0; height: 22%; background: #8b5e34; }
.magic-clock-arch { left: 38%; bottom: 18%; width: 24%; height: 48%; border-radius: 16px 16px 0 0; background: linear-gradient(180deg, #b77942, #6f4327); opacity: 0.45; }

.magic-sea-floor { left: -4%; right: -4%; bottom: -8%; height: 28%; border-radius: 50% 50% 0 0; background: #d6a85f; }
.magic-sea-grass { bottom: 16%; width: 54px; height: 72px; border-radius: 70% 30% 0 0; background: linear-gradient(135deg, #16a34a, #86efac); transform-origin: bottom center; animation: magicSeaSway 3.6s ease-in-out infinite; }
.magic-sea-grass--a { left: 12%; }
.magic-sea-grass--b { right: 16%; animation-delay: 700ms; }

.magic-star-field { width: 100%; height: 100%; background: radial-gradient(circle at 12% 62%, white 0 2px, transparent 3px), radial-gradient(circle at 35% 35%, white 0 2px, transparent 3px), radial-gradient(circle at 92% 48%, white 0 2px, transparent 3px); animation: magicTwinkle 2.8s ease-in-out infinite; }
.magic-star-field--b { transform: translateY(10px); opacity: 0.6; animation-delay: 900ms; }

.magic-forest-row { left: -4%; right: -4%; bottom: 0; height: 48%; background: repeating-linear-gradient(90deg, #1f5a33 0 32px, #2f7a43 32px 68px); clip-path: polygon(0 100%, 0 40%, 5% 20%, 10% 42%, 15% 18%, 21% 45%, 26% 16%, 33% 44%, 40% 21%, 48% 42%, 55% 14%, 63% 44%, 70% 18%, 78% 42%, 86% 19%, 94% 42%, 100% 22%, 100% 100%); }
.magic-forest-row--back { bottom: 15%; opacity: 0.45; transform: scaleY(0.86); }
.magic-forest-row--front { opacity: 0.68; }

.magic-scene-object-layer {
  z-index: 6;
}

.magic-stage-object {
  --stage-size: 64px;
  position: absolute;
  width: var(--stage-size);
  height: var(--stage-size);
  transform: translate(-50%, -50%) scale(0.84);
  transform-origin: center bottom;
  opacity: 0.78;
  filter: saturate(0.96);
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
  animation: magicStageFloat 4.2s ease-in-out infinite;
  animation-delay: var(--float-delay, 0ms);
}

.magic-stage-object[data-reveal="0"],
.magic-stage-object.is-revealed,
.magic-stage-object.is-awake {
  opacity: 0.95;
  filter: saturate(1.05);
  transform: translate(-50%, -50%) scale(1);
}

.magic-stage-object:not([data-reveal="0"]):not(.is-revealed):not(.is-awake)::after {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 66%);
}

.magic-stage-object.is-complete {
  opacity: 1;
  filter: saturate(1.28) brightness(1.06);
}

.magic-stage-object.is-hit {
  z-index: 12;
}

.magic-stage-object.is-pulse { animation: magicStageHitPulse 650ms ease both; }
.magic-stage-object.is-bounce { animation: magicStageHitBounce 720ms cubic-bezier(.2,.9,.2,1.2) both; }
.magic-stage-object.is-celebrating { animation: magicObjectCelebrate 1.2s ease-in-out infinite; }

.magic-stage-object > span {
  position: absolute;
  display: block;
}

.magic-stage-aura {
  inset: -26%;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--magic-color, #FF9800) 45%, transparent), transparent 68%);
  opacity: 0;
}

.magic-stage-object.is-hit .magic-stage-aura {
  animation: magicAuraPulse 820ms ease both;
}

.stage-sun-rays { inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #ffd54a 0 12deg, transparent 12deg 28deg); animation: magicSpin 9s linear infinite; }
.stage-sun-core { inset: 18%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7ad, #ff9800); box-shadow: 0 0 34px #ffd54a; }
.stage-cloud-puff { left: 6%; right: 6%; bottom: 24%; height: 44%; border-radius: 999px; background: #fff; box-shadow: 22px -16px 0 2px #fff, 48px -5px 0 0 #f8fafc, -18px 2px 0 #f8fafc; }
.stage-moon-core { inset: 10%; border-radius: 50%; background: #fde68a; box-shadow: inset -18px 0 0 #f8fafc, 0 0 28px rgba(253,230,138,0.8); }
.stage-star-core, .stage-starfish-core, .stage-spark-core { inset: 0; display: grid !important; place-items: center; color: var(--magic-color, #ffd54a); font-size: calc(var(--stage-size) * 0.72); text-shadow: 0 0 22px currentColor; }
.stage-planet-core { inset: 18%; border-radius: 50%; background: linear-gradient(135deg, #7dd3fc, #c4b5fd); }
.stage-planet-ring { left: 0; right: 0; top: 42%; height: 18%; border: 5px solid #fde68a; border-left-color: transparent; border-right-color: transparent; border-radius: 50%; transform: rotate(-18deg); }
.stage-rocket-body { left: 32%; top: 10%; width: 36%; height: 68%; border-radius: 50% 50% 22% 22%; background: linear-gradient(180deg, #fff, #ef4444); }
.stage-rocket-flame { left: 38%; bottom: 0; width: 24%; height: 28%; border-radius: 50%; background: linear-gradient(180deg, #ffd54a, #ff5722); animation: magicFlame 380ms ease-in-out infinite; }
.stage-comet-tail { right: 34%; top: 36%; width: 82%; height: 22%; border-radius: 999px; background: linear-gradient(90deg, transparent, #93c5fd); transform: rotate(-18deg); }
.stage-comet-core { right: 8%; top: 26%; width: 38%; height: 38%; border-radius: 50%; background: #fde68a; box-shadow: 0 0 22px #fde68a; }
.stage-fish-body { left: 12%; top: 28%; width: 66%; height: 46%; border-radius: 60% 45% 45% 60%; background: linear-gradient(135deg, #ff8ac7, #ffd54a); }
.stage-fish-tail { right: 4%; top: 34%; width: 28%; height: 34%; background: #ff8ac7; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.stage-coral-branch { left: 24%; bottom: 0; width: 52%; height: 88%; border-radius: 999px 999px 0 0; background: linear-gradient(180deg, #fb7185, #e11d48); box-shadow: -22px 22px 0 -7px #f97316, 22px 16px 0 -8px #f97316; }
.stage-bubble-one, .stage-bubble-two, .stage-bubble-three { border: 3px solid rgba(255,255,255,0.8); border-radius: 50%; background: rgba(255,255,255,0.12); }
.stage-bubble-one { left: 10%; top: 40%; width: 34%; height: 34%; }
.stage-bubble-two { left: 48%; top: 14%; width: 24%; height: 24%; }
.stage-bubble-three { right: 6%; bottom: 12%; width: 18%; height: 18%; }
.stage-tower-body { left: 26%; bottom: 0; width: 48%; height: 76%; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, #b77942, #7c4a2b); box-shadow: inset 0 0 0 4px rgba(255,255,255,0.12); }
.stage-tower-roof { left: 18%; top: 2%; width: 64%; height: 28%; background: #7f1d1d; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.stage-clock-face { inset: 6%; border-radius: 50%; background: #fff7ed; border: 6px solid #92400e; box-shadow: 0 0 18px rgba(255,213,74,0.55); }
.stage-clock-face span { position: absolute; left: 48%; top: 18%; width: 6%; height: 34%; background: #1f2937; transform-origin: 50% 95%; transform: rotate(35deg); }
.stage-pendulum-arm { left: 48%; top: 0; width: 4%; height: 72%; background: #6b3f22; transform-origin: top center; animation: magicPendulum 1.7s ease-in-out infinite; }
.stage-pendulum-bob { left: 34%; bottom: 0; width: 32%; height: 32%; border-radius: 50%; background: #ffd54a; }
.stage-gear-core { inset: 0; display: grid !important; place-items: center; color: #8b5e34; font-size: calc(var(--stage-size) * 0.82); animation: magicSpin 6s linear infinite; }
.stage-window-grid { inset: 8%; border-radius: 8px; background: repeating-linear-gradient(90deg, #fde68a 0 12px, #1e293b 12px 18px), repeating-linear-gradient(0deg, transparent 0 12px, rgba(30,41,59,0.48) 12px 18px); box-shadow: 0 0 22px rgba(253,230,138,0.75); }
.stage-lamp-post { left: 47%; top: 28%; width: 7%; height: 70%; background: #111827; }
.stage-lamp-glow { left: 25%; top: 0; width: 50%; height: 36%; border-radius: 50%; background: radial-gradient(circle, #fde68a, rgba(253,230,138,0.08) 70%); box-shadow: 0 0 38px #fde68a; }
.stage-car-beam { left: 0; top: 42%; width: 100%; height: 26%; background: linear-gradient(90deg, transparent, rgba(255,245,157,0.8), transparent); border-radius: 999px; }
.stage-car-dot { left: 45%; top: 38%; width: 18%; height: 18%; border-radius: 50%; background: #fde68a; box-shadow: 0 0 18px #fde68a; }
.stage-tree-crown { left: 10%; top: 0; width: 80%; height: 68%; border-radius: 50% 50% 42% 42%; background: radial-gradient(circle at 35% 28%, #86efac, #15803d); box-shadow: -22px 18px 0 -8px #16a34a, 24px 22px 0 -10px #22c55e; }
.stage-tree-trunk { left: 42%; bottom: 0; width: 16%; height: 42%; border-radius: 6px; background: #7c4a2b; }
.stage-leaf-core { inset: 12%; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, #bbf7d0, #16a34a); transform: rotate(-20deg); }
.stage-butterfly-wing { top: 24%; width: 40%; height: 42%; border-radius: 70% 70% 45% 45%; background: #ff8ac7; }
.stage-butterfly-wing.left { left: 4%; transform: rotate(-26deg); }
.stage-butterfly-wing.right { right: 4%; transform: rotate(26deg); }
.stage-butterfly-body { left: 47%; top: 24%; width: 6%; height: 48%; border-radius: 999px; background: #4c1d95; }
.stage-bird-wing { inset: 16%; border-top: 8px solid #334155; border-left: 8px solid transparent; border-right: 8px solid transparent; border-radius: 50%; transform: rotate(8deg); }
.stage-flower-stem { left: 48%; bottom: 0; width: 6%; height: 54%; background: #15803d; }
.stage-flower-petals { left: 18%; top: 4%; width: 64%; height: 64%; border-radius: 50%; background: radial-gradient(circle, #ffd54a 0 18%, transparent 19%), radial-gradient(circle at 50% 0, #ff8ac7 0 20%, transparent 21%), radial-gradient(circle at 0 50%, #ff8ac7 0 20%, transparent 21%), radial-gradient(circle at 100% 50%, #ff8ac7 0 20%, transparent 21%), radial-gradient(circle at 50% 100%, #ff8ac7 0 20%, transparent 21%); }
.stage-path-core { left: 10%; right: 10%; bottom: 0; height: 84%; border-radius: 50% 50% 0 0; background: linear-gradient(180deg, rgba(217,119,6,0.55), #b45309); clip-path: polygon(44% 0, 56% 0, 80% 100%, 20% 100%); }
.stage-wave-line { left: 0; right: 0; top: 38%; height: 32%; background: repeating-radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0 8px, transparent 9px 24px); opacity: 0.7; }

.magic-scene-stage[data-milestone="25"] { filter: saturate(1.2) brightness(1.05); }
.magic-scene-stage[data-milestone="50"] { filter: saturate(1.38) brightness(1.09); }
.magic-scene-stage[data-milestone="75"] { filter: saturate(1.58) brightness(1.13); }
.magic-scene-stage[data-milestone="100"] { filter: saturate(1.8) brightness(1.16); }
.magic-scene-stage[data-milestone="25"]::after { opacity: 0.65; }
.magic-scene-stage[data-milestone="50"]::after { opacity: 0.8; }
.magic-scene-stage[data-milestone="75"]::after { opacity: 0.95; }
.magic-scene-stage[data-milestone="100"]::after { opacity: 1; }

.magic-scene-effect-layer,
.magic-scene-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.magic-scene-milestone {
  position: absolute;
  top: 70px;
  left: 50%;
  z-index: 34;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  opacity: 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,245,210,0.98));
  color: #9a3412;
  font-weight: 900;
  font-size: clamp(18px, 2.6vw, 30px);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  box-shadow: 0 18px 44px rgba(15,23,42,0.22), 0 0 0 4px rgba(255,152,0,0.24);
  transition: opacity 160ms ease, transform 160ms ease;
}

.magic-scene-milestone.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: magicMilestoneFloat 1.2s ease both;
}

.magic-scene-object {
  position: relative;
  overflow: visible;
  transform-origin: center bottom;
  z-index: 2;
}

.magic-scene-object[data-state="awakening"] {
  opacity: 0.72 !important;
  box-shadow: 0 12px 30px rgba(33,150,243,0.14);
}

.magic-scene-object[data-state="active"] {
  opacity: 0.9 !important;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--magic-color, #2196F3) 42%, transparent), 0 0 0 3px color-mix(in srgb, var(--magic-color, #2196F3) 22%, transparent);
}

.magic-scene-object[data-state="completed"],
.magic-scene-object[data-state="celebrating"] {
  opacity: 1 !important;
}

.magic-scene-object-aura {
  position: absolute;
  inset: -48%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--magic-color, #FF9800) 72%, transparent), transparent 62%);
  opacity: 0;
  transform: scale(0.65);
  z-index: -1;
}

.magic-scene-object.is-hit .magic-scene-object-aura,
.magic-scene-object.is-celebrating .magic-scene-object-aura {
  animation: magicAuraPulse 900ms ease both;
}

.magic-scene-object.is-pulse {
  animation: magicObjectPulse 560ms ease both;
}

.magic-scene-object.is-bounce {
  animation: magicObjectBounce 640ms cubic-bezier(.2,.9,.2,1.2) both;
}

.magic-scene-object.is-celebrating {
  animation: magicObjectCelebrate 1.4s ease-in-out infinite;
}

.magic-sparkle {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--spark-color, #FF9800);
  box-shadow: 0 0 16px 4px var(--spark-color, #FF9800);
  transform: translate(-50%, -50%);
  animation: magicSparkle 980ms ease-out forwards;
  z-index: 31;
}

.magic-sparkle--final {
  width: 18px;
  height: 18px;
  animation-duration: 1350ms;
}

.magic-sparkle--burst {
  width: 17px;
  height: 17px;
  animation-duration: 1120ms;
}

.magic-hit-ring {
  position: absolute;
  inset: -12px;
  border-radius: 16px;
  border: 5px solid color-mix(in srgb, var(--magic-color, #FF9800) 78%, white);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.magic-hit-plus {
  position: absolute;
  right: 10px;
  top: -14px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  min-width: 42px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff7ed;
  color: #ea580c;
  font-weight: 1000;
  font-size: 1.2rem;
  box-shadow: 0 10px 26px rgba(15,23,42,0.18), 0 0 0 3px rgba(255,152,0,0.22);
}

.magic-scene-object.is-hit .magic-hit-ring {
  animation: magicHitRing 760ms ease-out both;
}

.magic-scene-object.is-hit .magic-hit-plus {
  animation: magicHitPlus 840ms ease-out both;
}

.magic-neutral {
  animation: magicNeutralNudge 280ms ease both;
}

.magic-combo {
  animation: magicComboGlow 760ms ease both;
}

.magic-combo-toast {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 35;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  padding: 14px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff9800, #ffd54a);
  color: #422006;
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 56px);
  box-shadow: 0 24px 70px rgba(234,88,12,0.38), 0 0 0 5px rgba(255,255,255,0.55);
  pointer-events: none;
}

.magic-combo-toast.is-visible {
  animation: magicComboToast 1050ms ease both;
}

.magic-milestone-hit {
  animation: magicStageLift 900ms ease both;
}

.magic-completed {
  animation: magicCompletionGlow 2.6s ease-in-out infinite;
}

@keyframes magicCloudDrift {
  0% { transform: translateX(0); opacity: 0.28; }
  50% { opacity: 0.48; }
  100% { transform: translateX(calc(100vw + 180px)); opacity: 0.28; }
}

@keyframes magicAmbientGlow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.08); }
}

@keyframes magicAuraPulse {
  0% { opacity: 0; transform: scale(0.62); }
  38% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.28); }
}

@keyframes magicObjectPulse {
  0% { transform: translateY(0) scale(1); }
  44% { transform: translateY(-12px) scale(1.15); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes magicObjectBounce {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-20px) scale(1.15); }
  68% { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes magicObjectCelebrate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-1deg); }
  75% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes magicSparkle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(0.2);
  }
}

@keyframes magicHitRing {
  0% { opacity: 0; transform: scale(0.72); }
  22% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.42); }
}

@keyframes magicHitPlus {
  0% { opacity: 0; transform: translateY(8px) scale(0.8); }
  18%, 62% { opacity: 1; transform: translateY(-10px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-28px) scale(0.92); }
}

@keyframes magicNeutralNudge {
  0%, 100% { filter: saturate(1); }
  45% { filter: saturate(0.92) brightness(0.98); }
}

@keyframes magicComboGlow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: inset 0 0 110px rgba(255,213,74,0.58); }
}

@keyframes magicComboToast {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72) rotate(-3deg); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.94) rotate(2deg); }
}

@keyframes magicStageLift {
  0% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.55) brightness(1.18); }
  100% { filter: saturate(1.22) brightness(1.08); }
}

@keyframes magicMilestoneFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.94); }
  18%, 78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.98); }
}

@keyframes magicCompletionGlow {
  0%, 100% { filter: saturate(1.55) brightness(1.12); }
  50% { filter: saturate(2) brightness(1.24); }
}

@keyframes magicStageFloat {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -8px; }
}

@keyframes magicStageHitPulse {
  0% { transform: translate(-50%, -50%) scale(1); filter: saturate(1.05); }
  45% { transform: translate(-50%, -50%) scale(1.22); filter: saturate(1.45) brightness(1.14); }
  100% { transform: translate(-50%, -50%) scale(1); filter: saturate(1.12); }
}

@keyframes magicStageHitBounce {
  0% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, calc(-50% - 22px)) scale(1.16); }
  68% { transform: translate(-50%, calc(-50% + 4px)) scale(0.98); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes magicSpin {
  to { transform: rotate(360deg); }
}

@keyframes magicPendulum {
  0%, 100% { transform: rotate(-13deg); }
  50% { transform: rotate(13deg); }
}

@keyframes magicSeaSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(6deg); }
}

@keyframes magicTwinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

@keyframes magicFlame {
  0%, 100% { transform: scaleY(0.82); opacity: 0.85; }
  50% { transform: scaleY(1.16); opacity: 1; }
}

.scroll-panel {
  max-height: clamp(220px, 40vh, 460px);
  display: flex;
  overflow-y: auto;
  padding-right: 4px;
}

.scroll-panel::-webkit-scrollbar { width: 8px; }
.scroll-panel::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: clamp(240px, 55vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
}

.template-card {
  border-radius: calc(var(--radius) - 5px);
  border: 1px solid rgba(0,0,0,0.06);
  background: #fafafa;
  padding: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.template-card:hover {
  border-color: rgba(33,150,243,0.35);
  transform: translateY(-1px);
}

.template-card.active {
  border-color: rgba(76,175,80,0.5);
  background: rgba(76,175,80,0.08);
}

.template-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-meta .badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
}

.staff-preview {
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  overflow-x: auto;
}

.staff-canvas {
  min-height: 200px;
  min-width: 520px;
  padding: 8px;
}

.note-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.piano-wrap {
  padding: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 0;
}

.admin-ui .piano-wrap {
  margin-top: 60px;
  margin-bottom: 20px;
  justify-content: center;
  transform-origin: top center;
  transform: scale(1.0);
}

.piano {
  position: relative;
  --white-key-width: 28px;
  --black-key-width: 18px;
  --white-key-height: 160px;
  --black-key-height: 100px;
  --piano-height: 180px;
  height: var(--piano-height);
  min-width: 1456px;
  /* tabletop shadow effect */
  box-shadow: 0 28px 48px rgba(15,23,42,0.28);
  border-radius: 12px;
}

.piano::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -28px;
  width: 70%;
  height: 36px;
  background: radial-gradient(ellipse at center, rgba(15,23,42,0.22), rgba(15,23,42,0.08) 40%, transparent 70%);
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

.garden-training {
  position: relative;
  display: grid;
  gap: 14px;
}

.game-room {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 220px);
  display: grid;
  gap: 14px;
}

.game-core {
  display: grid;
  gap: 5px;
  align-items: start;
  justify-items: stretch;
  width: 100%;
  min-width: 0;
}

.game-slot section {
  display: none;
  width: min(1920px, 100%);
  min-height: 420px;
}

.note-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.note-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.note-option input {
  accent-color: var(--secondary-color);
}

.game-sheet-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  align-self: start;
  margin-top: 0;
  justify-self: stretch;
  width: 100%;
}

/* Garden runtime uses floating metronome controls, so sheet row should be single column. */
body[data-game-module="garden"] .game-sheet-row {
  grid-template-columns: minmax(0, 1fr);
}

/* Keep garden training stage as compact as magic scene so sheet/piano fit on screen. */
body[data-game-module="garden"] .game-slot,
body[data-game-module="garden"] .game-slot section {
  min-height: 387px !important;
  height: 387px !important;
}

/* Compact the notation area height in garden runtime. */
body[data-game-module="garden"] .garden-sheet {
  min-height: 150px;
  padding: 4px 0;
}

body[data-game-module="garden"] .garden-sheet > div {
  min-height: 150px;
}

.metronome-card {
  /* Integrated into the notes area: visually flush with sheet */
  background: transparent;
  border-radius: 6px;
  border: none;
  box-shadow: none;
  padding: 8px 6px;
  min-height: 0;
  display: grid;
  gap: 8px;
  justify-self: center;
}

.piano-controls-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 6px;
  width: 100%;
}

.magic-scene-floating-controls {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 42;
  pointer-events: auto;
}

.metronome-icon {
  width: 110px;
  height: 420px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, #fff7cc, #ffd166 55%, #f59e0b);
  border: 2px solid rgba(0,0,0,0.08);
  position: relative;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.65);
}

.metronome-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.1));
}

.metronome-dot {
  position: absolute;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 1;
}

.metronome-dot.left { left: 12px; background: #ffe29a; }
.metronome-dot.right { right: 12px; background: #ff7a00; }

.metronome-needle {
  position: absolute;
  width: 4px;
  height: 38px;
  background: #1f2933;
  border-radius: 4px;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) rotate(18deg);
  z-index: 1;
}

.metronome-label-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.metronome-btn {
  padding: 4px 8px;
  font-size: 0.78rem;
  display: inline-block;
  margin: 0 auto;
  min-width: 68px;
}

.rhythm-toggle-btn {
  color: #fff;
  border: 1px solid transparent;
}

.rhythm-toggle-btn.is-on {
  background: #2e7d32;
  border-color: #1b5e20;
}

.rhythm-toggle-btn.is-off {
  background: #c62828;
  border-color: #8e0000;
}

.rhythm-debug {
  display: none !important;
}

.metronome-card .garden-metronome-bpm {
  font-weight: 700;
  font-size: 0.9rem;
}

.magic-assign-display-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(33,150,243,0.16);
  border-radius: 12px;
  background: rgba(33,150,243,0.06);
}

.magic-display-help {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15,23,42,0.04);
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.35;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.notation-display {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  color: var(--primary-color);
}

.notation-staff {
  width: min(100%, 520px);
  overflow: hidden;
}

.notation-staff svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 112px;
}


.notation-staff-measured svg {
  max-height: 126px;
}

.notation-labels {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.notation-label {
  color: var(--note-color, #111827);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.08);
}

.notation-label.is-current {
  color: #fff;
  background: var(--note-color, var(--secondary-color));
  box-shadow: 0 0 0 3px rgba(33,150,243,0.16);
}

.notation-letter-only {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.4vw, 2.35rem);
  line-height: 1.05;
}

.garden-training-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-room .garden-training-header {
  justify-content: flex-end;
}

.garden-training-stage {
  position: relative;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #b3e5fc 0%, #e1f5fe 45%, #fff 100%);
  border: 1px solid rgba(0,0,0,0.06);
}

.game-info-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
  z-index: 2;
}

.game-info-title {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-heading);
}

.game-info-meta {
  font-size: 0.82rem;
  white-space: nowrap;
}

.garden-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.08);
}

.garden-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  transition: width 200ms ease;
}

.garden-target-card {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  border: 2px solid var(--primary-color);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  text-align: center;
}

.garden-target-note {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  line-height: 1;
}

  .garden-mascot {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 132px;
    transition: transform 180ms ease;
    text-shadow: 0 14px 20px rgba(0,0,0,0.25);
    z-index: 2;
  }

.garden-mascot.jump {
  animation: garden-jump 0.5s ease;
}

@keyframes garden-jump {
  50% { transform: translateX(-50%) translateY(-30px); }
}

  .garden-ground {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 22%;
    background: linear-gradient(180deg, #66bb6a, #43a047);
    border-top: 8px solid #81c784;
    overflow: visible;
    z-index: 1;
  }

body[data-game-module="magic_scene"] .garden-ground {
  display: none;
}

body[data-game-module="magic_scene"] .magic-scene-items-panel {
  display: none;
  padding: 10px 14px 12px;
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,250,240,0.92));
  border: 1px solid rgba(255,152,0,0.16);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15,23,42,0.12);
}

body[data-game-module="magic_scene"] .magic-scene-items-panel[hidden] {
  display: none;
}

body[data-game-module="magic_scene"] .magic-scene-items-title {
  margin-bottom: 8px;
  color: #274060;
  font-family: var(--font-heading);
  font-size: 0.96rem;
}

body[data-game-module="magic_scene"] .magic-scene-items-title::before {
  content: "✦";
  color: var(--primary-color);
  margin-right: 6px;
}

body[data-game-module="magic_scene"] .magic-scene-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin: 0;
}

body[data-game-module="magic_scene"] .magic-scene-object {
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,152,0,0.18);
  box-shadow: 0 8px 18px rgba(15,23,42,0.10);
  opacity: 1 !important;
}

body[data-game-module="magic_scene"] .magic-scene-object-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(33,150,243,0.16), rgba(255,152,0,0.18));
  color: var(--primary-color);
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

body[data-game-module="magic_scene"] .magic-scene-object-content {
  min-width: 0;
}

body[data-game-module="magic_scene"] .magic-scene-object-label {
  color: #274060;
  font-size: 0.82rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-game-module="magic_scene"] .magic-scene-object-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

body[data-game-module="magic_scene"] .magic-scene-object-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--secondary-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

body[data-game-module="magic_scene"] .magic-scene-object-progress {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
}

body[data-game-module="magic_scene"] .magic-scene-card-progress {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

body[data-game-module="magic_scene"] .magic-scene-card-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-color), #FFD54A);
  transition: width 180ms ease;
}

body[data-game-module="magic_scene"] .magic-scene-object.is-active {
  border-color: var(--primary-color);
  box-shadow: 0 12px 28px rgba(255,152,0,0.22), 0 0 0 3px rgba(255,152,0,0.12);
  transform: translateY(-2px);
}

body[data-game-module="magic_scene"] .magic-scene-object.is-complete {
  border-color: rgba(34,197,94,0.48);
  background: linear-gradient(180deg, rgba(240,253,244,0.98), rgba(255,255,255,0.96));
}

body[data-game-module="magic_scene"] .magic-scene-object.is-complete .magic-scene-card-progress span {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

body[data-game-module="magic_scene"] .garden-mascot {
  bottom: 18%;
}

  .garden-flower {
    position: absolute;
    bottom: 20%;
    left: 50%;
    width: var(--flower-size, 28px);
    height: var(--flower-size, 28px);
    user-select: none;
    --petal-a: hsl(var(--flower-hue, 12), 90%, 72%);
    --petal-b: hsl(var(--flower-hue2, 40), 92%, 64%);
    --petal-c: hsl(calc(var(--flower-hue2, 40) + 20), 85%, 56%);
    animation: garden-fly 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
  }

  .garden-flower::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
      radial-gradient(circle at 50% 12%, var(--petal-a) 0 42%, transparent 44%),
      radial-gradient(circle at 80% 30%, var(--petal-b) 0 40%, transparent 42%),
      radial-gradient(circle at 88% 66%, var(--petal-c) 0 38%, transparent 40%),
      radial-gradient(circle at 50% 90%, var(--petal-a) 0 42%, transparent 44%),
      radial-gradient(circle at 12% 66%, var(--petal-b) 0 38%, transparent 40%),
      radial-gradient(circle at 20% 30%, var(--petal-c) 0 40%, transparent 42%);
  }

  .garden-flower[data-variant="daisy"]::before {
    background:
      radial-gradient(circle at 50% 8%, #fffdf4 0 42%, transparent 44%),
      radial-gradient(circle at 78% 26%, #fff7e6 0 40%, transparent 42%),
      radial-gradient(circle at 90% 62%, #fffaf0 0 38%, transparent 40%),
      radial-gradient(circle at 50% 92%, #fffdf4 0 42%, transparent 44%),
      radial-gradient(circle at 12% 62%, #fff7e6 0 38%, transparent 40%),
      radial-gradient(circle at 22% 28%, #fffaf0 0 40%, transparent 42%);
  }

  .garden-flower[data-variant="sun"]::before {
    background:
      radial-gradient(circle at 50% 10%, #ffd54f 0 44%, transparent 46%),
      radial-gradient(circle at 84% 34%, #ffb74d 0 42%, transparent 44%),
      radial-gradient(circle at 92% 70%, #ff9800 0 40%, transparent 42%),
      radial-gradient(circle at 50% 94%, #ffd54f 0 44%, transparent 46%),
      radial-gradient(circle at 8% 70%, #ffb74d 0 40%, transparent 42%),
      radial-gradient(circle at 16% 34%, #ff9800 0 42%, transparent 44%);
  }

  .garden-flower[data-variant="tulip"]::before {
    background:
      radial-gradient(circle at 50% 10%, #ff8a80 0 38%, transparent 40%),
      radial-gradient(circle at 80% 28%, #ff5252 0 36%, transparent 38%),
      radial-gradient(circle at 50% 90%, #ff8a80 0 38%, transparent 40%),
      radial-gradient(circle at 20% 28%, #ff5252 0 36%, transparent 38%);
  }

  .garden-flower::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 55%;
    width: 6px;
    height: 26px;
    transform: translateX(-50%) rotate(-6deg);
    background:
      radial-gradient(circle at 10% 30%, hsl(var(--flower-leaf-hue, 120), 60%, 42%) 0 46%, transparent 48%),
      radial-gradient(circle at 90% 60%, hsl(var(--flower-leaf-hue, 120), 60%, 42%) 0 46%, transparent 48%),
      linear-gradient(180deg, #7bc96f 0%, #43a047 100%);
    background-size: 14px 10px, 14px 10px, 6px 26px;
    background-position: -6px 6px, -2px 14px, center bottom;
    background-repeat: no-repeat;
    border-radius: 999px;
    opacity: 0.9;
  }

  .garden-flower-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36%;
    height: 36%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff7c2 0 45%, hsl(calc(var(--flower-hue, 12) + 40), 90%, 55%) 70%);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
  }

  .garden-flower-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: calc(var(--flower-size, 28px) * 0.7);
    transform: translateY(-2px);
    pointer-events: none;
  }

  .garden-flower.settled {
    animation: none;
    transform: translateX(-50%) rotate(var(--flower-tilt, 0deg)) scale(var(--flower-scale, 1));
  }

  @keyframes garden-fly {
    0% {
      transform: translateX(-50%) rotate(var(--flower-tilt, 0deg)) scale(calc(var(--flower-scale, 1) * 0.6));
      opacity: 0.9;
    }
    60% {
      transform: translateX(var(--garden-x)) translateY(-40px) rotate(var(--flower-tilt, 0deg)) scale(calc(var(--flower-scale, 1) * 1.1));
    }
    100% {
      transform: translateX(var(--garden-x)) translateY(var(--garden-y)) rotate(var(--flower-tilt, 0deg)) scale(var(--flower-scale, 1));
      opacity: 1;
    }
  }

  .garden-sheet {
    padding: 8px 0;
    overflow-x: auto;
    min-height: 200px;
    width: 100%;
    justify-self: stretch;
    display: flex;
    justify-content: flex-start;
    scrollbar-gutter: stable both-edges;
  }

  .garden-sheet > div {
      min-height: 200px;
      min-width: 0;
      width: max-content;
      padding: 0 10px;
    }

.garden-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

  .garden-metronome {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: rgba(255,255,255,0.85);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  }

.garden-metronome-label {
  font-weight: 700;
  color: var(--text-dark);
}

.garden-metronome-bpm {
  font-weight: 700;
  color: var(--text-dark);
}

  .garden-metronome-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
  }

.garden-metronome-pulse.is-active {
  background: var(--primary-color);
  animation: pulse 0.25s ease;
}

  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
  }

  .garden-metronome-visual {
    position: relative;
    width: 96px;
    height: 128px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 55%, #f59e0b 100%);
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.6), 0 10px 20px rgba(0,0,0,0.12);
    display: grid;
    place-items: center;
    overflow: hidden;
  }

  .garden-metronome-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0));
    opacity: 0.6;
  }

  .garden-metronome-visual .metronome-arm {
    position: absolute;
    bottom: 18px;
    width: 4px;
    height: 68px;
    border-radius: 999px;
    background: #2f2f2f;
    transform-origin: bottom center;
    transition: transform 120ms ease;
  }

  .garden-metronome-visual .metronome-knob {
    position: absolute;
    bottom: 78px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1f2937;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3), 0 6px 12px rgba(0,0,0,0.2);
  }

  .garden-metronome-visual .metronome-light {
    position: absolute;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
  }

  .garden-metronome-visual .metronome-light.left {
    left: 14px;
  }

  .garden-metronome-visual .metronome-light.right {
    right: 14px;
  }

  .garden-metronome-visual[data-side="left"] .metronome-arm {
    transform: rotate(-18deg);
  }

  .garden-metronome-visual[data-side="right"] .metronome-arm {
    transform: rotate(18deg);
  }

  .garden-metronome-visual[data-side="left"] .metronome-light.left,
  .garden-metronome-visual[data-side="right"] .metronome-light.right {
    background: #f97316;
    box-shadow: 0 0 8px rgba(249,115,22,0.6);
    transform: scale(1.2);
  }

  .garden-metronome-visual.is-tick {
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.6), 0 0 0 3px rgba(255,152,0,0.15), 0 10px 20px rgba(0,0,0,0.12);
  }

.garden-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 32, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5;
}

.garden-overlay-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 26px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(0,0,0,0.2);
}

.garden-overlay-card h2 {
  font-family: var(--font-heading);
  margin: 0 0 8px;
}

.piano-key.hit {
  transform: translateY(2px);
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.12);
}

.piano-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.piano-filters-title {
  font-weight: 700;
  color: var(--text-dark);
}

.piano-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
}

.piano-filter-option input {
  accent-color: var(--secondary-color);
}

.piano-white {
  display: inline-flex;
  align-items: flex-end;
  height: var(--white-key-height);
  position: relative;
  z-index: 1;
}

.piano-key {
  position: relative;
  cursor: pointer;
  padding: 0;
  border: 1px solid rgba(0,0,0,0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  background: #fff;
}

.piano-key.white {
  width: var(--white-key-width);
  height: var(--white-key-height);
  border-bottom-width: 4px;
  border-radius: 0 0 10px 10px;
  margin-right: -1px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.2);
}

.piano-key.black {
  position: absolute;
  top: 0;
  width: var(--black-key-width);
  height: var(--black-key-height);
  border-radius: 0 0 6px 6px;
  border-color: rgba(0,0,0,0.6);
  background: #000000;
  z-index: 2;
  color: #fff;
}

.piano-key span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: rgba(0,0,0,0.65);
  pointer-events: none;
}

.piano-key.black span {
  color: rgba(255,255,255,0.9);
  bottom: 6px;
  font-size: 0.65rem;
}

.piano-key.white span {
  color: #222;
}

.piano-key:active {
  transform: translateY(2px);
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.12);
}

.piano-key.white:active {
  filter: brightness(0.98);
}

.piano-key.black:active {
  filter: brightness(1.1);
}

.note-key {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: #607d8b;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.note-key:active { transform: scale(0.97); }

.note-key[data-note^="C"] { background: #F44336; }
.note-key[data-note^="D"] { background: #FF9800; }
.note-key[data-note^="E"] { background: #4CAF50; }
.note-key[data-note^="F"] { background: #2196F3; }
.note-key[data-note^="G"] { background: #9C27B0; }
.note-key[data-note^="A"] { background: #607D8B; }
.note-key[data-note^="B"] { background: #795548; }

.assign-panel {
  border-top: 1px dashed rgba(0,0,0,0.1);
  padding-top: 14px;
}

.upload-box {
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.02);
  cursor: pointer;
  min-height: 110px;
}

.upload-text {
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}

.upload-preview {
  max-height: 220px;
  max-width: 100%;
  display: none;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.note-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
}

.note-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sequence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.04);
}

.sequence-chip .chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2196f3;
}

.note-block {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.note-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-header {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.6fr auto;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(51,51,51,0.7);
}

.note-grid {
  display: grid;
  gap: 8px;
}

.note-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.6fr auto;
  gap: 10px;
  align-items: center;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(33,150,243,0.3);
  background: rgba(33,150,243,0.08);
  font-weight: 700;
  font-size: 0.85rem;
}

.note-sub {
  font-weight: 600;
  opacity: 0.7;
}

.preview-stack {
  display: grid;
  gap: 12px;
}

.preview-card {
  border-radius: calc(var(--radius) - 4px);
  border: 1px dashed rgba(0,0,0,0.15);
  background: #f8fafc;
  padding: 12px;
}

.preview-title {
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.preview-subtitle {
  font-weight: 800;
  margin-bottom: 6px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-item {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  display: none;
  max-width: min(520px, calc(100vw - 48px));
}

@media (max-width: 920px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-form { border-top-left-radius: 0; border-top-right-radius: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; border-radius: 0; }
  .top-nav-bar { align-items: flex-start; }
  .top-nav-actions { margin-left: 0; width: 100%; }
  .game-room { min-height: auto; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .note-header { display: none; }
  .note-row { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  body.fixed-sidebar .app-shell { grid-template-columns: 260px 1fr; }
  body.fixed-sidebar .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

/* Admin-style panels (more formal, less playful) */
body.admin-ui {
  --font-heading: 'Roboto', sans-serif;
  background: #f5f6f8;
}

body.admin-ui .page-title {
  font-family: var(--font-body);
  font-size: 1.4rem;
  letter-spacing: 0.2px;
}

body.admin-ui h2 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 0;
}

body.admin-ui .stat-value {
  font-family: var(--font-body);
  font-size: 1.45rem;
}

body.admin-ui .tag {
  font-weight: 600;
  letter-spacing: 0.2px;
  background: rgba(0,0,0,0.06);
}

body.admin-ui .btn {
  padding: 10px 12px;
}

body.admin-ui table th {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0.2px;
}

.supergamur-game {
  position: relative;
  display: none;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  color: var(--text-dark);
  height: 400px;
  padding: 0;
  margin: 0;
  border: none;
}

body[data-game-module="supergamur"] .supergamur-game {
  display: flex;
}

body[data-game-module="supergamur"] .game-area,
body[data-game-module="supergamur"] .game-slot,
body[data-game-module="supergamur"] .game-slot section {
  min-height: 400px !important;
  height: 400px !important;
}

body[data-game-module="garden"] .game-area,
body[data-game-module="garden"] .game-slot,
body[data-game-module="garden"] .game-slot section,
body[data-game-module="practice"] .game-area,
body[data-game-module="practice"] .game-slot,
body[data-game-module="practice"] .game-slot section,
body[data-game-module="runner"] .game-area,
body[data-game-module="runner"] .game-slot,
body[data-game-module="runner"] .game-slot section,
body[data-game-module="magic_scene"] .game-area,
body[data-game-module="magic_scene"] .game-slot,
body[data-game-module="magic_scene"] .game-slot section {
    min-height: 480px !important;
    height: 480px !important;
  }

body[data-game-module="magic_scene"] .game-slot .garden-stage {
  display: flex !important;
}

body[data-game-module="magic_scene"] .game-slot .supergamur-game {
  display: none !important;
}

body[data-game-module="magic_scene"] .game-room-main {
  grid-template-rows: auto auto;
  gap: 0;
}

body[data-game-module="magic_scene"] .game-core {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 0;
}

body[data-game-module="magic_scene"] .game-sheet-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

body[data-game-module="magic_scene"] .metronome-card {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  justify-self: start;
  align-self: start;
  padding: 8px 10px;
  margin-top: 0;
  z-index: 26;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(243,248,255,0.92));
  box-shadow: 0 10px 24px rgba(15,23,42,0.18);
}

body[data-game-module="magic_scene"] .piano-controls-row {
  justify-content: flex-start;
  align-items: center;
}

body[data-game-module="magic_scene"] .game-core {
  align-content: start;
}

body[data-game-module="magic_scene"] .garden-metronome-visual {
  width: 64px;
  height: 86px;
  border-radius: 11px;
}

body[data-game-module="magic_scene"] .garden-metronome-visual .metronome-arm {
  bottom: 12px;
  width: 3px;
  height: 46px;
}

body[data-game-module="magic_scene"] .garden-metronome-visual .metronome-knob {
  bottom: 52px;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35), 0 3px 7px rgba(0,0,0,0.18);
}

body[data-game-module="magic_scene"] .garden-metronome-visual .metronome-light {
  top: 7px;
  width: 7px;
  height: 7px;
}

body[data-game-module="magic_scene"] .garden-metronome-visual .metronome-light.left {
  left: 9px;
}

body[data-game-module="magic_scene"] .garden-metronome-visual .metronome-light.right {
  right: 9px;
}

body[data-game-module="magic_scene"] .garden-sheet {
  display: flex;
  width: 100%;
  justify-content: center;
}

body[data-game-module="magic_scene"] .game-sheet-row .garden-sheet {
  display: none !important;
}

body[data-game-module="magic_scene"] .piano-wrap {
  justify-self: center;
  width: 100%;
  margin-top: -4px;
  transform-origin: top center;
}

body[data-game-module="magic_scene"] .game-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0 !important;
  height: auto !important;
}

body[data-game-module="magic_scene"] .game-slot,
body[data-game-module="magic_scene"] .game-slot section {
  min-height: 387px !important;
  height: 387px !important;
}

body[data-game-module="magic_scene"] .garden-training-stage {
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(15,23,42,0.12);
  overflow: hidden;
}

body[data-game-module="magic_scene"] .game-info-pill {
  min-width: 250px;
  padding: 10px 14px 10px 58px;
  border-radius: 18px;
}

body[data-game-module="magic_scene"] .game-info-pill::before {
  content: "☾";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 14px;
  color: #fff;
  font-size: 1.35rem;
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32), 0 8px 20px rgba(15,23,42,0.18);
}

body[data-game-module="magic_scene"] .game-info-title {
  font-size: 1.05rem;
}

body[data-game-module="magic_scene"] .garden-target-card {
  display: none !important;
}

body[data-game-module="magic_scene"] .garden-target-card.magic-assignment-target-card {
  display: block !important;
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  z-index: 20;
  margin: 0 auto;
  width: calc(100% - 24px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-game-module="magic_scene"] .garden-target-note {
  color: var(--primary-color);
  font-size: 1rem;
  white-space: normal;
  min-height: 0;
  display: grid;
  align-items: center;
  gap: 2px;
}

body[data-game-module="magic_scene"] .garden-target-card .muted {
  display: none;
}

body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display {
  display: grid !important;
  width: 100%;
}

body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff {
  width: min(100%, 1980px);
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff svg {
  width: auto !important;
  max-width: none;
  height: auto !important;
  max-height: none;
}

body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff-measured svg {
  width: auto !important;
  max-width: none;
  height: auto !important;
  max-height: none;
}

body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff-grand svg {
  height: auto !important;
}

body[data-game-module="magic_scene"] .garden-target-note .notation-labels {
  display: none;
}

body[data-game-module="magic_scene"] .game-sheet-row .garden-sheet {
  visibility: hidden;
}

body[data-game-module="magic_scene"] .magic-target-sequence-notation {
  width: min(100%, 520px);
  margin-top: 0;
}

body[data-game-module="magic_scene"] .magic-target-sequence-notation .notation-staff {
  width: 100%;
}

body[data-game-module="magic_scene"] .magic-target-sequence-notation .notation-staff svg {
  max-height: 42px;
}

body[data-game-module="magic_scene"] .magic-target-sequence-notation .notation-labels {
  font-size: 0.64rem;
  gap: 3px;
}

body[data-game-module="magic_scene"] .magic-target-sequence-notation .notation-label {
  padding: 2px 5px;
}

body[data-game-module="magic_scene"] .magic-target-current {
  display: block;
  color: var(--primary-color);
}

body[data-game-module="magic_scene"] .magic-target-sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 2px;
  color: #64748b;
  font-family: var(--font-body);
  font-size: clamp(0.72rem, 1.1vw, 0.94rem);
  font-weight: 900;
  line-height: 1.1;
}

body[data-game-module="magic_scene"] .magic-target-sequence span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15,23,42,0.07);
}

body[data-game-module="magic_scene"] .magic-target-sequence span.is-current {
  color: #fff;
  background: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.16);
}

body[data-game-module="magic_scene"] .magic-target-sequence b {
  color: #94a3b8;
  font-weight: 900;
}

body[data-game-module="magic_scene"] .assignment-area {
  border-radius: 0;
  margin-top: 0;
  padding-top: 0;
}

body[data-game-module="rhythm"] .game-room-main {
  grid-template-rows: auto;
  gap: 0;
}

body[data-game-module="rhythm"] .game-area {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}

body[data-game-module="rhythm"] .game-slot,
body[data-game-module="rhythm"] .game-slot section {
  min-height: 0 !important;
  height: auto !important;
}

body[data-game-module="rhythm"] .game-slot .garden-stage,
body[data-game-module="rhythm"] .game-slot .supergamur-game {
  display: none !important;
}

.magic-equalizer-stage {
  background: #020617 !important;
}

.magic-equalizer-bg {
  position: absolute;
  inset: 0;
  z-index: 6;
  background:
    radial-gradient(circle at 22% 28%, rgba(0, 255, 213, 0.05), transparent 45%),
    radial-gradient(circle at 78% 62%, rgba(0, 60, 255, 0.08), transparent 45%),
    black;
}

.magic-equalizer-shell {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.magic-equalizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.magic-equalizer-combo {
  position: absolute;
  right: 24px;
  top: 18px;
  color: #fff;
  font-weight: 900;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(-6px);
  text-shadow: 0 0 12px rgba(0, 255, 213, 0.8);
  pointer-events: none;
}

.magic-equalizer-combo.is-visible {
  animation: equalizerCombo 900ms ease;
}

.magic-equalizer-shell.is-wrong {
  animation: equalizerWrong 190ms ease;
}

.magic-equalizer-shell.is-complete {
  animation: equalizerComplete 900ms ease both;
}

@keyframes equalizerWrong {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(-52%, -50%); }
  75% { transform: translate(-48%, -50%); }
}

@keyframes equalizerCombo {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  20% { opacity: 1; transform: translateY(-10px) scale(1.2); }
  80% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-20px) scale(1); }
}

@keyframes equalizerComplete {
  0% { box-shadow: 0 0 40px rgba(0,0,0,0.8); }
  50% { box-shadow: 0 0 60px rgba(0, 255, 213, 0.4), 0 0 100px rgba(0, 60, 255, 0.3); }
  100% { box-shadow: 0 0 40px rgba(0,0,0,0.8); }
}

@media (max-width: 1100px) {
  body[data-game-module="magic_scene"] .garden-target-card.magic-assignment-target-card {
    margin-top: 6px;
    width: calc(100% - 16px);
    max-width: none;
  }

  body[data-game-module="magic_scene"] .game-info-pill {
    min-width: 0;
    max-width: calc(100% - 24px);
  }
}

@media (max-width: 760px) {
  body[data-game-module="magic_scene"] .game-slot,
  body[data-game-module="magic_scene"] .game-slot section {
    min-height: 360px !important;
    height: 360px !important;
  }

  body[data-game-module="magic_scene"] .garden-target-note {
    min-height: 0;
    white-space: normal;
  }

  body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note {
    min-height: 0;
  }

  body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff svg {
    height: auto !important;
    max-height: none;
  }

  body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff-measured svg {
    height: auto !important;
    max-height: none;
  }

  body[data-game-module="magic_scene"] .magic-assignment-target-card .garden-target-note.notation-display .notation-staff-grand svg {
    height: auto !important;
  }

  body[data-game-module="magic_scene"] .magic-target-sequence-notation .notation-staff svg {
    max-height: 38px;
  }
}

#game-container {
  position: relative;
  width: 100%;
  height: 400px;
  background-color: #5c94fc;
  overflow: hidden;
  border-radius: 12px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 400px;
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  font-size: 20px;
  text-shadow: 2px 2px #000;
  pointer-events: none;
  display: flex;
  gap: 20px;
  z-index: 5;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 10;
}

.overlay h1 {
  font-family: var(--font-heading);
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}


.supergamur-character,
.supergamur-obstacle {
  filter: drop-shadow(0 12px 14px rgba(15,23,42,0.35));
}

.supergamur-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supergamur-scoreboard {
  display: flex;
  gap: 18px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.supergamur-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 2;
}

.supergamur-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.supergamur-overlay-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  width: min(360px, 90vw);
  box-shadow: 0 25px 50px rgba(15,23,42,0.25);
}

.supergamur-overlay-card h2 {
  margin-bottom: 10px;
  font-family: var(--font-heading);
}

.supergamur-overlay-card p {
  color: rgba(33,33,33,0.75);
  margin-bottom: 18px;
}

.supergamur-overlay-card .btn {
  min-width: 140px;
}

.supergamur-placeholder {
  font-size: 0.95rem;
  color: rgba(33,33,33,0.75);
}

.supergamur-character {
  background-image: url("../images/supergamur/sabit.png");
}

.supergamur-obstacle--engel1 { background-image: url("../images/supergamur/engel1.png"); }
.supergamur-obstacle--engel2 { background-image: url("../images/supergamur/engel2.png"); }
.supergamur-obstacle--engel3 { background-image: url("../images/supergamur/engel3.png"); }
.supergamur-obstacle--duvar { background-image: url("../images/supergamur/duvar.png"); }
.supergamur-obstacle--duvar2 { background-image: url("../images/supergamur/duvar2.png"); }

/* Shared sidebar collapse by brand click */
body.sidebar-collapsed-by-brand .app-shell {
  grid-template-columns: 76px 1fr;
}

body.sidebar-collapsed-by-brand .sidebar {
  padding: 14px 10px;
}

body.sidebar-collapsed-by-brand .sidebar .nav,
body.sidebar-collapsed-by-brand .sidebar .sidebar-footer {
  display: none;
}

body.sidebar-collapsed-by-brand .sidebar .brand {
  justify-content: center;
  margin-bottom: 0;
}

body.sidebar-collapsed-by-brand .sidebar .brand-title {
  display: none;
}

/* Student Sidebar - Reference Style */
body.student-home-body.sidebar-collapsed-by-brand .student-sidebar {
  width: auto;
  left: auto;
}

body.student-home-body.sidebar-collapsed-by-brand .student-sidebar .student-nav,
body.student-home-body.sidebar-collapsed-by-brand .student-sidebar .student-side-footer,
body.student-home-body.sidebar-collapsed-by-brand .student-sidebar .student-side-profile-card,
body.student-home-body.sidebar-collapsed-by-brand .student-sidebar .student-side-illustration {
  display: block;
}

body.student-home-body.sidebar-collapsed-by-brand .student-sidebar .student-brand {
  justify-content: center;
}

.student-home-shell {
  grid-template-columns: 350px 1fr;
}

.student-home-body {
  background:
    radial-gradient(circle at 10% 8%, rgba(0, 161, 255, 0.18), transparent 34%),
    radial-gradient(circle at 88% 2%, rgba(126, 87, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #020b2d 0%, #02114a 42%, #021035 100%);
}

.student-home-shell .student-sidebar {
  min-height: calc(100vh - 16px);
  margin: 8px;
  border-radius: 28px;
  border: 1px solid rgba(0, 140, 255, 0.3);
  background: linear-gradient(180deg, #020c3f 0%, #031f68 45%, #02103c 100%);
  box-shadow: inset 0 0 0 1px rgba(88, 165, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 18px 16px;
  gap: 14px;
}

.student-brand {
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: auto;
}

.student-brand-logo {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.student-side-profile-card {
  background: linear-gradient(180deg, rgba(9, 27, 95, 0.9), rgba(5, 20, 72, 0.88));
  border: 1px solid rgba(100, 171, 255, 0.22);
  border-radius: 24px;
  padding: 10px;
  gap: 8px;
}

.student-side-profile-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.student-side-avatar {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(34, 193, 255, 0.85);
  box-shadow: 0 0 20px rgba(44, 170, 255, 0.45);
}

.student-side-greet {
  display: grid;
  gap: 2px;
  color: #fff;
}

.student-side-greet small {
  color: rgba(210, 230, 255, 0.9);
  font-size: 0.95rem;
}

.student-side-greet strong {
  font-size: 1.55rem;
  line-height: 1;
}

.student-level-pill {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  color: #f5ffb0;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(205, 255, 90, 0.22);
}

.student-xp-wrap {
  display: grid;
  gap: 6px;
}

.student-xp-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 50, 120, 0.85);
}

.student-xp-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00b0ff, #2ad4ff);
  box-shadow: 0 0 12px rgba(42, 212, 255, 0.6);
}

.student-xp-text {
  color: #d2e8ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.student-side-menu {
  gap: 8px;
}

.student-menu-item {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(88, 150, 255, 0.22);
  background: linear-gradient(90deg, rgba(10, 36, 105, 0.88), rgba(9, 31, 92, 0.95));
  color: #f7fbff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.student-menu-item .menu-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.student-menu-item .menu-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.icon-home { color: #fff; }
.icon-video, .icon-badge { color: #ffc400; }
.icon-notes { color: #3297ff; }
.icon-task { color: #00d4ff; }
.icon-discover { color: #9a6bff; }

.student-menu-item .menu-label {
  flex: 1;
}

.student-menu-item .menu-arrow {
  font-size: 1.5rem;
  color: rgba(214, 230, 255, 0.72);
  line-height: 1;
}

.student-menu-item.active,
.student-menu-item:hover {
  border-color: rgba(45, 187, 255, 0.75);
  background: linear-gradient(90deg, #1f3cbf, #0f65d6);
  box-shadow: 0 0 0 1px rgba(73, 193, 255, 0.35), 0 0 28px rgba(14, 138, 255, 0.4);
}

.student-side-illustration {
  margin-top: 2px;
}

.student-side-illustration img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.student-side-footer {
  margin-top: auto;
}

.student-logout-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255, 95, 95, 0.45);
  background: linear-gradient(90deg, #8f1111, #d42020);
  color: #fff4f4;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.student-logout-btn .icon-logout {
  color: #ffd6d6;
  width: 24px;
  height: 24px;
}

@media (max-width: 1280px) {
  .student-home-shell { grid-template-columns: 300px 1fr; }
  .student-menu-item { min-height: 62px; font-size: 1.15rem; }
  .student-side-greet strong { font-size: 1.7rem; }
  .student-logout-btn { min-height: 62px; font-size: 1.45rem; }
}

@media (max-width: 920px) {
  .student-sidebar {
    width: 320px;
    left: -340px;
    margin: 0;
    border-radius: 0 26px 26px 0;
    min-height: 100vh;
  }
}

/* Student Home Refresh */
.student-home-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(33,150,243,0.15), transparent 35%),
    radial-gradient(circle at 88% 10%, rgba(255,152,0,0.15), transparent 28%),
    linear-gradient(180deg, #f4f7f6, #eef4ff 48%, #f7fbff);
}

.student-home-shell .student-sidebar {
  background: linear-gradient(180deg, #11243b 0%, #1c3553 60%, #1a2f46 100%);
}

.student-profile-mini {
  display: grid;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 12px;
  font-size: 0.9rem;
}

.student-profile-mini span { opacity: 0.9; }

.student-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  background: rgba(255,255,255,0.05);
}

.student-nav a.active,
.student-nav a:hover {
  background: rgba(33,150,243,0.22);
  border-color: rgba(126, 203, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(126,203,255,0.25), 0 0 22px rgba(33,150,243,0.22);
}

.student-home-main {
  display: grid;
  gap: 16px;
}

.student-mobile-top {
  display: none;
  justify-content: space-between;
  gap: 10px;
}

.student-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(17,36,59,0.98), rgba(16,77,130,0.88)),
    radial-gradient(circle at 16% 18%, rgba(255,255,255,0.15), transparent 28%);
  border: 1px solid rgba(255,255,255,0.2);
}

.student-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
}

.student-hero p {
  margin: 0;
  max-width: 54ch;
  opacity: 0.95;
}

.student-hero-stats {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-pill {
  display: grid;
  gap: 2px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
  min-width: 110px;
}

.hero-pill span { font-size: 0.78rem; opacity: 0.9; }
.hero-pill strong { font-size: 1.08rem; }

.hero-art {
  position: absolute;
  right: 18px;
  top: 10px;
  display: flex;
  gap: 12px;
  font-size: 1.8rem;
  opacity: 0.3;
}

.category-wrap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-chip {
  border: 0;
  border-radius: 16px;
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  color: #11243b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(17,36,59,0.08);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.category-chip:nth-child(1) { background: linear-gradient(135deg, #e3f2fd, #ffffff); }
.category-chip:nth-child(2) { background: linear-gradient(135deg, #fff3e0, #ffffff); }
.category-chip:nth-child(3) { background: linear-gradient(135deg, #e8f5e9, #ffffff); }
.category-chip:nth-child(4) { background: linear-gradient(135deg, #ede7f6, #ffffff); }
.category-chip:nth-child(5) { background: linear-gradient(135deg, #fffde7, #ffffff); }
.category-chip:nth-child(6), .category-chip:nth-child(7) { background: linear-gradient(135deg, #e0f7fa, #ffffff); }

.category-chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e88e5;
}

.category-chip:hover,
.category-chip.active {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17,36,59,0.12);
}

.student-task-panel h2,
.student-video-section h2,
.student-video-detail h2,
#profileCard h2,
#motivation h2 {
  margin: 0 0 10px;
}

.student-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.video-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(17,36,59,0.1);
  transition: transform 150ms ease;
}

.video-card:hover { transform: translateY(-4px); }

.video-thumb {
  border: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.2), transparent 35%),
    linear-gradient(130deg, #1e3d5b, #2b78c2);
}

.play-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #1e3d5b;
  font-size: 1.5rem;
  padding-left: 4px;
}

.video-body { padding: 12px; }
.video-body h3 { margin: 0 0 8px; font-size: 1.02rem; }
.video-body p { margin: 0 0 10px; color: rgba(0,0,0,0.67); font-size: 0.92rem; }
.video-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.fav-btn {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(17,36,59,0.08);
}

.fav-btn.active {
  background: #ffd54f;
}

.video-player-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  margin-bottom: 12px;
}

.video-player-wrap video {
  width: 100%;
  max-height: 420px;
  display: block;
}

.video-fallback {
  padding: 12px;
  color: #fff;
  background: #1e293b;
}

@media (max-width: 1080px) {
  .category-wrap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .student-video-grid {
    grid-template-columns: 1fr;
  }

  .app-shell.student-home-shell {
    grid-template-columns: 1fr;
  }

  .student-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 260px;
    z-index: 20;
    transition: left 160ms ease;
  }

  body.student-sidebar-open .student-sidebar {
    left: 0;
  }

  .student-mobile-top {
    display: flex;
  }
}

@media (max-width: 640px) {
  .category-wrap {
    grid-template-columns: 1fr 1fr;
  }
}

/* Student Home Compact Tuning (reference-aligned proportions) */
.student-home-shell { grid-template-columns: 236px 1fr; }
.student-sidebar { gap: 14px; padding: 16px 14px; }
.student-sidebar .brand { min-height: 52px; }
.student-home-main { gap: 12px; padding: 14px; }
.student-profile-mini { padding: 10px; border-radius: 12px; font-size: 0.85rem; }
.student-nav a { min-height: 38px; padding: 8px 10px; font-size: 0.96rem; }
.student-hero { border-radius: 18px; padding: 18px 20px; min-height: 216px; }
.student-hero h1 { font-size: clamp(1.18rem, 1.9vw, 1.85rem); margin-bottom: 8px; }
.student-hero p { font-size: 1rem; max-width: 50ch; }
.student-hero-stats { margin-top: 12px; }
.hero-pill { min-width: 96px; padding: 7px 11px; }
.hero-art { font-size: 1.45rem; gap: 9px; }
.category-wrap { gap: 8px; }
.category-chip { min-height: 46px; border-radius: 14px; padding: 8px 10px; font-size: 0.95rem; }
.student-task-panel, .student-video-section, .student-video-detail, #profileCard, #motivation { border-radius: 16px; }
.student-task-panel { padding: 14px; }
.student-video-section { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 18px; box-shadow: 0 12px 30px rgba(17,36,59,0.08); padding: 14px; }
.student-video-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.video-card { border-radius: 14px; box-shadow: 0 8px 20px rgba(17,36,59,0.1); }
.video-thumb { aspect-ratio: 16 / 9.2; }
.play-icon { width: 46px; height: 46px; font-size: 1.12rem; }
.video-body { padding: 9px 10px 10px; }
.video-body h3 { font-size: 0.92rem; line-height: 1.2; margin-bottom: 6px; }
.video-body p { font-size: 0.82rem; margin-bottom: 8px; }
.video-meta .tag { padding: 4px 8px; font-size: 0.74rem; }
.fav-btn { width: 24px; height: 24px; font-size: 0.8rem; }
.student-video-detail { padding: 14px; }
.video-player-wrap video { }
#motivation p { margin: 0 0 10px; }

@media (max-width: 1400px) { .student-video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1220px) { .student-video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 920px) {
  .student-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell.student-home-shell { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .student-video-grid { grid-template-columns: 1fr; } }

/* Student Sidebar Compact Final (applies to all student pages) */
body.student-home-body .app-shell.student-home-shell {
  grid-template-columns: 296px 1fr !important;
}

body.student-home-body .student-sidebar {
  padding: 10px !important;
  gap: 8px !important;
}

body.student-home-body .student-brand-logo {
  max-width: 232px !important;
}

body.student-home-body .student-side-profile-card {
  padding: 8px !important;
  border-radius: 12px !important;
}

body.student-home-body .student-side-avatar {
  width: 64px !important;
  height: 64px !important;
}

body.student-home-body .student-side-greet strong {
  font-size: 1.05rem !important;
}

body.student-home-body .student-side-greet small {
  font-size: 0.72rem !important;
}

body.student-home-body .student-level-pill {
  font-size: 0.72rem !important;
  padding: 4px 8px !important;
}

body.student-home-body .student-xp-bar {
  height: 12px !important;
}

body.student-home-body .student-xp-text {
  font-size: 0.72rem !important;
}

body.student-home-body .student-side-menu {
  gap: 7px !important;
}

body.student-home-body .student-menu-item {
  min-height: 44px !important;
  border-radius: 11px !important;
  padding: 6px 9px !important;
  font-size: 0.8rem !important;
  gap: 7px !important;
}

body.student-home-body .student-menu-item .menu-icon {
  width: 20px !important;
  height: 20px !important;
}

body.student-home-body .student-menu-item .menu-arrow {
  font-size: 1.25rem !important;
}

body.student-home-body .student-side-illustration img {
  max-height: 190px !important;
  object-fit: contain !important;
}

body.student-home-body .student-logout-btn {
  min-height: 36px !important;
  border-radius: 10px !important;
  font-size: 0.58rem !important;
  padding: 4px 7px !important;
  gap: 5px !important;
}

body.student-home-body .student-logout-btn .icon-logout {
  width: 12px !important;
  height: 12px !important;
}

@media (max-width: 920px) {
  body.student-home-body .app-shell.student-home-shell {
    grid-template-columns: 1fr !important;
  }

  body.student-home-body .student-sidebar {
    width: 296px !important;
    left: -312px !important;
    min-height: 100vh !important;
  }
}

/* Student Task + Category Final Alignment */
.student-task-panel {
  padding: 10px !important;
}

.student-task-panel h2 {
  margin-bottom: 8px !important;
}

.student-task-row {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}

.student-task-link {
  display: block;
  text-decoration: none;
  font-weight: 800;
  color: #1f2937;
  font-size: 0.95rem;
  line-height: 1.2;
}

.category-wrap {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(17,36,59,0.08);
}

.category-chip {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.24) !important;
  min-height: 40px !important;
  border-radius: 14px !important;
  padding: 5px 9px !important;
  justify-content: center;
  gap: 9px;
}

.category-chip:nth-child(1) { background: linear-gradient(135deg, #ff6b2c, #ff7f3f) !important; }
.category-chip:nth-child(2) { background: linear-gradient(135deg, #f6b11a, #f4bf38) !important; }
.category-chip:nth-child(3) { background: linear-gradient(135deg, #73bf2d, #8acc42) !important; }
.category-chip:nth-child(4) { background: linear-gradient(135deg, #37b590, #4ec29f) !important; }
.category-chip:nth-child(5) { background: linear-gradient(135deg, #2f87ea, #4a97ee) !important; }
.category-chip:nth-child(6) { background: linear-gradient(135deg, #5e67d8, #787de4) !important; }

.category-chip .cat-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.category-chip:hover,
.category-chip.active {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(17,36,59,0.2) !important;
}

/* Category Button Width Tune */
.category-wrap {
  justify-content: space-between;
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  flex: 0 0 154px;
  min-width: 154px;
  max-width: 170px;
  min-height: 38px !important;
  padding: 4px 9px !important;
  border-radius: 13px !important;
  font-size: 0.88rem;
}

.category-chip .cat-icon {
  width: 21px;
  height: 21px;
  font-size: 0.86rem;
}

.video-thumb {
  background-size: cover !important;
  background-position: center;
  background-repeat: no-repeat;
}

.video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,21,36,0.04) 35%, rgba(7,21,36,0.3));
}

.video-thumb {
  position: relative;
}

.video-thumb .play-icon {
  position: relative;
  z-index: 1;
}

@media (max-width: 1220px) {
  .category-chip {
    flex: 1 1 calc(33.333% - 8px);
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 740px) {
  .category-chip {
    flex: 1 1 calc(50% - 8px);
  }
}

/* Hero + Category seamless blend (remove white strip, fade under buttons) */
body.student-home-body .student-home-main > .student-hero.hero-with-banner {
  position: relative;
  overflow: visible;
  margin-bottom: -8px;
  z-index: 1;
}

body.student-home-body .student-home-main > .student-hero.hero-with-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -210px;
  height: 300px;
  border-radius: 0 0 22px 22px;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(2, 11, 45, 0) 0%, rgba(2, 11, 45, 0.08) 30%, rgba(2, 11, 45, 0.22) 55%, rgba(2, 11, 45, 0.44) 100%),
    url('/assets/images/student/home/hero-world-music.png');
  background-size: cover, cover;
  background-position: center top, center top;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.72) 40%, rgba(0,0,0,0.32) 72%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.72) 40%, rgba(0,0,0,0.32) 72%, rgba(0,0,0,0) 100%);
  z-index: 1;
}

body.student-home-body .student-home-main > .student-hero.hero-with-banner + .category-wrap {
  position: relative;
  z-index: 2;
  margin-top: -12px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Keep category buttons identical in idle/active states */
body.student-home-body .student-home-main .category-wrap .category-chip,
body.student-home-body .student-home-main .category-wrap .category-chip.active,
body.student-home-body .student-home-main .category-wrap .category-chip:hover {
  min-height: 38px !important;
  height: 38px !important;
  padding: 4px 9px !important;
  border-radius: 13px !important;
  font-size: 0.88rem !important;
  transform: none !important;
}

/* Single continuous banner from top to categories, then soft fade */
body.student-home-body .student-home-main {
  position: relative;
  background:
    linear-gradient(
      180deg,
      rgba(2, 10, 40, 0.42) 0%,
      rgba(2, 10, 40, 0.34) 22%,
      rgba(2, 10, 40, 0.24) 42%,
      rgba(2, 10, 40, 0.12) 62%,
      rgba(2, 10, 40, 0.04) 76%,
      rgba(2, 10, 40, 0) 88%
    ),
    url('/assets/images/student/home/hero-world-music.png');
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% 780px, 100% 780px;
}

/* Remove duplicated mid-page banner layer */
body.student-home-body .student-home-main > .student-hero.hero-with-banner::after {
  content: none !important;
}

/* Keep hero text readable but transparent container */
body.student-home-body .student-home-main > .student-hero.hero-with-banner {
  background: linear-gradient(180deg, rgba(8, 25, 58, 0.34), rgba(8, 25, 58, 0.08)) !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.student-home-body .student-home-main > .student-hero.hero-with-banner + .category-wrap {
  margin-top: -10px;
}

/* Student category chips: keep one stable size on all pages/states */
.student-home-main .category-wrap .category-chip {
  flex: 0 0 186px !important;
  min-width: 186px !important;
  max-width: 186px !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 3px 10px !important;
  font-size: 0.87rem !important;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 1220px) {
  .student-home-main .category-wrap .category-chip {
    flex: 0 0 186px !important;
    min-width: 186px !important;
    max-width: 186px !important;
    height: 36px !important;
  }
}

@media (max-width: 740px) {
  .student-home-main .category-wrap .category-chip {
    flex: 0 0 186px !important;
    min-width: 186px !important;
    max-width: 186px !important;
    height: 36px !important;
  }
}

/* Student Final Revamp */
.hero-with-banner {
  background-image: linear-gradient(100deg, rgba(10,33,55,0.72), rgba(10,33,55,0.26)), url('/assets/images/student/home/hero-world-music.png');
  background-size: cover;
  background-position: center;
  min-height: 250px;
}

.hero-with-banner .student-hero-content {
  max-width: 620px;
  text-align: center;
}

.hero-with-banner .student-hero-content p {
  margin-left: auto;
  margin-right: auto;
}

.hero-with-banner .student-hero-stats {
  justify-content: center;
}

.hero-title-fancy {
  margin: 0 0 8px;
  line-height: 1.03;
  font-family: 'Fredoka One', cursive;
  letter-spacing: 0.01em;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.hero-title-fancy .hero-title-white {
  color: #f7fbff;
  font-size: clamp(1.6rem, 3.1vw, 2.7rem);
}

.hero-title-fancy .hero-title-gold {
  color: #ffc12e;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
}

.hero-title-fancy .hero-title-rainbow {
  display: inline-block;
  font-size: clamp(2.2rem, 4.9vw, 4.3rem);
  font-weight: 700;
  background: linear-gradient(90deg, #ffd100 0%, #ff8a00 36%, #ff5ea8 72%, #b76cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.18);
}

.student-layout-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  align-items: start;
}

.student-task-panel-compact {
  background: linear-gradient(150deg, #fff7d6, #ffe8ae);
  border: 1px solid rgba(247,181,49,0.35);
  box-shadow: 0 10px 22px rgba(247,181,49,0.2);
}

.student-task-panel-compact h2 {
  color: #6b4f00;
}

.student-task-panel-compact .student-task-row {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(247,181,49,0.32);
}

.student-featured-panel {
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
}

.student-featured-video-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.student-featured-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.student-featured-video-grid .video-card {
  border-radius: 12px;
}

.student-featured-video-grid .video-thumb {
  aspect-ratio: 16 / 9;
}

.student-featured-video-grid .video-body {
  padding: 8px 8px 9px;
}

.student-featured-video-grid .video-body h3 {
  font-size: 0.84rem;
  margin: 0 0 6px;
}

.student-featured-video-grid .video-meta .tag {
  padding: 3px 7px;
  font-size: 0.7rem;
}

.student-intro-video-wrap {
  width: min(760px, 100%);
  max-width: 760px;
  margin: 2px auto 0;
}

.student-intro-video-wrap video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.student-featured-video-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.student-featured-video-item:hover {
  background: #f6f9ff;
  border-color: rgba(47, 135, 234, 0.4);
}

@media (max-width: 1080px) {
  .student-featured-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .student-featured-video-grid {
    grid-template-columns: 1fr;
  }
}

.video-detail-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: start;
}

.video-player-wrap-clean {
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: 0 8px 22px rgba(15,23,42,0.18);
  overflow: hidden;
}

.video-player-wrap-clean video {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: #000;
}

.video-info-panel {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border: 1px solid rgba(33,150,243,0.16);
  border-radius: 14px;
  padding: 12px;
}

.video-info-panel h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.video-info-panel p {
  margin: 0 0 10px;
  color: rgba(15,23,42,0.78);
}

.video-note-label {
  display: block;
  margin-top: 8px;
  font-weight: 800;
  color: #0f172a;
}

.assignment-beauty {
  max-width: 940px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
  border: 1px solid rgba(33,150,243,0.2);
}

.assignment-beauty h1 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
}

.assignment-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 14px 0;
}

.assignment-detail-box {
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.1);
  background: #fff;
  padding: 14px;
  min-height: 120px;
}

.coming-soon-panel {
  max-width: 820px;
  background: linear-gradient(145deg, #ffffff, #f1f8ff);
  border: 1px dashed rgba(33,150,243,0.35);
  padding: 26px;
}

.coming-soon-panel h1 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
}

@media (max-width: 1100px) {
  .student-layout-row {
    grid-template-columns: 1fr;
  }

  .video-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero-with-banner {
    min-height: 210px;
    background-position: center right;
  }

  .assignment-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Focus video mode + common sidebar */
body.videos-focus-mode #homeIntroRow { display: none !important; }

.student-videos-page .student-video-section {
  margin-top: 0;
}

.student-videos-page #videoDetail {
  margin-top: 0;
}

/* Video player size/position tuning */
.video-detail-layout {
  display: grid;
  grid-template-columns: minmax(560px, 760px) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.video-player-wrap-tall {
  max-width: 760px;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.video-player-wrap-tall video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-info-panel-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1220px) {
  .video-detail-layout {
    grid-template-columns: 1fr;
  }

  .video-player-wrap-tall {
    max-width: none;
    aspect-ratio: 16 / 9;
  }

  .video-player-wrap-tall video {
    height: 100%;
  }

  .video-info-panel-side {
    min-height: 0;
  }
}

/* Student dashboard/ui final behavior overrides */
body.student-home-body .student-sidebar {
  background: #173a61 !important;
}

body.student-home-body .student-home-main .category-wrap {
  margin-top: -10px !important;
  min-height: 58px;
  align-items: center;
}

body.student-home-body .student-home-main .category-wrap .category-chip,
body.student-home-body .student-home-main .category-wrap .category-chip:hover,
body.student-home-body .student-home-main .category-wrap .category-chip.active {
  transform: none !important;
}

body.student-home-body .student-featured-panel.student-featured-panel-intro {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Student dashboard cinematic banner fade (final override) */
body.student-home-body .student-home-main {
  position: relative;
  overflow: hidden;
  background: transparent !important;
}

body.student-home-body .student-home-main::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 0;
  height: 780px;
  background:
    linear-gradient(
      180deg,
      rgba(4,12,38,0.12) 0%,
      rgba(4,12,38,0.08) 28%,
      rgba(4,12,38,0.04) 54%,
      rgba(4,12,38,0.015) 74%,
      rgba(4,12,38,0) 100%
    ),
    url('/assets/images/student/home/hero-world-music.png');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 42%,
    rgba(0,0,0,0.82) 58%,
    rgba(0,0,0,0.42) 74%,
    rgba(0,0,0,0.12) 88%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 42%,
    rgba(0,0,0,0.82) 58%,
    rgba(0,0,0,0.42) 74%,
    rgba(0,0,0,0.12) 88%,
    rgba(0,0,0,0) 100%
  );
}

body.student-home-body .student-home-main > * {
  position: relative;
  z-index: 2;
}

body.student-home-body .student-home-main > .student-hero.hero-with-banner,
body.student-home-body .hero-with-banner {
  background: transparent !important;
  background-image: none !important;
}



