:root {
  /* Cartoon Christmas Storybook Palette */
  --bg: #0c2231;
  --bg-deep: #081822;
  --bg-subtle: #14362d;
  --surface: #173d32;
  --surface-tint: #112e26;
  --surface-hover: #1e4d3f;

  --ink-outline: #071410;
  --border: rgba(255, 214, 112, 0.34);
  --border-strong: rgba(255, 214, 112, 0.62);

  --ink: #fffaf0;
  --ink-secondary: #d7efe3;
  --muted: #98bdb0;

  /* Punchy Festive Cartoon Accents */
  --pine: #25a55b;
  --pine-dark: #156e3b;
  --pine-hover: #2ec06b;
  --pine-soft: rgba(37, 165, 91, 0.24);
  --pine-border: #5ce092;

  --berry: #ef3b42;
  --berry-dark: #a61c22;
  --berry-hover: #ff5158;
  --berry-soft: rgba(239, 59, 66, 0.22);
  --berry-border: #ff7e83;

  --brass: #ffd15c;
  --brass-dark: #c98e16;
  --brass-soft: rgba(255, 209, 92, 0.2);
  --brass-border: #ffe08a;

  --frost: #7ed8ff;
  --snow: #eef8ff;

  /* Code Editor Deep Winter Slate */
  --code-bg: #091713;
  --code-chrome: #0f251e;
  --code-border: #071410;
  --code-text: #f0faf4;
  --code-muted: #84a899;

  /* Chunky Cartoon Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Hard-Offset Cartoon Shadows */
  --shadow-xs: 0 3px 0 var(--ink-outline);
  --shadow-sm: 0 5px 0 var(--ink-outline);
  --shadow-md: 0 7px 0 var(--ink-outline);
  --shadow-gloss: inset 0 2px 0 rgba(255, 255, 255, 0.16);

  --candy-stripe: repeating-linear-gradient(
    -45deg,
    #ef3b42 0 12px,
    #fffaf0 12px 24px,
    #25a55b 24px 36px,
    #ffd15c 36px 44px
  );

  --candy-red-white: repeating-linear-gradient(
    -45deg,
    #ef3b42 0 10px,
    #fffaf0 10px 20px
  );

  --font-display: "Fredoka", "Nunito", "Comic Sans MS", sans-serif;
  --font-sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.58;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    /* Cartoon twinkling night sky stars */
    radial-gradient(2.5px 2.5px at 8% 14%, rgba(255, 240, 180, 0.85) 50%, transparent 100%),
    radial-gradient(2px 2px at 22% 8%, rgba(255, 255, 255, 0.75) 50%, transparent 100%),
    radial-gradient(3px 3px at 42% 18%, rgba(255, 209, 92, 0.8) 50%, transparent 100%),
    radial-gradient(2px 2px at 66% 10%, rgba(126, 216, 255, 0.8) 50%, transparent 100%),
    radial-gradient(3px 3px at 84% 20%, rgba(255, 240, 180, 0.85) 50%, transparent 100%),
    radial-gradient(2px 2px at 93% 9%, rgba(255, 255, 255, 0.7) 50%, transparent 100%),
    radial-gradient(2.5px 2.5px at 14% 48%, rgba(255, 255, 255, 0.5) 50%, transparent 100%),
    radial-gradient(2.5px 2.5px at 88% 55%, rgba(255, 209, 92, 0.55) 50%, transparent 100%),
    /* Warm festive aurora & moonlight glow */
    radial-gradient(ellipse 80% 42% at 50% -6%, rgba(239, 59, 66, 0.22), transparent 65%),
    radial-gradient(ellipse 65% 40% at 88% 12%, rgba(255, 209, 92, 0.16), transparent 60%),
    radial-gradient(ellipse 75% 50% at 14% 78%, rgba(37, 165, 91, 0.22), transparent 65%),
    linear-gradient(180deg, #0b2033 0%, #0e2a29 52%, #113429 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Plump Cartoon Falling Snowfall */
.snowfall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -2.5rem;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(7, 20, 16, 0.35), 0 0 10px rgba(126, 216, 255, 0.65);
  user-select: none;
  will-change: transform;
  animation-name: fb-snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fb-snowfall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(var(--snow-drift, 26px), 26vh, 0) rotate(90deg);
  }
  50% {
    transform: translate3d(calc(var(--snow-drift, 26px) * -0.5), 55vh, 0) rotate(180deg);
  }
  75% {
    transform: translate3d(var(--snow-drift, 26px), 84vh, 0) rotate(270deg);
  }
  100% {
    transform: translate3d(0, 112vh, 0) rotate(360deg);
  }
}

body.snow-off .snowfall {
  display: none;
}

/* Header & Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #163d31 0%, #102e25 100%);
  border-bottom: 3px solid var(--ink-outline);
  box-shadow: 0 5px 0 rgba(7, 20, 16, 0.45);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Chunky Cartoon Dangling Christmas String Lights */
.christmas-lights {
  position: relative;
  z-index: 51;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  height: 22px;
  padding: 0 0.75rem;
  overflow: visible;
  pointer-events: none;
  background: linear-gradient(180deg, #0d251e 0%, rgba(13, 37, 30, 0) 100%);
  border-top: 2px solid var(--ink-outline);
}

/* Dark evergreen wire cord */
.christmas-lights::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #1b5c3a;
  border-bottom: 1.5px solid var(--ink-outline);
}

.bulb {
  position: relative;
  width: 12px;
  height: 15px;
  border-radius: 45% 45% 55% 55%;
  margin-top: 5px;
  flex-shrink: 0;
  border: 2px solid var(--ink-outline);
  transform-origin: top center;
  animation: fb-twinkle 2.6s ease-in-out infinite, fb-sway 4.2s ease-in-out infinite;
}

/* Bulb socket cap */
.bulb::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 1px;
  width: 6px;
  height: 4px;
  background: #236e44;
  border: 1.5px solid var(--ink-outline);
  border-radius: 2px;
}

/* Glossy cartoon highlight dot on bulb */
.bulb::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 5px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

.bulb-red {
  background: #ff474d;
  box-shadow: 0 0 12px 3px rgba(255, 71, 77, 0.78);
  animation-delay: 0s, 0s;
}

.bulb-gold {
  background: #ffd84d;
  box-shadow: 0 0 12px 3px rgba(255, 216, 77, 0.82);
  animation-delay: 0.65s, 0.8s;
}

.bulb-green {
  background: #3be883;
  box-shadow: 0 0 12px 3px rgba(59, 232, 131, 0.75);
  animation-delay: 1.3s, 1.6s;
}

.bulb-ice {
  background: #66d9ff;
  box-shadow: 0 0 12px 3px rgba(102, 217, 255, 0.8);
  animation-delay: 1.95s, 2.4s;
}

@keyframes fb-twinkle {
  0%, 100% {
    opacity: 1;
    filter: brightness(1.15);
  }
  50% {
    opacity: 0.58;
    filter: brightness(0.8);
  }
}

@keyframes fb-sway {
  0%, 100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

/* Gentle, cozy Christmas Party light wave (not too flashy / no rapid strobing) */
body.party-mode .bulb {
  animation: fb-party-chase 1.4s ease-in-out infinite, fb-sway 2.8s ease-in-out infinite;
}

body.party-mode .bulb-red {
  --party-glow: rgba(255, 71, 77, 0.95);
  animation-delay: 0s, 0s;
}

body.party-mode .bulb-gold {
  --party-glow: rgba(255, 216, 77, 0.98);
  animation-delay: 0.35s, 0.45s;
}

body.party-mode .bulb-green {
  --party-glow: rgba(59, 232, 131, 0.92);
  animation-delay: 0.7s, 0.9s;
}

body.party-mode .bulb-ice {
  --party-glow: rgba(102, 217, 255, 0.95);
  animation-delay: 1.05s, 1.35s;
}

@keyframes fb-party-chase {
  0%, 100% {
    opacity: 0.48;
    filter: brightness(0.78);
    box-shadow: 0 0 6px 1px var(--party-glow, rgba(255, 216, 77, 0.5));
  }
  42%, 58% {
    opacity: 1;
    filter: brightness(1.32);
    box-shadow: 0 0 18px 6px var(--party-glow, rgba(255, 216, 77, 0.95));
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, #27a960 0%, #166e3b 100%);
  border: 2.5px solid var(--ink-outline);
  box-shadow: 0 3px 0 var(--ink-outline), var(--shadow-gloss);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 2.5px 0 var(--ink-outline);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--brass);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-drawer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.nav-drawer-footer {
  display: none;
}

.nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-pill);
  padding: 0.24rem;
  box-shadow: var(--shadow-xs);
}

.nav-btn {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  color: var(--ink-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  height: 36px;
  padding: 0 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  line-height: 1;
  flex-shrink: 0;
}

.nav-label {
  display: inline-block;
  line-height: 1;
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.nav-btn.active {
  color: #1a1204;
  background: linear-gradient(180deg, #ffe07a 0%, #f5b935 100%);
  border-color: var(--ink-outline);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.nav-btn.active:hover {
  color: #1a1204;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-actions .btn {
  height: 40px;
  padding: 0 0.92rem;
  line-height: 1;
  white-space: nowrap;
}

.topbar-actions #auth-btn {
  flex-shrink: 0;
}

.snow-toggle {
  color: var(--muted);
  border: 2.5px solid var(--ink-outline);
  background: var(--surface-tint);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

.snow-toggle.is-active {
  color: #0b2638;
  background: linear-gradient(180deg, #d7f3ff 0%, #8cd9ff 100%);
  border-color: var(--ink-outline);
  box-shadow: 0 3px 0 var(--ink-outline), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.snow-toggle.is-active:hover {
  color: #071b29;
  background: linear-gradient(180deg, #e8f8ff 0%, #a5e2ff 100%);
}

.btn.party-toggle {
  color: #2b1300;
  font-weight: 800;
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(180deg, #ffe27a 0%, #f7b538 100%);
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--ink-outline), inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.btn.party-toggle:hover {
  color: #1f0d00;
  background: linear-gradient(180deg, #ffed9e 0%, #ffc44d 100%);
}

.btn.party-toggle.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, #ff5b62 0%, #d92638 100%);
  border-color: var(--ink-outline);
  box-shadow: 0 3px 0 var(--ink-outline), 0 0 16px rgba(255, 209, 92, 0.72), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn.party-toggle.is-active:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #ff7076 0%, #e53547 100%);
}

.party-toggle.is-active .party-toggle-icon {
  display: inline-block;
  animation: fb-party-icon-bounce 0.9s ease-in-out infinite;
}

@keyframes fb-party-icon-bounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-2px) rotate(-10deg);
  }
}

/* Mobile Hamburger Menu Toggle */
.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 2.5px solid var(--ink-outline);
  background: var(--surface-tint);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.nav-menu-toggle:hover {
  background: var(--surface-hover);
}

.nav-menu-toggle:active {
  transform: translateY(2px);
}

.topbar.nav-open .nav-menu-toggle {
  background: linear-gradient(180deg, #ffe07a 0%, #f5b935 100%);
  color: #1a1204;
}

.hamburger-lines {
  position: relative;
  width: 18px;
  height: 14px;
  display: block;
}

.hamburger-lines span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  border-radius: 99px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.18s ease, top 0.2s ease;
}

.hamburger-lines span:nth-child(1) {
  top: 0;
}

.hamburger-lines span:nth-child(2) {
  top: 5.75px;
}

.hamburger-lines span:nth-child(3) {
  top: 11.5px;
}

.topbar.nav-open .hamburger-lines span:nth-child(1) {
  top: 5.75px;
  transform: rotate(45deg);
}

.topbar.nav-open .hamburger-lines span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.3);
}

.topbar.nav-open .hamburger-lines span:nth-child(3) {
  top: 5.75px;
  transform: rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 14, 18, 0.58);
  backdrop-filter: blur(2px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin-top: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.18;
  text-shadow: 0 2.5px 0 rgba(7, 20, 16, 0.8);
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.05rem);
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1.2rem;
}

h4 {
  font-size: 0.98rem;
  text-shadow: none;
}

p {
  color: var(--ink-secondary);
}

.muted {
  color: var(--muted);
}

.error {
  color: #ff989b;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #ffe59e;
  background: rgba(8, 22, 18, 0.85);
  border: 1.5px solid var(--ink-outline);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

hr {
  border: 0;
  border-top: 2px dashed rgba(255, 214, 112, 0.28);
  margin: 1.3rem 0;
}

/* Chunky Bouncy Cartoon Buttons */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(180deg, #215747 0%, #163d32 100%);
  color: var(--ink);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-pill);
  padding: 0.56rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink-outline), var(--shadow-gloss);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, background 0.14s ease, color 0.14s ease;
}

.btn:hover {
  background: linear-gradient(180deg, #296b57 0%, #1c4c3e 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink-outline), var(--shadow-gloss);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink-outline), var(--shadow-gloss);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: 0 2px 0 var(--ink-outline);
}

.btn.primary {
  background: linear-gradient(180deg, #ff565c 0%, #df2b32 100%);
  border-color: var(--ink-outline);
  color: #fffef9;
  text-shadow: 0 1.5px 0 rgba(120, 14, 18, 0.7);
  box-shadow: 0 4px 0 var(--ink-outline), inset 0 2.5px 0 rgba(255, 255, 255, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #ff6c71 0%, #ef353c 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink-outline), inset 0 2.5px 0 rgba(255, 255, 255, 0.42);
}

.btn.primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink-outline), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn.ghost {
  background: rgba(16, 46, 37, 0.65);
  border-color: var(--ink-outline);
  box-shadow: 0 3px 0 var(--ink-outline);
  color: var(--ink-secondary);
}

.btn.ghost:hover {
  background: var(--surface-hover);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--ink-outline);
}

.btn.sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.84rem;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  display: inline-block;
  animation: fb-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Main Container & Cartoon Cards */
.container {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1140px;
  margin: 2rem auto 0;
  padding: 0 1.5rem 2.5rem;
  display: grid;
  gap: 1.6rem;
  align-content: start;
}

.card {
  position: relative;
  background: linear-gradient(180deg, #1b463a 0%, #14362c 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 1.7rem;
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  min-width: 0;
  max-width: 100%;
}

/* Layout Utilities */
.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

/* Festive Cartoon Landing Masthead */
.masthead {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 209, 92, 0.22), transparent 50%),
    radial-gradient(circle at 12% 88%, rgba(239, 59, 66, 0.22), transparent 55%),
    linear-gradient(180deg, #1d4e40 0%, #13362c 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 2.6rem 2.5rem 2.4rem;
  box-shadow: 0 8px 0 var(--ink-outline), var(--shadow-gloss);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, 0.85fr);
  gap: 2.4rem;
  align-items: center;
}

.masthead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 11px;
  background: var(--candy-stripe);
  border-bottom: 2.5px solid var(--ink-outline);
}

.masthead-kicker {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: #1f1403;
  background: linear-gradient(180deg, #ffe285 0%, #f5ba38 100%);
  border: 2px solid var(--ink-outline);
  border-radius: var(--radius-pill);
  padding: 0.26rem 0.85rem;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 0 var(--ink-outline);
}

.masthead-kicker::before {
  content: "🎅";
  font-size: 1rem;
}

.masthead h1 {
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 0 4px 0 var(--ink-outline);
}

.masthead-lead {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 52ch;
  margin: 0 0 1.6rem;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Gift-Wrapped Miniature 6x4 Advent Preview */
.mini-advent {
  position: relative;
  background: linear-gradient(180deg, #113027 0%, #0b221c 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 6px 0 var(--ink-outline), var(--shadow-gloss);
}

.mini-advent-bow {
  display: flex;
  justify-content: center;
  margin: -2.15rem auto 0.35rem;
  font-size: 1.85rem;
  filter: drop-shadow(0 3px 0 var(--ink-outline));
  user-select: none;
}

.mini-advent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px dashed rgba(255, 214, 112, 0.3);
}

.mini-advent-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--brass);
}

.mini-advent-sub {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--frost);
}

.mini-advent-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}

.mini-door {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid var(--ink-outline);
  background: #173d32;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--muted);
  box-shadow: 0 2.5px 0 var(--ink-outline);
}

.mini-door.unlocked {
  background: linear-gradient(180deg, #2ec06b 0%, #1d8a4b 100%);
  color: #ffffff;
  text-shadow: 0 1.5px 0 var(--ink-outline);
}

.mini-door.christmas {
  background: linear-gradient(180deg, #ff565c 0%, #d4262d 100%);
  color: #ffe799;
  text-shadow: 0 1.5px 0 var(--ink-outline);
  box-shadow: 0 2.5px 0 var(--ink-outline), 0 0 12px rgba(255, 209, 92, 0.55);
}

.mini-advent-foot {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Cartoon Info Strip (Landing) */
.editorial-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  padding: 0.2rem 0;
}

.editorial-col {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #1b463a 0%, #13342b 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.3rem 1.25rem;
  box-shadow: var(--shadow-sm), var(--shadow-gloss);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.editorial-col:hover {
  transform: translateY(-4px);
}

.editorial-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: var(--brass);
  border-bottom: 2px solid var(--ink-outline);
}

.editorial-col:nth-child(1)::before {
  background: var(--berry);
}

.editorial-col:nth-child(2)::before {
  background: var(--pine);
}

.editorial-col:nth-child(3)::before {
  background: var(--brass);
}

.editorial-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brass);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.editorial-col h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45rem;
}

.editorial-col p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Season Summary Strip (Authenticated Calendar) */
.season-summary {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 14%, rgba(255, 209, 92, 0.18), transparent 45%),
    linear-gradient(180deg, #1d4d3f 0%, #14362c 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.7rem 1.45rem;
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  display: grid;
  gap: 1.2rem;
}

.season-summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--candy-stripe);
  border-bottom: 2.5px solid var(--ink-outline);
}

.season-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.metric-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-block + .metric-block {
  border-left: 2px dashed rgba(255, 214, 112, 0.28);
  padding-left: 1.5rem;
}

.metric-label {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2.5px 0 var(--ink-outline);
}

.metric-value small {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-shadow: none;
}

.metric-sub {
  font-size: 0.83rem;
  color: var(--ink-secondary);
}

/* 24-Day Completion Ruler (Advent Ornament Pips) */
.pip-strip {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 5px;
}

.pip {
  height: 12px;
  border-radius: 6px;
  background: #0d231d;
  border: 2px solid var(--ink-outline);
}

.pip.unlocked {
  background: #1f6b4b;
}

.pip.started {
  background: linear-gradient(180deg, #ffe27a, #f0b12a);
  box-shadow: 0 0 8px rgba(255, 209, 92, 0.55);
}

.pip.solved {
  background: linear-gradient(180deg, #52f094, #20a056);
  box-shadow: 0 0 9px rgba(82, 240, 148, 0.55);
}

/* Chunky Progress Bar */
.progress-track {
  width: 100%;
  height: 11px;
  background: #0c211b;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 2px solid var(--ink-outline);
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #25a55b, #52f094);
  transition: width 0.35s ease;
}

/* Warm-Up / Practice Callout with Candy-Cane Left Ribbon */
.example-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #1b473a 0%, #13342a 100%);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1.25rem 1.85rem;
  box-shadow: var(--shadow-sm), var(--shadow-gloss);
}

.example-banner::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: var(--candy-red-white);
  border-right: 2.5px solid var(--ink-outline);
}

.example-banner.solved {
  background: linear-gradient(180deg, #1f5941 0%, #15402e 100%);
}

.example-banner-main {
  flex: 1 1 360px;
}

.example-banner-actions {
  flex-shrink: 0;
}

/* Calendar Header & Legend */
.calendar-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed rgba(255, 214, 112, 0.3);
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 0.45rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid var(--ink-outline);
}

.legend-dot.solved { background: #4be88d; }
.legend-dot.started { background: var(--brass); }
.legend-dot.unlocked { background: var(--frost); }
.legend-dot.locked { background: #58786d; }

/* 6x4 Cartoon Advent Gift-Door Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.95rem;
}

.day-tile {
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1rem;
  min-height: 152px;
  border-radius: var(--radius-md);
  border: 3px solid var(--ink-outline);
  background: linear-gradient(180deg, #215747 0%, #163d32 100%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 0 var(--ink-outline), var(--shadow-gloss);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, background 0.16s ease;
}

.day-tile.open {
  cursor: pointer;
}

.day-tile.open:hover {
  transform: translateY(-4px) rotate(-0.8deg);
  box-shadow: 0 9px 0 var(--ink-outline), 0 0 18px rgba(255, 209, 92, 0.35), var(--shadow-gloss);
}

.day-tile.open:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink-outline), var(--shadow-gloss);
}

.day-tile.solved {
  background: linear-gradient(180deg, #279c59 0%, #186b3c 100%);
}

.day-tile.solved:hover {
  box-shadow: 0 9px 0 var(--ink-outline), 0 0 18px rgba(82, 240, 148, 0.45), var(--shadow-gloss);
}

.day-tile.in-progress {
  background: linear-gradient(180deg, #5e4b19 0%, #3d3110 100%);
}

/* Special Christmas Eve Finale Tile for Day 24 */
.day-tile.day-24 {
  background:
    radial-gradient(circle at 85% 18%, rgba(255, 224, 122, 0.28) 0%, transparent 58%),
    linear-gradient(180deg, #ef3b42 0%, #b31d24 100%);
  box-shadow: 0 5px 0 var(--ink-outline), inset 0 0 0 2px rgba(255, 209, 92, 0.55), var(--shadow-gloss);
}

.day-tile.day-24.open:hover {
  box-shadow: 0 9px 0 var(--ink-outline), 0 0 22px rgba(255, 209, 92, 0.55), inset 0 0 0 2px rgba(255, 224, 122, 0.75), var(--shadow-gloss);
}

.day-tile.day-24 .day-num {
  color: #fff0a8;
  text-shadow: 0 2.5px 0 var(--ink-outline);
}

.day-tile.locked {
  background: linear-gradient(180deg, #132e26 0%, #0e231d 100%);
  border-style: dashed;
  border-color: rgba(152, 189, 176, 0.35);
  box-shadow: 0 3px 0 rgba(7, 20, 16, 0.6);
  color: var(--muted);
}

.day-tile.day-24.locked {
  background:
    radial-gradient(circle at 85% 18%, rgba(255, 209, 92, 0.1) 0%, transparent 58%),
    linear-gradient(180deg, #2f171b 0%, #200f12 100%);
  border-color: rgba(255, 209, 92, 0.45);
  box-shadow: 0 3px 0 rgba(7, 20, 16, 0.6);
}

.day-tile.day-24.locked .day-num {
  color: rgba(255, 224, 122, 0.72);
  opacity: 1;
}

.day-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}

.day-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--brass);
  text-shadow: 0 2.5px 0 var(--ink-outline);
  font-variant-numeric: tabular-nums;
}

.day-tile.locked .day-num {
  color: var(--muted);
  opacity: 0.7;
  text-shadow: none;
}

.day-status-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.52rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: #102a22;
  color: var(--ink-secondary);
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--ink-outline);
}

.day-status-pill.solved {
  color: #1f1403;
  background: linear-gradient(180deg, #ffe27a 0%, #f5b935 100%);
}

.day-status-pill.in-progress {
  color: #1f1403;
  background: #ffd15c;
}

.day-status-pill.ready {
  color: #062112;
  background: #6bf0a3;
}

.day-status-pill.locked {
  color: var(--muted);
  background: rgba(8, 22, 18, 0.45);
  border-color: rgba(152, 189, 176, 0.25);
  box-shadow: none;
}

.day-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.day-tile.locked .day-title {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.day-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 2px dashed rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.day-tile.locked .day-footer {
  color: var(--muted);
}

/* Forms & Inputs */
input,
select,
textarea {
  background: var(--surface-tint);
  color: var(--ink);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.82rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  width: 100%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(255, 209, 92, 0.3);
}

select {
  width: auto;
  cursor: pointer;
}

/* Auth Layout */
.auth-shell {
  max-width: 840px;
  margin: 1rem auto;
  width: 100%;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem;
}

.auth-divider-col {
  border-left: 2px dashed rgba(255, 214, 112, 0.3);
  padding-left: 2.25rem;
}

.auth-oauth {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 1.4rem;
  border-bottom: 2px dashed rgba(255, 214, 112, 0.3);
}

.auth-disclosure {
  margin-top: 1.15rem;
  border-top: 2px dashed rgba(255, 214, 112, 0.24);
  padding-top: 0.85rem;
}

.auth-disclosure summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-disclosure summary::-webkit-details-marker {
  display: none;
}

.auth-disclosure summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brass);
}

.auth-disclosure[open] summary::after {
  content: "−";
}

.auth-disclosure-body {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

/* Challenge Detail View */
.timer-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
  background: var(--surface-tint);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--ink-outline);
  box-shadow: var(--shadow-xs);
  font-size: 0.86rem;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.timer-pill strong {
  font-family: var(--font-mono);
  color: var(--brass);
  font-weight: 600;
}

.limits-bar {
  display: flex;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  margin: 0.7rem 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed rgba(255, 214, 112, 0.25);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.limit-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--surface-tint);
  border: 2px solid var(--ink-outline);
  border-radius: var(--radius-pill);
  padding: 0.16rem 0.65rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.prompt-box {
  background: var(--surface-tint);
  padding: 1.45rem 1.6rem;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--ink-outline);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
  min-width: 0;
  max-width: 100%;
}

.prompt-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  max-width: 76ch;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.72;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
}

.samples-section {
  margin-top: 1.4rem;
}

.samples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.samples-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
}

.samples-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.sample-box {
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  max-width: 100%;
}

.sample-box h4 {
  margin-bottom: 0.65rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brass);
}

.sample-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.sample-grid > div {
  min-width: 0;
}

.sample-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-download-sample {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--ink-outline);
  border-radius: var(--radius-pill);
  padding: 0.12rem 0.5rem;
  color: var(--ink-secondary);
  cursor: pointer;
}

.btn-download-sample:hover {
  background: var(--brass);
  color: #1f1403;
}

pre {
  background: var(--code-bg);
  border: 2px solid var(--ink-outline);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  margin: 0.35rem 0 0;
  color: var(--code-text);
  max-width: 100%;
}

/* Code Workspace */
.workspace-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  margin-top: 1rem;
  align-items: start;
}

.editor-pane {
  min-width: 0;
  max-width: 100%;
}

.workspace-actions {
  margin-top: 1rem;
}

/* AWS Lambda-style Multi-File IDE Shell */
.ide-shell {
  display: flex;
  align-items: stretch;
  background: var(--code-bg);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  height: 460px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ide-shell:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(255, 209, 92, 0.25);
}

.ide-explorer {
  flex: 0 0 205px;
  width: 205px;
  background: var(--code-chrome);
  border-right: 2px solid var(--ink-outline);
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--code-text);
  font-size: 0.8rem;
  user-select: none;
}

.ide-shell.explorer-collapsed .ide-explorer {
  display: none;
}

.ide-explorer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ide-explorer-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--code-muted);
}

.ide-explorer-actions {
  display: flex;
  gap: 0.25rem;
}

.ide-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--code-text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 0.16rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.25;
}

.ide-icon-btn:hover {
  background: rgba(255, 209, 92, 0.2);
  border-color: var(--brass);
  color: #fff;
}

.ide-root-label {
  padding: 0.35rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brass);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ide-inline-create {
  padding: 0.4rem 0.45rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ide-inline-create input {
  width: 100%;
  box-sizing: border-box;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--brass);
  border-radius: 4px;
  padding: 0.28rem 0.42rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  margin: 0;
}

.ide-inline-hint {
  margin-top: 0.25rem;
  font-size: 0.69rem;
  color: var(--code-muted);
  line-height: 1.25;
}

.ide-inline-hint.error {
  color: #ff9c9e;
  font-weight: 600;
}

.ide-file-tree {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0;
}

.ide-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  padding-right: 0.35rem;
  min-height: 26px;
}

.ide-tree-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.ide-tree-row.active {
  background: rgba(255, 209, 92, 0.18);
}

.ide-tree-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  background: transparent;
  border: 0;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  padding: 0.22rem 0;
  cursor: pointer;
  text-align: left;
}

.ide-tree-caret {
  width: 0.7rem;
  text-align: center;
  color: var(--code-muted);
  flex-shrink: 0;
}

.ide-tree-icon {
  font-size: 0.78rem;
  flex-shrink: 0;
}

.ide-tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-entry-pill {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(255, 209, 92, 0.22);
  color: var(--brass);
  border: 1px solid rgba(255, 209, 92, 0.45);
  border-radius: 4px;
  padding: 0.05rem 0.28rem;
  flex-shrink: 0;
}

.ide-tree-actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s ease;
  flex-shrink: 0;
}

.ide-tree-row:hover .ide-tree-actions,
.ide-tree-row:focus-within .ide-tree-actions {
  opacity: 1;
}

.ide-row-btn {
  background: transparent;
  border: 0;
  color: var(--code-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.1rem 0.24rem;
  border-radius: 3px;
  line-height: 1;
}

.ide-row-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ide-row-btn.danger:hover {
  background: rgba(239, 59, 66, 0.28);
  color: #ffb8ba;
}

.ide-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ide-tabs-bar {
  display: flex;
  align-items: stretch;
  background: var(--code-chrome);
  border-bottom: 2px solid var(--ink-outline);
  min-height: 34px;
  overflow: hidden;
}

.ide-toggle-btn {
  flex: 0 0 34px;
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--code-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.ide-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ide-tabs {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ide-tab {
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
  color: var(--code-muted);
  flex-shrink: 0;
}

.ide-tab.active {
  background: var(--code-bg);
  color: #fff;
  box-shadow: inset 0 2px 0 var(--brass);
}

.ide-tab-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

.ide-entry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  display: inline-block;
}

.ide-tab-close {
  background: transparent;
  border: 0;
  color: var(--code-muted);
  cursor: pointer;
  padding: 0.25rem 0.45rem 0.25rem 0.1rem;
  font-size: 0.9rem;
  line-height: 1;
}

.ide-tab-close:hover {
  color: #ffb8ba;
}

.editor-shell {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  background: var(--code-bg);
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 720px) {
  .ide-shell {
    flex-direction: column;
    height: auto;
  }
  .ide-explorer {
    flex: 0 0 auto;
    width: 100%;
    max-height: 165px;
    border-right: 0;
    border-bottom: 2px solid var(--ink-outline);
  }
  .editor-shell {
    height: 360px;
  }
}

.editor-gutter {
  flex: 0 0 3.2rem;
  background: var(--code-chrome);
  border-right: 2px solid var(--ink-outline);
  padding: 0.85rem 0;
  overflow: hidden;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--code-muted);
  text-align: right;
}

.gutter-line {
  padding: 0 0.6rem 0 0.35rem;
  height: 1.55em;
}

.gutter-line.error {
  color: #ffb8ba;
  background: rgba(239, 59, 66, 0.32);
  font-weight: 600;
}

.gutter-line.warning {
  color: #ffe08a;
  background: rgba(255, 209, 92, 0.25);
  font-weight: 600;
}

textarea#code-editor {
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.55;
  margin: 0;
  background: transparent;
  color: var(--code-text);
  border: 0;
  border-radius: 0;
  padding: 0.85rem 0.95rem;
  tab-size: 4;
  resize: none;
  height: 100%;
  white-space: pre;
  overflow-wrap: normal;
  overflow: auto;
  box-shadow: none;
}

textarea#code-editor:focus {
  border-color: transparent;
  box-shadow: none;
}

/* Linter Diagnostics Panel */
.lint-panel {
  background: var(--code-chrome);
  border: 3px solid var(--ink-outline);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 0.8rem;
  overflow: hidden;
  color: var(--code-text);
  box-shadow: var(--shadow-xs);
}

.lint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.85rem;
  border-top: 2px solid var(--ink-outline);
  font-family: var(--font-mono);
}

.lint-header .muted {
  color: var(--code-muted);
}

.lint-summary {
  font-weight: 600;
}

.lint-summary.ok {
  color: #6bf0a3;
}

.lint-summary.warn {
  color: #ffe08a;
}

.lint-summary.error {
  color: #ff9ea1;
}

.lint-list {
  max-height: 160px;
  overflow-y: auto;
  display: grid;
}

.lint-list:empty {
  display: none;
}

.lint-item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: grid;
  grid-template-columns: auto 4.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--code-text);
  border: 0;
  border-top: 1.5px solid var(--ink-outline);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.lint-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lint-item .lint-sev {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 6px;
}

.lint-item.error .lint-sev {
  color: #fff5f5;
  background: var(--berry);
}

.lint-item.warning .lint-sev {
  color: #1f1403;
  background: var(--brass);
}

.lint-loc {
  color: var(--frost);
  white-space: nowrap;
}

.lint-msg {
  color: var(--code-text);
  font-family: var(--font-sans);
}

.lint-rule {
  color: var(--code-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Execution Output & Score Breakdown */
.output-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  background: var(--surface-tint);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-md);
  min-height: 180px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.output-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.95rem;
  background: #173e33;
  border-bottom: 2.5px solid var(--ink-outline);
  font-family: var(--font-display);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.output-pane-title {
  font-weight: 700;
  color: var(--brass);
}

.run-output {
  flex: 1 1 auto;
  padding: 1rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.output-placeholder {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0.75rem;
  text-align: center;
}

.output-pre,
.run-output pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  max-width: 100%;
  margin: 0.5rem 0 0;
}

.run-output code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-banner {
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  border: 2.5px solid var(--ink-outline);
  background: var(--surface);
  font-size: 0.88rem;
  box-shadow: var(--shadow-xs);
}

.result-banner.pass,
.case-row.pass {
  background: #1a5c3a;
  border: 2.5px solid var(--ink-outline);
  color: #d6ffea;
}

.result-banner.fail,
.case-row.fail {
  background: #7d1d22;
  border: 2.5px solid var(--ink-outline);
  color: #ffe3e4;
}

.case-row {
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-sm);
  margin-top: 0.6rem;
  font-size: 0.86rem;
  box-shadow: var(--shadow-xs);
}

.case-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.case-io {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--ink);
}

.case-io-block {
  margin-top: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.case-io .case-io-block {
  margin-top: 0;
}

.case-io-block .output-pre {
  margin-top: 0.25rem;
}

.output-empty {
  color: var(--muted);
  font-style: italic;
}

.score-card {
  background: linear-gradient(180deg, #4b3d16 0%, #34290d 100%);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-xs);
}

.score-card .progress-fill {
  background: linear-gradient(90deg, #f0b12a, #ffe27a);
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.16rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--brass);
  color: #1f1403;
  border: 2px solid var(--ink-outline);
  font-variant-numeric: tabular-nums;
}

/* Leaderboards & Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.65rem;
}

.lb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.lb-header-title {
  margin: 0;
}

.lb-header-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.lb-count {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

.lb-track-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.table-wrap > table {
  margin-top: 0;
}

th,
td {
  text-align: left;
  padding: 0.8rem 0.85rem;
  border-bottom: 2px dashed rgba(255, 214, 112, 0.2);
}

th {
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2.5px solid var(--ink-outline);
}

tbody tr:hover {
  background: rgba(255, 209, 92, 0.08);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--surface-tint);
  border: 2px solid var(--ink-outline);
}

.rank-badge.rank-1 {
  color: #1f1403;
  background: linear-gradient(180deg, #ffe585 0%, #f5b935 100%);
  box-shadow: 0 2px 0 var(--ink-outline);
}

.rank-badge.rank-2 {
  color: #0b2638;
  background: linear-gradient(180deg, #e0f5ff 0%, #99dcff 100%);
  box-shadow: 0 2px 0 var(--ink-outline);
}

.rank-badge.rank-3 {
  color: #fffaf0;
  background: linear-gradient(180deg, #ff6469 0%, #d92d34 100%);
  box-shadow: 0 2px 0 var(--ink-outline);
}

.lb-name-cell {
  max-width: 240px;
}

.lb-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.team-name-heading {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lb-progress-cell {
  min-width: 165px;
}

.lb-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.lb-mini-bar {
  width: 100%;
  height: 9px;
  border-radius: var(--radius-pill);
  background: #0c211b;
  border: 1.5px solid var(--ink-outline);
  overflow: hidden;
  margin-top: 0.3rem;
}

.lb-mini-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #25a55b, #52f094);
}

.lb-score-cell {
  font-weight: 700;
  white-space: nowrap;
}

/* Loading & Skeletons */
@keyframes fb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fb-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 140px;
  text-align: left;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--brass);
  border-right-color: var(--berry);
  animation: fb-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.loading-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.loading-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

.skeleton-block {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(28, 72, 58, 0.75) 25%,
    rgba(43, 102, 83, 0.9) 50%,
    rgba(28, 72, 58, 0.75) 75%
  );
  background-size: 200% 100%;
  animation: fb-shimmer 1.4s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  width: 60%;
}

.skeleton-title {
  height: 22px;
  width: 45%;
}

.skeleton-bar {
  height: 9px;
  width: 100%;
  border-radius: var(--radius-pill);
}

.skeleton-tile {
  min-height: 152px;
  border-radius: var(--radius-md);
  border: 3px solid var(--ink-outline);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(23, 61, 50, 0.85);
}

/* Cartoon Snowy Village Horizon & Footer */
.winter-horizon {
  position: relative;
  z-index: 2;
  width: 100%;
  line-height: 0;
  margin-top: auto;
  pointer-events: none;
  margin-bottom: -2px;
}

.winter-horizon svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 88px;
}

.site-footer {
  position: relative;
  z-index: 2;
  background: #e8f6ff;
  color: #13362c;
}

.site-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #13362c;
}

.site-footer-portals {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(19, 54, 44, 0.14);
}

.footer-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.footer-portal-link.active {
  background: rgba(19, 54, 44, 0.1);
  border-color: rgba(19, 54, 44, 0.24);
}

.site-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.site-footer-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer-sep {
  color: #6a8f82;
}

.footer-link {
  color: #13362c;
  text-decoration: none;
  font-weight: 700;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-bug-link {
  color: #c82328;
  text-decoration: none;
  font-weight: 700;
}

.footer-bug-link:hover {
  text-decoration: underline;
}

.bug-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.85rem;
}

.bug-form-grid > label {
  min-width: 0;
}

.bug-form-grid select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bug-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bug-badge.status-open {
  background: var(--berry-soft);
  color: #ffb3b5;
  border: 1px solid var(--berry-border);
}

.bug-badge.status-investigating {
  background: var(--brass-soft);
  color: var(--brass);
  border: 1px solid var(--brass-border);
}

.bug-badge.status-resolved {
  background: var(--pine-soft);
  color: #9bf0c0;
  border: 1px solid var(--pine-border);
}

.bug-badge.status-closed {
  background: var(--bg-subtle);
  color: var(--muted);
  border: 1px solid var(--border);
}

.bug-badge.sev-critical,
.bug-badge.sev-high {
  background: var(--berry-soft);
  color: #ffb3b5;
  border: 1px solid var(--berry-border);
}

.bug-badge.sev-medium {
  background: var(--brass-soft);
  color: var(--brass);
  border: 1px solid var(--brass-border);
}

.bug-badge.sev-low {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.bug-admin-note {
  margin-top: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: var(--brass-soft);
  border: 1px solid var(--brass-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 100;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #25a55b 0%, #197a41 100%);
  color: #ffffff;
  border: 2.5px solid var(--ink-outline);
  box-shadow: var(--shadow-sm), var(--shadow-gloss);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.error {
  background: linear-gradient(180deg, #ff565c 0%, #c92228 100%);
  color: #fff8f8;
}

/* Documentation View */
.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
  gap: 1.5rem;
  align-items: start;
}

.docs-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  line-height: 1.15;
  margin: 0.35rem 0 0.75rem;
  color: var(--ink);
}

.docs-lead {
  color: var(--ink-secondary);
  font-size: 1.02rem;
  margin: 0;
  max-width: 60ch;
}

.docs-toc {
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-xs);
}

.docs-toc-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brass);
  margin-bottom: 0.65rem;
}

.docs-toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.docs-toc-btn {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-secondary);
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.65rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.docs-toc-btn:hover {
  background: var(--surface-hover);
  border-color: var(--ink-outline);
  color: var(--brass);
}

.docs-section {
  scroll-margin-top: 96px;
}

.docs-section h2 {
  margin-top: 0.25rem;
  margin-bottom: 0.65rem;
}

.docs-section > p {
  color: var(--ink-secondary);
  margin-top: 0;
}

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

.docs-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-tile {
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-xs);
}

.docs-tile h3 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.docs-tile p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.93rem;
}

.docs-list {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-secondary);
  font-size: 0.93rem;
}

.docs-list li + li {
  margin-top: 0.38rem;
}

.docs-lang-viewer {
  margin-top: 0.85rem;
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.docs-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 0.8rem;
  background: var(--code-chrome);
  border-bottom: 2.5px solid var(--ink-outline);
}

.docs-lang-tab {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.32rem 0.78rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.docs-lang-tab:hover {
  background: var(--surface-hover);
  color: var(--ink);
  transform: translateY(-1px);
}

.docs-lang-tab.active {
  background: linear-gradient(180deg, #ffe27a 0%, #f5b935 100%);
  color: #1f1403;
  font-weight: 700;
}

.docs-lang-meta {
  padding: 0.65rem 0.9rem;
  border-bottom: 2px solid var(--ink-outline);
  font-size: 0.88rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.docs-code-block {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0.95rem 1.05rem;
  font-size: 0.84rem;
  line-height: 1.55;
}

.docs-callout {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #4b3d16 0%, #34290d 100%);
  border: 2.5px solid var(--ink-outline);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  font-size: 0.93rem;
}

.docs-api-box {
  margin-top: 1rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  box-shadow: var(--shadow-xs);
}

.docs-api-box h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 0 0 0.4rem;
}

.docs-api-box .docs-code-block {
  border: 2px solid var(--ink-outline);
  border-radius: var(--radius-sm);
}

.docs-faq {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.docs-faq-item {
  background: var(--surface-tint);
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.05rem;
  box-shadow: var(--shadow-xs);
}

.docs-faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.docs-faq-item summary::-webkit-details-marker {
  display: none;
}

.docs-faq-item summary::after {
  content: "+";
  font-family: var(--font-display);
  color: var(--brass);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.docs-faq-item[open] summary::after {
  content: "−";
}

.docs-faq-item p {
  margin: 0.6rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.93rem;
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .snowflake,
  .bulb,
  body.party-mode .bulb,
  .party-toggle.is-active .party-toggle-icon,
  .party-elf-svg,
  .party-elf-hand {
    animation: none !important;
  }
  body.party-mode .bulb {
    opacity: 1;
    filter: brightness(1.22);
  }
  .snowfall {
    display: none;
  }
}

/* Responsive Breakpoints (Desktop Compact, Tablet & Mobile) */
@media (max-width: 1340px) {
  .topbar-inner {
    padding: 0.45rem 1rem;
    gap: 0.55rem;
  }
  .brand-sub {
    display: none;
  }
  .nav-btn {
    font-size: 0.85rem;
    padding: 0 0.62rem;
    gap: 0.28rem;
  }
  .topbar-actions .btn {
    padding: 0 0.76rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 1200px) {
  .snow-toggle-label {
    display: none;
  }
}

@media (max-width: 1024px) {
  body {
    background-attachment: scroll;
  }
  .container {
    margin-top: 1.5rem;
    padding: 0 1.15rem 2.2rem;
    gap: 1.35rem;
  }
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .masthead {
    grid-template-columns: 1fr;
    padding: 2rem 1.75rem 1.8rem;
    gap: 1.75rem;
  }
}

@media (max-width: 1140px) {
  .topbar-inner {
    min-height: 60px;
    padding: 0.45rem 1rem;
    gap: 0.65rem;
  }
  .brand-sub {
    display: block;
  }
  .nav-menu-toggle {
    display: inline-flex;
  }
  .nav-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.9rem 1rem 1.05rem;
    background: linear-gradient(180deg, #13352b 0%, #0d261f 100%);
    border-top: 2px solid var(--ink-outline);
    border-bottom: 3px solid var(--ink-outline);
    box-shadow: 0 14px 32px rgba(4, 14, 18, 0.58);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.18s ease;
  }
  .topbar.nav-open .nav-drawer {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .nav-btn {
    width: 100%;
    height: auto;
    min-height: 46px;
    padding: 0.6rem 0.9rem;
    justify-content: flex-start;
    gap: 0.55rem;
    font-size: 0.94rem;
    border-radius: 13px;
    background: var(--surface-tint);
    border: 2px solid rgba(255, 214, 112, 0.22);
    box-shadow: 0 3px 0 var(--ink-outline);
  }
  .nav-btn:hover {
    background: var(--surface-hover);
  }
  .nav-btn.active {
    border-color: var(--ink-outline);
    box-shadow: 0 3px 0 var(--ink-outline), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  }
  .nav-icon {
    font-size: 1.1rem;
  }
  .nav-btn-wide {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 880px) {
  .season-metrics,
  .editorial-strip,
  .auth-grid,
  .docs-hero,
  .docs-grid,
  .docs-grid.two-col {
    grid-template-columns: 1fr;
  }
  .metric-block + .metric-block {
    border-left: 0;
    padding-left: 0;
    border-top: 2px dashed rgba(255, 214, 112, 0.28);
    padding-top: 0.9rem;
  }
  .auth-divider-col {
    border-left: 0;
    padding-left: 0;
    border-top: 2px dashed rgba(255, 214, 112, 0.28);
    padding-top: 1.5rem;
  }
  .pip-strip {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
  }
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
  }
  .sample-grid,
  .case-io {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lb-name-cell {
    max-width: 140px;
  }
  .topbar-inner {
    min-height: 56px;
    padding: 0.45rem 0.85rem;
    gap: 0.5rem;
  }
  .brand {
    gap: 0.5rem;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .brand-sub {
    display: none;
  }
  .topbar-actions {
    gap: 0.42rem;
  }
  .topbar-actions #snow-toggle {
    display: none;
  }
  .topbar-actions #party-toggle {
    padding: 0 0.65rem;
    min-width: 42px;
    justify-content: center;
  }
  .topbar-actions .party-toggle-label {
    display: none;
  }
  .topbar-actions .btn {
    height: 42px;
    padding: 0 0.82rem;
    font-size: 0.86rem;
  }
  .nav-menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
  .nav-drawer {
    padding: 0.8rem 0.85rem 0.95rem;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .nav-btn {
    min-height: 46px;
    padding: 0.58rem 0.8rem;
    font-size: 0.9rem;
  }
  .nav-btn-wide {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .nav-drawer-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-top: 0.65rem;
    border-top: 2px dashed rgba(255, 214, 112, 0.24);
  }
  .nav-drawer-snow,
  .nav-drawer-party {
    width: 100%;
    height: 42px;
    justify-content: space-between;
    padding: 0 0.95rem;
    font-size: 0.9rem;
  }
  .snow-status-pill {
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.16rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgba(7, 20, 16, 0.22);
    border: 1.5px solid rgba(7, 20, 16, 0.35);
  }
  .christmas-lights {
    height: 16px;
    padding: 0 0.4rem;
  }
  .christmas-lights .bulb:nth-child(even) {
    display: none;
  }
  .container {
    margin-top: 1.1rem;
    padding: 0 0.85rem 1.75rem;
    gap: 1.1rem;
  }
  .card,
  .season-summary,
  .masthead {
    padding: 1.15rem 1rem;
    border-radius: var(--radius-md);
  }
  h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.2rem);
  }
  h2 {
    font-size: 1.3rem;
  }
  .masthead-lead {
    font-size: 0.96rem;
    margin-bottom: 1.2rem;
  }
  .masthead-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .masthead-actions .btn {
    width: 100%;
  }
  .mini-advent {
    padding: 1rem 0.85rem;
  }
  .mini-advent-grid {
    gap: 0.35rem;
  }
  .mini-door {
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .example-banner {
    padding: 1.05rem 1rem 1.05rem 1.35rem;
    border-radius: var(--radius-md);
  }
  .example-banner-main {
    flex: 1 1 100%;
  }
  .example-banner-actions {
    width: 100%;
  }
  .example-banner-actions .btn {
    width: 100%;
  }
  .calendar-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .day-tile {
    min-height: 128px;
    padding: 0.82rem;
  }
  .day-num {
    font-size: 1.35rem;
  }
  .day-title {
    font-size: 0.88rem;
  }
  .timer-pill {
    width: 100%;
    justify-content: space-between;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.35rem 0.75rem;
  }
  .prompt-box {
    padding: 1rem;
  }
  .prompt-text {
    font-size: 0.92rem;
  }
  .sample-box {
    padding: 0.85rem;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  select#lang-select {
    width: 100%;
  }
  .editor-shell {
    height: 320px;
  }
  .editor-gutter {
    flex: 0 0 2.5rem;
    font-size: 0.78rem;
  }
  textarea#code-editor {
    font-size: 16px;
    padding: 0.85rem 0.65rem;
  }
  .lint-item {
    grid-template-columns: auto 4.2rem minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
  }
  .lint-rule {
    display: none;
  }
  .workspace-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .workspace-actions .btn {
    width: 100%;
  }
  th,
  td {
    padding: 0.6rem 0.55rem;
    font-size: 0.84rem;
  }
  .winter-horizon svg {
    height: auto;
    min-height: 76px;
  }
  .site-footer-inner {
    text-align: center;
    padding: 0.65rem 1rem 1.2rem;
    gap: 0.55rem;
    font-size: 0.84rem;
  }
  .site-footer-meta {
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
  }
  .site-footer-links {
    justify-content: center;
  }
  .toast {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
    text-align: center;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 370px) {
  .brand-sub {
    display: none;
  }
  .nav {
    grid-template-columns: 1fr;
  }
  .nav-btn-wide {
    justify-content: flex-start;
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .mini-advent-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Interactive CTF Container Shell Terminal */
.ctf-shell-mount {
  border: 2.5px solid var(--ink-outline);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.frosty-tty-root {
  position: relative;
  overflow: hidden;
}

.frosty-tty-screen {
  position: relative;
  width: 100%;
  height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--code-text);
  background: #06110e;
  cursor: text;
  outline: none;
}

.frosty-tty-screen:focus,
.frosty-tty-screen:focus-within,
.frosty-tty-root:focus-within .frosty-tty-screen {
  box-shadow: inset 0 0 0 2px rgba(126, 216, 255, 0.55);
}

.frosty-tty-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  resize: none;
  pointer-events: none;
  background: transparent;
  color: transparent;
}

.frosty-tty-output {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.frosty-tty-line {
  min-height: 1.45em;
}

.frosty-tty-cursor {
  background: #7ed8ff;
  color: #06110e;
  font-weight: 700;
  border-radius: 2px;
  animation: fb-tty-blink 1.1s steps(2, start) infinite;
}

@keyframes fb-tty-blink {
  to {
    background: transparent;
    color: var(--code-text);
  }
}


/* ============================================================================
   KIDS ADVENT WORKSHOP (Ages 5–10) — Chunky, Colourful, Touch-Friendly UI
   ============================================================================ */

.kids-account-banner {
  background: linear-gradient(135deg, rgba(37, 165, 91, 0.24), rgba(126, 216, 255, 0.14));
  border-color: var(--brass-border);
}

.kids-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.72rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(126, 216, 255, 0.18);
  border: 2px solid var(--ink-outline);
  color: var(--snow);
  box-shadow: var(--shadow-xs);
}

.kids-pill.gold {
  background: var(--brass);
  color: #071410;
}

.kids-game-heading {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0.85rem 0 0.45rem;
}

.kids-prompt-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.62;
  color: var(--ink);
}

.kids-tips-box {
  margin-top: 0.85rem;
}

.kids-play-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #163d34 0%, #102d28 100%);
}

.kids-game-mount {
  position: relative;
  min-height: 320px;
}

.kids-stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.kids-round-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.kids-clue-card {
  width: 100%;
  max-width: 640px;
  text-align: center;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(8, 24, 34, 0.48);
  border: 2.5px solid var(--ink-outline);
  box-shadow: var(--shadow-xs);
}

.kids-big-emoji {
  font-size: 3.8rem;
  line-height: 1.15;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 4px 0 rgba(7, 20, 16, 0.55));
}

.kids-clue-text {
  margin: 0.25rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--snow);
}

/* Word Baubles */
.kids-word-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.kids-word-slot {
  width: 56px;
  height: 62px;
  border-radius: 14px;
  border: 3px dashed rgba(255, 209, 92, 0.65);
  background: rgba(7, 20, 16, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brass);
}

.kids-word-slot.filled {
  border-style: solid;
  border-color: #071410;
  background: var(--pine);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
  transform: translateY(-2px);
}

.kids-bauble-rack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.kids-bauble-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #071410;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 4px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.kids-bauble-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
}

.kids-bauble-btn.berry { background: #ef3b42; }
.kids-bauble-btn.pine { background: #25a55b; }
.kids-bauble-btn.gold { background: #f2b728; color: #071410; }
.kids-bauble-btn.frost { background: #2e95d3; }
.kids-bauble-btn.plum { background: #9b51e0; }

.kids-bauble-btn.used {
  opacity: 0.22;
  transform: scale(0.9);
  cursor: default;
}

.kids-bauble-cap {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 8px;
  border-radius: 3px;
  background: var(--brass);
  border: 2px solid #071410;
}

/* Number Baskets & Toy Scales */
.kids-math-baskets {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kids-basket-box {
  min-width: 120px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(8, 24, 34, 0.55);
  border: 2.5px solid #071410;
  box-shadow: var(--shadow-xs);
  text-align: center;
}

.kids-basket-box.question {
  min-width: 78px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--brass);
}

.kids-basket-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  font-size: 1.85rem;
}

.kids-basket-num {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--brass);
}

.kids-math-op {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--snow);
}

.kids-tin-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.85rem 0;
}

.kids-count-item {
  font-size: 2rem;
}

.kids-count-slot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px dashed var(--brass);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--brass);
}

.kids-scale-stage {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.kids-scale-beam {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(8, 24, 34, 0.5);
  border: 2.5px solid #071410;
  margin-bottom: 0.75rem;
}

.kids-scale-pan {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.kids-weight-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.kids-weight-block {
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  border: 2.5px solid #071410;
  font-family: var(--font-display);
  font-size: 1.2rem;
  box-shadow: var(--shadow-xs);
}

.kids-weight-block.pine { background: var(--pine); }
.kids-weight-block.berry { background: var(--berry); }
.kids-weight-block.frost { background: #2e95d3; }
.kids-weight-block.mystery {
  background: var(--brass);
  color: #071410;
}

.kids-pan-plate {
  width: 100%;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #c98e16;
  color: #071410;
  font-weight: 800;
  border: 2px solid #071410;
}

.kids-scale-fulcrum {
  font-size: 2.4rem;
}

.kids-choices-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.kids-choice-btn {
  min-width: 78px;
  height: 68px;
  padding: 0 1.2rem;
  border-radius: 18px;
  border: 3px solid #071410;
  background: var(--snow);
  color: #071410;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease;
}

.kids-choice-btn:hover {
  transform: translateY(-3px);
  background: var(--brass);
}

.kids-choice-btn.correct {
  background: var(--pine);
  color: #ffffff;
}

/* Memory Match */
.kids-mem-grid {
  display: grid;
  grid-template-columns: repeat(var(--mem-cols, 4), minmax(72px, 108px));
  gap: 0.65rem;
  justify-content: center;
}

.kids-mem-card {
  height: 96px;
  border-radius: 16px;
  border: 3px solid #071410;
  background: linear-gradient(145deg, #ef3b42, #b82027);
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  transition: transform 0.15s ease;
}

.kids-mem-card:hover:not(:disabled) {
  transform: translateY(-3px);
}

.kids-mem-card.open {
  background: var(--snow);
  color: #071410;
}

.kids-mem-card.matched {
  background: #d8f8e5;
  border-color: var(--pine-border);
}

.kids-mem-front {
  font-size: 2rem;
}

.kids-mem-back {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.kids-mem-card.open .kids-mem-front {
  display: none;
}

.kids-mem-card.open .kids-mem-back {
  display: flex;
}

.kids-mem-icon {
  font-size: 2.1rem;
  line-height: 1.1;
}

/* Pattern Strand */
.kids-pattern-wire {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kids-pattern-node {
  min-width: 56px;
  height: 56px;
  padding: 0 0.55rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 2.5px solid #071410;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.65rem;
}

.kids-pattern-node.mystery {
  border-style: dashed;
  border-color: var(--brass);
  background: rgba(255, 209, 92, 0.18);
}

/* Word Safari Grid */
.kids-word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.kids-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 24, 34, 0.55);
  border: 2px solid #071410;
  font-size: 0.95rem;
}

.kids-word-chip.done {
  background: var(--pine);
  color: #ffffff;
  text-decoration: line-through;
}

.kids-ws-grid {
  display: grid;
  grid-template-columns: repeat(var(--ws-cols, 6), minmax(44px, 56px));
  gap: 0.42rem;
  justify-content: center;
}

.kids-ws-cell {
  height: 52px;
  border-radius: 12px;
  border: 2.5px solid #071410;
  background: var(--snow);
  color: #071410;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.kids-ws-cell.selected {
  background: var(--brass);
  transform: scale(1.05);
}

.kids-ws-cell.found {
  background: var(--pine);
  color: #ffffff;
}

.kids-ws-cell.hint-glow {
  box-shadow: 0 0 0 4px var(--berry), var(--shadow-xs);
}

/* 2D & 3D Canvas Stage + Controls */
.kids-canvas-wrap {
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-md);
  border: 3px solid #071410;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0b1e2d;
  touch-action: none;
}

.kids-game-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: none;
}

.kids-dpad-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.kids-dpad-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.kids-ctrl-btn {
  min-width: 124px;
  font-size: 1rem;
  padding: 0.6rem 1.05rem;
  user-select: none;
}

/* 2D Maze Grid */
.kids-maze-grid {
  display: grid;
  grid-template-columns: repeat(var(--maze-cols, 7), minmax(36px, 50px));
  gap: 4px;
  padding: 0.55rem;
  border-radius: var(--radius-md);
  background: #0b2230;
  border: 3px solid #071410;
}

.kids-maze-cell {
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1.5px solid rgba(7, 20, 16, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  padding: 0;
}

.kids-maze-cell.wall {
  background: #144933;
  cursor: default;
}

.kids-maze-cell.path {
  background: #e9f7ff;
  color: #071410;
  cursor: pointer;
}

.kids-maze-cell.here {
  background: var(--brass);
}

.kids-maze-cell.goal {
  background: #ffd9df;
}

.kids-maze-foot {
  color: #7ab8db;
  font-size: 1.1rem;
}

/* Musical Jingle Bells */
.kids-bell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 168px));
  gap: 0.85rem;
}

.kids-bell-pad {
  height: 124px;
  border-radius: 20px;
  border: 3px solid #071410;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: #ffffff;
  font-family: var(--font-display);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.kids-bell-pad.berry { background: #d62f37; }
.kids-bell-pad.gold { background: #e6a919; color: #071410; }
.kids-bell-pad.pine { background: #1f924f; }
.kids-bell-pad.frost { background: #2684c4; }

.kids-bell-pad.lit {
  transform: scale(1.07);
  filter: brightness(1.32);
  box-shadow: 0 0 24px rgba(255, 240, 175, 0.9);
}

.kids-bell-emoji {
  font-size: 2.3rem;
}

/* Picture Swap Jigsaw */
.kids-mini-btn {
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 2px solid #071410;
  background: rgba(255, 255, 255, 0.12);
  color: var(--snow);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.kids-mini-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.kids-mini-btn.active {
  background: var(--brass);
  color: #071410;
}

.kids-jigsaw-tip {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #e9f7ff;
  text-align: center;
}

.kids-jigsaw-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.kids-jigsaw-grid {
  display: grid;
  grid-template-columns: repeat(var(--jig-cols, 3), 112px);
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: #0b1e2d;
  border: 3px solid #071410;
}

.kids-jigsaw-ref {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(8, 24, 34, 0.6);
  border: 2.5px solid #071410;
  box-shadow: var(--shadow-xs);
}

.kids-jigsaw-ref-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--brass);
}

.kids-jigsaw-ref-canvas {
  display: block;
  border-radius: 10px;
  border: 2.5px solid #071410;
  background: #102c46;
}

.kids-jigsaw-ref-cap {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cfe9f7;
}

.kids-jigsaw-tile {
  position: relative;
  width: 112px;
  height: 102px;
  padding: 0;
  border-radius: 10px;
  border: 3px solid #071410;
  overflow: hidden;
  cursor: pointer;
  background: #102c46;
}

.kids-jigsaw-tile canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.kids-jigsaw-tile.selected {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass);
  transform: scale(1.04);
  z-index: 2;
}

.kids-jigsaw-tile.home {
  border-color: var(--pine-border);
}

.kids-jigsaw-tile.hint-target {
  border-color: #ffd15c;
  box-shadow: 0 0 0 3px rgba(255, 209, 92, 0.92), 0 0 18px rgba(255, 209, 92, 0.75);
  z-index: 2;
}

.kids-tile-num {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(7, 20, 16, 0.84);
  color: #ffd15c;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffd15c;
}

.kids-tile-lock {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pine);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #071410;
}

.kids-tile-target-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffd15c;
  color: #071410;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1.5px solid #071410;
  white-space: nowrap;
}

/* Victory Banner & Confetti */
.kids-victory-banner {
  width: 100%;
  max-width: 540px;
  margin: 1rem auto 0;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(37, 165, 91, 0.34), rgba(255, 209, 92, 0.24));
  border: 3px solid var(--brass);
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: kids-pop-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.kids-victory-stars {
  font-size: 2.3rem;
  letter-spacing: 0.2rem;
}

.kids-victory-title {
  margin: 0.3rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.kids-victory-sub {
  margin: 0 0 0.9rem;
  color: var(--snow);
}

.kids-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.kids-confetti-piece {
  position: absolute;
  top: -2rem;
  font-size: 1.5rem;
  animation-name: kids-confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

.wiggle {
  animation: kids-wiggle 0.32s ease;
}

@keyframes kids-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes kids-pop-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes kids-confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(420px) rotate(320deg);
    opacity: 0;
  }
}

@media (max-width: 560px) {
  .kids-jigsaw-grid {
    grid-template-columns: repeat(var(--jig-cols, 3), minmax(74px, 1fr));
  }
  .kids-jigsaw-tile {
    width: 100%;
    height: auto;
    aspect-ratio: 112 / 102;
  }
  .kids-mem-grid {
    grid-template-columns: repeat(3, minmax(74px, 1fr));
  }
}


/* ============================================================================
   NEW KIDS GAME ENGINES (Rhyme, Spot Difference, Pipes, Sorter, Coder, Paint)
   ============================================================================ */

/* Rhyme & Riddle */
.kids-rhyme-hint-badge {
  display: inline-block;
  margin: 0.55rem 0 0;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 209, 92, 0.2);
  border: 2px solid var(--brass);
  color: var(--brass);
  font-weight: 800;
  font-size: 0.92rem;
}

.kids-rhyme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 210px));
  gap: 0.8rem;
  justify-content: center;
  width: 100%;
}

.kids-rhyme-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 3px solid #071410;
  background: var(--snow);
  color: #071410;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.kids-rhyme-choice:hover:not(:disabled) {
  transform: translateY(-3px);
  background: var(--brass);
}

.kids-rhyme-choice.correct {
  background: var(--pine);
  color: #ffffff;
}

.kids-rhyme-choice.eliminated {
  opacity: 0.25;
  cursor: default;
}

.kids-rhyme-emoji {
  font-size: 2.35rem;
  line-height: 1.1;
}

.kids-rhyme-word {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Spot the Difference */
.kids-diff-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  max-width: 720px;
}

.kids-diff-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem;
  border-radius: 16px;
  background: rgba(8, 24, 34, 0.55);
  border: 2.5px solid #071410;
}

.kids-diff-label {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--brass);
}

.kids-diff-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2.5px solid #071410;
  cursor: crosshair;
  touch-action: manipulation;
}

.kids-diff-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.kids-diff-chip {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(8, 24, 34, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--snow);
}

.kids-diff-chip.found {
  background: var(--pine);
  border-color: #071410;
  color: #ffffff;
}

/* Hot Cocoa Pipe Builder */
.kids-pipe-grid {
  display: grid;
  grid-template-columns: repeat(var(--pipe-cols, 4), minmax(66px, 92px));
  gap: 0.4rem;
  justify-content: center;
  padding: 0.65rem;
  border-radius: 18px;
  background: rgba(8, 24, 34, 0.65);
  border: 3px solid #071410;
}

.kids-pipe-tile {
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 12px;
  border: 2.5px solid #071410;
  background: #142a40;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.kids-pipe-tile:hover:not(:disabled) {
  transform: scale(1.04);
  background: #1e3b58;
}

.kids-pipe-tile.powered {
  background: #233b2e;
  box-shadow: 0 0 12px rgba(255, 209, 92, 0.35);
}

.kids-pipe-tile.fixed {
  cursor: default;
}

.kids-pipe-tile.hint-glow {
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(255, 209, 92, 0.55);
}

.kids-pipe-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.kids-pipe-snow {
  font-size: 1.5rem;
  opacity: 0.35;
}

/* Santa's Conveyor Gift Sorter */
.kids-conveyor-belt {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(20, 42, 64, 0.88),
    rgba(20, 42, 64, 0.88) 14px,
    rgba(13, 30, 46, 0.92) 14px,
    rgba(13, 30, 46, 0.92) 28px
  );
  border: 3px solid #071410;
  box-shadow: var(--shadow-sm);
}

.kids-conveyor-item.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.4rem;
  border-radius: 16px;
  background: var(--snow);
  color: #071410;
  border: 3px solid #071410;
  box-shadow: var(--shadow-xs);
  animation: kids-pop-in 0.2s ease;
}

.kids-conveyor-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.kids-conveyor-item.next {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.65;
  font-size: 1.8rem;
  color: var(--snow);
}

.kids-conveyor-item.next small {
  font-size: 0.72rem;
  font-weight: 700;
}

.kids-sorter-bins {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 175px));
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

.kids-sorter-bin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.95rem 0.65rem;
  border-radius: 18px;
  border: 3px solid #071410;
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}

.kids-sorter-bin.berry { background: #ef3b42; }
.kids-sorter-bin.gold { background: #f2b728; color: #071410; }
.kids-sorter-bin.frost { background: #2e95d3; }
.kids-sorter-bin.pine { background: #25a55b; }

.kids-sorter-bin:hover {
  transform: translateY(-4px);
}

.kids-sorter-bin.correct {
  transform: scale(1.06);
  box-shadow: 0 0 0 4px #22c55e;
}

.kids-sorter-bin-key {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.75;
}

.kids-sorter-bin-emoji {
  font-size: 2.3rem;
}

.kids-sorter-bin-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

/* Elf Path Programmer (Kids Block Coding) */
.kids-code-grid {
  display: grid;
  grid-template-columns: repeat(var(--code-cols, 4), minmax(52px, 68px));
  gap: 0.35rem;
  justify-content: center;
  padding: 0.6rem;
  border-radius: 16px;
  background: rgba(8, 24, 34, 0.6);
  border: 3px solid #071410;
}

.kids-code-cell {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 2px solid #071410;
  background: #d9eefc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
}

.kids-code-cell.wall {
  background: #174d33;
}

.kids-code-cell.elf {
  background: #ffd15c;
  box-shadow: 0 0 10px rgba(255, 209, 92, 0.7);
}

.kids-code-cell.goal {
  background: #fde68a;
}

.kids-code-tray {
  width: 100%;
  max-width: 560px;
  min-height: 54px;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: rgba(8, 24, 34, 0.58);
  border: 2.5px dashed rgba(255, 209, 92, 0.65);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.kids-code-block {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--snow);
  border: 2px solid #071410;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.kids-code-block.active {
  background: var(--brass);
  transform: scale(1.14);
  box-shadow: 0 0 10px rgba(255, 209, 92, 0.8);
}

.kids-code-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.kids-code-dir {
  min-width: 96px;
  font-weight: 800;
}

/* Color-by-Number Holiday Pixel Paint */
.kids-paint-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.kids-paint-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 2.5px solid #071410;
  background: rgba(8, 24, 34, 0.65);
  color: var(--snow);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.kids-paint-swatch.selected {
  background: var(--snow);
  color: #071410;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--brass);
}

.kids-paint-swatch.done {
  opacity: 0.55;
}

.kids-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch-bg, #ef3b42);
  border: 2px solid #071410;
}

.kids-pixel-grid {
  display: grid;
  grid-template-columns: repeat(var(--pixel-cols, 8), minmax(30px, 44px));
  gap: 3px;
  justify-content: center;
  padding: 0.55rem;
  border-radius: 16px;
  background: #071410;
  border: 3px solid #071410;
  user-select: none;
  touch-action: none;
}

.kids-pixel-grid.complete {
  gap: 0;
  box-shadow: 0 0 24px rgba(255, 209, 92, 0.55);
}

.kids-pixel-cell {
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: #e2e8f0;
  color: #1e293b;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.kids-pixel-grid.complete .kids-pixel-cell {
  border-radius: 0;
}

.kids-pixel-cell.hint-pulse {
  background: #fef08a;
  box-shadow: inset 0 0 0 3px #f59e0b;
}

/* Shared touch & desktop ergonomics across all 20 kids games & puzzles */
.kids-bauble-btn,
.kids-choice-btn,
.kids-mem-card,
.kids-ws-cell,
.kids-maze-cell,
.kids-bell-pad,
.kids-jigsaw-tile,
.kids-pipe-tile,
.kids-rhyme-choice,
.kids-sorter-bin,
.kids-code-dir,
.kids-paint-swatch,
.kids-pixel-cell,
.kids-ctrl-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.kids-ctrl-btn {
  touch-action: none;
}

.kids-ws-grid {
  touch-action: none;
  max-width: 100%;
}

.kids-dpad-bottom-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
}

.kids-dpad-up {
  min-width: 124px;
}

#kidsJigPreviewCanvas {
  max-width: 100%;
  height: auto;
}

.kids-sorter-bins {
  grid-template-columns: repeat(var(--bin-cols, 3), minmax(0, 1fr));
}

@media (max-width: 640px) {
  .kids-play-card {
    padding: 0.95rem 0.7rem;
  }
  .kids-round-bar {
    gap: 0.45rem;
  }
  .kids-dpad-row,
  .kids-dpad-bottom-row {
    width: 100%;
    gap: 0.4rem;
  }
  .kids-dpad-row .kids-ctrl-btn,
  .kids-dpad-bottom-row .kids-ctrl-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.65rem 0.45rem;
    font-size: 0.88rem;
  }
  .kids-ws-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(var(--ws-cols, 6), minmax(0, 1fr));
    gap: 0.28rem;
    padding: 0.45rem;
  }
  .kids-ws-cell {
    width: 100%;
    min-height: 40px;
    aspect-ratio: 1 / 1;
    font-size: clamp(0.95rem, 4vw, 1.25rem);
  }
  .kids-maze-grid {
    width: 100%;
    max-width: 380px;
    grid-template-columns: repeat(var(--maze-cols, 7), minmax(0, 1fr));
    gap: 0.22rem;
    padding: 0.4rem;
  }
  .kids-maze-cell {
    width: 100%;
    min-height: 36px;
    aspect-ratio: 1 / 1;
    font-size: clamp(0.9rem, 4.2vw, 1.35rem);
  }
  .kids-jigsaw-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(var(--jig-cols, 3), minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.45rem;
  }
  .kids-jigsaw-tile {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .kids-mem-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(min(var(--mem-cols, 4), 4), minmax(0, 1fr));
    gap: 0.4rem;
  }
  .kids-mem-card {
    min-height: 76px;
    height: auto;
    aspect-ratio: 4 / 5;
  }
  .kids-rhyme-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .kids-diff-pair {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .kids-diff-card {
    padding: 0.45rem;
  }
  .kids-pipe-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(var(--pipe-cols, 4), minmax(0, 1fr));
    gap: 0.3rem;
    padding: 0.45rem;
  }
  .kids-pipe-tile {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .kids-sorter-bins {
    width: 100%;
    grid-template-columns: repeat(var(--bin-cols, 3), minmax(0, 1fr));
    gap: 0.45rem;
  }
  .kids-sorter-bin {
    padding: 0.65rem 0.35rem;
    min-height: 92px;
  }
  .kids-sorter-bin-label {
    font-size: 0.82rem;
  }
  .kids-code-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(var(--code-cols, 4), minmax(0, 1fr));
    gap: 0.28rem;
    padding: 0.45rem;
  }
  .kids-code-cell {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 44px;
  }
  .kids-code-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 320px;
    gap: 0.45rem;
  }
  .kids-code-dir {
    min-width: 0;
    width: 100%;
    min-height: 44px;
  }
  .kids-pixel-grid {
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(var(--pixel-cols, 8), minmax(0, 1fr));
    gap: 2px;
    padding: 0.4rem;
  }
  .kids-pixel-cell {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    font-size: clamp(0.68rem, 2.8vw, 0.9rem);
  }
  .kids-bell-grid {
    width: 100%;
    max-width: 340px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .kids-bell-pad {
    min-height: 108px;
  }
}



/* =========================================================================
   Santa's Magic Sleigh Dashboard (Kid-Friendly Cockpit Layout)
   ========================================================================= */

.nav-btn-santa {
  border-color: rgba(239, 59, 66, 0.5);
}

.nav-btn-santa.active {
  background: linear-gradient(180deg, #ff5158 0%, #ef3b42 100%);
  color: #fffaf0;
  border-color: var(--ink-outline);
}

.container:has(.santa-dashboard) {
  max-width: 1320px;
}

.container:has(.santa-game-page) {
  max-width: 1120px;
}

.santa-dashboard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Floating Snow Magic Overlay */
.santa-magic-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}

.santa-magic-flake {
  position: absolute;
  top: -2.2rem;
  user-select: none;
  animation: santa-magic-snowfall 2.4s ease-in forwards;
  filter: drop-shadow(0 2px 6px rgba(126, 216, 255, 0.65));
}

/* Rudolph Super Glow & Turbo Boost Global Dashboard States */
.santa-dashboard.is-rudolph-glow .santa-cockpit-header,
.santa-dashboard.is-rudolph-glow .santa-map-card,
.santa-dashboard.is-rudolph-glow .santa-control-deck {
  box-shadow: 0 0 26px rgba(255, 68, 78, 0.55), var(--shadow-md);
  border-color: #ff6b72;
}

.santa-dashboard.is-rudolph-glow .rudolph-nose-glow {
  transform: scale(1.65);
  transform-box: fill-box;
  transform-origin: center;
  fill: rgba(255, 59, 66, 0.92);
}

.santa-dashboard.is-turbo .santa-speedo-box {
  box-shadow: 0 0 24px rgba(255, 209, 92, 0.65), inset 0 0 18px rgba(59, 232, 131, 0.25);
  border-color: var(--brass);
}

/* Top Cockpit Header */
.santa-cockpit-header {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.25rem;
  background:
    radial-gradient(ellipse 65% 85% at 92% 10%, rgba(255, 209, 92, 0.26), transparent 62%),
    radial-gradient(ellipse 55% 75% at 8% 92%, rgba(239, 59, 66, 0.26), transparent 62%),
    linear-gradient(135deg, #19473a 0%, #12332c 52%, #183452 100%);
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  animation: santa-card-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.santa-cockpit-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background: var(--candy-stripe);
  background-size: 62px 62px;
  animation: santa-candy-scroll 3.4s linear infinite;
  z-index: 2;
}

.santa-hero-aurora {
  position: absolute;
  inset: -30% -15%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 46% 32% at 24% 25%, rgba(59, 232, 131, 0.22), transparent 70%),
    radial-gradient(ellipse 42% 28% at 72% 22%, rgba(126, 216, 255, 0.22), transparent 68%),
    radial-gradient(ellipse 36% 24% at 50% 82%, rgba(255, 209, 92, 0.16), transparent 70%);
  filter: blur(18px);
  animation: santa-aurora-drift 11s ease-in-out infinite alternate;
}

.santa-cockpit-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.92fr);
  gap: 1.1rem;
  align-items: center;
  padding-top: 0.35rem;
}

/* Interactive Talking Santa Mascot */
.santa-mascot-zone {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.santa-mascot-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.45rem 0.45rem;
  border-radius: 22px;
  border: 3px solid var(--ink-outline);
  background: radial-gradient(circle at 50% 30%, #ffe69a, #f2a922);
  box-shadow: 0 5px 0 var(--ink-outline);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}

.santa-mascot-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 0 var(--ink-outline);
}

.santa-mascot-btn:active {
  transform: translateY(3px) scale(0.97);
  box-shadow: 0 2px 0 var(--ink-outline);
}

.santa-mascot-btn.is-bouncing {
  animation: santa-mascot-hop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.santa-mascot-svg {
  display: block;
  filter: drop-shadow(0 3px 0 rgba(7, 20, 16, 0.3));
}

.santa-mascot-tap-hint {
  margin-top: -0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: #ef3b42;
  color: #fffaf0;
  border: 2px solid var(--ink-outline);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.santa-mascot-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.santa-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.santa-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.72rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(126, 216, 255, 0.22);
  color: #e6f7ff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.santa-live-pill.is-live {
  background: linear-gradient(180deg, #ff5158, #d9262d);
  color: #fff;
  animation: santa-pulse 1.8s ease-in-out infinite;
}

.santa-live-pill.is-eve {
  background: linear-gradient(180deg, #ffd15c, #e5a319);
  color: #1d1404;
}

.santa-live-pill.is-done {
  background: linear-gradient(180deg, #34c772, #1b8c4b);
  color: #fff;
}

.santa-sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.72rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: linear-gradient(180deg, #32c973, #1e9651);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--ink-outline);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.santa-sound-btn[aria-pressed="false"] {
  background: rgba(16, 40, 48, 0.8);
  color: var(--muted);
}

.santa-sound-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-outline);
}

.santa-cockpit-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.38rem, 2.5vw, 1.95rem);
  line-height: 1.12;
  color: #fffaf0;
  text-shadow: 0 3px 0 rgba(7, 20, 16, 0.55);
}

.santa-speech-bubble {
  position: relative;
  display: inline-block;
  padding: 0.48rem 0.8rem;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  background: #fffaf0;
  color: #142820;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 3px 0 var(--ink-outline);
  max-width: 100%;
}

.santa-speech-bubble.is-popping {
  animation: santa-bubble-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Chunky Sleeps & Countdown Console */
.santa-countdown-console {
  background: rgba(7, 22, 32, 0.72);
  border: 3px solid var(--ink-outline);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  box-shadow: var(--shadow-sm), inset 0 2px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.santa-sleeps-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: linear-gradient(90deg, rgba(255, 209, 92, 0.25), rgba(126, 216, 255, 0.22));
  color: #ffe699;
  font-family: var(--font-display);
  font-size: 0.98rem;
  text-align: center;
}

.santa-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.santa-time-tile {
  border: 2.5px solid var(--ink-outline);
  border-radius: 14px;
  padding: 0.45rem 0.3rem;
  box-shadow: 0 4px 0 var(--ink-outline);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.santa-time-tile.tile-berry {
  background: linear-gradient(180deg, #ff5b62 0%, #c9262e 100%);
}

.santa-time-tile.tile-gold {
  background: linear-gradient(180deg, #ffcf4d 0%, #d48c12 100%);
}

.santa-time-tile.tile-pine {
  background: linear-gradient(180deg, #35c470 0%, #1c8549 100%);
}

.santa-time-tile.tile-frost {
  background: linear-gradient(180deg, #4ec0ff 0%, #1d7cc4 100%);
}

.santa-time-tile.is-ticking {
  animation: santa-digit-tick 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.santa-time-num {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fffaf0;
  text-shadow: 0 2px 0 rgba(7, 20, 16, 0.45);
  font-variant-numeric: tabular-nums;
}

.santa-time-tile.tile-gold .santa-time-num,
.santa-time-tile.tile-gold .santa-time-unit {
  color: #1f1403;
  text-shadow: none;
}

.santa-time-unit {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 250, 240, 0.92);
  margin-top: 0.1rem;
}

.santa-tz-caption {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(214, 241, 255, 0.85);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* =========================================================================
   MAIN 2-COLUMN BENTO DASHBOARD GRID
   ========================================================================= */
.santa-bento-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

.santa-bento-left,
.santa-bento-right {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

.santa-bento-left > :last-child,
.santa-bento-right > :last-child {
  flex: 1;
}

.santa-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.santa-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.santa-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: #fffaf0;
}

/* Global Flight Radar Card */
.santa-map-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
}

.santa-radar-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(126, 216, 255, 0.22);
  color: #dff5ff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.santa-radar-badge.is-live {
  background: var(--berry);
  color: #fff;
  animation: santa-pulse 1.6s ease-in-out infinite;
}

.santa-radar-badge.is-sim {
  background: #3b82f6;
  color: #fff;
}

.santa-radar-badge.is-done {
  background: var(--pine);
  color: #fff;
}

.santa-map-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 3px solid var(--ink-outline);
  background: #0d355c;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.42);
}

.santa-world-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

/* Friendly Non-Blocking Floating Launch Strip at Bottom of Map */
.santa-map-launch-strip {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.58rem 0.85rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: rgba(11, 37, 50, 0.88);
  backdrop-filter: blur(4px);
  box-shadow: 0 5px 0 rgba(7, 20, 16, 0.75);
}

.santa-launch-copy {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: #fffaf0;
}

.santa-launch-icon {
  font-size: 1.5rem;
  line-height: 1;
  animation: santa-standby-float 2.4s ease-in-out infinite;
}

.santa-launch-sub {
  display: block;
  font-size: 0.78rem;
  color: #bfe7ff;
}

.santa-mega-fly-btn {
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(180deg, #ff5d64 0%, #e02830 100%);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--ink-outline);
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
  white-space: nowrap;
}

.santa-mega-fly-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 0 var(--ink-outline);
}

.santa-mega-fly-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink-outline);
}

/* Pretend Flight Controls Bar */
.santa-sim-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  background: rgba(59, 130, 246, 0.22);
}

.santa-sim-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
}

.santa-sim-controls input[type="range"] {
  flex: 1;
  min-width: 110px;
  accent-color: var(--brass);
}

/* Flight Telemetry HUD */
.santa-flight-hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.santa-hud-cell {
  background: rgba(8, 24, 34, 0.65);
  border: 2px solid var(--ink-outline);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.santa-hud-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.santa-hud-val {
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #fffaf0;
  font-variant-numeric: tabular-nums;
}

.santa-hud-sub {
  font-size: 0.74rem;
  color: var(--brass);
  font-weight: 700;
}

/* City Postcard Spotlight */
.santa-city-spotlight {
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(90deg, rgba(255, 209, 92, 0.14), rgba(126, 216, 255, 0.1));
}

.santa-spotlight-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.santa-spotlight-content.is-entering {
  animation: santa-spotlight-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.santa-spotlight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.98rem;
}

.santa-spotlight-greeting {
  font-size: 0.88rem;
  color: var(--brass);
  font-weight: 700;
}

.santa-spotlight-fact {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.santa-stop-tag {
  padding: 0.14rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink-outline);
  font-size: 0.72rem;
  font-weight: 700;
}

.santa-stop-tag.visited {
  background: var(--pine);
  color: #fff;
}

.santa-stop-tag.next {
  background: var(--berry);
  color: #fff;
}

.santa-stop-tag.planned {
  background: rgba(126, 216, 255, 0.24);
  color: #dff5ff;
}

.santa-stops-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.santa-stops-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin-bottom: 0.3rem;
}

.santa-stop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.santa-stop-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink-outline);
  background: rgba(8, 24, 34, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
}

.santa-stop-chip.visited {
  background: rgba(37, 165, 91, 0.26);
  border-color: var(--pine-border);
}

.santa-stop-chip.next {
  background: rgba(239, 59, 66, 0.32);
  border-color: var(--berry-border);
}

/* =========================================================================
   SLEIGH CONTROL DECK — BIG CHUNKY 3D TOY BUTTONS!
   ========================================================================= */
.santa-control-deck {
  padding: 1rem 1.05rem;
  border: 3px solid var(--ink-outline);
  background:
    radial-gradient(ellipse 65% 80% at 50% 0%, rgba(255, 209, 92, 0.14), transparent 65%),
    linear-gradient(180deg, #163646 0%, #0f2532 100%);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.santa-deck-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.santa-deck-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.santa-deck-lights {
  display: inline-flex;
  gap: 0.3rem;
}

.deck-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--ink-outline);
  animation: santa-star-twinkle 2.2s ease-in-out infinite;
}

.deck-dot.red { background: #ff545c; animation-delay: 0s; }
.deck-dot.gold { background: #ffd15c; animation-delay: 0.6s; }
.deck-dot.green { background: #46e086; animation-delay: 1.2s; }

.santa-deck-counters {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.santa-mini-counter {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(7, 20, 16, 0.58);
  font-family: var(--font-display);
  font-size: 0.86rem;
  color: #fffaf0;
}

.santa-toy-btn-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.santa-toy-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.85rem 0.55rem 0.78rem;
  border-radius: 18px;
  border: 3px solid var(--ink-outline);
  box-shadow: 0 6px 0 var(--ink-outline), inset 0 3px 0 rgba(255, 255, 255, 0.38);
  cursor: pointer;
  color: #fffaf0;
  font-family: var(--font-display);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, filter 0.15s ease;
}

.santa-toy-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 9px 0 var(--ink-outline), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.06);
}

.santa-toy-btn:active,
.santa-toy-btn.is-pressed {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 var(--ink-outline), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.santa-toy-btn-led {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid var(--ink-outline);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
}

.santa-toy-btn.is-active-toggle {
  outline: 3px solid #ffd15c;
  outline-offset: 2px;
}

.santa-toy-btn-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(7, 20, 16, 0.35));
}

.santa-toy-btn-label {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 0 rgba(7, 20, 16, 0.38);
}

.santa-toy-btn.tone-gold {
  background: linear-gradient(180deg, #ffda66 0%, #e09914 100%);
  color: #241602;
}
.santa-toy-btn.tone-gold .santa-toy-btn-label { text-shadow: none; }

.santa-toy-btn.tone-berry {
  background: linear-gradient(180deg, #ff5962 0%, #cf232c 100%);
}

.santa-toy-btn.tone-berry-bright {
  background: linear-gradient(180deg, #ff7096 0%, #d92b5a 100%);
}

.santa-toy-btn.tone-frost {
  background: linear-gradient(180deg, #56c9ff 0%, #1c82cc 100%);
}

.santa-toy-btn.tone-caramel {
  background: linear-gradient(180deg, #f5a142 0%, #bd6116 100%);
}

.santa-toy-btn.tone-pine {
  background: linear-gradient(180deg, #3bd47a 0%, #1b8c4b 100%);
}

/* =========================================================================
   RIGHT PANEL: MAGIC SPEEDOMETER + 4 RING GAUGES
   ========================================================================= */
.santa-gauges-card {
  padding: 1rem 1.05rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.santa-speedo-pill {
  padding: 0.22rem 0.68rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(255, 209, 92, 0.2);
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
}

.santa-speedo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: radial-gradient(circle at 50% 25%, rgba(28, 72, 92, 0.85), rgba(9, 25, 36, 0.92));
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.santa-speedo-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  overflow: visible;
}

.santa-gauge-needle {
  transition: transform 0.45s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.santa-speedo-readout {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: -0.15rem;
  text-align: left;
}

.santa-speedo-face {
  font-size: 1.85rem;
  line-height: 1;
}

.santa-speedo-status {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fffaf0;
  line-height: 1.1;
}

.santa-speedo-sub {
  font-size: 0.78rem;
  color: #bfe7ff;
}

/* 4 Circular Ring-Gauge Tiles */
.santa-dials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

.santa-dial-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: rgba(9, 27, 38, 0.72);
  box-shadow: 0 4px 0 var(--ink-outline);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.santa-dial-tile:hover {
  transform: translateY(-3px);
}

.santa-dial-tile.tone-pine { border-top: 5px solid #3bd47a; }
.santa-dial-tile.tone-gold { border-top: 5px solid #ffd15c; }
.santa-dial-tile.tone-berry { border-top: 5px solid #ff5962; }
.santa-dial-tile.tone-frost { border-top: 5px solid #56c9ff; }

.santa-ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
}

.santa-ring-svg {
  width: 68px;
  height: 68px;
  transform: rotate(-90deg);
}

.santa-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 8;
}

.santa-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.santa-ring-fill.pine { stroke: #46e086; }
.santa-ring-fill.gold { stroke: #ffd15c; }
.santa-ring-fill.berry { stroke: #ff5b62; }
.santa-ring-fill.frost { stroke: #63d1ff; }

.santa-ring-emoji {
  position: absolute;
  font-size: 1.55rem;
  line-height: 1;
}

.santa-dial-num {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: #fffaf0;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.santa-dial-num-compact {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.santa-dial-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #e4f4ff;
  margin-top: 0.12rem;
}

.santa-dial-sub {
  margin-top: 0.18rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffd97d;
  line-height: 1.25;
}

.santa-dial-foot {
  margin-top: 0.08rem;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.2;
}

/* =========================================================================
   RIGHT PANEL: KID-FRIENDLY NICE-O-METER CARD
   ========================================================================= */
.santa-list-card {
  padding: 1rem 1.05rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  background:
    radial-gradient(ellipse 60% 65% at 92% 8%, rgba(255, 209, 92, 0.16), transparent 65%),
    radial-gradient(ellipse 55% 60% at 8% 92%, rgba(37, 165, 91, 0.16), transparent 65%),
    var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.santa-nice-badge-pct {
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: linear-gradient(180deg, #35c470, #1c8549);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
}

.santa-list-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.santa-list-input {
  flex: 1;
  min-width: 0;
  padding: 0.58rem 0.85rem;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  background: rgba(8, 24, 34, 0.78);
  color: #fffaf0;
  font-size: 0.98rem;
  font-family: var(--font-display);
}

.santa-list-input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(255, 209, 92, 0.28);
}

.santa-check-btn {
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-size: 0.96rem;
  border-radius: 14px;
  white-space: nowrap;
}

.santa-list-result {
  position: relative;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  padding: 0.78rem 0.9rem;
  background: rgba(8, 24, 34, 0.62);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 108px;
  justify-content: center;
}

.santa-list-result.is-idle,
.santa-list-result.is-scanning {
  text-align: center;
  align-items: center;
}

.santa-list-result.is-nice {
  background: linear-gradient(180deg, rgba(24, 86, 58, 0.78) 0%, rgba(11, 36, 30, 0.86) 100%);
  border-top: 5px solid var(--pine);
}

.santa-list-result.is-vip {
  background: linear-gradient(180deg, rgba(112, 78, 16, 0.68) 0%, rgba(28, 34, 24, 0.86) 100%);
  border-top: 5px solid var(--brass);
}

.santa-list-result.is-almost,
.santa-list-result.is-warning {
  background: linear-gradient(180deg, rgba(102, 32, 38, 0.6) 0%, rgba(26, 22, 32, 0.84) 100%);
  border-top: 5px solid var(--berry);
}

.santa-list-idle-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.santa-list-idle-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.santa-list-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.santa-list-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink-outline);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
}

.santa-list-badge.is-nice { background: var(--pine); color: #fff; }
.santa-list-badge.is-vip { background: linear-gradient(180deg, #ffd15c, #e5a319); color: #1d1404; }
.santa-list-badge.is-almost { background: var(--berry); color: #fff; }

.santa-list-result-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fffaf0;
}

.santa-list-score-pill {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.14rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(7, 20, 16, 0.6);
  border: 1.5px solid var(--ink-outline);
  color: #ffd15c;
}

.santa-list-note {
  margin: 0.1rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.santa-deeds-box {
  position: relative;
  border-radius: 14px;
  border: 2px solid var(--ink-outline);
  padding: 0.68rem 0.75rem;
  background: rgba(8, 24, 34, 0.52);
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.santa-deeds-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.santa-deeds-title {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: #fffaf0;
}

.santa-deeds-total {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brass);
}

.santa-deeds-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.santa-deed-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.34rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: linear-gradient(180deg, #21546b 0%, #163a4d 100%);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 3px 0 var(--ink-outline);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.santa-deed-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink-outline);
}

.santa-deed-pill-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-outline);
}

.santa-deed-count {
  color: #ffd15c;
  font-weight: 800;
}

.santa-elf-ticker {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.santa-nice-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.15rem;
}

.santa-nice-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.36rem 0.35rem;
  border-radius: 12px;
  border: 2px solid var(--ink-outline);
  background: rgba(8, 24, 34, 0.68);
  font-size: 0.69rem;
  color: var(--ink-secondary);
  line-height: 1.2;
}

.santa-nice-pill strong {
  margin-top: 0.12rem;
  font-family: var(--font-display);
  font-size: 0.86rem;
  color: #fffaf0;
  font-variant-numeric: tabular-nums;
}

.santa-nice-pill.nice { border-top: 3px solid #3bd47a; }
.santa-nice-pill.almost { border-top: 3px solid #ffd15c; }
.santa-nice-pill.upgrades { border-top: 3px solid #63d1ff; }

.santa-elf-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.santa-elf-spotted {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.62rem;
  border-radius: 12px;
  border: 1.5px solid rgba(126, 216, 255, 0.22);
  background: rgba(16, 46, 56, 0.6);
  font-size: 0.78rem;
  color: #e6f7ff;
  line-height: 1.3;
}

.santa-elf-spotter {
  color: #9ddcff;
  font-style: normal;
  font-weight: 600;
}

.santa-elf-spotted-emoji {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Shared Animated Meter Bars */
.santa-meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.santa-meter-track {
  width: 100%;
  height: 12px;
  border-radius: var(--radius-pill);
  background: rgba(7, 20, 16, 0.6);
  border: 2px solid var(--ink-outline);
  overflow: hidden;
  margin-top: 0.2rem;
}

.santa-nice-track {
  height: 13px;
}

.santa-meter-fill {
  position: relative;
  height: 100%;
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.santa-meter-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 48%, transparent 76%);
  transform: translateX(-120%);
  animation: santa-meter-shimmer 2.8s ease-in-out infinite;
}

.santa-meter-fill.pine,
.santa-meter-fill.energy {
  background: linear-gradient(90deg, #25a55b, #5ce092);
}

.santa-meter-fill.gold {
  background: linear-gradient(90deg, #f0a818, #ffe08a);
}

.santa-meter-fill.berry,
.santa-meter-fill.nose {
  background: linear-gradient(90deg, #ef3b42, #ff858a);
}

.santa-meter-fill.frost {
  background: linear-gradient(90deg, #32a8e6, #9ae2ff);
}

/* =========================================================================
   BOTTOM DASHBOARD DOCK: INTERACTIVE REINDEER BARN
   ========================================================================= */
.santa-reindeer-section {
  padding: 1rem 1.15rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
}

.santa-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.santa-barn-pill {
  padding: 0.22rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(37, 165, 91, 0.26);
  color: #c8f7dc;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
}

.santa-barn-pill.is-complete {
  background: linear-gradient(180deg, #ffd15c, #e5a319);
  color: #1d1404;
}

.santa-barn-stats-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.santa-barn-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(8, 24, 34, 0.78);
  box-shadow: 0 3px 0 var(--ink-outline);
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.santa-barn-stat-pill strong {
  color: #fffaf0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.santa-barn-stat-pill.tone-streak { border-color: #ff8c42; }
.santa-barn-stat-pill.tone-perfect { border-color: #ffd15c; }
.santa-barn-stat-pill.tone-best { border-color: #63d1ff; }

.santa-barn-quest-bar {
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 2px solid var(--ink-outline);
  background: rgba(8, 24, 34, 0.55);
}

.santa-barn-track {
  height: 13px;
}

.santa-barn-complete-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.72rem 0.95rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(135deg, rgba(255, 209, 92, 0.24), rgba(37, 165, 91, 0.32));
  box-shadow: 0 4px 0 var(--ink-outline);
}

.santa-barn-complete-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.santa-barn-complete-copy {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.santa-barn-complete-copy strong {
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #fff5cc;
}

.santa-barn-complete-copy span {
  font-size: 0.82rem;
  color: #dff7eb;
}

.santa-treat-basket {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(180deg, rgba(26, 66, 86, 0.75), rgba(12, 34, 48, 0.85));
}

.santa-treat-basket.is-complete {
  opacity: 0.75;
}

.santa-treat-basket-label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffd15c;
  white-space: nowrap;
}

.santa-treat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
}

.santa-treat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(180deg, #1d4e66 0%, #123345 100%);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--ink-outline);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.santa-treat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink-outline);
}

.santa-treat-btn.is-selected {
  background: linear-gradient(180deg, #ffd15c 0%, #e09612 100%);
  color: #1d1404;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 5px 0 var(--ink-outline), 0 0 14px rgba(255, 209, 92, 0.45);
}

.santa-treat-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.santa-reindeer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.santa-reindeer-card {
  position: relative;
  overflow: visible;
  background: rgba(11, 32, 41, 0.7);
  border: 2.5px solid var(--ink-outline);
  border-radius: 16px;
  padding: 0.8rem 0.85rem;
  box-shadow: 0 4px 0 var(--ink-outline);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
  animation: santa-card-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(80ms + var(--stagger-idx, 0) * 35ms);
}

.santa-reindeer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--ink-outline);
}

.santa-reindeer-card.accent-berry { border-top: 5px solid var(--berry); }
.santa-reindeer-card.accent-gold { border-top: 5px solid var(--brass); }
.santa-reindeer-card.accent-frost { border-top: 5px solid var(--frost); }
.santa-reindeer-card.accent-pine { border-top: 5px solid var(--pine); }

.santa-reindeer-card.is-fed-today {
  background: linear-gradient(180deg, rgba(20, 62, 54, 0.78), rgba(10, 32, 36, 0.84));
}

.santa-reindeer-card.is-perfect-match {
  box-shadow: 0 4px 0 var(--ink-outline), 0 0 16px rgba(255, 209, 92, 0.25);
}

.santa-reindeer-card.is-cheering {
  animation: santa-cheer-bounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.santa-reindeer-card.is-cheering .santa-reindeer-avatar {
  animation: santa-avatar-cheer 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.santa-reindeer-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.santa-reindeer-avatar {
  display: inline-block;
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
  transform-origin: center bottom;
  animation: santa-deer-idle 3.2s ease-in-out infinite;
  animation-delay: calc(var(--stagger-idx, 0) * 0.3s);
}

.deer-rudolph .santa-reindeer-avatar {
  animation: santa-rudolph-avatar 2.2s ease-in-out infinite;
}

.deer-dasher .santa-reindeer-avatar,
.deer-blitzen .santa-reindeer-avatar {
  animation: santa-deer-sprint 1.8s ease-in-out infinite;
}

.deer-dancer .santa-reindeer-avatar {
  animation: santa-deer-dance 2.4s ease-in-out infinite;
}

.santa-reindeer-head {
  flex: 1;
  min-width: 0;
}

.santa-reindeer-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fffaf0;
  line-height: 1.1;
}

.santa-reindeer-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.14rem;
}

.santa-reindeer-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ddcff;
}

.santa-reindeer-mood {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brass);
}

.santa-craving-bar {
  padding: 0.36rem 0.58rem;
  border-radius: 10px;
  border: 1.5px dashed rgba(255, 209, 92, 0.45);
  background: rgba(8, 22, 32, 0.58);
  font-size: 0.78rem;
  color: #e8f5ff;
  line-height: 1.25;
}

.santa-craving-text strong {
  color: #ffd15c;
}

.santa-reindeer-card.is-fed-today .santa-craving-bar {
  border-style: solid;
  border-color: rgba(70, 224, 134, 0.45);
  background: rgba(20, 74, 52, 0.55);
}

.santa-fed-badge {
  font-weight: 700;
  color: #bdf7d5;
}

.santa-fed-badge.is-perfect {
  color: #ffe28a;
}

.santa-reindeer-activity {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.3;
  min-height: 2.3em;
}

.santa-reindeer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.santa-treat-label {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.2;
  min-width: 0;
}

.santa-carrot-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.36rem 0.68rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: linear-gradient(180deg, #ffae47 0%, #e07214 100%);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--ink-outline);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.santa-carrot-btn.is-pet-mode {
  background: linear-gradient(180deg, #ff6b9d 0%, #d63c71 100%);
}

.santa-carrot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink-outline);
}

.santa-carrot-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-outline);
}

.santa-float-particle {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd15c;
  text-shadow: 0 2px 0 rgba(7, 20, 16, 0.8);
  animation: santa-particle-float 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* North Pole 2D Fun Games Hub (inside left bento column) */
.santa-games-hub {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  background: linear-gradient(155deg, rgba(16, 54, 46, 0.92), rgba(11, 36, 52, 0.94));
}

.santa-games-hub-sub {
  margin: -0.25rem 0 0;
  font-size: 0.9rem;
}

.santa-games-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  flex: 1;
  align-content: stretch;
}

.santa-game-link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 2.5px solid var(--ink-outline);
  background: rgba(9, 28, 36, 0.78);
  color: #fffaf0;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink-outline);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, border-color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.santa-game-link-card.tone-pine {
  border-top: 5px solid #2ee077;
  background: linear-gradient(160deg, rgba(22, 86, 54, 0.65), rgba(9, 28, 36, 0.85));
}

.santa-game-link-card.tone-gold {
  border-top: 5px solid #ffd15c;
  background: linear-gradient(160deg, rgba(112, 82, 22, 0.55), rgba(9, 28, 36, 0.85));
}

.santa-game-link-card.tone-berry {
  border-top: 5px solid #ff4f58;
  background: linear-gradient(160deg, rgba(118, 28, 38, 0.6), rgba(9, 28, 36, 0.85));
}

.santa-game-link-card.tone-frost {
  border-top: 5px solid #4cc9ff;
  background: linear-gradient(160deg, rgba(22, 74, 114, 0.65), rgba(9, 28, 36, 0.85));
}

.santa-game-link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--ink-outline);
  color: #fffaf0;
}

.santa-game-link-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink-outline);
}

.santa-game-link-emoji {
  font-size: 2.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.santa-game-link-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.santa-game-link-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.santa-game-link-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #fffaf0;
  line-height: 1.2;
}

.santa-game-link-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 240, 0.14);
  color: #ffe8a3;
}

.santa-game-link-desc {
  font-size: 0.8rem;
  color: #cce3da;
  line-height: 1.3;
}

.santa-game-link-play {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: #ffd15c;
  color: #071410;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =========================================================================
   SANTA 2D KIDS GAMES PAGES
   ========================================================================= */
.santa-game-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.santa-game-page *,
.santa-game-page *::before,
.santa-game-page *::after {
  -webkit-tap-highlight-color: transparent;
}

.santa-game-page button,
.santa-game-page a {
  touch-action: manipulation;
}

.sg-header-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sg-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sg-title-block {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sg-title-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.sg-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  color: #fffaf0;
}

.sg-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.94rem;
}

.sg-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sg-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(9, 28, 36, 0.7);
  color: #dcefe6;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.12s ease;
}

@media (hover: hover) {
  .sg-switch-pill:hover {
    transform: translateY(-2px);
    background: rgba(24, 68, 56, 0.88);
    color: #fffaf0;
  }
}

.sg-switch-pill.is-active {
  background: linear-gradient(180deg, #ffd970, #f5b932);
  color: #071410;
  box-shadow: 0 3px 0 var(--ink-outline);
}

.sg-stage-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 3px solid var(--ink-outline);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sg-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sg-hud-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sg-stage-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
}

.sg-stage-sound-btn {
  display: none;
  padding: 0.32rem 0.55rem;
  font-size: 0.9rem;
  min-height: 34px;
}

.sg-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sg-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-outline);
  background: rgba(8, 26, 36, 0.75);
  color: #e6f6ef;
  font-size: 0.9rem;
}

.sg-hud-pill.tone-gold {
  background: rgba(255, 209, 92, 0.2);
  color: #ffe8a3;
}

.sg-canvas-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--ink-outline);
  background: #081826;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sg-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--sg-w, 860) / var(--sg-h, 520);
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.sg-stage-card.is-portrait:not(.is-fullscreen) .sg-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-stage-card.is-portrait:not(.is-fullscreen) .sg-canvas {
  width: min(100%, calc(68dvh * var(--sg-w, 480) / var(--sg-h, 640)));
  max-height: 68dvh;
  margin: 0 auto;
}

.sg-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sg-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sg-actions-row {
  padding-top: 0.2rem;
}

.sg-treat-row {
  justify-content: space-between;
}

.sg-treat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.sg-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.45rem 0.78rem;
  border-radius: 12px;
  border: 2px solid var(--ink-outline);
  background: rgba(12, 36, 44, 0.85);
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink-outline);
  transition: transform 0.1s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) {
  .sg-tool-btn:hover {
    transform: translateY(-2px);
    background: rgba(22, 58, 66, 0.95);
  }
}

.sg-tool-btn:active {
  transform: translateY(1px);
}

.sg-tool-btn.is-selected {
  background: linear-gradient(180deg, #ffd970, #f5b932);
  color: #071410;
  transform: translateY(-1px);
}

.sg-tool-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Tree decoration top-left popup picker */
.sg-tree-picker-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.sg-tree-picker-trigger {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 16;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.45rem 0.82rem;
  border-radius: 14px;
  border: 2.5px solid var(--ink-outline);
  background: linear-gradient(180deg, rgba(19, 58, 70, 0.94), rgba(10, 32, 42, 0.96));
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink-outline), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  max-width: calc(100% - 20px);
}

.sg-tree-picker-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-tree-picker-caret {
  font-size: 0.8rem;
  color: #ffd15c;
  margin-left: 0.1rem;
}

@media (hover: hover) {
  .sg-tree-picker-trigger:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(28, 76, 88, 0.96), rgba(14, 42, 54, 0.98));
  }
}

.sg-tree-picker-trigger:active {
  transform: translateY(1px);
}

.sg-tree-picker-trigger.is-open {
  background: linear-gradient(180deg, #ffd970, #f5b932);
  color: #071410;
}

.sg-tree-picker-trigger.is-open .sg-tree-picker-caret {
  color: #071410;
}

.sg-tree-picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: auto;
  background: rgba(4, 14, 20, 0.38);
}

.sg-tree-picker-menu {
  position: absolute;
  top: 56px;
  left: 10px;
  z-index: 15;
  pointer-events: auto;
  width: min(460px, calc(100% - 20px));
  max-height: calc(100% - 66px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 3px solid var(--ink-outline);
  background: linear-gradient(180deg, rgba(12, 36, 48, 0.97), rgba(7, 22, 32, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 209, 92, 0.32);
  overflow: hidden;
}

.sg-tree-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 209, 92, 0.1);
  flex-shrink: 0;
}

.sg-tree-picker-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffe8a3;
}

.sg-tree-picker-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid var(--ink-outline);
  background: rgba(12, 36, 44, 0.9);
  color: #fffaf0;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.sg-tree-picker-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sg-tree-picker-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sg-tree-picker-section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9ed8c4;
}

.sg-tree-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 0.42rem;
}

.sg-tree-picker-item {
  width: 100%;
  justify-content: flex-start;
  padding: 0.42rem 0.62rem;
  font-size: 0.82rem;
}

.sg-tip-text {
  font-size: 0.9rem;
  color: #d3eee2;
  flex: 1;
}

/* Fullscreen mode (works on desktop, Android Chrome, and iOS Safari CSS fallback) */
body.sg-fullscreen-active {
  overflow: hidden;
  overscroll-behavior: none;
}

body.sg-fullscreen-active .topbar,
body.sg-fullscreen-active .site-footer,
body.sg-fullscreen-active .winter-horizon {
  display: none;
}

body.sg-fullscreen-active .container {
  z-index: 9999;
}

.sg-stage-card.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, #09202e 0%, #071520 100%);
  box-shadow: none;
  padding:
    max(0.5rem, env(safe-area-inset-top))
    max(0.65rem, env(safe-area-inset-right))
    max(0.55rem, env(safe-area-inset-bottom))
    max(0.65rem, env(safe-area-inset-left));
  gap: 0.5rem;
  overflow: hidden;
}

.sg-stage-card.is-fullscreen .sg-stage-sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sg-stage-card.is-fullscreen .sg-stage-topbar {
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0.45rem;
}

.sg-stage-card.is-fullscreen .sg-hud-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0.35rem;
}

.sg-stage-card.is-fullscreen .sg-hud-bar::-webkit-scrollbar {
  display: none;
}

.sg-stage-card.is-fullscreen .sg-hud-pill {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.sg-stage-card.is-fullscreen .sg-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  container-type: size;
}

.sg-stage-card.is-fullscreen .sg-canvas {
  max-width: 100%;
  max-height: 100%;
  width: min(100cqw, calc(100cqh * var(--sg-w, 860) / var(--sg-h, 520)));
  height: min(100cqh, calc(100cqw * var(--sg-h, 520) / var(--sg-w, 860)));
}

.sg-stage-card.is-fullscreen .sg-controls-bar {
  flex-shrink: 0;
  gap: 0.4rem;
  max-height: 30dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.sg-stage-card.is-fullscreen .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row) {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.sg-stage-card.is-fullscreen .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row)::-webkit-scrollbar {
  display: none;
}

.sg-stage-card.is-fullscreen .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row) > * {
  flex-shrink: 0;
}

@media (hover: none) {
  .sg-key-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .santa-games-link-grid {
    grid-template-columns: 1fr;
  }

  .santa-game-page {
    gap: 0.6rem;
  }

  .sg-header-card {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .sg-title-block {
    gap: 0.55rem;
  }

  .sg-title-emoji {
    font-size: 1.85rem;
  }

  .sg-title {
    font-size: 1.18rem;
  }

  .sg-subtitle {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .sg-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding-bottom: 2px;
  }

  .sg-switcher::-webkit-scrollbar {
    display: none;
  }

  .sg-switch-pill {
    flex-shrink: 0;
    padding: 0.34rem 0.68rem;
    font-size: 0.78rem;
  }

  .sg-stage-card {
    padding: 0.6rem 0.65rem;
    gap: 0.55rem;
  }

  .sg-stage-topbar {
    gap: 0.4rem;
  }

  .sg-hud-bar {
    gap: 0.35rem;
  }

  .sg-hud-pill {
    padding: 0.24rem 0.52rem;
    font-size: 0.78rem;
  }

  .sg-canvas-wrap {
    border-radius: 12px;
    border-width: 2px;
  }

  .sg-controls-bar {
    gap: 0.45rem;
  }

  .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row) {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.38rem;
    padding-bottom: 3px;
  }

  .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row)::-webkit-scrollbar {
    display: none;
  }

  .sg-toolbar-row:not(.sg-treat-row):not(.sg-tip-row) > * {
    flex-shrink: 0;
  }

  .sg-tip-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .sg-tool-btn {
    padding: 0.45rem 0.68rem;
    font-size: 0.82rem;
    min-height: 40px;
  }

  .sg-tree-picker-trigger {
    top: 8px;
    left: 8px;
    padding: 0.38rem 0.68rem;
    font-size: 0.82rem;
    min-height: 36px;
  }

  .sg-tree-picker-menu {
    top: 50px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: calc(100% - 58px);
  }

  .sg-tree-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .sg-tree-picker-item {
    padding: 0.38rem 0.55rem;
    font-size: 0.78rem;
    min-height: 36px;
  }

  .sg-key-hint {
    display: none;
  }

  .sg-treat-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .sg-treat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
  }

  .sg-treat-btn {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.12rem;
    padding: 0.42rem 0.2rem;
    font-size: 0.76rem;
    min-height: 50px;
  }

  .sg-treat-btn > span:first-child {
    font-size: 1.25rem;
    line-height: 1;
  }

  .sg-restart-btn {
    align-self: flex-end;
  }

  .sg-tip-text {
    white-space: normal;
    min-width: 0;
    font-size: 0.8rem;
    line-height: 1.35;
  }
}

@media (max-height: 520px) {
  .sg-stage-card.is-fullscreen {
    gap: 0.32rem;
    padding:
      max(0.3rem, env(safe-area-inset-top))
      max(0.5rem, env(safe-area-inset-right))
      max(0.35rem, env(safe-area-inset-bottom))
      max(0.5rem, env(safe-area-inset-left));
  }

  .sg-stage-card.is-fullscreen .sg-hud-pill {
    padding: 0.18rem 0.45rem;
    font-size: 0.74rem;
  }

  .sg-stage-card.is-fullscreen .sg-fullscreen-btn,
  .sg-stage-card.is-fullscreen .sg-stage-sound-btn {
    padding: 0.22rem 0.5rem;
    font-size: 0.78rem;
    min-height: 30px;
  }

  .sg-stage-card.is-fullscreen .sg-tool-btn {
    padding: 0.28rem 0.55rem;
    font-size: 0.76rem;
    min-height: 34px;
  }

  .sg-stage-card.is-fullscreen .sg-treat-row {
    flex-direction: row;
    align-items: center;
  }

  .sg-stage-card.is-fullscreen .sg-treat-btn {
    flex-direction: row;
    min-height: 34px;
    padding: 0.28rem 0.45rem;
  }

  .sg-stage-card.is-fullscreen .sg-controls-bar {
    max-height: 24dvh;
  }
}

/* Kids Games CTA Strip */
.santa-kids-cta {
  padding: 0.95rem 1.15rem;
  border: 3px solid var(--ink-outline);
  background: linear-gradient(135deg, rgba(35, 110, 82, 0.55), rgba(24, 62, 92, 0.65));
}

.santa-cta-copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.santa-cta-big-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.santa-big-kids-btn {
  padding: 0.62rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  border-radius: var(--radius-pill);
}

/* =========================================================================
   MAP SVG ANIMATIONS
   ========================================================================= */
.santa-route-leg {
  stroke: rgba(126, 216, 255, 0.34);
  stroke-width: 1.9;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  transition: stroke 0.35s ease, stroke-width 0.35s ease;
}

.santa-route-leg.is-visited {
  stroke: #ffd15c;
  stroke-width: 2.8;
  stroke-dasharray: none;
  opacity: 0.94;
  filter: drop-shadow(0 0 3px rgba(255, 209, 92, 0.5));
}

.santa-route-leg.is-active {
  stroke: #ff6b72;
  stroke-width: 3.3;
  stroke-dasharray: 7 5;
  animation: santa-dash-march 0.9s linear infinite;
}

.santa-aurora-ribbon {
  transform-box: fill-box;
  transform-origin: center;
}

.santa-aurora-ribbon.ribbon-1 {
  animation: santa-map-aurora-wave 9s ease-in-out infinite alternate;
}

.santa-aurora-ribbon.ribbon-2 {
  animation: santa-map-aurora-wave 12s ease-in-out infinite alternate-reverse;
}

.santa-ocean-star {
  animation: santa-star-twinkle 3.2s ease-in-out infinite;
}

.santa-ocean-labels text {
  fill: rgba(168, 232, 255, 0.28);
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 9.5px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 2.8px;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.santa-map-compass text {
  fill: #ffd15c;
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}

.santa-city-pin {
  cursor: pointer;
}

.santa-city-pin .pin-halo {
  fill: rgba(126, 216, 255, 0.24);
  transition: fill 0.2s ease, transform 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.santa-city-pin .pin-dot {
  fill: #d4f1ff;
  stroke: #071410;
  stroke-width: 1.5;
  transition: fill 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.santa-city-pin .pin-hit {
  fill: transparent;
  pointer-events: all;
}

@media (hover: hover) {
  .santa-city-pin:hover .pin-dot { transform: scale(1.45); }
  .santa-city-pin:hover .pin-halo { transform: scale(1.3); }
}
.santa-city-pin.is-north-pole .pin-dot { fill: #ef3b42; }
.santa-city-pin.is-visited .pin-halo { fill: rgba(255, 209, 92, 0.36); }
.santa-city-pin.is-visited .pin-dot { fill: #ffd15c; }
.santa-city-pin.is-next .pin-halo {
  fill: rgba(239, 59, 66, 0.45);
  animation: santa-radar-ping 1.5s ease-in-out infinite;
}
.santa-city-pin.is-next .pin-dot { fill: #ff5158; }
.santa-city-pin.is-selected .pin-halo { fill: rgba(92, 224, 146, 0.48); }
.santa-city-pin.is-selected .pin-dot { fill: #5ce092; transform: scale(1.3); }

.sleigh-radar-ring,
.next-beacon-ring {
  animation: santa-radar-ping 1.7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.sleigh-radar-ring-outer,
.next-beacon-ring-outer {
  animation: santa-sonar-ripple 2.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.sleigh-bob {
  animation: santa-sleigh-gallop 1.35s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.rudolph-nose-glow {
  animation: santa-nose-glow 1.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.rudolph-nose-dot {
  animation: santa-nose-dot 1.2s ease-in-out infinite;
}

.santa-stardust-dot {
  animation: santa-stardust-fade 1s ease-out forwards;
  transform-box: fill-box;
  transform-origin: center;
}

.santa-burst-ring {
  animation: santa-burst-expand 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-box: fill-box;
  transform-origin: center;
}

.santa-burst-spark {
  animation: santa-burst-spark-fly 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =========================================================================
   KEYFRAMES
   ========================================================================= */
@keyframes santa-magic-snowfall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(105vh) translateX(28px) rotate(320deg); opacity: 0.1; }
}

@keyframes santa-mascot-hop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-10px) rotate(-6deg) scale(1.06); }
  70% { transform: translateY(-3px) rotate(5deg); }
}

@keyframes santa-bubble-pop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes santa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 59, 66, 0.55), var(--shadow-xs); }
  50% { box-shadow: 0 0 0 8px rgba(239, 59, 66, 0), var(--shadow-xs); }
}

@keyframes santa-card-rise {
  0% { opacity: 0; transform: translateY(14px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes santa-candy-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 62px 0; }
}

@keyframes santa-aurora-drift {
  0% { transform: translate3d(-4%, -2%, 0) scale(1); opacity: 0.72; }
  50% { transform: translate3d(4%, 3%, 0) scale(1.06); opacity: 0.96; }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.02); opacity: 0.78; }
}

@keyframes santa-digit-tick {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(-2px); }
  100% { transform: scale(1); }
}

@keyframes santa-meter-shimmer {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(160%); }
}

@keyframes santa-map-aurora-wave {
  0% { opacity: 0.55; transform: translateX(-16px) scaleY(0.92); }
  50% { opacity: 0.95; transform: translateX(12px) scaleY(1.12); }
  100% { opacity: 0.65; transform: translateX(-6px) scaleY(0.98); }
}

@keyframes santa-star-twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.95; }
}

@keyframes santa-dash-march {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

@keyframes santa-radar-ping {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.42; transform: scale(1.15); }
}

@keyframes santa-sonar-ripple {
  0% { opacity: 0.85; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.95); }
}

@keyframes santa-sleigh-gallop {
  0%, 100% { transform: translateY(0) rotate(-2.5deg); }
  50% { transform: translateY(-3.5px) rotate(3deg); }
}

@keyframes santa-nose-glow {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 0.98; transform: scale(1.45); }
}

@keyframes santa-nose-dot {
  0%, 100% { fill: #ff3b42; }
  50% { fill: #ff9498; }
}

@keyframes santa-stardust-fade {
  0% { opacity: 0.95; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.15); }
}

@keyframes santa-burst-expand {
  0% { opacity: 0.95; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(3.4); }
}

@keyframes santa-burst-spark-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--burst-x, 12px), var(--burst-y, -12px)) scale(0.2); }
}

@keyframes santa-standby-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes santa-spotlight-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes santa-cheer-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.045) translateY(-6px); box-shadow: 0 0 18px rgba(255, 209, 92, 0.55), 0 8px 0 var(--ink-outline); }
  65% { transform: scale(0.98) translateY(1px); }
  100% { transform: scale(1); }
}

@keyframes santa-avatar-cheer {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(-9px) rotate(-10deg) scale(1.25); }
  70% { transform: translateY(-3px) rotate(8deg) scale(1.1); }
}

@keyframes santa-deer-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-3deg); }
}

@keyframes santa-rudolph-avatar {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 2px rgba(255, 59, 66, 0.35)); }
  50% { transform: translateY(-3px) scale(1.08); filter: drop-shadow(0 0 9px rgba(255, 59, 66, 0.92)); }
}

@keyframes santa-deer-sprint {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  40% { transform: translateX(3px) translateY(-3px) rotate(5deg); }
  75% { transform: translateX(-2px) rotate(-4deg); }
}

@keyframes santa-deer-dance {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(7deg) translateY(-4px); }
}

@keyframes santa-particle-float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6) rotate(0deg); }
  18% { opacity: 1; transform: translate(calc(-50% + var(--px, 0px) * 0.25), -14px) scale(1.18) rotate(calc(var(--rot, 0deg) * 0.4)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--px, 0px)), var(--py, -66px)) scale(0.85) rotate(var(--rot, 0deg)); }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .santa-cockpit-header,
  .santa-cockpit-header::before,
  .santa-hero-aurora,
  .santa-time-tile.is-ticking,
  .santa-meter-fill::after,
  .santa-aurora-ribbon,
  .santa-ocean-star,
  .santa-route-leg.is-active,
  .santa-city-pin.is-next .pin-halo,
  .sleigh-radar-ring,
  .sleigh-radar-ring-outer,
  .next-beacon-ring,
  .next-beacon-ring-outer,
  .sleigh-bob,
  .rudolph-nose-glow,
  .rudolph-nose-dot,
  .santa-launch-icon,
  .santa-spotlight-content.is-entering,
  .santa-reindeer-card,
  .santa-reindeer-avatar,
  .santa-live-pill.is-live,
  .santa-radar-badge.is-live,
  .deck-dot {
    animation: none !important;
  }
  .santa-meter-fill::after {
    display: none;
  }
}

/* Touch ergonomics & range slider styling for Santa Dashboard */
.santa-toy-btn,
.santa-mascot-btn,
.santa-deed-pill-btn,
.santa-treat-btn,
.santa-carrot-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.santa-reindeer-footer {
  flex-wrap: wrap;
  gap: 0.45rem;
}

#santa-sim-scrubber,
.santa-sim-bar input[type="range"] {
  background: transparent;
  border: 0;
  padding: 0.35rem 0;
  box-shadow: none;
  accent-color: var(--brass);
  min-height: 36px;
  cursor: pointer;
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .santa-bento-grid {
    grid-template-columns: 1fr;
  }
  .santa-reindeer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .santa-dials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .santa-flight-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .santa-cockpit-bar {
    grid-template-columns: 1fr;
  }
  .santa-flight-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .santa-flight-hud > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .santa-stops-strip {
    grid-template-columns: 1fr;
  }
  .santa-dials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .santa-map-launch-strip {
    position: static;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    justify-content: center;
    text-align: center;
  }
  .santa-deed-pill-btn,
  .santa-treat-btn,
  .santa-carrot-btn {
    min-height: 44px;
  }
}

@media (max-width: 580px) {
  .santa-mascot-zone {
    flex-direction: column;
    text-align: center;
  }
  .santa-title-row {
    justify-content: center;
  }
  .santa-toy-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .santa-reindeer-grid {
    grid-template-columns: 1fr;
  }
  .santa-nice-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .santa-list-input-row {
    flex-direction: column;
  }
}

@media (max-width: 400px) {
  .santa-nice-breakdown {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Christmas Party — Pop-Up North Pole Elves Stage
   ========================================================================== */
.party-elves-stage {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  gap: 0.4rem;
  padding: 0 1.25rem;
  pointer-events: none;
  overflow: hidden;
}

.party-elf {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(125%);
  opacity: 0;
  transition:
    transform 0.52s cubic-bezier(0.22, 1.28, 0.36, 1) var(--elf-delay, 0s),
    opacity 0.32s ease var(--elf-delay, 0s);
}

.party-elves-stage.is-visible .party-elf {
  transform: translateY(8px);
  opacity: 1;
}

.party-elves-stage.is-leaving .party-elf {
  transform: translateY(130%);
  opacity: 0;
  transition:
    transform 0.48s cubic-bezier(0.55, 0.06, 0.68, 0.19) var(--elf-delay, 0s),
    opacity 0.35s ease var(--elf-delay, 0s);
}

.party-elf-bubble {
  margin-bottom: 0.22rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #fff9ec;
  color: #132c20;
  border: 2.2px solid var(--ink-outline);
  box-shadow: 0 3px 0 var(--ink-outline);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
}

.party-elf-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #fff9ec;
  border-right: 2px solid var(--ink-outline);
  border-bottom: 2px solid var(--ink-outline);
}

.party-elf-svg {
  display: block;
  width: 88px;
  height: 100px;
  filter: drop-shadow(0 6px 10px rgba(4, 14, 10, 0.45));
  transform-origin: bottom center;
}

.party-elves-stage.is-visible .party-elf-svg {
  animation: fb-elf-bob 1.15s ease-in-out infinite;
  animation-delay: var(--elf-bob-delay, 0s);
}

.party-elf-hand {
  transform-origin: 22px 86px;
}

.party-elves-stage.is-visible .party-elf-hand {
  animation: fb-elf-wave 0.72s ease-in-out infinite;
  animation-delay: var(--elf-bob-delay, 0s);
}

.party-elf-name {
  margin-top: -0.65rem;
  margin-bottom: 0.55rem;
  padding: 0.08rem 0.5rem;
  border-radius: var(--radius-pill);
  background: #0d251e;
  color: #ffe8a3;
  border: 2px solid var(--ink-outline);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
}

@keyframes fb-elf-bob {
  0%, 100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-7px) rotate(1.5deg);
  }
}

@keyframes fb-elf-wave {
  0%, 100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

@media (max-width: 820px) {
  .party-elves-stage {
    padding: 0 0.5rem;
    gap: 0.2rem;
  }
  .party-elf-svg {
    width: 68px;
    height: 77px;
  }
  .party-elf-bubble {
    font-size: 0.66rem;
    padding: 0.16rem 0.42rem;
  }
  .party-elf-name {
    font-size: 0.64rem;
  }
}

@media (max-width: 560px) {
  .party-elf-bubble {
    display: none;
  }
  .party-elf-svg {
    width: 56px;
    height: 64px;
  }
  .party-elf-name {
    font-size: 0.6rem;
    padding: 0.05rem 0.38rem;
  }
}

/* ============================================================================
   Santa Dashboard — Side-Peeking Santa, Elves & Reindeer
   ============================================================================ */
.santa-peekers-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  overflow: hidden;
}

.santa-peeker {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
  transition: transform 0.56s cubic-bezier(0.22, 1.32, 0.36, 1);
}

.santa-peeker:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 4px;
  border-radius: 16px;
}

.santa-peeker.is-hiding {
  transition: transform 0.42s cubic-bezier(0.55, 0, 0.85, 0.4);
}

.santa-peeker.is-side-left {
  left: 0;
  flex-direction: row;
  transform-origin: left center;
  transform: translateX(-115%) rotate(-10deg);
}

.santa-peeker.is-side-left.is-peeking {
  transform: translateX(-10px) rotate(10deg);
}

.santa-peeker.is-side-right {
  right: 0;
  flex-direction: row-reverse;
  transform-origin: right center;
  transform: translateX(115%) rotate(10deg);
}

.santa-peeker.is-side-right.is-peeking {
  transform: translateX(10px) rotate(-10deg);
}

.santa-peeker-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 10px rgba(4, 15, 12, 0.55));
}

.santa-peeker.is-peeking .santa-peeker-art {
  animation: santa-peeker-bob 2.2s ease-in-out infinite;
}

.santa-peeker.is-booped .santa-peeker-art {
  animation: santa-peeker-boop 0.48s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.santa-peeker-svg {
  display: block;
  width: 96px;
  height: 96px;
}

.santa-peeker.is-side-right .santa-peeker-svg {
  transform: scaleX(-1);
}

.santa-peeker-rudolph-glow {
  animation: santa-peeker-nose-pulse 1.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.santa-peeker-bubble {
  position: relative;
  max-width: 195px;
  padding: 0.48rem 0.72rem;
  border-radius: 14px;
  background: #fffaf0;
  color: #091a14;
  border: 2.5px solid var(--ink-outline);
  box-shadow: 0 5px 0 rgba(7, 20, 16, 0.85), 0 8px 18px rgba(4, 15, 12, 0.38);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  opacity: 0;
  transform: scale(0.72) translateY(6px);
  transition:
    opacity 0.28s ease 0.2s,
    transform 0.34s cubic-bezier(0.22, 1.35, 0.36, 1) 0.2s;
}

.santa-peeker.is-peeking .santa-peeker-bubble {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.santa-peeker.is-hiding .santa-peeker-bubble {
  opacity: 0;
  transform: scale(0.8) translateY(4px);
  transition-delay: 0s;
}

.santa-peeker.is-booped .santa-peeker-bubble {
  background: #fff3c4;
  border-color: var(--ink-outline);
}

.santa-peeker-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: inherit;
  border: 2.5px solid var(--ink-outline);
  transform: translateY(-50%) rotate(45deg);
}

.santa-peeker.is-side-left .santa-peeker-bubble::before {
  left: -7px;
  border-top: 0;
  border-right: 0;
}

.santa-peeker.is-side-right .santa-peeker-bubble::before {
  right: -7px;
  border-bottom: 0;
  border-left: 0;
}

.santa-peeker:hover .santa-peeker-art {
  filter: drop-shadow(0 0 12px rgba(255, 209, 92, 0.72)) drop-shadow(0 6px 10px rgba(4, 15, 12, 0.55));
}

@keyframes santa-peeker-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

@keyframes santa-peeker-boop {
  0% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.18) rotate(-8deg) translateY(-6px); }
  70% { transform: scale(0.95) rotate(6deg); }
  100% { transform: scale(1.06) rotate(0deg); }
}

@keyframes santa-peeker-nose-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.24); }
}

@media (max-width: 640px) {
  .santa-peeker-svg {
    width: 74px;
    height: 74px;
  }
  .santa-peeker-bubble {
    max-width: 148px;
    font-size: 0.76rem;
    padding: 0.38rem 0.56rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .santa-peekers-layer {
    display: none;
  }
}

/* ============================================================================
   PORTAL HUB (frostybytes.uk)
   ============================================================================ */
.hub-hero {
  text-align: center;
  padding: 2rem 1.5rem;
}

.hub-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  margin: 0.35rem 0 0.65rem;
}

.hub-lead {
  max-width: 680px;
  margin: 0 auto 0.65rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hub-sublead {
  max-width: 660px;
  margin: 0 auto 1.25rem;
  color: var(--ink-secondary);
  font-size: 0.96rem;
  line-height: 1.55;
}

.hub-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hub-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--surface-tint);
  border: 2px solid var(--ink-outline);
  box-shadow: var(--shadow-xs);
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.hub-status-pill.is-authed {
  background: linear-gradient(180deg, #1d5c3b 0%, #14412a 100%);
  color: var(--ink);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.hub-card:hover {
  transform: translateY(-3px);
  border-color: var(--brass);
}

.hub-card-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.hub-card-host {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brass);
  letter-spacing: 0.02em;
}

.hub-card h2 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  margin: 0.1rem 0 0;
}

.hub-card p {
  margin: 0 0 0.75rem;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  flex: 1;
}

.hub-card-cta {
  align-self: flex-start;
}

/* ============================================================================
   UK & EU COMPLIANT COOKIE CONSENT BANNER & PREFERENCES MODAL
   ============================================================================ */
.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.footer-link-btn:hover {
  text-decoration: underline;
}

/* Cookie consent banner & modal are rendered inside Turnstile's isolated Shadow DOM (#turnstile-consent-root) */

/* ==========================================================================
   3-Portal Hub Grid Balance
   ========================================================================== */
.hub-grid.hub-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .hub-grid.hub-grid-three {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   THEME 2: CODING ADVENT — Modern Festive IDE / Developer Christmas Theme
   (Responsive across desktop, tablet, and mobile)
   ========================================================================== */
:root[data-theme="coding"],
body[data-theme="coding"] {
  --bg: #0b1120;
  --bg-deep: #070b15;
  --bg-subtle: #111a2e;
  --surface: #131e35;
  --surface-tint: #0e1628;
  --surface-hover: #1a2845;

  --ink-outline: rgba(148, 163, 184, 0.24);
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(52, 211, 153, 0.48);

  --ink: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;

  --pine: #10b981;
  --pine-dark: #059669;
  --pine-hover: #34d399;
  --pine-soft: rgba(16, 185, 129, 0.16);
  --pine-border: rgba(52, 211, 153, 0.5);

  --berry: #f43f5e;
  --berry-dark: #e11d48;
  --berry-hover: #fb7185;
  --berry-soft: rgba(244, 63, 94, 0.16);
  --berry-border: rgba(251, 113, 133, 0.5);

  --brass: #fbbf24;
  --brass-dark: #d97706;
  --brass-soft: rgba(251, 191, 36, 0.16);
  --brass-border: rgba(251, 191, 36, 0.45);

  --frost: #38bdf8;
  --snow: #e0f2fe;

  --code-bg: #070d19;
  --code-chrome: #0f172a;
  --code-border: rgba(148, 163, 184, 0.22);
  --code-text: #e2e8f0;
  --code-muted: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 8px;

  --shadow-xs: 0 2px 6px rgba(2, 6, 23, 0.35);
  --shadow-sm: 0 6px 18px rgba(2, 6, 23, 0.42);
  --shadow-md: 0 12px 32px rgba(2, 6, 23, 0.5);
  --shadow-gloss: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --font-display: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body[data-theme="coding"] {
  font-weight: 500;
  background-color: #0b1120;
  background-image:
    radial-gradient(circle at 12% 10%, rgba(16, 185, 129, 0.14), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.12), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(244, 63, 94, 0.08), transparent 45%),
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  background-size: auto, auto, auto, 32px 32px, 32px 32px, auto;
}

body[data-theme="coding"] .snowfall,
body[data-theme="coding"] .party-elves-stage {
  display: none !important;
}

/* Coding Topbar & Sleek LED Fairy Lights */
body[data-theme="coding"] .topbar {
  background: rgba(11, 17, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.45);
}

body[data-theme="coding"] .brand-title {
  font-family: var(--font-mono);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-shadow: none;
  color: #f8fafc;
}

body[data-theme="coding"] .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #34d399;
  letter-spacing: 0.01em;
}

body[data-theme="coding"] .christmas-lights {
  height: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

body[data-theme="coding"] .christmas-lights::before {
  top: 0;
  height: 1px;
  background: rgba(52, 211, 153, 0.3);
  border-bottom: none;
}

body[data-theme="coding"] .bulb {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 3px;
  border: none;
  animation: fb-twinkle 3.2s ease-in-out infinite;
}

body[data-theme="coding"] .bulb::before,
body[data-theme="coding"] .bulb::after {
  display: none;
}

body[data-theme="coding"] .nav-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #cbd5e1;
  padding: 0.44rem 0.85rem;
}

body[data-theme="coding"] .nav-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  transform: none;
  box-shadow: none;
}

body[data-theme="coding"] .nav-btn.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.15);
}

body[data-theme="coding"] .nav-menu-toggle {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #131e35;
  box-shadow: none;
}

/* Coding Buttons & Cards */
body[data-theme="coding"] .btn {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

body[data-theme="coding"] .btn:hover {
  background: #273549;
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.45);
}

body[data-theme="coding"] .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.4);
}

body[data-theme="coding"] .btn.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: rgba(52, 211, 153, 0.65);
  color: #022c22;
  text-shadow: none;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.28);
}

body[data-theme="coding"] .btn.primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  border-color: #6ee7b7;
  color: #022c22;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

body[data-theme="coding"] .btn.ghost {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: none;
  color: #cbd5e1;
}

body[data-theme="coding"] .btn.ghost:hover {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: none;
}

body[data-theme="coding"] .card {
  background: linear-gradient(180deg, rgba(19, 30, 53, 0.94) 0%, rgba(15, 23, 42, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
}

body[data-theme="coding"] h1,
body[data-theme="coding"] h2,
body[data-theme="coding"] h3 {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  text-shadow: none;
}

body[data-theme="coding"] .progress-label,
body[data-theme="coding"] .metric-label {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: #34d399;
}

/* Coding Calendar Tiles & Warm-up */
body[data-theme="coding"] .day-tile {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #16233d 0%, #111b30 100%);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.16s ease;
}

body[data-theme="coding"] .day-tile.open:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.22);
}

body[data-theme="coding"] .day-tile.solved {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.22) 0%, rgba(6, 78, 59, 0.35) 100%);
  border-color: rgba(52, 211, 153, 0.55);
}

body[data-theme="coding"] .day-tile.in-progress {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.16) 0%, rgba(120, 53, 15, 0.28) 100%);
  border-color: rgba(251, 191, 36, 0.5);
}

body[data-theme="coding"] .day-tile.day-24 {
  background:
    radial-gradient(circle at 88% 15%, rgba(251, 191, 36, 0.22) 0%, transparent 55%),
    linear-gradient(180deg, rgba(244, 63, 94, 0.28) 0%, rgba(136, 19, 55, 0.42) 100%);
  border-color: rgba(251, 113, 133, 0.65);
  box-shadow: var(--shadow-sm);
}

body[data-theme="coding"] .day-tile.locked {
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

body[data-theme="coding"] .day-num {
  font-family: var(--font-mono);
  text-shadow: none;
}

body[data-theme="coding"] .warmup-callout {
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid #38bdf8;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(19, 30, 53, 0.95) 100%);
  box-shadow: var(--shadow-sm);
}

body[data-theme="coding"] .warmup-callout::before {
  display: none;
}

body[data-theme="coding"] .docs-tile,
body[data-theme="coding"] .docs-callout,
body[data-theme="coding"] .docs-api-box,
body[data-theme="coding"] .docs-faq-item,
body[data-theme="coding"] .docs-lang-viewer {
  border-width: 1px;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

body[data-theme="coding"] .docs-toc-btn,
body[data-theme="coding"] .docs-lang-tab {
  font-family: var(--font-mono);
  border-width: 1px;
  border-radius: 6px;
  box-shadow: none;
}

body[data-theme="coding"] .docs-lang-tab.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #34d399;
  color: #6ee7b7;
}

body[data-theme="coding"] .winter-horizon {
  display: none;
}

body[data-theme="coding"] .site-footer {
  background: rgba(7, 11, 21, 0.92);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  margin-top: 2rem;
}

body[data-theme="coding"] .site-footer-portals {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="coding"] .site-footer a,
body[data-theme="coding"] .site-footer .footer-link-btn {
  color: #cbd5e1;
}

body[data-theme="coding"] .site-footer a:hover,
body[data-theme="coding"] .site-footer .footer-link-btn:hover {
  color: #34d399;
}

body[data-theme="coding"] .site-footer .footer-portal-link.active {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
}

@media (max-width: 1140px) {
  body[data-theme="coding"] .topbar.nav-open .nav-drawer {
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.7);
  }
}

/* ==========================================================================
   THEME 3: HACKING (CYBER ADVENT CTF) — Festive Cyber-Ops Terminal Theme
   (Responsive across desktop, tablet, and mobile)
   ========================================================================== */
:root[data-theme="hacking"],
body[data-theme="hacking"] {
  --bg: #040a07;
  --bg-deep: #020604;
  --bg-subtle: #08140e;
  --surface: #0a1811;
  --surface-tint: #06100b;
  --surface-hover: #0f241a;

  --ink-outline: rgba(34, 255, 136, 0.26);
  --border: rgba(34, 255, 136, 0.22);
  --border-strong: rgba(34, 255, 136, 0.55);

  --ink: #e8fff1;
  --ink-secondary: #a8e6c3;
  --muted: #6ea586;

  --pine: #22ff88;
  --pine-dark: #00b85c;
  --pine-hover: #5cffaa;
  --pine-soft: rgba(34, 255, 136, 0.14);
  --pine-border: rgba(34, 255, 136, 0.5);

  --berry: #ff3b5c;
  --berry-dark: #c9183a;
  --berry-hover: #ff617c;
  --berry-soft: rgba(255, 59, 92, 0.16);
  --berry-border: rgba(255, 59, 92, 0.55);

  --brass: #ffb84d;
  --brass-dark: #d98218;
  --brass-soft: rgba(255, 184, 77, 0.16);
  --brass-border: rgba(255, 184, 77, 0.5);

  --frost: #38e8ff;
  --snow: #d6fff0;

  --code-bg: #030806;
  --code-chrome: #07120c;
  --code-border: rgba(34, 255, 136, 0.28);
  --code-text: #c8ffdf;
  --code-muted: #568a6d;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 4px;

  --shadow-xs: 0 0 0 1px rgba(34, 255, 136, 0.12);
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.65), 0 0 14px rgba(34, 255, 136, 0.08);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.78), 0 0 22px rgba(34, 255, 136, 0.09);
  --shadow-gloss: inset 0 1px 0 rgba(34, 255, 136, 0.12);

  --font-display: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body[data-theme="hacking"] {
  font-weight: 500;
  background-color: #040a07;
  background-image:
    radial-gradient(circle at 18% 8%, rgba(34, 255, 136, 0.11), transparent 42%),
    radial-gradient(circle at 86% 14%, rgba(255, 59, 92, 0.1), transparent 38%),
    repeating-linear-gradient(
      180deg,
      rgba(34, 255, 136, 0.025) 0px,
      rgba(34, 255, 136, 0.025) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(rgba(34, 255, 136, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 255, 136, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #040a07 0%, #07120c 100%);
  background-size: auto, auto, auto, 40px 40px, 40px 40px, auto;
}

body[data-theme="hacking"] .snowfall,
body[data-theme="hacking"] .party-elves-stage {
  display: none !important;
}

/* Hacking Topbar & Festive Cyber LED Rail */
body[data-theme="hacking"] .topbar {
  background: rgba(4, 10, 7, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34, 255, 136, 0.28);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.75);
}

body[data-theme="hacking"] .brand-title {
  font-family: var(--font-mono);
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(34, 255, 136, 0.35);
  color: #e8fff1;
}

body[data-theme="hacking"] .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #22ff88;
}

body[data-theme="hacking"] .christmas-lights {
  height: 10px;
  background: #030806;
  border-top: 1px solid rgba(34, 255, 136, 0.22);
}

body[data-theme="hacking"] .christmas-lights::before {
  display: none;
}

body[data-theme="hacking"] .bulb {
  width: 10px;
  height: 3px;
  border-radius: 1px;
  margin-top: 3px;
  border: none;
  animation: fb-twinkle 2.4s steps(2, end) infinite;
}

body[data-theme="hacking"] .bulb::before,
body[data-theme="hacking"] .bulb::after {
  display: none;
}

body[data-theme="hacking"] .bulb-red {
  background: #ff3b5c;
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.85);
}

body[data-theme="hacking"] .bulb-green {
  background: #22ff88;
  box-shadow: 0 0 8px rgba(34, 255, 136, 0.85);
}

body[data-theme="hacking"] .bulb-gold {
  background: #ffb84d;
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.8);
}

body[data-theme="hacking"] .bulb-ice {
  background: #38e8ff;
  box-shadow: 0 0 8px rgba(56, 232, 255, 0.8);
}

body[data-theme="hacking"] .nav-btn {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: #a8e6c3;
  padding: 0.42rem 0.8rem;
}

body[data-theme="hacking"] .nav-btn:hover {
  background: rgba(34, 255, 136, 0.08);
  border-color: rgba(34, 255, 136, 0.35);
  color: #22ff88;
  transform: none;
  box-shadow: none;
}

body[data-theme="hacking"] .nav-btn.active {
  background: rgba(34, 255, 136, 0.14);
  border-color: #22ff88;
  color: #22ff88;
  box-shadow: 0 0 12px rgba(34, 255, 136, 0.22);
}

body[data-theme="hacking"] .nav-menu-toggle {
  border: 1px solid rgba(34, 255, 136, 0.45);
  border-radius: 4px;
  background: #08140e;
  box-shadow: none;
}

/* Hacking Buttons & Terminal Panels */
body[data-theme="hacking"] .btn {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #0c1f16;
  color: #e8fff1;
  border: 1px solid rgba(34, 255, 136, 0.35);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(34, 255, 136, 0.08);
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

body[data-theme="hacking"] .btn:hover {
  background: #122e21;
  border-color: #22ff88;
  color: #22ff88;
  transform: none;
  box-shadow: 0 0 14px rgba(34, 255, 136, 0.25);
}

body[data-theme="hacking"] .btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

body[data-theme="hacking"] .btn.primary {
  background: linear-gradient(180deg, #ff3b5c 0%, #c9183a 100%);
  border-color: #ff617c;
  color: #ffffff;
  text-shadow: none;
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.35);
}

body[data-theme="hacking"] .btn.primary:hover {
  background: linear-gradient(180deg, #ff5470 0%, #e01e43 100%);
  border-color: #ff8aa0;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 59, 92, 0.5);
}

body[data-theme="hacking"] .btn.ghost {
  background: rgba(6, 16, 11, 0.8);
  border: 1px solid rgba(34, 255, 136, 0.25);
  box-shadow: none;
  color: #a8e6c3;
}

body[data-theme="hacking"] .btn.ghost:hover {
  border-color: #22ff88;
  color: #22ff88;
  background: rgba(34, 255, 136, 0.1);
}

body[data-theme="hacking"] .card {
  background: linear-gradient(180deg, rgba(10, 24, 17, 0.96) 0%, rgba(6, 16, 11, 0.98) 100%);
  border: 1px solid rgba(34, 255, 136, 0.26);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-gloss);
}

body[data-theme="hacking"] h1,
body[data-theme="hacking"] h2,
body[data-theme="hacking"] h3 {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  text-shadow: none;
}

body[data-theme="hacking"] .progress-label,
body[data-theme="hacking"] .metric-label {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: #22ff88;
}

/* Hacking CTF Grid Tiles & Callouts */
body[data-theme="hacking"] .day-tile {
  border: 1px solid rgba(34, 255, 136, 0.25);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #0b1c14 0%, #07130d 100%);
  box-shadow: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

body[data-theme="hacking"] .day-tile.open:hover {
  transform: translateY(-2px);
  border-color: #22ff88;
  box-shadow: 0 0 18px rgba(34, 255, 136, 0.24), inset 0 0 12px rgba(34, 255, 136, 0.06);
}

body[data-theme="hacking"] .day-tile.solved {
  background: linear-gradient(180deg, rgba(34, 255, 136, 0.16) 0%, rgba(6, 40, 24, 0.55) 100%);
  border-color: rgba(34, 255, 136, 0.65);
}

body[data-theme="hacking"] .day-tile.in-progress {
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.14) 0%, rgba(64, 42, 8, 0.4) 100%);
  border-color: rgba(255, 184, 77, 0.55);
}

body[data-theme="hacking"] .day-tile.day-24 {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 184, 77, 0.2) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255, 59, 92, 0.24) 0%, rgba(74, 10, 22, 0.6) 100%);
  border-color: rgba(255, 59, 92, 0.75);
  box-shadow: 0 0 16px rgba(255, 59, 92, 0.2);
}

body[data-theme="hacking"] .day-tile.locked {
  background: rgba(4, 10, 7, 0.72);
  border: 1px dashed rgba(110, 165, 134, 0.24);
  box-shadow: none;
}

body[data-theme="hacking"] .day-num {
  font-family: var(--font-mono);
  color: #22ff88;
  text-shadow: 0 0 8px rgba(34, 255, 136, 0.35);
}

body[data-theme="hacking"] .warmup-callout {
  border: 1px solid rgba(255, 59, 92, 0.4);
  border-left: 4px solid #ff3b5c;
  background: linear-gradient(135deg, rgba(10, 24, 17, 0.96) 0%, rgba(24, 10, 14, 0.92) 100%);
  box-shadow: var(--shadow-sm);
}

body[data-theme="hacking"] .warmup-callout::before {
  display: none;
}

body[data-theme="hacking"] .docs-tile,
body[data-theme="hacking"] .docs-callout,
body[data-theme="hacking"] .docs-api-box,
body[data-theme="hacking"] .docs-faq-item,
body[data-theme="hacking"] .docs-lang-viewer {
  border-width: 1px;
  border-color: rgba(34, 255, 136, 0.24);
  box-shadow: none;
}

body[data-theme="hacking"] .docs-toc-btn,
body[data-theme="hacking"] .docs-lang-tab {
  font-family: var(--font-mono);
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
}

body[data-theme="hacking"] .docs-lang-tab.active {
  background: rgba(34, 255, 136, 0.16);
  border-color: #22ff88;
  color: #22ff88;
}

body[data-theme="hacking"] .winter-horizon {
  display: none;
}

body[data-theme="hacking"] .site-footer {
  background: #030806;
  border-top: 1px solid rgba(34, 255, 136, 0.25);
  color: #6ea586;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 2rem;
}

body[data-theme="hacking"] .site-footer-portals {
  border-bottom-color: rgba(34, 255, 136, 0.18);
}

body[data-theme="hacking"] .site-footer a,
body[data-theme="hacking"] .site-footer .footer-link-btn {
  color: #a8e6c3;
}

body[data-theme="hacking"] .site-footer a:hover,
body[data-theme="hacking"] .site-footer .footer-link-btn:hover {
  color: #22ff88;
}

body[data-theme="hacking"] .site-footer .footer-portal-link.active {
  background: rgba(34, 255, 136, 0.12);
  border-color: rgba(34, 255, 136, 0.45);
  color: #22ff88;
}

@media (max-width: 1140px) {
  body[data-theme="hacking"] .topbar.nav-open .nav-drawer {
    background: #06100b;
    border-bottom: 1px solid rgba(34, 255, 136, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="coding"] .bulb,
  body[data-theme="hacking"] .bulb {
    animation: none;
  }
}
