:root {
  --sky: #8ed7ff;
  --sky-soft: #c8f0ff;
  --cloud: #f8fff8;
  --cloud-shade: #b8d4e9;
  --yellow: #ffd63d;
  --yellow-light: #fff1a0;
  --orange: #ff9d2e;
  --red: #e94d35;
  --green: #6db346;
  --green-dark: #2e7031;
  --grass: #4dcb47;
  --dirt: #8b461e;
  --dirt-dark: #4b2a21;
  --cream: #fff5cf;
  --paper: #fff9df;
  --purple: #56308f;
  --purple-soft: #8659d9;
  --ink: #17243b;
  --ink-soft: #273957;
  --shadow: #0e1729;
  --white: #ffffff;
  --pixel: 4px;
  --radius: 14px;
  --title-font: 'Press Start 2P', 'Silkscreen', system-ui, sans-serif;
  --pixel-font: 'Silkscreen', 'Press Start 2P', system-ui, sans-serif;
  --body-font: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--body-font);
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 360px),
    radial-gradient(circle at 12px 12px, rgba(39, 57, 87, .08) 2px, transparent 2px) 0 0 / 28px 28px,
    linear-gradient(180deg, #bff1ff 0%, #91dbff 48%, #dff8ff 100%);
}

body.menu-open {
  overflow: hidden;
}

body.loaded .loading-screen {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(194, 241, 255, .92), rgba(137, 220, 255, .95)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 16px, rgba(255,255,255,0) 16px 32px);
  transition: opacity .45s ease, transform .45s ease;
}

.loader-card {
  width: min(420px, 100%);
  padding: 28px;
  text-align: center;
  background: var(--paper);
  box-shadow: 12px 12px 0 rgba(14, 23, 41, .18);
}

.loader-title {
  font-family: var(--title-font);
  color: var(--purple);
  line-height: 1.6;
  margin-bottom: 18px;
  text-shadow: 2px 2px 0 var(--yellow-light);
}

.pixel-loader {
  height: 28px;
  border: 4px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 3px;
  overflow: hidden;
}

.pixel-loader span {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #65d64f 0 14px, #a6ee65 14px 22px);
  transform-origin: left;
  animation: loadingFill 1.25s steps(14) forwards;
}

@keyframes loadingFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.pixel-border {
  border: 4px solid var(--ink);
  outline: 3px solid rgba(255,255,255,.36);
  box-shadow: 7px 7px 0 var(--shadow);
}

.topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(1120px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 4px solid var(--ink);
  background: rgba(255, 249, 223, .94);
  box-shadow: 6px 6px 0 rgba(14, 23, 41, .25);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--pixel-font);
  font-size: 14px;
  line-height: .95;
  white-space: nowrap;
}

.brand-orb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 4px solid var(--ink);
  color: var(--white);
  background: var(--red);
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 900;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.desktop-nav a {
  padding: 10px 12px;
  border: 3px solid transparent;
  font-family: var(--pixel-font);
  font-size: 14px;
  color: var(--ink-soft);
}

.desktop-nav a:hover,
.desktop-nav a.active {
  border-color: var(--ink);
  background: var(--yellow-light);
  box-shadow: 3px 3px 0 var(--shadow);
  color: var(--ink);
}

.mini-pixel-btn {
  cursor: pointer;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 10px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.mini-pixel-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
  filter: saturate(1.08);
}

.mini-pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.menu-toggle {
  display: none;
}

.mobile-menu {
  position: fixed;
  top: 82px;
  right: 14px;
  z-index: 55;
  width: min(280px, calc(100% - 28px));
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--paper);
  transform: translateY(-12px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.mobile-menu.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  padding: 12px;
  border: 3px solid var(--ink);
  background: var(--sky-soft);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 15px;
}

.screen {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
}

.hero {
  display: grid;
  place-items: center;
  padding: 104px 18px 160px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.50), rgba(255,255,255,0) 45%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 22px, rgba(255,255,255,0) 22px 44px),
    repeating-linear-gradient(0deg, rgba(14, 23, 41, .05) 0 4px, transparent 4px 24px),
    linear-gradient(180deg, #c5f5ff 0%, #96dcff 58%, #79ccff 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 4px solid var(--ink);
  background: var(--grass);
  box-shadow: 6px 6px 0 var(--shadow);
  z-index: -1;
}

.hero::before {
  width: 170px;
  height: 40px;
  top: 150px;
  left: -34px;
  background: linear-gradient(#61d850 0 45%, #244d50 45% 58%, #29506a 58%);
}

.hero::after {
  width: 220px;
  height: 52px;
  right: -38px;
  bottom: 210px;
  background: linear-gradient(#5fd74e 0 48%, #274d54 48% 62%, #28445a 62%);
}

.logo-cloud {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 22px;
  border-radius: 0 0 18px 18px;
  background: rgba(255,255,255,.95);
  box-shadow: 7px 7px 0 rgba(14, 23, 41, .22);
}

.logo-chip {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 10%, transparent 11%),
    linear-gradient(135deg, #fff6b8 0 45%, #f1d04a 45% 100%);
  font-family: var(--pixel-font);
  font-size: 10px;
  text-align: center;
  box-shadow: 3px 3px 0 var(--shadow);
}

.hero-content {
  width: min(980px, 100%);
  text-align: center;
  margin-top: 18px;
}

.hero-kicker,
.section-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  background: var(--yellow-light);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}

.section-tag::before,
.hero-kicker::before {
  content: "✦";
  color: var(--red);
}

.pixel-title {
  display: grid;
  gap: clamp(12px, 2vw, 26px);
  margin: 0 auto 18px;
  font-family: var(--title-font);
  font-size: clamp(38px, 9vw, 108px);
  line-height: .9;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: -.03em;
  text-shadow:
    4px 0 0 var(--red),
    -4px 0 0 var(--red),
    0 4px 0 var(--red),
    0 -4px 0 var(--red),
    7px 7px 0 var(--orange),
    12px 12px 0 var(--shadow);
  transform: rotate(-1.2deg);
  animation: titleWobble 3.2s steps(2) infinite;
}

.pixel-title span:nth-child(2) {
  transform: scale(.72) rotate(1.5deg);
}

.pixel-title span:nth-child(3) {
  transform: rotate(1.2deg);
}

@keyframes titleWobble {
  0%, 100% { transform: rotate(-1.2deg) translateY(0); }
  50% { transform: rotate(.8deg) translateY(-3px); }
}

.hero-subtitle {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 10px 18px;
  color: var(--white);
  background: var(--purple);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  font-family: var(--title-font);
  font-size: clamp(14px, 2.7vw, 24px);
  line-height: 1.5;
  text-shadow: 3px 3px 0 #24437d;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  margin: 2px auto 16px;
  padding: 12px 16px;
  background: linear-gradient(#f7f7f7 0 30%, #a6a6a6 30% 100%);
  color: var(--white);
  font-family: var(--title-font);
  font-size: clamp(13px, 2vw, 18px);
  text-shadow: 2px 2px 0 #666;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(680px, 100%);
  margin: 0 auto 12px;
  padding: 12px;
  background: rgba(255, 249, 223, .92);
}

.count-item {
  padding: 12px 6px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: inset -4px -4px 0 rgba(23, 36, 59, .13);
}

.count-item strong {
  display: block;
  font-family: var(--title-font);
  font-size: clamp(18px, 3vw, 28px);
  color: var(--red);
}

.count-item span {
  display: block;
  margin-top: 6px;
  font-family: var(--pixel-font);
  font-size: 13px;
  color: var(--ink-soft);
}

.timer-progress {
  width: min(520px, 88%);
  height: 22px;
  margin: 0 auto 22px;
  padding: 3px;
  border: 4px solid var(--ink);
  background: var(--white);
  box-shadow: 5px 5px 0 var(--shadow);
}

.timer-progress span {
  display: block;
  width: 12%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #6ee26a 0 14px, #b9f36e 14px 24px);
  transition: width .4s ease;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.pixel-btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  min-width: 170px;
  padding: 16px 20px;
  border: 4px solid var(--ink);
  background: linear-gradient(#ffe86a 0 18%, var(--orange) 18% 72%, #e54d83 72% 100%);
  color: var(--purple);
  box-shadow: 0 7px 0 var(--shadow), inset 0 4px 0 rgba(255,255,255,.45);
  font-family: var(--title-font);
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(255,255,255,.45);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.pixel-btn:hover,
.pixel-btn:focus-visible {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 0 var(--shadow), inset 0 4px 0 rgba(255,255,255,.45);
  filter: saturate(1.08);
  animation: buttonBounce .42s steps(2);
}

.pixel-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--shadow), inset 0 4px 0 rgba(255,255,255,.35);
}

.btn-green {
  background: linear-gradient(#a7dc70 0 22%, #5f9b3f 22% 74%, #397434 74% 100%);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--green-dark);
}

.btn-orange {
  background: linear-gradient(#fff06d 0 20%, #ff9d2e 20% 74%, #dd5a32 74% 100%);
  color: var(--purple);
}

.btn-purple {
  background: linear-gradient(#d4a3ff 0 22%, #7f56cf 22% 74%, #4a2e82 74% 100%);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--purple);
}

.btn-start {
  min-width: 230px;
  background: linear-gradient(#fff26e 0 18%, #ff9b35 18% 68%, #f64d8c 68% 100%);
  color: var(--purple);
}

.compact-btn {
  min-width: 130px;
  min-height: 50px;
  font-size: 13px;
  padding: 12px 16px;
}

@keyframes buttonBounce {
  0%, 100% { rotate: 0deg; }
  50% { rotate: -1deg; }
}

.hud {
  position: absolute;
  right: clamp(14px, 4vw, 44px);
  bottom: 102px;
  z-index: 2;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.life-bar {
  display: flex;
  gap: 7px;
  font-size: 30px;
  text-shadow: 3px 3px 0 var(--shadow);
}

.life-bar span {
  color: #ff464f;
  animation: heartBlink 2s steps(2) infinite;
}

.life-bar .soft {
  color: var(--yellow);
  animation-delay: .5s;
}

@keyframes heartBlink {
  0%, 74%, 100% { transform: scale(1); }
  75% { transform: scale(.9); }
}

.score-box {
  padding: 8px 10px;
  background: var(--paper);
  font-family: var(--pixel-font);
  font-size: 14px;
}

.trophy-icon {
  font-size: 32px;
  filter: drop-shadow(3px 3px 0 var(--shadow));
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 126px;
  border-top: 5px solid var(--ink);
  background:
    linear-gradient(180deg, #57cf42 0 28px, #2f7a39 28px 38px, transparent 38px),
    repeating-linear-gradient(90deg, rgba(29, 83, 43, .35) 0 28px, transparent 28px 56px),
    repeating-linear-gradient(45deg, #8f421c 0 18px, #743218 18px 36px, #a84e20 36px 54px);
  box-shadow: inset 0 6px 0 rgba(255,255,255,.18);
}

.ground::before,
.ground::after {
  content: "";
  position: absolute;
  top: -44px;
  width: 64px;
  height: 76px;
  border: 5px solid var(--ink);
  background: linear-gradient(90deg, #37b442 0 52%, #2e9e39 52% 100%);
  box-shadow: inset 0 10px 0 #7eed5b, 6px 6px 0 var(--shadow);
}

.ground::before { left: 16px; }
.ground::after { right: 18px; }

.sky-decor,
.coin,
.star,
.pixel-sun {
  position: absolute;
  pointer-events: none;
}

.cloud {
  width: 160px;
  height: 54px;
  background: var(--cloud);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--cloud-shade);
  animation: cloudMove 18s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 14px;
  width: 70px;
  height: 70px;
  border: 4px solid var(--ink);
  border-bottom: 0;
  background: var(--cloud);
}

.cloud::before {
  left: 18px;
  border-radius: 18px 18px 0 0;
}

.cloud::after {
  right: 18px;
  width: 80px;
  height: 84px;
  border-radius: 18px 18px 0 0;
}

.cloud-1 { top: 110px; left: -70px; animation-duration: 24s; }
.cloud-2 { top: 170px; right: -60px; transform: scale(.72); animation-duration: 28s; animation-direction: reverse; }
.cloud-3 { top: 45px; left: 72%; transform: scale(.55); animation-duration: 20s; opacity: .85; }

@keyframes cloudMove {
  0% { translate: -12px 0; }
  50% { translate: 18px 0; }
  100% { translate: -12px 0; }
}

.pixel-sun,
.coin {
  width: 48px;
  height: 48px;
  border: 4px solid #d57d18;
  background:
    radial-gradient(circle, #fff475 0 22%, #ffc132 23% 50%, #f18924 51% 100%);
  box-shadow: 4px 4px 0 var(--shadow);
  transform: rotate(45deg);
}

.pixel-sun { left: 9%; top: 25%; }
.coin-left { left: 3%; bottom: 42%; }
.coin-right { right: 6%; top: 28%; animation-delay: .6s; }

.coin-spin { animation: coinSpin 3s steps(4) infinite; }
.floaty { animation: floaty 2.4s ease-in-out infinite; }

@keyframes coinSpin {
  to { rotate: 405deg; }
}

@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

.star {
  color: var(--yellow);
  font-size: 42px;
  text-shadow: 3px 3px 0 var(--orange);
  animation: twinkle 1.7s steps(2) infinite;
}

.star-a { top: 92px; left: 14%; }
.star-b { right: 17%; bottom: 34%; animation-delay: .3s; }

@keyframes twinkle {
  50% { transform: scale(.72); opacity: .7; }
}

.section {
  position: relative;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0;
}

.section::before {
  content: "";
  position: absolute;
  inset: 44px -18px 24px;
  z-index: -1;
  border: 4px solid rgba(23, 36, 59, .10);
  background: rgba(255,255,255,.16);
  box-shadow: 8px 8px 0 rgba(14, 23, 41, .08);
}

.section-heading {
  width: min(760px, 100%);
  margin: 0 auto 32px;
  text-align: center;
}

.left-heading {
  text-align: left;
  margin-left: 0;
}

.section-heading h2 {
  margin: 0 0 12px;
  color: var(--yellow);
  font-family: var(--title-font);
  font-size: clamp(25px, 5vw, 46px);
  line-height: 1.2;
  text-shadow:
    3px 0 0 var(--red),
    -3px 0 0 var(--red),
    0 3px 0 var(--red),
    0 -3px 0 var(--red),
    6px 6px 0 var(--shadow);
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 800;
}

.menu-grid,
.info-grid,
.rules-grid,
.materials-grid,
.groups-grid,
.committee-grid,
.downloads-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.level-card,
.pixel-card,
.rule-card,
.material-card,
.group-card,
.committee-card,
.download-card,
.gallery-card,
.extra-card,
.notice-item,
.faq-item {
  position: relative;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--shadow), inset 0 4px 0 rgba(255,255,255,.56);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.level-card:hover,
.pixel-card:hover,
.material-card:hover,
.group-card:hover,
.committee-card:hover,
.download-card:hover,
.gallery-card:hover,
.extra-card:hover {
  transform: translate(-2px, -6px);
  box-shadow: 10px 12px 0 var(--shadow), inset 0 4px 0 rgba(255,255,255,.56);
  filter: saturate(1.06);
}

.level-card {
  min-height: 148px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, #fff8d5 0 50%, #f6d983 50% 100%);
  cursor: pointer;
  overflow: hidden;
}

.level-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background: repeating-linear-gradient(45deg, #fff 0 10px, transparent 10px 20px);
  pointer-events: none;
}

.level-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.level-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 25px;
}

.level-number {
  padding: 6px 8px;
  border: 3px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 13px;
}

.level-card h3,
.pixel-card h3,
.rule-card h3,
.material-card h3,
.group-card h3,
.committee-card h3,
.download-card h3,
.extra-card h3,
.notice-item h3,
.faq-question {
  margin: 14px 0 8px;
  font-family: var(--pixel-font);
  font-size: 21px;
  line-height: 1.1;
  color: var(--purple);
}

.level-card p,
.pixel-card p,
.rule-card p,
.material-card p,
.group-card p,
.committee-card p,
.download-card p,
.extra-card p,
.notice-item p,
.faq-answer p,
.map-info p,
.profile-card p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 800;
}

.pixel-card,
.rule-card,
.material-card,
.group-card,
.committee-card,
.download-card,
.gallery-card,
.extra-card {
  padding: 20px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 26px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  gap: 22px;
  align-items: stretch;
}

.school-poster {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background: linear-gradient(#aee6ff 0 55%, #8cc7ec 55% 100%);
}

.school-sky::before,
.school-sky::after {
  content: "";
  position: absolute;
  top: 38px;
  width: 90px;
  height: 34px;
  border: 4px solid var(--ink);
  background: var(--cloud);
  box-shadow: 4px 4px 0 var(--cloud-shade);
}

.school-sky::before { left: 34px; }
.school-sky::after { right: 38px; top: 78px; transform: scale(.8); }

.school-building {
  position: absolute;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  width: 220px;
  height: 170px;
}

.school-building .roof {
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 110px solid transparent;
  border-right: 110px solid transparent;
  border-bottom: 70px solid #c94b35;
  filter: drop-shadow(4px 4px 0 var(--shadow));
}

.school-building .body {
  display: grid;
  place-items: center;
  height: 104px;
  border: 5px solid var(--ink);
  background: #ffe2a4;
  font-family: var(--pixel-font);
  color: #a34728;
  box-shadow: 6px 6px 0 var(--shadow);
}

.school-building .door {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 48px;
  height: 72px;
  border: 4px solid var(--ink);
  background: #8b4d2c;
}

.school-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  border-top: 4px solid var(--ink);
  background: repeating-linear-gradient(45deg, #8e461f 0 16px, #6f3418 16px 32px);
}

.facility-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.facility-grid span,
.badge,
.role-badge,
.member-pill,
.download-meta {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 7px 9px;
  border: 3px solid var(--ink);
  background: var(--sky-soft);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 13px;
  color: var(--ink);
}

.muted {
  color: #60708a;
}

.speech-grid {
  display: grid;
  gap: 18px;
}

.speech-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}

.pixel-avatar {
  position: relative;
  width: 82px;
  height: 96px;
  border: 4px solid var(--ink);
  background: #ffce9f;
  box-shadow: 6px 6px 0 var(--shadow);
}

.pixel-avatar::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 10px;
  height: 18px;
  background: #2d2c45;
  box-shadow: -8px 10px 0 #2d2c45, 8px 10px 0 #2d2c45;
}

.pixel-avatar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 34px;
  border-top: 4px solid var(--ink);
  background: var(--purple);
}

.avatar-teacher::after { background: var(--green); }
.avatar-student::after { background: var(--red); }

.speech-bubble {
  position: relative;
  padding: 20px;
  background: var(--paper);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 34px;
  width: 22px;
  height: 22px;
  border-left: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: var(--paper);
  transform: rotate(45deg);
}

.level-map {
  display: grid;
  gap: 18px;
}

.schedule-card {
  border: 4px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.52), transparent 45%),
    linear-gradient(90deg, #fff4b8, #ffcc62);
  box-shadow: 8px 8px 0 var(--shadow);
  overflow: hidden;
}

.schedule-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.schedule-level {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 4px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--title-font);
  font-size: 18px;
}

.schedule-summary h3 {
  margin: 0 0 6px;
  font-family: var(--pixel-font);
  font-size: 26px;
  color: var(--purple);
}

.schedule-summary p {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.schedule-arrow {
  font-family: var(--title-font);
  color: var(--red);
  font-size: 24px;
  transition: transform .2s ease;
}

.schedule-card.open .schedule-arrow {
  transform: rotate(90deg);
}

.schedule-detail {
  display: none;
  padding: 0 16px 16px;
}

.schedule-card.open .schedule-detail {
  display: block;
  animation: popIn .22s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 3px solid var(--ink);
  background: rgba(255,255,255,.78);
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .35);
}

.timeline-time {
  font-family: var(--pixel-font);
  font-size: 14px;
  color: var(--red);
}

.timeline-title {
  font-weight: 1000;
  font-size: 17px;
}

.rule-card {
  background: linear-gradient(180deg, #fff6d5, #ffeaaa);
}

.rule-card .rule-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border: 4px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--title-font);
}

.inventory-wrap {
  padding: 18px;
  background: linear-gradient(180deg, #fff5cd, #f2d489);
}

.inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.inventory-head h3 {
  margin: 0;
  font-family: var(--title-font);
  color: var(--purple);
  font-size: clamp(18px, 3vw, 28px);
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  user-select: none;
  font-weight: 900;
  transition: transform .16s ease, background .16s ease;
}

.check-item:hover {
  transform: translateY(-3px);
}

.check-box {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 4px solid var(--ink);
  background: var(--white);
  box-shadow: inset -3px -3px 0 rgba(23,36,59,.13);
  font-family: var(--title-font);
  font-size: 12px;
}

.check-item.checked {
  background: #d8ffb8;
}

.check-item.checked .check-box {
  background: var(--green);
  color: var(--white);
}

.material-card {
  cursor: pointer;
  background: linear-gradient(180deg, #fff8da, #cfefff);
}

.material-card .badge {
  margin-top: 14px;
  background: var(--yellow-light);
}

.notice-board {
  display: grid;
  gap: 12px;
  padding: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(113, 68, 31, .16) 0 16px, rgba(255,255,255,0) 16px 32px),
    linear-gradient(180deg, #bd7740, #80502e);
}

.notice-item {
  padding: 18px;
  background: var(--paper);
}

.notice-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.new-badge {
  display: inline-flex;
  padding: 6px 9px;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 13px;
}

.search-panel,
.group-tools {
  margin-bottom: 18px;
}

.search-panel {
  padding: 18px;
  background: var(--paper);
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--purple);
}

.search-row,
.group-tools {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  gap: 12px;
  align-items: center;
}

.group-tools {
  grid-template-columns: 240px 1fr;
}

.pixel-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 13px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--body-font);
  font-weight: 900;
  font-size: 17px;
  outline: 0;
}

.pixel-input:focus {
  background: #fff8c2;
  box-shadow: 6px 6px 0 var(--shadow);
}

.student-result {
  display: grid;
  gap: 14px;
}

.player-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 18px;
  border: 4px solid var(--ink);
  background: linear-gradient(180deg, #fff8da, #e5f8ff);
  box-shadow: 8px 8px 0 var(--shadow);
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 4px solid var(--ink);
  background: linear-gradient(180deg, #87d9ff 0 45%, #57c84d 45% 100%);
  box-shadow: 5px 5px 0 var(--shadow);
  font-family: var(--title-font);
  font-size: 30px;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--shadow);
}

.player-info h3 {
  margin: 0 0 10px;
  font-family: var(--title-font);
  font-size: clamp(19px, 3vw, 28px);
  color: var(--purple);
  line-height: 1.25;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.profile-list div {
  padding: 10px;
  border: 3px solid var(--ink);
  background: rgba(255,255,255,.72);
  box-shadow: 3px 3px 0 rgba(14,23,41,.35);
  font-weight: 900;
}

.empty-state {
  padding: 24px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--shadow);
  text-align: center;
  font-weight: 900;
  font-size: 18px;
}

.group-card {
  background: linear-gradient(180deg, #fff8dc, #c6f0ff);
}

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

.group-emblem {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 4px solid var(--ink);
  background: var(--red);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--title-font);
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.member-pill {
  background: var(--paper);
}

.committee-card {
  text-align: center;
  background: linear-gradient(180deg, #fff8d8, #e8d5ff);
}

.committee-avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 36px;
}

.role-badge {
  margin: 0 auto 12px;
  background: var(--green);
  color: var(--white);
}

.extras-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 340px);
  gap: 16px;
  overflow-x: auto;
  padding: 4px 8px 16px 4px;
  scroll-snap-type: x mandatory;
}

.extras-scroll::-webkit-scrollbar {
  height: 12px;
}

.extras-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,.45);
  border: 3px solid var(--ink);
}

.extras-scroll::-webkit-scrollbar-thumb {
  background: var(--green);
  border: 3px solid var(--ink);
}

.extra-card {
  scroll-snap-align: start;
  background: linear-gradient(180deg, #fffbd5, #d7ffca);
}

.extra-icon {
  font-size: 38px;
  filter: drop-shadow(3px 3px 0 rgba(14, 23, 41, .35));
}

.map-layout {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 18px;
  align-items: start;
}

.pixel-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 10px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.20) 50%, transparent 50%) 0 0/38px 38px,
    linear-gradient(rgba(255,255,255,.20) 50%, transparent 50%) 0 0/38px 38px,
    #77ce6b;
}

.map-cell {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 4px solid var(--ink);
  background: #ffe3a0;
  box-shadow: 4px 4px 0 var(--shadow);
  text-align: center;
  font-family: var(--pixel-font);
  font-size: 14px;
  cursor: pointer;
}

.map-cell:hover,
.map-cell.active {
  background: var(--yellow);
  transform: translateY(-3px);
}

.gallery-card {
  min-height: 210px;
  overflow: hidden;
  background: var(--paper);
  padding: 0;
}

.gallery-art {
  height: 150px;
  border-bottom: 4px solid var(--ink);
  background:
    linear-gradient(180deg, #9de5ff 0 58%, #65cd56 58% 72%, #8a461d 72% 100%);
  position: relative;
}

.gallery-art::before {
  content: "";
  position: absolute;
  width: 78px;
  height: 54px;
  left: 26px;
  bottom: 42px;
  border: 4px solid var(--ink);
  background: #ffd29a;
  box-shadow: 5px 5px 0 var(--shadow);
}

.gallery-art::after {
  content: "✦";
  position: absolute;
  right: 32px;
  top: 26px;
  color: var(--yellow);
  font-size: 42px;
  text-shadow: 3px 3px 0 var(--orange);
}

.gallery-card h3 {
  margin: 0;
  padding: 14px;
  font-family: var(--pixel-font);
  font-size: 17px;
  color: var(--purple);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  overflow: hidden;
  background: var(--paper);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.faq-question span:last-child {
  color: var(--red);
  font-family: var(--title-font);
}

.faq-answer {
  display: none;
  padding: 0 18px 18px;
}

.faq-item.open .faq-answer {
  display: block;
}

.download-card {
  background: linear-gradient(180deg, #fff7d4, #ffcf7d);
}

.download-card .pixel-btn {
  min-width: 0;
  width: 100%;
  margin-top: 14px;
  min-height: 50px;
  font-size: 13px;
}

.download-meta {
  margin-top: 10px;
  background: var(--sky-soft);
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #fff8d8, #c9f3ff);
}

.big-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 4px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 5px 5px 0 var(--shadow);
  font-family: var(--title-font);
  font-size: 36px;
}

.contact-left h3 {
  margin: 16px 0 10px;
  font-family: var(--title-font);
  font-size: clamp(22px, 4vw, 34px);
  color: var(--purple);
}

.contact-left p {
  margin: 0;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 900;
}

.contact-actions {
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.contact-actions .pixel-btn {
  min-width: 100%;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 23, 41, .62);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
  max-height: min(76vh, 720px);
  overflow-y: auto;
  padding: 24px;
  background: var(--paper);
}

.modal-card h2 {
  margin: 12px 0;
  font-family: var(--title-font);
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.25;
  color: var(--purple);
}

.modal-card p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 900;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--red);
  color: var(--white);
}

.modal-points {
  display: grid;
  gap: 9px;
}

.modal-points span {
  display: block;
  padding: 10px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 rgba(14,23,41,.32);
  font-weight: 900;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bottom-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 48;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 7px;
  border: 4px solid var(--ink);
  background: rgba(255, 249, 223, .95);
  box-shadow: 5px 5px 0 rgba(14, 23, 41, .28);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 3px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--pixel-font);
  font-size: 12px;
  text-shadow: 1px 1px 0 var(--green-dark);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  .desktop-nav,
  .sound-toggle {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .topbar {
    top: 10px;
  }

  .hero {
    padding-top: 112px;
  }

  .logo-cloud {
    top: 72px;
    padding: 8px 12px;
  }

  .logo-chip {
    width: 44px;
    height: 44px;
    font-size: 8px;
  }

  .menu-grid,
  .info-grid,
  .rules-grid,
  .materials-grid,
  .groups-grid,
  .committee-grid,
  .downloads-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout,
  .map-layout,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    min-width: 0;
  }

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

  .search-row {
    grid-template-columns: 1fr 170px;
  }

  .search-row .compact-btn {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    display: grid;
  }
}

@media (max-width: 640px) {
  .topbar {
    width: calc(100% - 16px);
    padding: 7px;
  }

  .brand {
    font-size: 12px;
  }

  .brand-orb {
    width: 36px;
    height: 36px;
  }

  .mini-pixel-btn {
    font-size: 12px;
    padding: 8px 9px;
  }

  .hero {
    min-height: 100svh;
    padding: 134px 12px 150px;
  }

  .hero-kicker,
  .section-tag {
    font-size: 13px;
    line-height: 1.2;
  }

  .pixel-title {
    font-size: clamp(34px, 13vw, 58px);
    text-shadow:
      3px 0 0 var(--red),
      -3px 0 0 var(--red),
      0 3px 0 var(--red),
      0 -3px 0 var(--red),
      5px 5px 0 var(--orange),
      8px 8px 0 var(--shadow);
  }

  .hero-subtitle {
    font-size: 13px;
    padding: 9px 10px;
  }

  .date-badge {
    min-width: 0;
    width: 100%;
    font-size: 12px;
  }

  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pixel-btn,
  .btn-start {
    width: 100%;
    min-width: 0;
    font-size: 14px;
  }

  .hud {
    left: 12px;
    right: 12px;
    bottom: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .score-box,
  .trophy-icon {
    display: none;
  }

  .life-bar {
    font-size: 22px;
  }

  .ground {
    height: 100px;
  }

  .cloud {
    transform: scale(.68);
  }

  .coin-left,
  .coin-right,
  .pixel-sun,
  .star-b {
    display: none;
  }

  .section {
    width: min(100% - 22px, 1160px);
    padding: 72px 0;
  }

  .section::before {
    inset: 34px -8px 20px;
  }

  .section-heading h2 {
    font-size: clamp(25px, 8vw, 36px);
  }

  .section-heading p,
  .level-card p,
  .pixel-card p,
  .rule-card p,
  .material-card p,
  .group-card p,
  .committee-card p,
  .download-card p,
  .extra-card p,
  .notice-item p,
  .faq-answer p,
  .map-info p,
  .profile-card p,
  .contact-left p {
    font-size: 16px;
  }

  .menu-grid,
  .info-grid,
  .rules-grid,
  .materials-grid,
  .groups-grid,
  .committee-grid,
  .downloads-grid,
  .gallery-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .level-card,
  .pixel-card,
  .rule-card,
  .material-card,
  .group-card,
  .committee-card,
  .download-card,
  .extra-card,
  .notice-item {
    padding: 16px;
  }

  .speech-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .speech-bubble::before {
    left: 50%;
    top: -15px;
    transform: translateX(-50%) rotate(135deg);
  }

  .schedule-summary {
    grid-template-columns: 58px 1fr 22px;
    gap: 10px;
    padding: 12px;
  }

  .schedule-level {
    width: 58px;
    height: 58px;
    font-size: 13px;
  }

  .schedule-summary h3 {
    font-size: 20px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .inventory-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-row,
  .group-tools {
    grid-template-columns: 1fr;
  }

  .player-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-list {
    grid-template-columns: 1fr;
    width: 100%;
    text-align: left;
  }

  .pixel-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .map-cell {
    min-height: 78px;
    font-size: 12px;
  }

  .school-poster {
    min-height: 310px;
  }

  .back-top {
    bottom: 76px;
    right: 12px;
  }

  .bottom-nav a {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .pixel-title {
    font-size: 32px;
  }

  .count-item strong {
    font-size: 17px;
  }

  .count-item span,
  .bottom-nav a {
    font-size: 10px;
  }

  .section-heading h2 {
    font-size: 24px;
  }
}

/* ==================================================
   UPDATE: FUN UI, BELL PANEL, QUERY SHARE, MINI GAME,
   DAN TWIBBON PREVIEW-FIRST
================================================== */
.bell-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--orange);
}

.bell-dot {
  position: absolute;
  right: -5px;
  top: -6px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--ink);
  background: var(--red);
  animation: bellPulse 1.4s infinite steps(2);
}

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}

.important-panel,
.mobile-menu {
  max-height: calc(100vh - 105px);
  overflow: auto;
}

.important-panel {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 61;
  width: min(390px, calc(100% - 32px));
  padding: 16px;
  background: var(--paper);
  transform: translateY(-12px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.important-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.important-head,
.caption-head,
.twibbon-preview-top,
.mini-game-head,
.inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.important-head h3,
.twibbon-preview-top h3,
.twibbon-simple-head h3,
.mini-game-head h3 {
  margin: 4px 0 0;
  font-family: var(--pixel-font);
  color: var(--purple);
}

.important-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.important-item {
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 12px;
  box-shadow: 4px 4px 0 rgba(14, 23, 41, .18);
}

.important-item b {
  display: block;
  font-family: var(--pixel-font);
  color: var(--red);
  margin-bottom: 4px;
}

.important-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.important-quick-links,
.entry-actions,
.coin-game-actions,
.twibbon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.entry-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 30, 59, .52);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
}

.entry-info-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.entry-info-card {
  position: relative;
  width: min(660px, 100%);
  padding: clamp(18px, 4vw, 28px);
  background: var(--paper);
  text-align: center;
  transform: translateY(16px) scale(.96);
  transition: .24s ease;
}

.entry-info-overlay.open .entry-info-card {
  transform: translateY(0) scale(1);
}

.entry-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.entry-mascot {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 34px;
  animation: floaty 1.7s infinite ease-in-out;
}

.entry-info-card h2 {
  margin: 8px 0;
  font-family: var(--title-font);
  line-height: 1.55;
  color: var(--purple);
  font-size: clamp(20px, 4vw, 28px);
}

.entry-lead {
  margin: 0 auto 14px;
  max-width: 560px;
  line-height: 1.5;
}

.entry-important-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
  text-align: left;
}

.entry-info-item {
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 12px;
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .22);
}

.entry-info-item b {
  display: block;
  font-family: var(--pixel-font);
  color: var(--red);
  margin-bottom: 5px;
}

.entry-info-item small {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.entry-actions {
  justify-content: center;
  margin-top: 12px;
}

.entry-skip {
  margin-top: 12px;
  background: var(--white);
}

.music-callout {
  position: absolute;
  top: 92px;
  right: clamp(12px, 4vw, 52px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  cursor: pointer;
}

.music-note {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--purple-soft);
  color: var(--white);
  font-family: var(--pixel-font);
}

.music-copy {
  display: grid;
  text-align: left;
}

.music-copy b {
  font-family: var(--pixel-font);
  color: var(--red);
  font-size: 13px;
}

.music-copy small {
  font-size: 12px;
}

.sound-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  height: 26px;
}

.sound-bars i {
  width: 5px;
  background: var(--green);
  border: 2px solid var(--ink);
  animation: soundBar .8s infinite steps(3);
}

.sound-bars i:nth-child(1) { height: 12px; }
.sound-bars i:nth-child(2) { height: 20px; animation-delay: .12s; }
.sound-bars i:nth-child(3) { height: 16px; animation-delay: .24s; }

@keyframes soundBar {
  50% { height: 7px; }
}

.share-link-board,
.quest-board,
.quick-game-card {
  background: var(--paper);
  padding: clamp(16px, 3vw, 22px);
  margin-top: 24px;
}

.share-link-head,
.quest-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.share-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.share-link-card {
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 rgba(14, 23, 41, .2);
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.share-link-card b {
  display: block;
  font-family: var(--pixel-font);
  color: var(--purple);
}

.share-link-card small {
  display: block;
  margin-top: 4px;
  word-break: break-all;
  font-size: 12px;
}

.quest-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .18);
  font-weight: 900;
}

.quest-item.done {
  background: #dfffd2;
}

.quest-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid var(--ink);
  background: var(--yellow);
}

.quest-progress,
.target-progress,
.combo-strip div {
  height: 18px;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: inset 3px 3px 0 rgba(14, 23, 41, .16);
  overflow: hidden;
}

.quest-progress span,
.target-progress span,
.combo-strip i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, #a8ef63 12px 20px);
  transition: width .25s ease;
}

.quick-game-card {
  position: relative;
  width: min(430px, calc(100% - 28px));
  margin: 28px auto 0;
}

.mini-game-ribbon {
  position: absolute;
  left: 18px;
  top: -18px;
  padding: 6px 10px;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--white);
  font-family: var(--pixel-font);
  box-shadow: 4px 4px 0 var(--shadow);
}

.best-score,
.game-mission-row,
.game-bonus-row,
.mini-game-stats,
.combo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--pixel-font);
  font-size: 13px;
}

.game-mission-row span,
.game-bonus-row span,
.mini-game-stats span,
.best-score,
.combo-strip span {
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 6px 8px;
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .18);
}

.coin-game-arena {
  position: relative;
  height: 245px;
  margin: 14px 0;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: linear-gradient(#84dcff 0 68%, #78d85a 68% 76%, #8b461e 76% 100%);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 5px 5px 0 var(--shadow);
}

.collectible-target {
  position: absolute;
  z-index: 4;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  font-family: var(--pixel-font);
  font-size: 25px;
  animation: popTarget .9s infinite steps(2);
}

.collectible-target.star-item { background: var(--purple-soft); color: var(--white); }
.collectible-target.heart-item { background: #ff6688; color: var(--white); }
.collectible-target.trap-item { background: var(--red); color: var(--white); }
.collectible-target.chest-item { background: var(--orange); }

@keyframes popTarget {
  50% { transform: translateY(-3px) scale(1.04); }
}

.runner-player {
  position: absolute;
  left: 22px;
  bottom: 42px;
  width: 44px;
  height: 66px;
  animation: runnerBob .44s infinite steps(2);
}

.runner-head,
.runner-body,
.runner-leg {
  position: absolute;
  border: 3px solid var(--ink);
  background: var(--yellow);
}
.runner-head { left: 11px; top: 0; width: 24px; height: 24px; }
.runner-body { left: 8px; top: 24px; width: 30px; height: 24px; background: var(--green); }
.runner-leg { bottom: 0; width: 10px; height: 18px; background: var(--purple-soft); }
.runner-leg-a { left: 9px; }
.runner-leg-b { right: 8px; animation-delay: .2s; }

@keyframes runnerBob { 50% { transform: translateY(-3px); } }

.arena-message,
.arena-countdown,
.arena-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel-font);
  border: 3px solid var(--ink);
  background: rgba(255, 249, 223, .92);
  box-shadow: 4px 4px 0 rgba(14, 23, 41, .25);
  padding: 8px 10px;
  text-align: center;
}

.arena-message { top: 12px; }
.arena-hint { bottom: 10px; font-size: 12px; }
.arena-countdown {
  top: 50%;
  font-size: 38px;
  padding: 10px 18px;
}

.score-popup,
.sparkle-pixel {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  font-family: var(--pixel-font);
  font-weight: 900;
}

.score-popup {
  color: var(--red);
  text-shadow: 2px 2px 0 var(--white);
  animation: scoreFloat .7s ease forwards;
}

@keyframes scoreFloat {
  to { transform: translateY(-32px); opacity: 0; }
}

.guide-buddy {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--paper);
  cursor: pointer;
}

.guide-face {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--yellow);
}

.guide-text {
  font-family: var(--pixel-font);
  font-size: 12px;
}

.achievement-toast {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100% - 32px));
  padding: 12px;
  background: var(--paper);
  transform: translateY(130%);
  opacity: 0;
  transition: .25s ease;
}

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

.toast-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-size: 25px;
}

.achievement-toast b {
  font-family: var(--pixel-font);
  color: var(--purple);
}

.achievement-toast p {
  margin: 2px 0 0;
  line-height: 1.35;
}

/* Twibbon: preview di atas, control minimal di bawah preview */
.twibbon-section::before {
  background: rgba(255, 248, 221, .68);
}

.twibbon-helper {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--paper);
  padding: 14px;
  margin-bottom: 20px;
}

.twibbon-step {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 9px;
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .18);
}

.twibbon-step b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-family: var(--pixel-font);
}

.twibbon-step span {
  font-weight: 900;
  line-height: 1.25;
}

.twibbon-workspace {
  display: grid;
  gap: 18px;
}

.twibbon-preview-wrap,
.twibbon-editor {
  background: var(--paper);
}

.twibbon-preview-wrap {
  position: relative;
  padding: clamp(14px, 3vw, 22px);
  border: 4px solid var(--ink);
  outline: 3px solid rgba(255,255,255,.36);
  box-shadow: 7px 7px 0 var(--shadow);
}

.twibbon-preview-top {
  margin-bottom: 12px;
}

.twibbon-stage {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(#86ddff 0 58%, #56c854 58% 72%, #8b461e 72% 100%);
  touch-action: none;
}

.twibbon-stage canvas,
.twibbon-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.twibbon-stage canvas {
  z-index: 1;
  display: block;
}

.twibbon-video-preview {
  z-index: 2;
  display: none;
  background: linear-gradient(180deg, #8ed7ff, #fff7cc);
  overflow: hidden;
}

.twibbon-video-preview.active {
  display: block;
}

.video-photo-layer {
  position: absolute;
  inset: 9% 9% 16%;
  border: 4px solid var(--ink);
  background: var(--cloud);
  background-size: cover;
  background-position: center;
  box-shadow: 5px 5px 0 rgba(14, 23, 41, .3);
}

.twibbon-video-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.video-fallback-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 68%, rgba(233,77,53,.95) 68% 100%);
}

.video-fallback-frame span,
.video-fallback-frame b,
.video-fallback-frame small {
  padding: 5px 10px;
  border: 3px solid var(--ink);
  background: rgba(23,36,59,.9);
  font-family: var(--title-font);
}

.drag-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 4;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 7px 10px;
  border: 3px solid var(--ink);
  background: rgba(255, 249, 223, .9);
  box-shadow: 3px 3px 0 rgba(14, 23, 41, .25);
  font-family: var(--pixel-font);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.twibbon-control-dock {
  width: min(700px, 100%);
  margin: 14px auto 0;
  padding: 12px;
  background: var(--white);
}

.compact-tabs,
.twibbon-main-controls,
.twibbon-secondary-controls,
.caption-actions,
.caption-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.compact-tabs {
  margin-bottom: 10px;
}

.twibbon-main-controls .mini-pixel-btn,
.twibbon-secondary-controls .mini-pixel-btn,
.file-control {
  min-height: 42px;
}

.file-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: var(--white);
}

.twibbon-secondary-controls {
  margin-top: 9px;
}

.twibbon-control-note {
  font-size: 14px;
  font-weight: 900;
}

.twibbon-editor {
  padding: clamp(15px, 3vw, 22px);
}

.twibbon-simple-head {
  margin-bottom: 14px;
}

.twibbon-simple-head p {
  margin: 6px 0 0;
}

.twibbon-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.soft-box {
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 14px;
  box-shadow: 4px 4px 0 rgba(14, 23, 41, .18);
}

.twibbon-step-title {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.twibbon-step-title b {
  font-family: var(--pixel-font);
  color: var(--red);
}

.twibbon-step-title span,
.twibbon-note,
.twibbon-control-note {
  line-height: 1.4;
}

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

.upload-tile {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 118px;
  padding: 12px;
  border: 3px dashed var(--ink);
  background: #fffbea;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}

.upload-tile:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 rgba(14, 23, 41, .18);
}

.upload-tile span {
  font-size: 28px;
}

.upload-tile b {
  font-family: var(--pixel-font);
  color: var(--purple);
}

.upload-tile small {
  line-height: 1.3;
}

.upload-tile input {
  display: none;
}

.twibbon-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pixel-input.caption-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

.sticky-actions {
  margin: 14px 0;
}

.twibbon-caption-box {
  padding: 14px;
  background: var(--paper);
  margin-top: 14px;
}

.caption-head {
  margin-bottom: 10px;
}

.caption-presets {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.twibbon-tabs .active,
.caption-presets .active {
  background: var(--purple-soft);
  color: var(--white);
}

.danger-lite {
  background: #ffb1a2;
}

.twibbon-note {
  margin: 12px 0 0;
  font-size: 14px;
}

.video-only {
  display: none;
}

body.twibbon-video-mode .video-only {
  display: grid;
}

body.twibbon-video-mode button.video-only,
body.twibbon-video-mode .twibbon-actions .video-only {
  display: inline-flex;
}

body.twibbon-video-mode #downloadTwibbonPhoto {
  display: none;
}

.twibbon-stage.dragging {
  cursor: grabbing;
}

.twibbon-stage.ready {
  animation: twibbonReady .32s ease;
}

@keyframes twibbonReady {
  50% { transform: scale(1.015); }
}

@media (max-width: 900px) {
  .twibbon-helper {
    grid-template-columns: repeat(2, 1fr);
  }

  .twibbon-helper #copyTwibbonDirectLink {
    grid-column: 1 / -1;
  }

  .twibbon-editor-grid,
  .twibbon-name-row {
    grid-template-columns: 1fr;
  }

  .entry-important-list {
    grid-template-columns: 1fr;
  }

  .music-callout {
    position: static;
    width: min(420px, calc(100% - 24px));
    margin: 92px auto 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 6px;
  }

  .bell-label,
  .sound-toggle {
    font-size: 0;
  }

  .sound-toggle::after {
    content: '♪';
    font-size: 14px;
  }

  .bell-toggle {
    padding-inline: 8px;
  }

  .quick-game-card {
    width: calc(100% - 24px);
  }

  .twibbon-helper,
  .twibbon-upload-grid {
    grid-template-columns: 1fr;
  }

  .twibbon-preview-wrap {
    padding: 12px;
  }

  .twibbon-stage {
    width: 100%;
  }

  .twibbon-control-dock {
    padding: 10px;
  }

  .twibbon-main-controls,
  .twibbon-secondary-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .twibbon-main-controls .mini-pixel-btn,
  .twibbon-secondary-controls .mini-pixel-btn,
  .file-control {
    width: 100%;
    padding: 8px 6px;
    font-size: 11px;
  }

  .file-control {
    grid-column: 1 / -1;
  }

  .twibbon-control-note {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
  }

  .drag-hint {
    font-size: 10px;
    white-space: normal;
  }

  .caption-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-buddy {
    display: none;
  }
}

@media (max-width: 420px) {
  .twibbon-main-controls,
  .twibbon-secondary-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .twibbon-preview-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

.coin-game-arena.shake {
  animation: arenaShake .25s steps(2);
}

@keyframes arenaShake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.quick-game-card.game-highlight {
  animation: highlightPulse .75s ease 3;
}

@keyframes highlightPulse {
  50% { transform: translateY(-6px) scale(1.02); filter: saturate(1.15); }
}

/* SAFETY FIX: konten tidak boleh hilang kalau satu script/observer gagal. */
body.loaded .reveal,
body.app-ready .reveal,
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
