/* ============================================================
   menu.css — title mark, button plates, screen chrome.
   ============================================================ */

.shell {
  position: relative;
  z-index: 10;
  height: 100%;
  padding: clamp(12px, 2.6vh, 30px) clamp(14px, 3vw, 54px) clamp(14px, 2.6vh, 30px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1100ms var(--ease-out), transform 1100ms var(--ease-out);
}
.shell.is-live { opacity: 1; transform: none; }

/* ---------- title mark ---------- */

.title {
  position: absolute;
  top: clamp(10px, 2.6vh, 32px);
  left: clamp(14px, 3.4vw, 56px);
  width: min(470px, 37vw);
  text-align: center;
  user-select: none;
}

.title::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 48%;
  width: 150%;
  height: 190%;
  transform: translate(-50%, -50%);
  background: radial-gradient(52% 44% at 50% 50%,
    rgba(3, 6, 4, 0.82), rgba(3, 6, 4, 0.42) 52%, rgba(3, 6, 4, 0) 76%);
  pointer-events: none;
  z-index: 0;
}

/* The numeral is set above the wordmark in carved stone, as on the box art. */
.title__numeral {
  display: block;
  position: relative;
  z-index: 1;
  font-family: var(--display-font);
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 54px);
  line-height: 1;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #6b6e56;
  background: linear-gradient(180deg, #9a9d7f 6%, #5c5f4a 52%, #2c2e23 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.085em #100d06;
  paint-order: stroke fill;
  margin-bottom: clamp(-10px, -0.9vh, -2px);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9));
}

/* Mirrored beneath the sub-title, the way the box art frames the wordmark. */
.title__numeral--foot {
  font-size: clamp(18px, 3vw, 36px);
  margin-bottom: 0;
  margin-top: clamp(-8px, -0.7vh, -2px);
}

.title__word {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0;
  font-family: var(--display-font);
  font-weight: 900;
  font-size: clamp(30px, 4.9vw, 62px);
  line-height: 0.98;
  letter-spacing: 0.045em;
  background: linear-gradient(180deg,
    #fff6d4 4%, var(--gold-bright) 20%, var(--gold) 46%,
    #c8912c 62%, #7d5312 84%, #b8862a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Paint-order lets a heavy stroke sit behind the gradient fill. */
  -webkit-text-stroke: 0.072em #120e06;
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}

.title__sub {
  position: relative;
  z-index: 1;
  margin: clamp(2px, 0.8vh, 10px) 0 0;
  font-family: var(--ui-font);
  font-weight: 700;
  font-size: clamp(12px, 1.9vw, 23px);
  letter-spacing: clamp(0.14em, 0.5vw, 0.3em);
  text-transform: uppercase;
  color: var(--gold);
  -webkit-text-stroke: 0.12em #120e06;
  paint-order: stroke fill;
  text-shadow: 0 0 24px rgba(237, 194, 87, 0.4);
}

/* Embers behind the mark, breathing. */
.title::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 118%;
  height: 150%;
  transform: translate(-50%, -50%);
  background: radial-gradient(58% 46% at 50% 50%,
    rgba(255, 158, 44, 0.30), rgba(190, 78, 20, 0.12) 46%, rgba(0,0,0,0) 74%);
  animation: mark-breathe 5.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes mark-breathe {
  0%, 100% { opacity: 0.62; transform: translate(-50%, -50%) scale(0.97); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.04); }
}

/* ---------- button rack ---------- */

.menu {
  position: absolute;
  top: 15%;
  right: clamp(14px, 3.4vw, 56px);
  width: min(404px, 32vw);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 5.5vh, 62px);
}

/* The rack hangs from two chains, as the original panel does. */
.rack { position: relative; isolation: isolate; }

.rack__chain {
  position: absolute;
  top: -22vh;
  bottom: calc(100% - 8px);
  width: 26px;
  z-index: -1;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='26' height='42' viewBox='0 0 26 42'>\
<ellipse cx='13' cy='11' rx='6.6' ry='10.4' fill='none' stroke='%230d0e10' stroke-width='6'/>\
<ellipse cx='13' cy='11' rx='6.6' ry='10.4' fill='none' stroke='%23585b63' stroke-width='2.6'/>\
<ellipse cx='13' cy='32' rx='10.6' ry='6.8' fill='none' stroke='%230d0e10' stroke-width='6'/>\
<ellipse cx='13' cy='32' rx='10.6' ry='6.8' fill='none' stroke='%2344464d' stroke-width='2.6'/>\
</svg>") repeat-y center top / 26px 42px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  pointer-events: none;
}
.rack__chain--left  { left: 16%; }
.rack__chain--right { left: 56%; }

.rack__board {
  position: relative;
  padding: clamp(10px, 1.6vh, 18px) clamp(10px, 1.6vw, 16px) clamp(12px, 1.8vh, 20px);
  border-radius: 3px;
  /* Riveted steel: a cold gradient over the stone photograph. */
  background:
    linear-gradient(180deg, rgba(58, 60, 64, 0.92), rgba(19, 20, 23, 0.96) 42%, rgba(12, 13, 15, 0.97)),
    url('../assets/art/stone-tile.jpg') center / 300px auto;
  background-blend-mode: multiply, normal;
  border: 1px solid #08090b;
  box-shadow:
    inset 0 1px 0 rgba(150, 156, 168, 0.34),
    inset 2px 0 0 rgba(0, 0, 0, 0.6),
    inset -2px 0 0 rgba(0, 0, 0, 0.6),
    inset 0 -2px 8px rgba(0, 0, 0, 0.8),
    0 10px 30px rgba(0, 0, 0, 0.7);
}

/* Rivet strips down both edges of the rack. */
.rack__board::before,
.rack__board::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 7px;
  background: radial-gradient(circle at 50% 6px, #6e727c 0 2.1px, #23252a 2.4px, transparent 3px) repeat-y;
  background-size: 7px 20px;
  opacity: 0.85;
  pointer-events: none;
}
.rack__board::before { left: 4px; }
.rack__board::after  { right: 4px; }

.menu__title {
  margin: 0 0 10px;
  text-align: center;
  font-size: clamp(12px, 1.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #9fb4d8;
  text-shadow: 0 2px 6px #000;
  min-height: 1.2em;
}
.menu__title:empty { display: none; }

.menu__list { display: flex; flex-direction: column; gap: clamp(5px, 0.9vh, 9px); }

/* Staggered entrance, replayed whenever a screen changes. */
.menu__list.is-entering .menu-button {
  animation: plate-in 400ms var(--ease-out) backwards;
}
.menu__list.is-entering .menu-button:nth-child(1) { animation-delay: 0ms; }
.menu__list.is-entering .menu-button:nth-child(2) { animation-delay: 55ms; }
.menu__list.is-entering .menu-button:nth-child(3) { animation-delay: 110ms; }
.menu__list.is-entering .menu-button:nth-child(4) { animation-delay: 165ms; }
.menu__list.is-entering .menu-button:nth-child(5) { animation-delay: 220ms; }
.menu__list.is-entering .menu-button:nth-child(6) { animation-delay: 275ms; }
@keyframes plate-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

/* --- the iron mount --- */

.menu-button {
  position: relative;
  display: block;
  width: auto;
  margin-left: 22px;
  padding: 5px 7px;
  border: 1px solid #07080a;
  border-radius: 2px;
  background: linear-gradient(180deg, #4d5057 0%, #2b2d32 18%, #16171b 62%, #26282d 100%);
  box-shadow:
    inset 0 1px 0 rgba(163, 170, 182, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 3px 8px rgba(0, 0, 0, 0.7);
  transition: filter 160ms var(--ease-out), transform 120ms var(--ease-out);
}

/* The barbed bracket that pins each plate to the rack. */
.menu-button::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 50%;
  width: 30px;
  height: 34px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='30' height='34' viewBox='0 0 30 34'>\
<path d='M29 17 L14 10 L17 4 L7 9 L2 2 L4 12 L0 17 L4 22 L2 32 L7 25 L17 30 L14 24 Z' \
fill='%2325272c' stroke='%23596069' stroke-width='1.4' stroke-linejoin='round'/>\
<circle cx='12' cy='17' r='3.1' fill='%230e0f12' stroke='%236a717c' stroke-width='1.2'/>\
</svg>") no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* --- the glowing rune plate --- */

.menu-button__plate {
  display: block;
  padding: clamp(7px, 1.2vh, 12px) 14px;
  border: 2px solid #2323b8;
  border-radius: 3px;
  background: linear-gradient(180deg, #0d0d4e 0%, #08083a 34%, #05052a 66%, #0a0a44 100%);
  box-shadow:
    inset 0 0 0 1px rgba(12, 12, 90, 0.9),
    inset 0 0 18px rgba(34, 34, 160, 0.5),
    inset 0 1px 0 rgba(90, 90, 220, 0.28);
  transition: border-color 160ms var(--ease-out), box-shadow 180ms var(--ease-out),
              background 180ms var(--ease-out);
}

.menu-button__label {
  display: block;
  color: #ffea58;
  font-size: clamp(13px, 1.55vw, 19px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
  transition: color 160ms var(--ease-out);
}

.menu-button__key { color: #ffffff; font-weight: 600; }

/* --- states --- */

.menu-button:hover,
.menu-button.is-focused { transform: translateX(3px); }

.menu-button:hover .menu-button__plate,
.menu-button.is-focused .menu-button__plate {
  border-color: #5c5cff;
  background: linear-gradient(180deg, #1a1a80 0%, #13135f 34%, #0c0c46 68%, #17176e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(40, 40, 190, 0.95),
    inset 0 0 24px rgba(80, 80, 235, 0.6),
    inset 0 1px 0 rgba(150, 150, 255, 0.4),
    0 0 18px rgba(50, 50, 220, 0.4);
}
.menu-button:hover .menu-button__label,
.menu-button.is-focused .menu-button__label { color: #fff6bd; }

.menu-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.menu-button.is-pressed { transform: translateX(3px) translateY(2px); }
.menu-button.is-pressed .menu-button__plate {
  background: linear-gradient(180deg, #0d0d44 0%, #14146a 60%, #0d0d44 100%);
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.85);
}

.menu-button--back .menu-button__label { letter-spacing: 0.16em; }

/* Used on the loading gate, where there is no rack to hang from. */
.menu-button--solo { margin: 0 auto; min-width: 220px; }
.menu-button--solo::before { content: none; }

/* ---------- screen chrome ---------- */

.chrome {
  position: absolute;
  left: clamp(14px, 3.4vw, 56px);
  right: clamp(14px, 3.4vw, 56px);
  bottom: clamp(10px, 1.8vh, 22px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #8b957c;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

.chrome__note { max-width: 46ch; line-height: 1.6; margin: 0; }
.chrome__note strong { color: #b9a877; font-weight: 600; }

/* Plain white, bottom-right — exactly where the game prints its build. */
.chrome__version {
  white-space: nowrap;
  text-align: right;
  color: #f2f2f2;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.audio-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(151, 116, 42, 0.6);
  border-radius: 3px;
  background: rgba(8, 12, 8, 0.66);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.audio-toggle:hover { color: var(--gold-bright); border-color: var(--gold); }
.audio-toggle[aria-pressed="true"] { color: #6f7a66; border-color: #3a4034; }

@media (max-width: 640px) {
  .chrome { flex-direction: column; align-items: center; text-align: center; }
  .chrome__version { text-align: center; }
  .audio-toggle { top: 12px; right: 12px; padding: 6px 10px; }
}


/* ---------- short viewports ---------- */

@media (max-height: 760px) {
  .shell { padding-bottom: clamp(28px, 4vh, 48px); }
  .title { padding-top: 0; }
  .title__numeral { font-size: clamp(22px, 3.4vw, 40px); }
  .menu { width: min(390px, 84vw); }
}

@media (max-height: 640px) {
  .chrome__note { display: none; }
  .chrome { justify-content: flex-end; }
  .menu { top: 11%; gap: clamp(12px, 3.4vh, 34px); }
  .title__word { font-size: clamp(26px, 4.2vw, 50px); }
  .title__sub { font-size: clamp(11px, 1.5vw, 17px); }
}


/* ---------- accessory row (the search glyph beside Battle.net) ---------- */

.menu-row { display: flex; align-items: stretch; gap: 6px; }
.menu-row .menu-button { flex: 1 1 auto; }

.menu-row__accessory {
  flex: 0 0 auto;
  width: clamp(30px, 3.2vw, 40px);
  border: 1px solid #07080a;
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 42%, rgba(96, 214, 186, 0.42), rgba(0, 0, 0, 0) 62%),
    linear-gradient(180deg, #4d5057 0%, #2b2d32 18%, #16171b 62%, #26282d 100%);
  box-shadow:
    inset 0 1px 0 rgba(163, 170, 182, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.7);
  position: relative;
}
.menu-row__accessory::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'>\
<circle cx='9' cy='9' r='6' fill='none' stroke='%236ee2c0' stroke-width='2'/>\
<path d='M13.6 13.6 L19 19' stroke='%236ee2c0' stroke-width='2.6' stroke-linecap='round'/>\
</svg>") no-repeat center / 58% auto;
  opacity: 0.85;
}

/* ---------- the iron cog in the bottom-left corner ---------- */

.stage__cog {
  position: absolute;
  left: -3.4%;
  bottom: -7%;
  width: clamp(150px, 17vw, 300px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.34;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'>\
<g fill='%232a2c2f' stroke='%23151618' stroke-width='3'><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(0 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(24 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(48 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(72 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(96 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(120 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(144 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(168 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(192 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(216 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(240 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(264 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(288 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(312 100 100)'/><rect x='94' y='4' width='12' height='24' rx='2' transform='rotate(336 100 100)'/></g>\
<circle cx='100' cy='100' r='80' fill='%23202224' stroke='%23151618' stroke-width='6'/>\
<circle cx='100' cy='100' r='80' fill='none' stroke='%233d4044' stroke-width='2.5'/>\
<circle cx='100' cy='100' r='40' fill='%230d0e10' stroke='%233d4044' stroke-width='4'/>\
<g fill='none' stroke='%23303336' stroke-width='9'>\
<path d='M100 42 V158 M42 100 H158'/></g>\
<circle cx='100' cy='100' r='14' fill='%23202224' stroke='%234a4d52' stroke-width='3'/>\
</svg>") no-repeat center / contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}

/* ---------- narrow screens: fall back to a single centred column ---------- */

@media (max-width: 900px) {
  .title {
    position: static;
    width: auto;
    margin: 0 auto clamp(14px, 3vh, 28px);
  }
  .menu {
    position: static;
    width: min(420px, 90vw);
    margin: 0 auto;
    gap: clamp(12px, 2.6vh, 26px);
  }
  .shell { display: flex; flex-direction: column; justify-content: center; }
  .chrome { position: static; margin-top: clamp(12px, 2.4vh, 22px); }
  .rack__chain { display: none; }
  .stage__cog { display: none; }
}
