:root {
  --bg: #07101f;
  --bg-soft: rgba(9, 17, 34, 0.84);
  --bg-panel: linear-gradient(180deg, rgba(15, 25, 46, 0.96), rgba(8, 14, 28, 0.96));
  --bg-panel-alt: linear-gradient(180deg, rgba(245, 248, 255, 0.95), rgba(223, 232, 255, 0.95));
  --text: #f8fbff;
  --text-soft: #b6c7e4;
  --line: rgba(148, 174, 227, 0.24);
  --blue: #0d5bff;
  --blue-2: #3b8dff;
  --gold: #ffc928;
  --gold-2: #ffe178;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 22px rgba(3, 10, 22, 0.26);
  --pixel-font: "Press Start 2P", cursive;
  --ui-font: "Inter", system-ui, sans-serif;
}
body[data-theme="day"] {
  --bg: #cfe0ff;
  --bg-soft: rgba(236, 243, 255, 0.92);
  --bg-panel: var(--bg-panel-alt);
  --text: #0e1a31;
  --text-soft: #395277;
  --line: rgba(14, 26, 49, 0.12);
  --shadow: 0 18px 45px rgba(31, 61, 118, 0.16);
  --shadow-soft: 0 10px 24px rgba(31, 61, 118, 0.10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

.world, .world-grid, .world-glow { position: fixed; inset: 0; pointer-events: none; }
.world-back {
  z-index: -4;
  background:
    radial-gradient(circle at 14% 18%, rgba(13, 91, 255, 0.30), transparent 38%),
    radial-gradient(circle at 86% 12%, rgba(255, 201, 40, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(4, 9, 19, 0.96), rgba(6, 14, 30, 0.96));
}
body[data-theme="day"] .world-back {
  background:
    radial-gradient(circle at 14% 18%, rgba(13, 91, 255, 0.24), transparent 40%),
    radial-gradient(circle at 86% 12%, rgba(255, 201, 40, 0.20), transparent 30%),
    linear-gradient(180deg, rgba(224, 236, 255, 0.96), rgba(205, 222, 255, 0.96));
}
.world-front {
  z-index: -3;
  opacity: .8;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.18));
}
.world-grid {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(10,22,42,0), rgba(10,22,42,.28)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 96px);
}
.world-glow {
  z-index: -1;
  background:
    radial-gradient(circle at 50% -10%, rgba(13, 91, 255, .24), transparent 44%),
    radial-gradient(circle at 50% 110%, rgba(255, 201, 40, .10), transparent 28%);
}
.container { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
.section { position: relative; padding: 44px 0; }
.section--hero { padding-top: 24px; padding-bottom: 28px; }
.section--alt { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)); }
body[data-theme="day"] .section--alt { background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.12)); }

.header {
  position: relative;
  z-index: 50;
  background: linear-gradient(180deg, rgba(5, 11, 22, 0.92), rgba(5, 11, 22, 0.76));
  border-bottom: 3px solid rgba(13, 91, 255, 0.28);
  box-shadow: 0 12px 34px rgba(0,0,0,.20);
}
body[data-theme="day"] .header {
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.94), rgba(235, 241, 255, 0.84));
  border-bottom-color: rgba(13, 91, 255, 0.18);
}
.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
}
.brand { display: inline-grid; gap: 6px; align-self: center; }
.brand__title,
.brand__subtitle,
.inventory-nav__item,
.theme-toggle,
.theme-auto,
.nav-toggle,
.pixel-pill,
.pixel-mini,
.server-indicator,
.meter__label,
.meter__value,
.panel__title,
.section-head__eyebrow,
.ip-panel__head,
.pixel-tag,
.step-card__num,
.link-panel,
.btn,
.toast__label,
.mode-card__badge { font-family: var(--pixel-font); }
.brand__title { font-size: clamp(14px, 1.25vw, 18px); letter-spacing: .06em; line-height: 1.35; text-shadow: 2px 2px 0 rgba(0,0,0,.26); }
.brand__subtitle { font-size: 9px; color: var(--text-soft); line-height: 1.3; }

.inventory-nav {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
  width: min(100%, 760px);
}
.inventory-nav__item,
.theme-toggle,
.theme-auto,
.inventory-slot,
.link-panel,
.btn,
.nav-toggle {
  position: relative;
  border: 3px solid #0b1322;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.24), 0 6px 0 rgba(5, 12, 24, .42), 0 12px 26px rgba(0,0,0,.16);
}
.inventory-nav__item {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(23, 41, 78, 0.96), rgba(12, 22, 42, 0.96));
  color: #f4f8ff;
  font-size: 10px;
  text-align: center;
  letter-spacing: .02em;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.inventory-nav__item:hover, .inventory-nav__item.active { transform: translateY(-2px); filter: brightness(1.05); border-color: rgba(255, 201, 40, 0.62); }
.inventory-nav__item.active::after, .inventory-slot::after, .link-panel::after, .btn::after, .theme-toggle::after, .theme-auto::after, .nav-toggle::after {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.08); pointer-events: none;
}
.theme-controls { display: flex; gap: 8px; align-items: center; }
.theme-toggle, .theme-auto, .nav-toggle { min-height: 52px; padding: 0 14px; cursor: pointer; font-size: 10px; background: linear-gradient(180deg, rgba(12, 99, 255, .98), rgba(7, 56, 168, .98)); color: #f7faff; }
.theme-toggle { min-width: 120px; color: #0e1a31; background: linear-gradient(180deg, rgba(255, 201, 40, 0.98), rgba(227, 168, 20, 0.98)); }
.theme-auto { min-width: 88px; }
.theme-auto.is-auto { box-shadow: inset 0 0 0 2px rgba(255, 201, 40, .22), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.24), 0 6px 0 rgba(5, 12, 24, .42), 0 12px 26px rgba(0,0,0,.16); }
.nav-toggle { display: none; width: 56px; padding: 0; place-items: center; }
.nav-toggle span { display: block; width: 22px; height: 3px; margin: 3px auto; background: #fff; }

.hero__grid, .contact-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 20px; }
.hero__side { display: grid; gap: 20px; }
.panel, .step-card, .mode-card {
  position: relative;
  overflow: hidden;
  border: 4px solid rgba(9, 17, 31, 0.88);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}
.panel::before, .step-card::before, .mode-card::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none; }
.panel, .step-card, .mode-card { padding: 24px; }
.panel__topline, .panel__title-row, .ip-panel__head, .players-panel__head, .footer__inner, .cta-strip, .hero__actions, .hero__stats, .status-stack, .ip-panel__tags, .link-grid, .steps-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.panel__title-row { align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel__title { margin: 0; font-size: clamp(12px, 1.15vw, 16px); line-height: 1.45; }
.panel__text, .step-card p, .section-head__text, .hero__subtitle, .footer p, .players-panel__head span, .mode-card p, .mode-card__list { margin: 0; color: var(--text-soft); font-size: 15px; }
.pixel-pill, .pixel-mini, .pixel-tag, .server-indicator, .mode-card__badge {
  display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 8px 10px;
  background: linear-gradient(180deg, rgba(16, 98, 255, .98), rgba(8, 56, 164, .98)); border: 2px solid rgba(7, 17, 33, .86);
  color: #f5f8ff; font-size: 9px; line-height: 1.45; text-transform: uppercase;
}
.pixel-pill--gold, .btn--gold, .server-indicator.is-online { background: linear-gradient(180deg, rgba(255, 201, 40, .98), rgba(219, 162, 18, .98)); color: #1d1300; }
.server-indicator.is-offline { background: linear-gradient(180deg, rgba(52, 81, 132, .98), rgba(32, 52, 88, .98)); color: #e9f2ff; }
.hero__logo { width: min(760px, 100%); margin: 18px 0 16px; filter: drop-shadow(0 18px 26px rgba(0,0,0,.30)); }
.hero__title { margin: 0 0 10px; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.04; font-weight: 900; letter-spacing: -.03em; }
.hero__subtitle { max-width: 860px; margin-bottom: 20px; font-size: clamp(16px, 1.5vw, 19px); }
.hero__stats { margin-bottom: 18px; }
.meter {
  flex: 1 1 240px; min-width: 240px; padding: 16px; border: 3px solid rgba(9, 17, 31, 0.86);
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.88), rgba(5, 10, 22, 0.88)); box-shadow: var(--shadow-soft);
}
body[data-theme="day"] .meter { background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(229,238,255,.86)); }
.meter__label, .meter__value { display: flex; justify-content: space-between; font-size: 9px; }
.meter__value { margin-top: 6px; color: var(--text); }
.meter__track { margin-top: 12px; height: 18px; padding: 3px; background: #070e1b; border: 3px solid #000; box-shadow: inset 0 2px 0 rgba(255,255,255,.06); }
.meter__fill { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--blue) 0 28px, var(--blue-2) 28px 56px); box-shadow: 0 0 16px rgba(13, 91, 255, 0.42); }
.meter__fill--a { width: 94%; }
.meter__fill--b { width: 78%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 18px; font-size: 10px; color: #f7faff;
  text-transform: uppercase; cursor: pointer; background: linear-gradient(180deg, rgba(12, 99, 255, .98), rgba(7, 56, 168, .98)); transition: transform .15s ease, filter .15s ease;
}
.btn:hover, .theme-toggle:hover, .theme-auto:hover, .inventory-slot:hover, .link-panel:hover, .nav-toggle:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn--ghost, .link-panel, .inventory-slot { background: linear-gradient(180deg, rgba(26, 44, 81, .98), rgba(10, 18, 34, .98)); }
.btn--primary { background: linear-gradient(180deg, rgba(18, 110, 255, .98), rgba(7, 58, 176, .98)); }
.btn--gold { color: #171100; }
.ip-panel { margin-top: 20px; padding: 20px; border: 3px solid rgba(13, 91, 255, 0.24); background: linear-gradient(180deg, rgba(7, 15, 31, 0.88), rgba(7, 14, 28, 0.70)); }
body[data-theme="day"] .ip-panel { background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(229,238,255,.74)); }
.ip-panel__head { justify-content: space-between; margin-bottom: 16px; font-size: 9px; }
.ip-panel__value { font-size: clamp(22px, 3vw, 36px); font-weight: 900; letter-spacing: -.03em; margin-bottom: 16px; }
.pixel-tag { font-size: 8px; }
.status-stack { flex-direction: column; margin-bottom: 18px; }
.status-stack--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.server-banner {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; margin-bottom: 18px; padding: 16px;
  border: 3px solid rgba(13, 91, 255, .24); background: linear-gradient(180deg, rgba(12, 22, 42, .84), rgba(7, 14, 25, .70)); box-shadow: var(--shadow-soft);
}
body[data-theme="day"] .server-banner { background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232,240,255,.76)); }
.server-banner__media { display: grid; place-items: center; width: 88px; height: 88px; border: 3px solid rgba(9, 17, 31, .86); background: linear-gradient(180deg, rgba(23, 41, 78, 0.96), rgba(12, 22, 42, 0.96)); }
.server-banner__media img { width: 64px; height: 64px; image-rendering: pixelated; object-fit: contain; }
.server-banner__body { min-width: 0; }
.server-banner__title { display: block; font-size: 24px; line-height: 1.08; margin-bottom: 8px; }
.server-banner__motd { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; }
.server-banner__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.status-card { display: grid; gap: 6px; padding: 16px; border: 3px solid rgba(13, 91, 255, .20); background: linear-gradient(180deg, rgba(10, 19, 36, .78), rgba(8, 14, 25, .60)); }
body[data-theme="day"] .status-card { background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(235,242,255,.66)); }
.status-card__label { color: var(--text-soft); font-size: 12px; text-transform: uppercase; font-weight: 700; }
.status-card__value { font-size: 20px; line-height: 1.2; word-break: break-word; }
.status-card__value--small { font-size: 16px; }
.players-panel { border: 3px solid rgba(255, 201, 40, .18); padding: 16px; background: linear-gradient(180deg, rgba(11, 19, 34, .70), rgba(7, 13, 24, .54)); }
.players-panel__head { justify-content: space-between; align-items: center; margin-bottom: 14px; }
.players-panel__head h3 { margin: 0; font-size: 18px; }
.players-grid, .inventory-grid, .link-grid, .steps-grid, .mode-grid { display: grid; gap: 14px; }
.players-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.link-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.player-card { display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 12px; border: 3px solid rgba(13, 91, 255, .22); background: linear-gradient(180deg, rgba(18, 29, 54, .90), rgba(7, 14, 28, .78)); }
.player-card img { width: 38px; height: 38px; image-rendering: pixelated; border: 2px solid #000; }
.player-card strong { display: block; font-size: 14px; }
.player-card span { color: var(--text-soft); font-size: 12px; }
.player-card--empty { grid-column: 1 / -1; justify-content: center; text-align: center; color: var(--text-soft); }
.inventory-slot, .link-panel { display: grid; align-content: center; justify-items: start; min-height: 116px; padding: 16px; color: #f6faff; }
.inventory-slot span, .link-panel { font-family: var(--pixel-font); font-size: 10px; }
.inventory-slot small { margin-top: 10px; color: #bdd0f5; font-family: var(--ui-font); font-size: 13px; }
.section-head { display: grid; gap: 12px; margin-bottom: 18px; }
.section-head__eyebrow { font-size: 10px; color: var(--gold); }
.section-head__title { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.08; }
.step-card h3, .mode-card h3 { margin: 0 0 10px; font-size: 22px; line-height: 1.12; }
.step-card__num { display: inline-flex; min-width: 74px; min-height: 34px; align-items: center; justify-content: center; margin-bottom: 18px; background: linear-gradient(180deg, rgba(13, 91, 255, .98), rgba(8, 56, 164, .98)); border: 2px solid rgba(7, 17, 33, .86); font-size: 10px; }
.mode-card__top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.mode-card__list { padding-left: 18px; margin-top: 14px; }
.mode-card__list li { margin-bottom: 8px; }
.mode-visual { position: relative; min-height: 170px; margin-top: 22px; border: 3px solid rgba(13, 91, 255, .20); background: linear-gradient(180deg, rgba(10,18,35,.84), rgba(6,10,22,.92)); overflow: hidden; }
.mode-card--underground .mode-visual { background: linear-gradient(180deg, rgba(16,22,38,.98), rgba(8,12,21,.98)); }
.mode-card--bedwars .mode-visual { background: linear-gradient(180deg, rgba(10,22,52,.92), rgba(6,14,30,.98)); }
.ore { position: absolute; width: 34px; height: 34px; border: 3px solid #111; box-shadow: 0 0 0 2px rgba(255,255,255,.03) inset; animation: floatOre 3.6s ease-in-out infinite; }
.ore--gold { background: linear-gradient(135deg, #4b3b00 0 35%, #ffc928 35% 65%, #4b3b00 65% 100%); }
.ore--blue { background: linear-gradient(135deg, #14274f 0 35%, #3b8dff 35% 65%, #14274f 65% 100%); }
.ore:nth-child(1) { top: 26px; left: 34px; }
.ore:nth-child(2) { top: 86px; left: 126px; animation-delay: .45s; }
.ore:nth-child(3) { top: 40px; right: 42px; animation-delay: .9s; }
.torch-glow { position: absolute; left: 50%; bottom: 18px; width: 90px; height: 90px; transform: translateX(-50%); background: radial-gradient(circle, rgba(255,201,40,.45), rgba(255,201,40,0)); animation: pulseGlow 2s ease-in-out infinite; }
.bed, .bridge, .spark { position: absolute; }
.bed { width: 62px; height: 38px; border: 3px solid #111; top: 38px; animation: bedBounce 2.4s ease-in-out infinite; }
.bed--left { left: 28px; background: linear-gradient(180deg, #ffd65b 0 45%, #ffffff 45% 100%); }
.bed--right { right: 28px; background: linear-gradient(180deg, #5da2ff 0 45%, #ffffff 45% 100%); animation-delay: .3s; }
.bridge { left: 50%; top: 96px; transform: translateX(-50%); width: 56%; height: 16px; background: repeating-linear-gradient(90deg, #c9c9c9 0 18px, #8e8e8e 18px 36px); border: 3px solid #111; animation: bridgeShift 2.8s linear infinite; }
.spark { width: 10px; height: 10px; background: var(--gold); box-shadow: 0 0 10px rgba(255,201,40,.6); }
.spark--1 { left: 42%; top: 46px; animation: spark 1.2s ease-out infinite; }
.spark--2 { left: 52%; top: 70px; animation: spark 1.2s ease-out .35s infinite; }
.spark--3 { left: 60%; top: 52px; animation: spark 1.2s ease-out .7s infinite; }
@keyframes floatOre { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseGlow { 0%,100% { opacity: .45; transform: translateX(-50%) scale(1); } 50% { opacity: .8; transform: translateX(-50%) scale(1.08); } }
@keyframes bedBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bridgeShift { 0% { background-position: 0 0; } 100% { background-position: 36px 0; } }
@keyframes spark { 0% { transform: translateY(0) scale(.8); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-20px) scale(1.3); opacity: 0; } }
.footer { padding: 26px 0 34px; border-top: 3px solid rgba(13, 91, 255, 0.20); background: linear-gradient(180deg, rgba(8, 14, 28, 0.82), rgba(7, 12, 23, 0.94)); }
body[data-theme="day"] .footer { background: linear-gradient(180deg, rgba(246, 249, 255, 0.8), rgba(231, 239, 255, 0.92)); }
.footer__inner { align-items: center; justify-content: space-between; }
.footer__meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-soft); }
.toast { position: fixed; left: 18px; top: 18px; z-index: 70; min-width: 240px; max-width: min(420px, calc(100vw - 36px)); padding: 16px 18px; border: 3px solid rgba(7, 17, 33, .88); background: linear-gradient(180deg, rgba(14, 24, 43, .97), rgba(8, 14, 24, .97)); box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast__label { display: block; margin-bottom: 8px; color: var(--gold-2); font-size: 9px; }
.toast__title { font-size: 14px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
body.theme-transitioning, body.theme-transitioning * { transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease, filter .28s ease !important; }
.click-burst { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: radial-gradient(circle, rgba(255, 201, 40, .96), rgba(13, 91, 255, .0)); box-shadow: 0 0 18px rgba(13, 91, 255, .55); animation: burst .55s ease forwards; pointer-events: none; }
@keyframes burst { 0% { transform: scale(.4); opacity: .92; } 100% { transform: scale(5.4); opacity: 0; } }

@media (max-width: 1180px) {
  .header__inner { grid-template-columns: auto 1fr auto; }
  .inventory-nav { width: 100%; max-width: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero__grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .header__inner { grid-template-columns: auto auto auto; }
  .nav-toggle { display: grid; justify-self: center; }
  .inventory-nav {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: 8px;
  }
  .inventory-nav.is-open { display: grid; }
  .theme-controls { justify-self: end; }
  .inventory-grid, .link-grid, .steps-grid, .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .players-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 20px, 1280px); }
  .header__inner { grid-template-columns: 1fr auto auto; gap: 10px; }
  .brand__title { font-size: 14px; }
  .brand__subtitle { font-size: 8px; }
  .theme-controls { width: auto; }
  .theme-toggle, .theme-auto { min-width: 0; padding: 0 10px; }
  .server-banner { grid-template-columns: 1fr; }
  .server-banner__media { width: 72px; height: 72px; }
  .section { padding: 30px 0; }
  .inventory-nav { grid-template-columns: 1fr; gap: 6px; }
  .inventory-nav__item, .theme-toggle, .theme-auto, .btn { min-height: 48px; font-size: 9px; }
  .hero__title { font-size: 30px; }
  .hero__subtitle { font-size: 15px; }
  .panel, .step-card, .mode-card { padding: 16px; }
  .meter { min-width: 100%; }
  .hero__actions, .cta-strip { flex-direction: column; }
  .btn { width: 100%; }
  .inventory-grid, .link-grid, .steps-grid, .mode-grid, .players-grid, .status-stack--grid { grid-template-columns: 1fr; }
  .ip-panel__value { font-size: 22px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .toast { left: 10px; right: 10px; top: 10px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== Rules page additions ===== */
.hero__grid--rules { grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); }
.hero__title--rules { font-size: clamp(28px, 3.8vw, 50px); }
.hero__actions--compact { margin-bottom: 0; }
.rules-search-panel { margin-top: 22px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.rules-input, .rules-select, .rules-textarea {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 3px solid #0b1322;
  background: linear-gradient(180deg, rgba(18, 29, 54, .92), rgba(7, 14, 28, .88));
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 15px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08), inset 0 -3px 0 rgba(0,0,0,.22), 0 6px 0 rgba(5, 12, 24, .32);
}
body[data-theme="day"] .rules-input,
body[data-theme="day"] .rules-select,
body[data-theme="day"] .rules-textarea {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(229,238,255,.86));
}
.rules-input::placeholder, .rules-textarea::placeholder { color: var(--text-soft); }
.rules-textarea { min-height: 150px; padding: 14px 16px; resize: vertical; }
.rules-clear { min-width: 144px; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.filter-chip {
  min-height: 42px;
  padding: 0 14px;
  border: 3px solid #0b1322;
  background: linear-gradient(180deg, rgba(26, 44, 81, .98), rgba(10, 18, 34, .98));
  color: #f6faff;
  font-family: var(--pixel-font);
  font-size: 9px;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.24), 0 6px 0 rgba(5, 12, 24, .42), 0 12px 26px rgba(0,0,0,.16);
}
.filter-chip:hover, .filter-chip.is-active { transform: translateY(-2px); filter: brightness(1.05); border-color: rgba(255, 201, 40, 0.62); }
.rules-note { margin: 14px 0 0; color: var(--text-soft); font-size: 14px; }
.rules-summary-grid .status-card__value { font-size: 18px; }
.inventory-grid--rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rules-top-grid, .rule-scale-grid, .appeal-grid { display: grid; gap: 16px; }
.rules-top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rule-scale-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.appeal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.rule-card h3, .scale-card h3 { margin: 0 0 10px; font-size: 22px; }
.rule-card p, .scale-card p { margin: 0; color: var(--text-soft); }
.card-kicker {
  display: inline-flex;
  min-width: 54px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(13, 91, 255, .98), rgba(8, 56, 164, .98));
  border: 2px solid rgba(7, 17, 33, .86);
  font-family: var(--pixel-font);
  font-size: 10px;
}
.rules-section-head { margin-top: 28px; }
.rules-accordion { display: grid; gap: 14px; }
.rule-block, .rule-sub {
  border: 4px solid rgba(9, 17, 31, 0.88);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}
.rule-block summary, .rule-sub summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--pixel-font);
  line-height: 1.5;
}
.rule-block summary::-webkit-details-marker, .rule-sub summary::-webkit-details-marker { display: none; }
.rule-block > summary {
  padding: 20px 22px;
  font-size: 11px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(12, 22, 42, .72), rgba(8, 14, 25, .60));
}
.rule-sub > summary {
  padding: 16px 18px;
  font-size: 10px;
  background: linear-gradient(180deg, rgba(18, 29, 54, .90), rgba(7, 14, 28, .80));
}
body[data-theme="day"] .rule-block > summary,
body[data-theme="day"] .rule-sub > summary {
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232,240,255,.74));
}
.rule-block__body { padding: 20px 22px 22px; color: var(--text-soft); font-size: 15px; }
.nested-list { display: grid; gap: 12px; }
.rule-sub > div { padding: 0 18px 18px; color: var(--text-soft); font-size: 15px; }
.checklist { display: grid; gap: 10px; }
.check-item { padding: 14px 16px; border: 3px solid rgba(13, 91, 255, .20); background: linear-gradient(180deg, rgba(10, 19, 36, .78), rgba(8, 14, 25, .60)); }
body[data-theme="day"] .check-item { background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(235,242,255,.66)); }
.appeal-form-panel { display: grid; gap: 16px; }
.appeal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.nick-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 12px; align-items: center; }
.skin-preview {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 3px solid #0b1322;
  background: linear-gradient(180deg, rgba(18, 29, 54, .92), rgba(7, 14, 28, .88));
}
.skin-preview img { width: 56px; height: 56px; image-rendering: pixelated; }
.form-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.form-status { color: var(--text-soft); font-size: 14px; }

@media (max-width: 1180px) {
  .hero__grid--rules { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .rules-top-grid, .rule-scale-grid, .appeal-grid, .appeal-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .search-row, .nick-row { grid-template-columns: 1fr; }
  .rules-clear { width: 100%; }
  .inventory-grid--rules { grid-template-columns: 1fr; }
  .rule-block > summary { font-size: 10px; padding: 16px; }
  .rule-sub > summary { font-size: 9px; padding: 14px; }
  .rule-block__body, .rule-sub > div { padding-left: 14px; padding-right: 14px; }
  .skin-preview { width: 100%; height: 88px; }
}
