/* Theme "middle" — «Гильдия подмастерьев», 11–14 лет.
   Heroes of Might & Magic 3 meets a modern comic: parchment panels in
   carved-wood frames with a gold hairline and corner rivets, a top bar that
   reads like the Heroes resource bar, buttons as embossed wood/gold plaques.
   Every rule is scoped under body[data-tier="middle"]; the landing preview
   card is scoped under body[data-tier="none"] .tier-card[data-tier="middle"].
   Selectors stay at "prefix + one class" so screen CSS can extend them. */

/* ---------- tokens ---------- */
body[data-tier="middle"],
body[data-tier="none"] .tier-card[data-tier="middle"] {
  --font-display: 'Philosopher', 'Georgia', serif;
  --font-body: 'Golos Text', system-ui, sans-serif;
  --bg: #e2cfa4;
  --bg-elev: #efe3c4;
  --bg-sunken: #dcc89a;
  --ink: #2a1e14;
  --ink-soft: #4f3c28;
  --line: #9a7a52;
  --accent: #b94a1c;
  --accent-ink: #fff6e3;
  --accent-2: #1f5e63;
  --good: #2f6e3b;
  --bad: #a63a2a;
  --warn: #9c6a0c;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 3px 0 #3a2312, 0 10px 24px rgba(42, 30, 20, 0.22);

  /* theme-private palette */
  --mg-wood: #4a2e1a;
  --mg-wood-light: #6a4529;
  --mg-wood-dark: #241508;
  --mg-gold: #c9a227;
  --mg-gold-light: #ebcb63;
  --mg-gold-text: #f3de9c;
  --mg-ember: #d9602b;
  --mg-parchment-light: #f8f0da;

  /* layered parchment: a lit top edge, shaded corners, a few faint stains,
     and a barely-there fibre grain */
  --mg-parchment:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 250, 235, 0.55), transparent 60%),
    radial-gradient(40% 35% at 85% 20%, rgba(150, 110, 50, 0.08), transparent 70%),
    radial-gradient(30% 25% at 20% 60%, rgba(150, 110, 50, 0.07), transparent 70%),
    radial-gradient(80% 60% at 100% 100%, rgba(140, 100, 40, 0.16), transparent 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(140, 100, 40, 0.1), transparent 70%),
    repeating-linear-gradient(135deg, rgba(100, 70, 30, 0.022) 0 1px, transparent 1px 6px),
    #efe3c4;
  --mg-wood-grain:
    repeating-linear-gradient(0deg, rgba(255, 225, 160, 0.06) 0 1px, transparent 1px 4px, rgba(0, 0, 0, 0.1) 4px 5px, transparent 5px 11px),
    linear-gradient(180deg, #65412a 0%, #4a2e1a 50%, #3a2312 100%);
  --mg-plaque-wood: linear-gradient(180deg, #6a4529 0%, #4a2e1a 55%, #3a2312 100%);
  --mg-plaque-wood-hover: linear-gradient(180deg, #7a5232 0%, #573721 55%, #452a16 100%);
  --mg-plaque-gold: linear-gradient(180deg, #ebcb63 0%, #c9a227 55%, #b38f1e 100%);
  --mg-plaque-gold-hover: linear-gradient(180deg, #f3d777 0%, #d4ad2f 55%, #bd9823 100%);
}

body[data-tier="middle"] {
  background:
    repeating-linear-gradient(135deg, rgba(100, 70, 30, 0.02) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, #d2ba86 0%, #e2cfa4 14%, #e4d2a8 86%, #d2ba86 100%);
}

/* ---------- top bar: the Heroes resource bar ---------- */
body[data-tier="middle"] .topbar {
  background: var(--mg-wood-grain);
  border-bottom: 3px solid var(--mg-wood-dark);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.25),
    inset 0 -1px 0 var(--mg-gold),
    0 4px 14px rgba(20, 10, 4, 0.4);
  color: var(--mg-gold-text);
}
body[data-tier="middle"] .topbar :focus-visible { outline-color: var(--mg-gold-text); }
body[data-tier="middle"] .brand-name {
  color: var(--mg-gold-light);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  letter-spacing: 0.01em;
}
body[data-tier="middle"] .brand-sub { color: #e2cfa3; }

body[data-tier="middle"] .resources {
  gap: 0;
  background: #1e1106;
  border: 1px solid #8a6a2b;
  border-radius: 3px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 225, 160, 0.15);
}
body[data-tier="middle"] .resource {
  padding: 4px 12px;
  line-height: 1.3;
  color: var(--mg-gold-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
  border-right: 1px solid rgba(201, 162, 39, 0.35);
}
body[data-tier="middle"] .resource:last-child { border-right: 0; }
body[data-tier="middle"] .resource.mana {
  background: #1e1106;
  border: 1px solid #8a6a2b;
  border-radius: 3px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 225, 160, 0.15);
  color: #a9dde2;
}
body[data-tier="middle"] .calendar {
  background: var(--mg-parchment);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 10px;
  border: 1px solid var(--mg-wood-dark);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--mg-gold);
}

body[data-tier="middle"] .nav { gap: 6px; }
body[data-tier="middle"] .nav a {
  min-height: 44px;
  min-width: 56px;
  justify-content: center;
  padding: 4px 10px;
  color: var(--mg-gold-text);
  background: var(--mg-plaque-wood);
  border: 1px solid var(--mg-wood-dark);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.3), 0 0 0 1px rgba(201, 162, 39, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  font-weight: 600;
}
body[data-tier="middle"] .nav a:hover { background: var(--mg-plaque-wood-hover); }
body[data-tier="middle"] .nav a.active {
  background: var(--mg-plaque-gold);
  color: var(--ink);
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.7), inset 0 -2px 0 rgba(90, 60, 0, 0.35), 0 0 0 1px var(--mg-wood-dark);
}

/* ---------- framed parchment: panels, cards, modals ---------- */
body[data-tier="middle"] .panel,
body[data-tier="middle"] .modal,
body[data-tier="middle"] .hero-banner {
  position: relative;
  background: var(--mg-parchment);
  border: 3px solid var(--mg-wood);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--mg-wood-dark), 0 3px 0 #3a2312, 0 10px 24px rgba(42, 30, 20, 0.22);
}
body[data-tier="middle"] .panel.error { border-color: var(--bad); }

/* gold hairline + four corner rivets, pure CSS */
body[data-tier="middle"] .panel::before,
body[data-tier="middle"] .modal::before,
body[data-tier="middle"] .hero-banner::before,
body[data-tier="none"] .tier-card[data-tier="middle"]::after {
  content: '';
  position: absolute;
  inset: 2px;
  pointer-events: none;
  border: 1px solid var(--mg-gold);
  border-radius: 2px;
  background-image:
    radial-gradient(circle, var(--mg-ember) 0 1.5px, var(--mg-gold-light) 2px 3.5px, #7a5a1a 4px 4.5px, transparent 5px),
    radial-gradient(circle, var(--mg-ember) 0 1.5px, var(--mg-gold-light) 2px 3.5px, #7a5a1a 4px 4.5px, transparent 5px),
    radial-gradient(circle, var(--mg-ember) 0 1.5px, var(--mg-gold-light) 2px 3.5px, #7a5a1a 4px 4.5px, transparent 5px),
    radial-gradient(circle, var(--mg-ember) 0 1.5px, var(--mg-gold-light) 2px 3.5px, #7a5a1a 4px 4.5px, transparent 5px);
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-origin: border-box;
  background-position: 0 0, 100% 0, 0 100%, 100% 100%;
}

body[data-tier="middle"] .card {
  position: relative;
  background: var(--mg-parchment);
  border: 2px solid var(--mg-wood);
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px #efe3c4, inset 0 0 0 3px rgba(201, 162, 39, 0.85), 0 2px 0 #3a2312, 0 6px 14px rgba(42, 30, 20, 0.18);
}
body[data-tier="middle"] .card-title { color: var(--mg-wood); }
body[data-tier="middle"] .card-icon { filter: drop-shadow(0 2px 0 rgba(42, 30, 20, 0.25)); }
body[data-tier="middle"] .card.locked { filter: saturate(0.5); }

/* ---------- buttons: embossed wood and gold plaques ---------- */
body[data-tier="middle"] .btn {
  min-height: 44px;
  background: var(--mg-plaque-wood);
  color: var(--mg-gold-text);
  border: 1px solid var(--mg-wood-dark);
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(201, 162, 39, 0.55),
    0 2px 0 #1e1208,
    0 3px 6px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.08s, background 0.15s, box-shadow 0.08s;
}
body[data-tier="middle"] .btn:hover { background: var(--mg-plaque-wood-hover); }
body[data-tier="middle"] .btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(201, 162, 39, 0.55), 0 0 0 #1e1208;
}
body[data-tier="middle"] .btn:disabled { transform: none; }
body[data-tier="middle"] .btn-small { min-height: 36px; }

body[data-tier="middle"] .btn-primary {
  background: var(--mg-plaque-gold);
  color: var(--ink);
  border-color: #6a4a10;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 200, 0.7),
    inset 0 -2px 0 rgba(90, 60, 0, 0.35),
    0 0 0 1px var(--mg-wood),
    0 2px 0 #3a2312,
    0 3px 6px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}
body[data-tier="middle"] .btn-primary:hover { background: var(--mg-plaque-gold-hover); filter: none; }
body[data-tier="middle"] .btn-primary:active {
  box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.4), inset 0 -1px 0 rgba(90, 60, 0, 0.35), 0 0 0 1px var(--mg-wood), 0 0 0 #3a2312;
}

body[data-tier="middle"] .btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
  text-shadow: none;
}
body[data-tier="middle"] .btn-ghost:hover { background: rgba(74, 46, 26, 0.12); }
body[data-tier="middle"] .btn-ghost:active { box-shadow: none; }

body[data-tier="middle"] .btn-danger {
  background: var(--mg-parchment-light);
  color: var(--bad);
  border-color: var(--bad);
  box-shadow: 0 2px 0 #3a2312;
  text-shadow: none;
}
body[data-tier="middle"] .btn-danger:hover { background: #f1d9c9; }

/* answer choices and level-up stats: parchment slips in a thin wood frame */
body[data-tier="middle"] .btn-choice,
body[data-tier="middle"] .btn-stat {
  background: var(--mg-parchment-light);
  color: var(--ink);
  border: 2px solid var(--mg-wood);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--mg-parchment-light), inset 0 0 0 3px var(--mg-gold), 0 2px 0 #3a2312, 0 4px 10px rgba(42, 30, 20, 0.18);
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}
body[data-tier="middle"] .btn-choice:hover,
body[data-tier="middle"] .btn-stat:hover { background: #fdf6e3; }
body[data-tier="middle"] .btn-choice:active,
body[data-tier="middle"] .btn-stat:active { box-shadow: inset 0 0 0 2px var(--mg-parchment-light), inset 0 0 0 3px var(--mg-gold), 0 0 0 #3a2312; }
body[data-tier="middle"] .btn-choice.is-right {
  background: var(--good);
  color: #fff;
  border-color: #1d4a27;
  box-shadow: inset 0 0 0 2px var(--good), inset 0 0 0 3px #cfe8c9, 0 2px 0 #3a2312;
}
body[data-tier="middle"] .btn-choice.is-wrong {
  background: var(--bad);
  color: #fff;
  border-color: #6e2419;
  box-shadow: inset 0 0 0 2px var(--bad), inset 0 0 0 3px #f1cfc6, 0 2px 0 #3a2312;
}
body[data-tier="middle"] .btn-stat small { color: var(--ink-soft); }

/* ---------- inputs ---------- */
body[data-tier="middle"] .input,
body[data-tier="middle"] .task-input {
  background: var(--mg-parchment-light);
  border: 2px solid #8a6a45;
  border-radius: 4px;
  box-shadow: inset 0 2px 3px rgba(74, 46, 26, 0.18);
}
body[data-tier="middle"] .input:focus,
body[data-tier="middle"] .task-input:focus { border-color: var(--accent-2); }

body[data-tier="middle"] .portrait {
  background: var(--mg-parchment-light);
  border: 2px solid var(--mg-wood);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--mg-parchment-light), inset 0 0 0 3px var(--mg-gold), 0 2px 0 #3a2312;
}
body[data-tier="middle"] .portrait[aria-pressed="true"] {
  background: var(--mg-plaque-gold);
  border-color: var(--mg-wood-dark);
  box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.7), inset 0 -2px 0 rgba(90, 60, 0, 0.35), 0 2px 0 #3a2312;
}

/* ---------- progress, tags, toasts ---------- */
body[data-tier="middle"] .progress {
  height: 12px;
  background: #3a2312;
  border: 1px solid #8a6a2b;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 245, 200, 0.5);
}
body[data-tier="middle"] .progress-fill {
  border-radius: 1px;
  background: linear-gradient(180deg, #4f9ea4, var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body[data-tier="middle"] .progress.xp .progress-fill { background: linear-gradient(180deg, var(--mg-gold-light), var(--mg-gold)); }
body[data-tier="middle"] .progress.hp .progress-fill { background: linear-gradient(180deg, var(--mg-ember), var(--bad)); }
body[data-tier="middle"] .progress.mana .progress-fill { background: linear-gradient(180deg, #4f9ea4, var(--accent-2)); }

body[data-tier="middle"] .tag {
  background: #e4d3a8;
  color: #3a2414;
  border: 1px solid #8a6a45;
  border-radius: 3px;
  padding: 1px 8px;
}
body[data-tier="middle"] .tag.good { background: var(--good); border-color: var(--good); color: #fff; }
body[data-tier="middle"] .tag.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
body[data-tier="middle"] .tag.warn { background: var(--warn); border-color: var(--warn); color: #fff; }

body[data-tier="middle"] .toast {
  background: var(--mg-plaque-wood);
  color: var(--mg-gold-text);
  border: 1px solid var(--mg-wood-dark);
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--mg-gold), 0 6px 16px rgba(20, 10, 4, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
body[data-tier="middle"] .toast-success { background: var(--good); color: #fff; }
body[data-tier="middle"] .toast-error { background: var(--bad); color: #fff; }

/* ---------- modals ---------- */
body[data-tier="middle"] .overlay { background: rgba(26, 15, 6, 0.72); }
body[data-tier="middle"] .modal { box-shadow: 0 0 0 1px var(--mg-wood-dark), 0 3px 0 #3a2312, 0 24px 60px rgba(20, 10, 4, 0.6); }
body[data-tier="middle"] .modal-title {
  color: var(--mg-wood);
  padding-bottom: 8px;
  border-bottom: 3px double var(--mg-gold);
}
body[data-tier="middle"] .modal-close {
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--mg-plaque-wood);
  color: var(--mg-gold-text);
  border: 1px solid var(--mg-wood-dark);
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.3), 0 0 0 1px rgba(201, 162, 39, 0.55);
  font-size: 1.4rem;
}
body[data-tier="middle"] .modal-close:hover { background: var(--mg-plaque-wood-hover); }

/* task prompt */
body[data-tier="middle"] .task-title { color: var(--mg-wood); }
body[data-tier="middle"] .task-timer {
  height: 8px;
  background: #3a2312;
  border: 1px solid #8a6a2b;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
body[data-tier="middle"] .task-timer-fill {
  background: linear-gradient(90deg, var(--mg-gold), var(--mg-ember));
  border-radius: 1px;
}
body[data-tier="middle"] .task-timer.low .task-timer-fill { background: var(--bad); }
body[data-tier="middle"] .task-question {
  padding: 12px 16px;
  background: rgba(255, 250, 235, 0.6);
  border-left: 4px solid var(--mg-gold);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(74, 46, 26, 0.12);
}
body[data-tier="middle"] .task-question td,
body[data-tier="middle"] .task-question th { border-color: #8a6a45; }
body[data-tier="middle"] .task-hint {
  background: rgba(31, 94, 99, 0.09);
  border-left: 3px solid var(--accent-2);
  border-radius: 2px;
}
body[data-tier="middle"] .task-feedback { border-top: 3px double var(--mg-gold); }
body[data-tier="middle"] .task-verdict { font-family: var(--font-display); font-size: 1.25rem; }

/* lesson (spell page) */
body[data-tier="middle"] .lesson-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
body[data-tier="middle"] .lesson-icon {
  font-size: 1.8rem;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mg-parchment-light);
  border: 2px solid var(--mg-wood);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--mg-parchment-light), inset 0 0 0 3px var(--mg-gold);
}
body[data-tier="middle"] .lesson-spell { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--mg-wood); line-height: 1.15; }
body[data-tier="middle"] .lesson-text { max-width: 64ch; line-height: 1.55; }
body[data-tier="middle"] .lesson-text p:first-child::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.82;
  padding: 4px 8px 0 0;
  color: var(--mg-wood);
}
body[data-tier="middle"] .lesson-examples {
  margin-top: 16px;
  padding: 10px 16px;
  background: rgba(74, 46, 26, 0.07);
  border: 1px solid #b89a66;
  border-left: 4px solid var(--mg-gold);
  border-radius: 2px;
}
body[data-tier="middle"] .week-event { color: var(--accent-2); font-weight: 600; }

/* ---------- landing (shown in this theme once a middle hero exists) ---------- */
body[data-tier="middle"] .hero-banner {
  padding: 36px 40px 32px;
  margin: 24px 0 36px;
  max-width: 820px;
}
body[data-tier="middle"] .hero-kicker { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
body[data-tier="middle"] .hero-title {
  color: var(--mg-wood);
  text-shadow: 3px 3px 0 var(--mg-gold);
}
body[data-tier="middle"] .hero-title .semi { color: var(--mg-ember); text-shadow: 3px 3px 0 var(--mg-wood); }
body[data-tier="middle"] .tier-card {
  background: var(--mg-parchment);
  border: 2px solid var(--mg-wood);
  box-shadow: inset 0 0 0 2px #efe3c4, inset 0 0 0 3px rgba(201, 162, 39, 0.85), 0 2px 0 #3a2312, 0 6px 14px rgba(42, 30, 20, 0.18);
}
body[data-tier="middle"] .how-step { padding-top: 8px; border-top: 3px double var(--mg-gold); }

/* ---------- the landing preview card: a sample of this theme ---------- */
body[data-tier="none"] .tier-card[data-tier="middle"] {
  position: relative;
  padding-top: 60px;
  color: var(--ink);
  background: var(--mg-parchment);
  border: 3px solid var(--mg-wood);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--mg-wood-dark), 0 3px 0 #3a2312, 0 10px 24px rgba(42, 30, 20, 0.22);
}
/* a miniature Heroes resource bar across the top of the card */
body[data-tier="none"] .tier-card[data-tier="middle"]::before {
  content: '\1FA99 2500\00a0\00a0\00a0\1FAB5 12\00a0\00a0\00a0\26CF\FE0F 8\00a0\00a0\00a0\1F48E 3';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mg-gold-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
  background: var(--mg-wood-grain);
  border-bottom: 2px solid var(--mg-wood-dark);
  box-shadow: inset 0 -1px 0 var(--mg-gold);
}
body[data-tier="none"] .tier-card[data-tier="middle"] .tier-ages {
  align-self: flex-start;
  padding: 2px 10px;
  background: var(--mg-plaque-gold);
  border: 1px solid var(--mg-wood);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.7), 0 1px 0 #3a2312;
  color: var(--ink);
}
body[data-tier="none"] .tier-card[data-tier="middle"] .tier-title { color: var(--mg-wood); }
body[data-tier="none"] .tier-card[data-tier="middle"] .tier-list { color: var(--ink-soft); }
body[data-tier="none"] .tier-card[data-tier="middle"] .tier-list li::marker { color: var(--mg-ember); }
body[data-tier="none"] .tier-card[data-tier="middle"] .btn-primary {
  min-height: 44px;
  background: var(--mg-plaque-gold);
  color: var(--ink);
  border: 1px solid #6a4a10;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 200, 0.7),
    inset 0 -2px 0 rgba(90, 60, 0, 0.35),
    0 0 0 1px var(--mg-wood),
    0 2px 0 #3a2312,
    0 3px 6px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}
body[data-tier="none"] .tier-card[data-tier="middle"] .btn-primary:hover { background: var(--mg-plaque-gold-hover); filter: none; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  body[data-tier="middle"] .resource { padding: 3px 8px; font-size: 0.9rem; }
  body[data-tier="middle"] .calendar { font-size: 0.8rem; padding: 3px 8px; }
  body[data-tier="middle"] .nav a { min-width: 48px; padding: 4px 6px; }
  body[data-tier="middle"] .btn-small { min-height: 44px; }
  body[data-tier="middle"] .hero-banner { padding: 24px 18px 22px; margin: 12px 0 28px; }
  body[data-tier="middle"] .hero-title { text-shadow: 2px 2px 0 var(--mg-gold); }
  body[data-tier="middle"] .hero-title .semi { text-shadow: 2px 2px 0 var(--mg-wood); }
}

/* phones: squeeze the resource bar so it fits on one row under the brand/nav */
@media (max-width: 480px) {
  body[data-tier="middle"] .topbar { padding: 4px 8px 6px; gap: 6px; }
  body[data-tier="middle"] .brand-name { font-size: 1.1rem; }
  body[data-tier="middle"] .topbar-mid { gap: 4px 6px; }
  body[data-tier="middle"] .resource { padding: 2px 5px; font-size: 0.8rem; gap: 3px; }
  body[data-tier="middle"] .calendar { font-size: 0.72rem; padding: 3px 6px; }
  body[data-tier="middle"] .nav { gap: 4px; }
  body[data-tier="middle"] .nav a { min-width: 44px; padding: 2px 4px; font-size: 0.72rem; }
}
