/* Hub: idle = цветно + slow motion; hover = blur при преход; активен = пълни FX */
:root {
  --corp-bg: #050508;
  --corp-edit-accent: #a855f7;
  --corp-edit-hot: #22d3ee;
  --corp-mario-sky: #5c94fc;
  --corp-mario-grass: #00a800;
  --corp-font: "Outfit", system-ui, sans-serif;
  --corp-pixel: "Press Start 2P", monospace;
  --corp-blur-bg: 5px;
  --corp-blur-motion: 26px;
  --corp-expand-ms: 580ms;
  --corp-slow: 2.5;
}

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

html {
  height: 100%;
  overflow: hidden;
}

html,
body {
  margin: 0;
  background: var(--corp-bg);
  color: #f4f4f5;
  font-family: var(--corp-font);
}

body.corp-hub {
  height: 100%;
  overflow: hidden;
}

.corp-hub {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.corp-bleed {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: linear-gradient(
    90deg,
    transparent 38%,
    rgba(168, 85, 247, 0.08) 48%,
    rgba(92, 148, 252, 0.1) 52%,
    transparent 62%
  );
}

@media (hover: hover) and (pointer: fine) {
  .corp-stage.has-focus-edit .corp-bleed,
  .corp-stage.has-focus-mario .corp-bleed {
    opacity: 1;
  }
}

.corp-header {
  position: relative;
  z-index: 10;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.corp-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.corp-logo {
  border-radius: 14px;
}

.corp-header__title {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f4f5;
}

.corp-stage {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

.corp-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(20px, 4vw, 48px);
  flex: 1 1 50%;
  min-width: 0;
  z-index: 1;
  contain: layout style;
  --speed: var(--corp-slow);
}

@media (hover: hover) and (pointer: fine) {
  .corp-panel--edit,
  .corp-panel--mario {
    --corp-expand-ms: 580ms;
    transition: flex var(--corp-expand-ms) cubic-bezier(0.4, 0, 0.16, 1);
  }

  .corp-panel.is-active {
    --speed: 1;
  }

  .corp-stage.has-focus-edit .corp-panel--edit.is-entering,
  .corp-stage.has-focus-edit .corp-panel--edit.is-active,
  .corp-stage.has-focus-edit .corp-panel--edit.is-exiting {
    flex: 1 1 78%;
    z-index: 4;
  }

  .corp-stage.has-focus-mario .corp-panel--mario.is-entering,
  .corp-stage.has-focus-mario .corp-panel--mario.is-active,
  .corp-stage.has-focus-mario .corp-panel--mario.is-exiting {
    flex: 1 1 78%;
    z-index: 4;
  }

  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-entering):not(.is-active):not(.is-exiting),
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) {
    flex: 1 1 42%;
    z-index: 1;
  }
}

.corp-panel__fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: filter var(--corp-expand-ms) ease;
}

@media (hover: hover) and (pointer: fine) {
  /* Idle: full color. Inactive sibling on focus: B&W + light blur */
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-panel__fx,
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-panel__fx {
    filter: grayscale(1) blur(var(--corp-blur-bg));
  }

  /* Expand/exit: heavy blur, FX paused */
  .corp-panel--edit.is-entering .corp-panel__fx,
  .corp-panel--edit.is-exiting .corp-panel__fx,
  .corp-panel--mario.is-entering .corp-panel__fx,
  .corp-panel--mario.is-exiting .corp-panel__fx {
    filter: grayscale(1) blur(var(--corp-blur-motion)) brightness(1.06);
  }

  .corp-panel--edit.is-entering .corp-fx-full,
  .corp-panel--edit.is-entering .corp-canvas,
  .corp-panel--edit.is-entering .corp-edit-mesh,
  .corp-panel--edit.is-entering .corp-orbs span,
  .corp-panel--edit.is-entering .corp-scanlines,
  .corp-panel--edit.is-entering .corp-grain,
  .corp-panel--edit.is-entering .corp-sketch-bleed,
  .corp-panel--edit.is-exiting .corp-fx-full,
  .corp-panel--edit.is-exiting .corp-canvas,
  .corp-panel--edit.is-exiting .corp-edit-mesh,
  .corp-panel--edit.is-exiting .corp-orbs span,
  .corp-panel--edit.is-exiting .corp-scanlines,
  .corp-panel--edit.is-exiting .corp-grain,
  .corp-panel--edit.is-exiting .corp-sketch-bleed,
  .corp-panel--mario.is-entering .corp-fx-full,
  .corp-panel--mario.is-exiting .corp-fx-full {
    animation-play-state: paused !important;
    opacity: 0.2;
  }

  .corp-panel--edit.is-entering .corp-canvas,
  .corp-panel--edit.is-exiting .corp-canvas,
  .corp-panel--edit.is-entering .corp-edit-mesh,
  .corp-panel--edit.is-exiting .corp-edit-mesh {
    opacity: 0.2;
  }

  .corp-panel--edit.is-active .corp-panel__fx,
  .corp-panel.is-active .corp-panel__fx {
    filter: none;
  }

  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-panel__label,
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-panel__name,
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-panel__desc,
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-status,
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-go,
  .corp-stage.has-focus-edit .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-panel__actions,
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-panel__label,
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-panel__desc,
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-status,
  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-go {
    filter: grayscale(0.85);
    transition: filter var(--corp-expand-ms) ease;
  }

  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-panel__name {
    opacity: 0.68;
    transition: opacity var(--corp-expand-ms) ease;
  }

  .corp-stage.has-focus-mario .corp-panel--edit:not(.is-entering):not(.is-active):not(.is-exiting) .corp-panel__name::before {
    opacity: 0.22;
  }
}

.corp-panel__content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  transition: filter var(--corp-expand-ms) ease;
}

.corp-panel__label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.corp-panel__label--pixel {
  font-family: var(--corp-pixel);
  font-size: 8px;
}

.corp-panel__name {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
}

.corp-panel--edit .corp-panel__name {
  position: relative;
  display: inline-block;
  max-width: 100%;
  background-image: linear-gradient(
    105deg,
    #e4e4e7 0%,
    #f4f4f5 12%,
    var(--corp-edit-hot) 32%,
    #ec4899 48%,
    var(--corp-edit-accent) 62%,
    #818cf8 78%,
    #e4e4e7 92%,
    #f4f4f5 100%
  );
  background-size: 260% 100%;
  background-repeat: repeat-x;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.corp-panel--edit .corp-panel__name::before {
  content: "";
  position: absolute;
  inset: -0.08em -0.12em;
  z-index: -1;
  border-radius: 0.12em;
  background: linear-gradient(
    105deg,
    rgba(34, 211, 238, 0.28),
    rgba(168, 85, 247, 0.42),
    rgba(236, 72, 153, 0.24)
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  filter: blur(14px);
  opacity: 0.45;
  pointer-events: none;
}

.corp-panel--edit.is-active .corp-panel__name {
  background-image: linear-gradient(
    105deg,
    #fff 0%,
    #fafafa 10%,
    var(--corp-edit-hot) 28%,
    #f472b6 44%,
    var(--corp-edit-accent) 58%,
    #a78bfa 74%,
    #fff 90%,
    #fafafa 100%
  );
}

.corp-panel--edit.is-active .corp-panel__name::before {
  opacity: 0.72;
  filter: blur(18px);
}

.corp-panel--edit .corp-panel__desc {
  color: rgba(228, 228, 231, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.corp-panel--edit.is-active .corp-panel__desc {
  color: #e4e4e7;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
}

.corp-panel__name--pixel {
  font-family: var(--corp-pixel);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  color: #fff;
  text-shadow: 3px 3px 0 #000;
}

.corp-panel--mario.is-active .corp-panel__name--pixel {
  text-shadow: 4px 4px 0 #000;
}

.corp-panel__desc {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
  color: #c4c4c8;
  max-width: 32ch;
}

.corp-panel.is-active .corp-panel__desc {
  color: #d4d4d8;
}

.corp-panel__desc--pixel {
  font-family: var(--corp-pixel);
  font-size: 8px;
  line-height: 1.8;
}

/* —— Edit —— */
.corp-panel--edit {
  background: #06060c;
  contain: layout style;
  isolation: isolate;
}

.corp-edit-mesh {
  position: absolute;
  inset: -8%;
  z-index: 0;
  opacity: 1;
  transform: translateZ(0);
  background:
    radial-gradient(ellipse 72% 58% at 18% 28%, rgba(168, 85, 247, 0.36), transparent 58%),
    radial-gradient(ellipse 64% 52% at 82% 68%, rgba(34, 211, 238, 0.28), transparent 54%),
    radial-gradient(ellipse 58% 70% at 52% 48%, rgba(99, 102, 241, 0.2), transparent 62%),
    radial-gradient(ellipse 48% 40% at 70% 22%, rgba(236, 72, 153, 0.14), transparent 55%),
    linear-gradient(145deg, #07070f 0%, #0a0a14 42%, #080810 100%);
  transition: opacity 0.35s ease;
}

.corp-panel--edit.is-active .corp-edit-mesh {
  opacity: 1;
}

.corp-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.68;
  transition: opacity 0.35s ease;
  transform: translateZ(0);
}

.corp-panel--edit.is-active .corp-canvas {
  opacity: 0.88;
}

.corp-grain {
  position: absolute;
  inset: -40%;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(0);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 0.35s ease;
}

.corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-grain {
  opacity: 0.05;
}

.corp-panel--edit.is-active .corp-grain {
  opacity: 0.07;
}

.corp-orbs span.corp-intro {
  position: absolute;
  border-radius: 50%;
  opacity: 0.46;
  filter: blur(30px);
  transform: translateZ(0);
}

.corp-panel--edit.is-active .corp-orbs span.corp-intro {
  opacity: 0.58;
  filter: blur(36px);
}

.corp-orbs span:nth-child(1) {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--corp-edit-accent), transparent 70%);
  top: 12%;
  left: 14%;
}

.corp-orbs span:nth-child(2) {
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, var(--corp-edit-hot), transparent 70%);
  top: 50%;
  right: 16%;
}

.corp-orbs span:nth-child(3) {
  width: 130px;
  height: 130px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: 16%;
  left: 34%;
}

.corp-orbs span:nth-child(4) {
  width: 88px;
  height: 88px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: 24%;
  right: 28%;
}

.corp-scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  transform: translateZ(0);
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  transition: opacity 0.35s ease;
}

.corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-scanlines {
  opacity: 0.22;
}

.corp-panel--edit.is-active .corp-scanlines {
  opacity: 0.28;
}

.corp-sketch-bleed {
  position: absolute;
  top: 0;
  right: -6%;
  width: 34%;
  height: 100%;
  transform: translateZ(0);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(168, 85, 247, 0.16) 55%,
    rgba(34, 211, 238, 0.12)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-sketch-bleed {
  opacity: 0.72;
}

.corp-panel--edit.is-active .corp-sketch-bleed {
  opacity: 1;
}

/* —— Mario —— */
.corp-panel--mario {
  background: linear-gradient(180deg, #6a8ab0 0%, #4a6a9a 45%, #2a4070 100%);
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) {
  background: linear-gradient(180deg, #8ec0ff 0%, var(--corp-mario-sky) 45%, #3d62b8 100%);
}

.corp-cloud {
  position: absolute;
  width: 56px;
  height: 20px;
  transform: translateZ(0);
  background: #f0f0f0;
  border-radius: 10px;
  box-shadow:
    -16px 5px 0 -4px #f0f0f0,
    16px 4px 0 -5px #f0f0f0;
  z-index: 2;
}

.corp-panel--mario.is-active .corp-cloud {
  background: #f8f8f8;
  box-shadow:
    -16px 5px 0 -4px #f8f8f8,
    16px 4px 0 -5px #f8f8f8;
}

.corp-cloud--1 { top: 12%; left: 6%; }
.corp-cloud--2 { top: 22%; left: 42%; }
.corp-cloud--3 { top: 8%; right: 8%; }
.corp-cloud--4 { top: 16%; left: 68%; width: 44px; height: 16px; }
.corp-cloud--5 { top: 30%; left: 18%; width: 64px; height: 22px; }

.corp-hills {
  position: absolute;
  bottom: 24%;
  left: 0;
  right: 0;
  height: 20%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.corp-hill {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
}

.corp-hill--1 {
  left: 2%;
  border-width: 0 90px 58px 90px;
  border-color: transparent transparent #1e5828 transparent;
  opacity: 0.55;
}

.corp-hill--2 {
  left: 28%;
  border-width: 0 120px 72px 120px;
  border-color: transparent transparent #267032 transparent;
  opacity: 0.72;
}

.corp-hill--3 {
  right: 6%;
  border-width: 0 100px 64px 100px;
  border-color: transparent transparent #1a5024 transparent;
  opacity: 0.6;
}

#panelMario .corp-castle {
  position: absolute;
  left: 50%;
  bottom: 24%;
  width: min(340px, 58%);
  min-width: 280px;
  height: clamp(110px, 40%, 168px);
  --castle-x: -52%;
  transform: translateX(var(--castle-x));
  z-index: 1;
  opacity: 1;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.35));
}

.corp-panel--mario.is-entering .corp-castle,
.corp-panel--mario.is-exiting .corp-castle {
  opacity: 0.55;
}

.corp-panel--mario.is-active .corp-castle {
  opacity: 1;
  filter: drop-shadow(5px 7px 0 rgba(0, 0, 0, 0.42));
}

.corp-castle__art {
  position: relative;
  width: 100%;
  height: 100%;
}

.corp-castle__foundation {
  position: absolute;
  bottom: 0;
  left: 4%;
  right: 4%;
  height: 14%;
  background: #989898;
  border: 3px solid #181010;
  box-shadow: inset 0 -4px 0 #787878;
}

.corp-castle__wall {
  position: absolute;
  bottom: 14%;
  left: 10%;
  right: 10%;
  height: 28%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8%;
  background: #b0b0b0;
  border: 3px solid #181010;
  border-bottom: none;
}

.corp-castle__gate {
  width: 22%;
  height: 88%;
  background: #5c4030;
  border: 3px solid #181010;
  border-bottom: none;
  box-shadow: inset 0 6px 0 #3a2818;
}

.corp-castle__tower {
  position: absolute;
  bottom: 14%;
  display: flex;
  flex-direction: column;
}

.corp-castle__tower--left {
  left: 0;
  width: 22%;
  height: 62%;
}

.corp-castle__tower--center {
  left: 50%;
  width: 28%;
  height: 86%;
  transform: translateX(-50%);
}

.corp-castle__tower--right {
  right: 0;
  width: 22%;
  height: 62%;
}

.corp-castle__roof {
  flex: 0 0 auto;
  height: 12%;
  min-height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #c03030 0 7px,
    #181010 7px 9px,
    #e4000b 9px 16px,
    #181010 16px 18px
  );
  border: 3px solid #181010;
  border-bottom: none;
}

.corp-castle__body {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, #c8c8c8 0%, #a8a8a8 100%);
  border: 3px solid #181010;
  border-top: none;
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.15);
}

.corp-castle__window {
  position: absolute;
  width: 18%;
  height: 16%;
  min-width: 8px;
  min-height: 8px;
  background: #f8d878;
  border: 2px solid #181010;
  box-shadow: inset 0 0 0 1px #c8a028;
}

.corp-castle__tower--left .corp-castle__window:nth-child(1) { top: 18%; left: 18%; }
.corp-castle__tower--left .corp-castle__window:nth-child(2) { top: 48%; right: 18%; }

.corp-castle__tower--center .corp-castle__window:nth-child(1) { top: 12%; left: 16%; }
.corp-castle__tower--center .corp-castle__window:nth-child(2) { top: 12%; right: 16%; }
.corp-castle__tower--center .corp-castle__window:nth-child(3) { top: 42%; left: 16%; }
.corp-castle__tower--center .corp-castle__window:nth-child(4) { top: 42%; right: 16%; }

.corp-castle__tower--right .corp-castle__window:nth-child(1) { top: 18%; left: 18%; }
.corp-castle__tower--right .corp-castle__window:nth-child(2) { top: 48%; right: 18%; }

.corp-castle__window--small {
  position: static;
  width: 10px;
  height: 10px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.corp-castle__flagpole {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 22%;
  margin-left: -2px;
  background: #787878;
  border: 2px solid #181010;
  z-index: 2;
}

.corp-castle__flag {
  position: absolute;
  top: 0;
  left: 4px;
  width: 18px;
  height: 12px;
  background: #e4000b;
  border: 2px solid #181010;
}

.corp-panel--mario.is-active .corp-castle__window {
  background: #fff4a8;
}

.corp-bird {
  position: absolute;
  width: 10px;
  height: 4px;
  z-index: 2;
  opacity: 0.85;
}

.corp-bird::before,
.corp-bird::after {
  content: "";
  position: absolute;
  top: 0;
  width: 6px;
  height: 3px;
  border-top: 2px solid #181010;
}

.corp-bird::before {
  left: 0;
  transform: rotate(-28deg);
  transform-origin: right center;
}

.corp-bird::after {
  right: 0;
  transform: rotate(28deg);
  transform-origin: left center;
}

.corp-bird--1 { top: 14%; left: 32%; }
.corp-bird--2 { top: 20%; left: 58%; transform: scale(0.85); }

.corp-bush {
  position: absolute;
  bottom: 24%;
  left: 8%;
  width: 36px;
  height: 18px;
  z-index: 3;
  background: #228018;
  border: 3px solid #181010;
  border-radius: 0;
  box-shadow:
    -14px 4px 0 -2px #1a6010,
    14px 4px 0 -2px #2a9820,
    0 -8px 0 -2px #30a828;
}

.corp-blocks {
  position: absolute;
  top: 42%;
  left: 10%;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.corp-qblock {
  width: 34px;
  height: 34px;
  background: #888;
  border: 3px solid #333;
  transform: translateZ(0);
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-qblock {
  background: linear-gradient(135deg, #f8d878, #c8a028);
  border-color: #181010;
}

.corp-brick {
  width: 34px;
  height: 34px;
  background: #666;
  border: 3px solid #333;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-brick {
  background: #b85c38;
  border-color: #181010;
}

.corp-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 24%;
}

.corp-grass {
  height: 14px;
  background: #3a6a3a;
  border-top: 3px solid #2a4a2a;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-grass {
  background: var(--corp-mario-grass);
  border-top-color: #007800;
}

.corp-dirt {
  height: calc(100% - 14px);
  background: #5a3a20;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-dirt {
  background: #c84c0c;
}

.corp-mario-wrap {
  position: absolute;
  bottom: 22%;
  right: 6%;
  z-index: 4;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform var(--corp-expand-ms) cubic-bezier(0.34, 1.2, 0.64, 1);
}

.corp-panel--mario.is-active .corp-mario-wrap {
  transform: translate3d(0, 0, 0) scale(1.3);
}

.corp-mario {
  width: 48px;
  height: 56px;
  position: relative;
  image-rendering: pixelated;
  opacity: 0.7;
  transform: translateZ(0);
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-mario {
  opacity: 0.92;
}

.corp-panel--mario.is-active .corp-mario {
  opacity: 1;
}

.corp-mario::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 32px;
  height: 12px;
  background: #888;
  box-shadow:
    0 12px 0 #888,
    0 24px 0 #556,
    -8px 36px 0 #556,
    8px 36px 0 #556,
    0 48px 0 #664,
    -8px 48px 0 #664,
    8px 48px 0 #664;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-mario::before {
  background: #e4000b;
  box-shadow:
    0 12px 0 #e4000b,
    0 24px 0 #1e40af,
    -8px 36px 0 #1e40af,
    8px 36px 0 #1e40af,
    0 48px 0 #854d0e,
    -8px 48px 0 #854d0e,
    8px 48px 0 #854d0e;
}

.corp-mario::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 4px;
  width: 24px;
  height: 8px;
  background: #aaa;
  box-shadow: 0 16px 0 #aaa;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-mario::after {
  background: #fec89a;
  box-shadow: 0 16px 0 #fec89a;
}

.corp-coin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #888;
  border: 2px solid #333;
  transform: translateZ(0);
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-coin {
  background: #f8d878;
  border-color: #181010;
}

.corp-pixel-bleed {
  position: absolute;
  top: 0;
  left: 0;
  width: 22%;
  height: 100%;
  background: linear-gradient(270deg, transparent, rgba(92, 148, 252, 0.2));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-pixel-bleed {
  opacity: 0.75;
}

.corp-panel--mario.is-active .corp-pixel-bleed {
  opacity: 1;
}

/* CTA */
.corp-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}

.corp-status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #52525b;
}

.corp-status.is-online .corp-status__dot {
  background: #22c55e;
}

.corp-status--soon .corp-status__dot,
.corp-status.is-soon .corp-status__dot {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.55);
}

.corp-status--soon .corp-status__text,
.corp-status.is-soon .corp-status__text {
  color: #fde68a;
}

.corp-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.corp-panel__actions--mario {
  margin-top: 4px;
}

.corp-soon {
  display: inline-flex;
  align-items: center;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  opacity: 0.72;
  cursor: not-allowed;
  user-select: none;
}

.corp-soon--mario {
  font-family: var(--corp-pixel);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.85);
  background: #52525b;
  border: 4px solid #181010;
  border-radius: 0;
  box-shadow: 0 4px 0 #27272a;
}

.corp-learn {
  display: inline-flex;
  align-items: center;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.corp-learn--mario {
  font-family: var(--corp-pixel);
  font-size: 8px;
  color: #3d2800;
  background: linear-gradient(145deg, #f5c842, #e8a020);
  border: 4px solid #181010;
  border-radius: 0;
  box-shadow: 0 4px 0 #9a6a10;
}

.corp-learn--mario:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #9a6a10;
}

.corp-learn-modal {
  margin: auto;
  padding: 0;
  border: none;
  max-width: min(640px, calc(100vw - 32px));
  width: 100%;
  background: transparent;
  color: #f4f4f5;
}

.corp-learn-modal::backdrop {
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
}

.corp-learn-modal__panel {
  position: relative;
  background: rgba(5, 5, 8, 0.96);
  border: 4px solid #181010;
  box-shadow: 0 12px 0 #181010, 0 0 0 2px var(--corp-mario-sky);
  padding: clamp(20px, 4vw, 32px);
  max-height: min(85vh, 720px);
  overflow: auto;
}

.corp-learn-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: #e4000b;
  border: 3px solid #181010;
  cursor: pointer;
  font-family: var(--corp-font);
}

.corp-learn__head {
  margin: 0 32px 16px 0;
  font-family: var(--corp-pixel);
  font-size: clamp(8px, 2.2vw, 10px);
  line-height: 1.6;
  color: var(--corp-mario-sky);
}

.corp-learn__hook {
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 14px;
}

.corp-learn__hook strong {
  color: #ffe566;
}

.corp-learn-modal__body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 244, 245, 0.9);
}

.corp-learn__list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.corp-learn__list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.corp-learn__coin {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff6a8, #f5c842 45%, #c98a10);
  border: 2px solid #8a5a08;
}

.corp-learn__outro {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.corp-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.corp-go--edit {
  color: #0a0a12;
  background: linear-gradient(135deg, var(--corp-edit-hot), var(--corp-edit-accent));
}

.corp-go--mario {
  font-family: var(--corp-pixel);
  font-size: 9px;
  color: #fff;
  background: #e4000b;
  border: 4px solid #181010;
  border-radius: 0;
  box-shadow: 0 4px 0 #a80008;
}

.corp-panel--mario.is-active .corp-go--mario {
  transform: translate3d(0, -1px, 0);
}

.corp-go.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.corp-go.is-disabled span::after {
  content: " — Not available";
  font-size: 12px;
}

/* FX: idle + неактивен sibling = бавно (--speed); активен = нормална скорост */
@media (prefers-reduced-motion: no-preference) {
  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-cloud.corp-intro {
    animation: introDrift calc(28s * var(--speed)) linear infinite;
  }
  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-cloud--2 {
    animation-duration: calc(34s * var(--speed));
    animation-delay: calc(-6s * var(--speed));
  }
  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-cloud--3 {
    animation-duration: calc(30s * var(--speed));
    animation-delay: calc(-12s * var(--speed));
  }

  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-cloud--4 {
    animation: introDrift calc(36s * var(--speed)) linear infinite;
    animation-delay: calc(-4s * var(--speed));
  }

  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-cloud--5 {
    animation: introDrift calc(42s * var(--speed)) linear infinite;
    animation-delay: calc(-18s * var(--speed));
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-orbs span.corp-intro:nth-child(1) {
    animation: corpIntroPulse calc(5.5s * var(--speed)) ease-in-out infinite;
  }
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-orbs span.corp-intro:nth-child(2) {
    animation: corpIntroPulse calc(6.2s * var(--speed)) ease-in-out infinite reverse;
    animation-delay: calc(-1.2s * var(--speed));
  }
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-orbs span.corp-intro:nth-child(3) {
    animation: corpIntroPulse calc(4.8s * var(--speed)) ease-in-out infinite;
    animation-delay: calc(-2.4s * var(--speed));
  }
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-orbs span.corp-intro:nth-child(4) {
    animation: corpIntroPulse calc(5s * var(--speed)) ease-in-out infinite reverse;
    animation-delay: calc(-0.8s * var(--speed));
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-scanlines {
    animation: scanDrift calc(8s * var(--speed)) linear infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-grain {
    animation: grainShift calc(0.45s * var(--speed)) steps(2) infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-sketch-bleed {
    animation: sketchBleed calc(4.5s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-edit-mesh {
    animation: editMeshDrift calc(22s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-panel__name {
    transform: translateZ(0);
    animation:
      editTitleSweep calc(7s * var(--speed)) ease-in-out infinite,
      editTitleBreathe calc(5.5s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-panel__name::before {
    animation:
      editTitleGlow calc(4.5s * var(--speed)) ease-in-out infinite,
      editTitleSweep calc(7s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--edit.is-active .corp-panel__name {
    animation:
      editTitleSweep calc(4.2s * var(--speed)) ease-in-out infinite,
      editTitleBreathe calc(3.6s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--edit.is-active .corp-panel__name::before {
    animation:
      editTitleGlow calc(3s * var(--speed)) ease-in-out infinite,
      editTitleSweep calc(4.2s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-cloud {
    animation: cloudDrift calc(18s * var(--speed)) linear infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-cloud--2 {
    animation-delay: calc(-6s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-cloud--3 {
    animation-delay: calc(-12s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-cloud--4 {
    animation: cloudDrift calc(24s * var(--speed)) linear infinite;
    animation-delay: calc(-5s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-cloud--5 {
    animation: cloudDrift calc(32s * var(--speed)) linear infinite;
    animation-delay: calc(-14s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-qblock {
    animation: blockBounce calc(1s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-qblock:nth-child(2) {
    animation-delay: calc(0.15s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-mario {
    animation: marioBob calc(0.5s * var(--speed)) steps(2) infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-coin {
    animation: coinFlip calc(0.7s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-coin:nth-child(2) {
    animation-delay: calc(0.2s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-castle {
    animation: castleIdle calc(6s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-hill--1 {
    animation: hillParallax calc(10s * var(--speed)) ease-in-out infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-hill--2 {
    animation: hillParallax calc(12s * var(--speed)) ease-in-out infinite reverse;
    animation-delay: calc(-3s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-hill--3 {
    animation: hillParallax calc(11s * var(--speed)) ease-in-out infinite;
    animation-delay: calc(-5s * var(--speed));
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-bird--1 {
    animation: birdGlide calc(14s * var(--speed)) linear infinite;
  }

  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-bird--2 {
    animation: birdGlide calc(18s * var(--speed)) linear infinite reverse;
    animation-delay: calc(-6s * var(--speed));
  }

  .corp-panel--mario.is-active .corp-castle__flag {
    animation: castleFlagWave calc(1.2s * var(--speed)) ease-in-out infinite alternate;
  }

  .corp-panel--mario.is-active .corp-castle__window {
    animation: castleWinGlow calc(2.4s * var(--speed)) ease-in-out infinite alternate;
  }
}

@keyframes corpIntroPulse {
  0%, 100% { opacity: 0.38; transform: translate3d(0, 0, 0) scale(1); }
  35% { opacity: 0.52; transform: translate3d(0, 0, 0) scale(1.04); }
  65% { opacity: 0.62; transform: translate3d(0, 0, 0) scale(1.08); }
}
@keyframes scanDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 6px, 0); }
}
@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-2%, -2%, 0); }
}
@keyframes sketchBleed {
  0%, 100% { opacity: 0.82; transform: translate3d(0, 0, 0); }
  50% { opacity: 1; transform: translate3d(-2%, 0, 0); }
}
@keyframes editMeshDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: hue-rotate(0deg) saturate(1);
  }
  33% {
    transform: translate3d(2.5%, -1.5%, 0) scale(1.04);
    filter: hue-rotate(8deg) saturate(1.08);
  }
  66% {
    transform: translate3d(-1.5%, 2%, 0) scale(1.02);
    filter: hue-rotate(-6deg) saturate(1.04);
  }
}
@keyframes editTitleSweep {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes editTitleBreathe {
  0%, 100% { transform: translateZ(0) scale3d(1, 1, 1); }
  50% { transform: translateZ(0) scale3d(1.018, 1.018, 1); }
}
@keyframes editTitleGlow {
  0%, 100% { opacity: 0.38; filter: blur(14px); }
  50% { opacity: 0.78; filter: blur(20px); }
}
@keyframes introDrift {
  100% { transform: translate3d(18vw, 0, 0); }
}
@keyframes cloudDrift {
  100% { transform: translate3d(100vw, 0, 0); }
}
@keyframes blockBounce {
  50% { transform: translate3d(0, -7px, 0); }
}
@keyframes marioBob {
  50% { transform: translate3d(0, -3px, 0); }
}
@keyframes coinFlip {
  50% { transform: scaleX(0.12); }
}
@keyframes castleIdle {
  0%, 100% { transform: translateX(var(--castle-x)) translateY(0); }
  50% { transform: translateX(var(--castle-x)) translateY(-3px); }
}
@keyframes hillParallax {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@keyframes birdGlide {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(40px, -8px, 0); }
}
@keyframes castleWinGlow {
  0% { background: #f8d878; box-shadow: inset 0 0 0 1px #c8a028; }
  100% { background: #fff4a8; box-shadow: inset 0 0 0 1px #f8d878, 0 0 6px rgba(248, 216, 120, 0.55); }
}
@keyframes castleFlagWave {
  0% { transform: skewY(0deg); }
  100% { transform: skewY(-8deg); }
}

@media (max-width: 820px) {
  html,
  body.corp-hub,
  .corp-hub {
    overflow-x: hidden;
  }

  .corp-header {
    padding: 16px 20px;
  }

  .corp-stage {
    flex-direction: column;
    overflow-x: hidden;
  }

  .corp-panel {
    flex: 1 1 50%;
    min-height: 0;
    padding: 24px 20px;
    transition: none;
  }

  .corp-panel__content {
    max-width: 100%;
  }

  .corp-canvas {
    display: none;
  }

  .corp-panel--edit .corp-panel__name {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    word-break: break-word;
    overflow-wrap: break-word;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  #panelMario .corp-castle {
    left: 50%;
    width: min(300px, 72%);
    min-width: 220px;
    height: clamp(96px, 36%, 140px);
    --castle-x: -50%;
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-panel__name {
    animation: editTitleSweep calc(7s * var(--corp-slow)) ease-in-out infinite;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-panel__name::before {
    animation:
      editTitleGlow calc(4.5s * var(--corp-slow)) ease-in-out infinite,
      editTitleSweep calc(7s * var(--corp-slow)) ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .corp-canvas {
    opacity: 0.52;
  }

  .corp-panel--edit .corp-panel__name,
  .corp-panel--edit .corp-panel__name::before {
    animation: none !important;
  }

  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-edit-mesh,
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-orbs span.corp-intro,
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-scanlines,
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-grain,
  .corp-panel--edit:not(.is-entering):not(.is-exiting) .corp-sketch-bleed {
    animation: none !important;
  }

  .corp-panel--mario:not(.is-active):not(.is-entering):not(.is-exiting) .corp-castle,
  .corp-panel--mario.is-active .corp-castle__flag,
  .corp-panel--mario.is-active .corp-castle__window,
  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-hill,
  .corp-panel--mario:not(.is-entering):not(.is-exiting) .corp-bird {
    animation: none !important;
  }

  #panelMario .corp-castle {
    --castle-x: -52%;
  }
}
