/* ============================================================
   MENU — main menu screen: big tile buttons, Netflix-style.
   Two primary tiles (Singleplayer/Multiplayer) up top, three
   secondary tiles below (Inventory, Shop, and Trade).
   ============================================================ */

#screen-menu {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: clamp(12px, 3vh, 24px);
  overflow: hidden;
  background: radial-gradient(circle at center, #21170f 0%, #090705 100%);
}

#screen-menu::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
  z-index: 0;
  pointer-events: none;
}

#screen-auth {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: clamp(12px, 3vh, 24px);
  overflow: hidden;
  background: radial-gradient(circle at center, #21170f 0%, #090705 100%);
}

.enter-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: clamp(12px, 3vh, 24px);
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(circle at center, #21170f 0%, #090705 100%);
}

.enter-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  text-align: center;
}

.enter-panel .mystic-logo {
  width: 150px;
  height: 150px;
}

.enter-prompt {
  margin: 18px 0 0;
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: rune-pulse 2.8s ease-in-out infinite;
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  text-align: center;
}

.auth-panel .mystic-logo {
  width: 116px;
  height: 116px;
}

.auth-status {
  min-height: 48px;
  margin: 12px auto 22px;
  color: var(--cream-dim);
  font-size: 15px;
  line-height: 1.5;
}

.auth-login {
  justify-content: center;
  min-width: 220px;
}

.auth-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
  color: rgba(225, 215, 193, 0.42);
  font-size: 12px;
}

.auth-legal-link {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(225, 215, 193, 0.32);
  text-underline-offset: 3px;
}

.auth-legal-link:hover,
.auth-legal-link:focus-visible {
  color: var(--gold);
  text-decoration-color: currentColor;
}

/* ---- Smooth ambient glow (multi-layer to avoid banding/pixelation) ---- */

.menu-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Square container so circle gradients are truly circular */
  width: 1400px;
  height: 1400px;
  transform: translate(-50%, -50%);
  /* Two stacked passes per blob: tight core + wide soft halo */
  background:
    radial-gradient(circle 280px at 38% 42%, rgba(79, 195, 232, 0.20) 0%, transparent 100%),
    radial-gradient(circle 480px at 38% 42%, rgba(79, 195, 232, 0.08) 0%, transparent 100%),
    radial-gradient(circle 240px at 63% 58%, rgba(232, 179, 79, 0.18) 0%, transparent 100%),
    radial-gradient(circle 420px at 63% 58%, rgba(232, 179, 79, 0.07) 0%, transparent 100%),
    radial-gradient(circle 180px at 50% 50%, rgba(160, 80, 220, 0.09) 0%, transparent 100%),
    radial-gradient(circle 360px at 50% 50%, rgba(160, 80, 220, 0.04) 0%, transparent 100%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

/* ---- Magical Firefly Particles ---- */

.fireflies {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.firefly {
  position: absolute;
  bottom: -15px;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  filter: drop-shadow(0 0 5px var(--gold));
  opacity: 0;
  animation: firefly-fly 14s infinite ease-in-out, firefly-flicker 3s infinite ease-in-out;
}

/* Original 12 */
.firefly:nth-child(1)  { left:  5%; width: 4px; height: 4px; animation-delay:  0.0s,  0.0s; animation-duration: 14s, 3.0s; }
.firefly:nth-child(2)  { left: 12%; width: 3px; height: 3px; animation-delay:  2.0s,  1.0s; animation-duration: 18s, 2.5s; }
.firefly:nth-child(3)  { left: 22%; width: 5px; height: 5px; animation-delay:  4.0s,  0.5s; animation-duration: 12s, 3.5s; }
.firefly:nth-child(4)  { left: 32%; width: 3px; height: 3px; animation-delay:  1.0s,  2.0s; animation-duration: 15s, 4.0s; }
.firefly:nth-child(5)  { left: 44%; width: 4px; height: 4px; animation-delay:  5.0s,  1.5s; animation-duration: 16s, 3.0s; }
.firefly:nth-child(6)  { left: 56%; width: 3px; height: 3px; animation-delay:  3.0s,  0.0s; animation-duration: 20s, 2.8s; }
.firefly:nth-child(7)  { left: 65%; width: 4px; height: 4px; animation-delay:  7.0s,  2.5s; animation-duration: 13s, 3.2s; }
.firefly:nth-child(8)  { left: 74%; width: 5px; height: 5px; animation-delay:  9.0s,  1.0s; animation-duration: 17s, 4.5s; }
.firefly:nth-child(9)  { left: 82%; width: 3px; height: 3px; animation-delay:  6.0s,  3.0s; animation-duration: 19s, 2.2s; }
.firefly:nth-child(10) { left: 89%; width: 4px; height: 4px; animation-delay:  8.0s,  0.8s; animation-duration: 15s, 3.8s; }
.firefly:nth-child(11) { left: 95%; width: 3px; height: 3px; animation-delay: 11.0s,  2.2s; animation-duration: 14s, 3.1s; }
.firefly:nth-child(12) { left: 50%; width: 4px; height: 4px; animation-delay: 10.0s,  1.7s; animation-duration: 16s, 2.9s; }
/* Extended 12 (varied horizontals and slightly warmer blue tone for some) */
.firefly:nth-child(13) { left:  8%; width: 3px; height: 3px; background: var(--mana); filter: drop-shadow(0 0 5px var(--mana)); animation-delay:  1.5s,  0.3s; animation-duration: 22s, 2.7s; }
.firefly:nth-child(14) { left: 18%; width: 4px; height: 4px; animation-delay: 13.0s,  1.2s; animation-duration: 11s, 3.6s; }
.firefly:nth-child(15) { left: 28%; width: 3px; height: 3px; background: var(--mana); filter: drop-shadow(0 0 5px var(--mana)); animation-delay:  3.5s,  2.8s; animation-duration: 17s, 4.2s; }
.firefly:nth-child(16) { left: 38%; width: 5px; height: 5px; animation-delay:  6.5s,  0.6s; animation-duration: 13s, 3.9s; }
.firefly:nth-child(17) { left: 47%; width: 3px; height: 3px; animation-delay:  9.5s,  1.9s; animation-duration: 21s, 2.4s; }
.firefly:nth-child(18) { left: 58%; width: 4px; height: 4px; background: var(--mana); filter: drop-shadow(0 0 5px var(--mana)); animation-delay:  0.5s,  3.2s; animation-duration: 14s, 3.3s; }
.firefly:nth-child(19) { left: 68%; width: 3px; height: 3px; animation-delay: 12.0s,  0.9s; animation-duration: 18s, 2.6s; }
.firefly:nth-child(20) { left: 77%; width: 4px; height: 4px; animation-delay:  4.5s,  2.1s; animation-duration: 15s, 4.1s; }
.firefly:nth-child(21) { left: 85%; width: 3px; height: 3px; background: var(--mana); filter: drop-shadow(0 0 5px var(--mana)); animation-delay:  7.5s,  1.4s; animation-duration: 12s, 3.7s; }
.firefly:nth-child(22) { left: 92%; width: 5px; height: 5px; animation-delay:  2.5s,  0.2s; animation-duration: 19s, 2.3s; }
.firefly:nth-child(23) { left: 35%; width: 3px; height: 3px; animation-delay: 14.0s,  2.6s; animation-duration: 16s, 3.4s; }
.firefly:nth-child(24) { left: 62%; width: 4px; height: 4px; background: var(--mana); filter: drop-shadow(0 0 5px var(--mana)); animation-delay:  5.5s,  1.1s; animation-duration: 23s, 2.8s; }

@keyframes firefly-fly {
  0% {
    bottom: -15px;
    transform: translateX(0);
  }
  25% { transform: translateX(22px); }
  50% { transform: translateX(-18px); }
  75% { transform: translateX(30px); }
  100% {
    bottom: 115%;
    transform: translateX(-12px);
  }
}

@keyframes firefly-flicker {
  0%, 100% { opacity: 0; }
  30%, 70%  { opacity: 0.9; }
  50%       { opacity: 0.2; }
}

.menu-wrap {
  position: relative;
  z-index: 1;
  width: min(94vw, 980px);
  text-align: center;
}

/* ---- Account widget (Discord login / profile), top-right corner ---- */

.account-widget {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
}

.menu-options {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 3;
}

.menu-options-trigger,
.menu-option-button {
  min-height: 36px;
  border-radius: 8px;
  border-color: rgba(232, 179, 79, 0.28);
  background: rgba(25, 20, 35, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cream);
  font-size: 12px;
}

.menu-options-panel {
  display: grid;
  gap: 8px;
  width: 178px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(232, 179, 79, 0.22);
  border-radius: 10px;
  background: rgba(12, 8, 18, 0.84);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.menu-option-button {
  width: 100%;
  justify-content: center;
}

.menu-option-config {
  display: grid;
  gap: 4px;
}

.menu-version {
  color: var(--cream-dim);
  font-size: 10px;
  letter-spacing: 0.35px;
  text-align: center;
}

.audio-config-panel {
  position: absolute;
  top: 78px;
  left: 24px;
  z-index: 4;
  width: min(280px, calc(100% - 48px));
  padding: 14px;
  border: 1px solid rgba(232, 179, 79, 0.24);
  border-radius: 10px;
  background: rgba(12, 8, 18, 0.9);
  color: var(--cream);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.audio-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.audio-config-header h2 {
  margin: 0;
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 16px;
}

.audio-config-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  cursor: pointer;
}

.volume-control {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
}

.volume-control input {
  width: 100%;
  accent-color: var(--gold);
}

.volume-control strong {
  color: var(--gold);
  font-size: 12px;
  text-align: right;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88, 101, 242, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.btn-discord:hover {
  background: rgba(88, 101, 242, 1);
  transform: translateY(-2px);
}
.btn-discord svg { width: 18px; height: 18px; }

.account-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(25, 20, 35, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 6px 14px 6px 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.account-name {
  font-size: 13px;
  color: var(--cream);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.account-gold {
  font-size: 12px;
  color: var(--gold);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 10px;
}

@media (max-width: 640px) {
  .menu-options { top: 10px; left: 10px; }
  .account-widget { top: 10px; right: 10px; }
  .menu-options-trigger { min-height: 32px; padding: 7px 10px; font-size: 11px; }
  .menu-options-panel { width: 156px; }
  .audio-config-panel {
    top: 58px;
    left: 10px;
    width: min(260px, calc(100% - 20px));
  }
  .btn-discord { font-size: 11px; padding: 7px 12px; }
  .btn-discord svg { width: 15px; height: 15px; }
  .account-name { font-size: 11px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.menu-brand {
  font-size: 56px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 25px rgba(232, 179, 79, 0.4);
  margin-bottom: 8px;
  background: linear-gradient(to bottom, #ffffff, #ffd98f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.brand-sub {
  font-size: 18px;
  color: var(--cream-dim);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.changelog-button {
  margin: 2px 0 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  cursor: pointer;
  font: 500 12px/1.2 "Inter", sans-serif;
  letter-spacing: 0.4px;
  text-decoration: underline;
  text-decoration-color: rgba(232, 179, 79, 0.35);
  text-underline-offset: 3px;
}

.menu-info-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.changelog-button:hover,
.changelog-button:focus-visible {
  color: var(--gold);
  text-decoration-color: currentColor;
  outline: none;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 40px;
}

.menu-grid-secondary {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.menu-tile {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(25, 20, 35, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 16px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.menu-tile::after {
  content: "";
  position: absolute;
  top: 0; left: -150%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
  transform: skewX(-25deg);
  transition: left 0.6s ease;
}

.menu-tile-primary {
  aspect-ratio: 16 / 10;
}

.menu-tile-primary:hover::after,
.menu-tile-primary:focus-visible::after,
.menu-tile-secondary-active:hover::after,
.menu-tile-secondary-active:focus-visible::after {
  left: 150%;
}

.menu-tile-primary:hover,
.menu-tile-primary:focus-visible {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--gold);
  background: rgba(35, 30, 50, 0.75);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--gold), 0 0 30px rgba(232, 179, 79, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  outline: none;
}

.menu-tile-icon {
  width: 52px;
  height: 52px;
  color: var(--gold);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.menu-tile-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.menu-tile-primary:hover .menu-tile-icon,
.menu-tile-primary:focus-visible .menu-tile-icon {
  transform: scale(1.15) translateY(-2px);
  filter: drop-shadow(0 4px 12px rgba(232, 179, 79, 0.4));
}

.menu-tile-label {
  font-family: "Cinzel", serif;
  font-size: 20px;
  letter-spacing: 0.5px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.menu-tile-sub {
  font-size: 13px;
  color: var(--cream-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.menu-tile-gold {
  margin-top: -4px;
  padding: 3px 8px;
  border: 1px solid rgba(232, 179, 79, 0.38);
  border-radius: 999px;
  background: rgba(8, 6, 15, 0.42);
  color: var(--gold);
  font-size: 11px;
  line-height: 1.2;
}

.menu-tile-gold-complete {
  color: var(--cream-dim);
  border-color: rgba(168, 159, 192, 0.28);
}

/* ---- Locked / secondary tiles ---- */

.menu-tile-locked {
  aspect-ratio: 16 / 9;
  background: rgba(15, 12, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.menu-tile-locked .menu-tile-icon {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.3);
  filter: none;
}
.menu-tile-locked .menu-tile-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: none;
}
.menu-tile-locked:hover {
  transform: none;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* ---- Secondary tile that's already unlocked (e.g. Inventory) ---- */

.menu-tile-secondary-active {
  aspect-ratio: 16 / 9;
}
.menu-tile-secondary-active .menu-tile-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
}
.menu-tile-secondary-active .menu-tile-label {
  font-size: 16px;
}
.menu-tile-secondary-active:hover,
.menu-tile-secondary-active:focus-visible {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--gold);
  background: rgba(35, 30, 50, 0.75);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  outline: none;
}
.menu-tile-secondary-active:hover .menu-tile-icon {
  transform: scale(1.1) translateY(-1px);
}

.menu-tile-support {
  border-color: rgba(255, 200, 162, 0.58);
  background: linear-gradient(135deg, #ff6f3d 0%, #ff5e2b 50%, #ff7d45 100%);
  box-shadow: 0 10px 26px rgba(255, 94, 43, 0.22), inset 0 1px 0 rgba(255, 240, 226, 0.42);
}

.menu-tile-support .menu-tile-icon { color: #6b351d; }

.menu-tile-support .menu-tile-label { color: #fffaf4; }

.menu-tile-support .menu-tile-sub { color: rgba(255, 250, 244, 0.84); }

.menu-tile-support:hover,
.menu-tile-support:focus-visible {
  border-color: #fff2e7;
  background: linear-gradient(135deg, #ff7d45 0%, #ff5e2b 50%, #ff8f5d 100%);
  box-shadow: 0 16px 32px rgba(255, 94, 43, 0.38), 0 0 0 1px rgba(255, 239, 227, 0.56), inset 0 1px 0 rgba(255, 250, 244, 0.5);
}

.changelog-card {
  width: min(90vw, 480px);
  padding: 26px 28px;
  text-align: left;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(232, 179, 79, 0.08);
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.changelog-header h2 { margin-bottom: 0; }

.changelog-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  cursor: pointer;
}

.changelog-placeholder {
  margin: 20px 0 0;
  color: var(--cream-dim);
  font-size: 14px;
  line-height: 1.5;
}

.changelog-entry {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(232, 179, 79, 0.2);
}

.changelog-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.changelog-entry-meta h3 {
  margin: 0;
  color: var(--cream);
  font-family: "Cinzel", serif;
  font-size: 17px;
}

.changelog-entry-meta span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.changelog-entry-intro {
  margin: 12px 0;
  color: var(--cream-dim);
  font-size: 14px;
}

.changelog-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--cream-dim);
  font-size: 13px;
  line-height: 1.45;
}

.changelog-list li::marker { color: var(--gold); }

.how-to-play-card {
  width: min(92vw, 670px);
  max-height: min(82vh, 760px);
  padding: 26px 28px;
  text-align: left;
}

.how-to-play-content {
  display: grid;
  gap: 18px;
  max-height: min(66vh, 610px);
  margin-top: 20px;
  padding-right: 7px;
  overflow-y: auto;
  color: var(--cream-dim);
  font-size: 13px;
  line-height: 1.55;
}

.how-to-play-content section {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(232, 179, 79, 0.17);
}

.how-to-play-content section:last-child { border-bottom: 0; padding-bottom: 0; }
.how-to-play-content h3 {
  margin: 0 0 7px;
  color: var(--cream);
  font-family: "Cinzel", serif;
  font-size: 16px;
}
.how-to-play-content p { margin: 0; }
.how-to-play-content ul { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 19px; }
.how-to-play-content li::marker { color: var(--gold); }

.how-to-legend { display: grid; gap: 8px; margin-top: 10px; }
.how-to-legend > div { display: flex; align-items: center; gap: 9px; }
.how-to-token,
.how-to-badge {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 700;
}
.how-to-mana { background: radial-gradient(circle at 35% 30%, var(--mana), var(--mana-dim)); color: #061217; }
.how-to-attack { background: rgba(232, 179, 79, 0.2); border: 1px solid var(--gold); color: var(--gold); }
.how-to-health { background: rgba(214, 69, 69, 0.2); border: 1px solid var(--hp); color: var(--hp); }
.how-to-badge { border: 1px solid var(--line); color: var(--cream); background: rgba(8, 6, 15, 0.55); }
.how-to-taunt { color: var(--taunt); border-color: rgba(127, 176, 105, 0.7); }
.how-to-taunt svg { width: 16px; height: 16px; }
.how-to-charge { color: var(--gold); border-color: rgba(232, 179, 79, 0.7); }
.how-to-shield { color: var(--mana); border-color: rgba(79, 195, 232, 0.7); }
.how-to-note { margin-top: 10px !important; font-size: 12px; }

.legal-card {
  display: flex;
  width: min(92vw, 680px);
  max-height: min(78vh, 720px);
  padding: 24px 28px;
  flex-direction: column;
  text-align: left;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(232, 179, 79, 0.08);
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.legal-header h2 { margin-bottom: 0; }

.legal-content {
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
  color: var(--cream-dim);
  font-size: 14px;
  line-height: 1.55;
  scrollbar-color: rgba(232, 179, 79, 0.55) transparent;
}

.legal-content h3 {
  margin: 20px 0 6px;
  color: var(--cream);
  font-family: "Cinzel", serif;
  font-size: 15px;
}

.legal-content h3:first-of-type { margin-top: 12px; }

.legal-content p { margin: 0 0 10px; }

.legal-content strong { color: var(--gold); }

.legal-updated {
  color: rgba(225, 215, 193, 0.52);
  font-size: 12px;
}

.card-request-card {
  position: relative;
  width: min(92vw, 430px);
  padding: 28px;
  text-align: left;
}

.card-request-card h2 {
  margin: 0 36px 10px 0;
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 22px;
}

.card-request-card p {
  margin: 0 0 18px;
  color: var(--cream-dim);
  font-size: 13px;
  line-height: 1.5;
}

.card-request-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--cream);
  font-size: 12px;
}

.card-request-card .text-input {
  box-sizing: border-box;
  margin-bottom: 10px;
}

.card-request-status {
  min-height: 20px;
  color: var(--taunt) !important;
}

.card-request-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.menu-tile-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  font-weight: 600;
}
.menu-tile-lock svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .menu-brand { font-size: 38px; }
  .brand-sub { font-size: 14px; }
  .menu-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }

  .legal-card {
    width: min(94vw, 680px);
    max-height: min(82vh, 720px);
    padding: 20px;
  }
  .how-to-play-card { width: min(94vw, 670px); max-height: min(86vh, 760px); padding: 20px; }
  .how-to-play-content { max-height: min(70vh, 620px); margin-top: 16px; }
  .card-request-card { width: min(94vw, 430px); padding: 22px; }
  .menu-grid-secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }
  .menu-tile-primary { aspect-ratio: 16 / 8; padding: 24px 12px; }
  .menu-tile-icon { width: 40px; height: 40px; }
  .menu-tile-secondary-active {
    aspect-ratio: auto;
    min-height: 74px;
    gap: 6px;
    padding: 10px 4px 9px;
    border-radius: 8px;
  }
  .menu-tile-secondary-active .menu-tile-icon {
    width: clamp(24px, 7vw, 30px);
    height: clamp(24px, 7vw, 30px);
    flex: 0 0 auto;
  }
  .menu-tile-secondary-active .menu-tile-label {
    max-width: 100%;
    font-size: clamp(11px, 3.25vw, 13px);
    line-height: 1.05;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .menu-tile-support .menu-tile-label { font-size: clamp(9px, 2.65vw, 11px); }
  .menu-tile-secondary-active .menu-tile-sub {
    display: none;
  }
  .menu-tile-locked { padding: 16px 8px; }
  .menu-tile-locked .menu-tile-sub { display: none; }
  .menu-tile-label { font-size: 18px; }
  .menu-tile-locked .menu-tile-label { font-size: 14px; }
  .mystic-logo { width: 110px; height: 110px; }
  .logo-container { margin-bottom: 8px; }
}

@media (max-width: 380px) {
  .menu-grid-secondary { gap: 4px; }
  .menu-tile-secondary-active {
    min-height: 68px;
    padding-inline: 3px;
  }
  .menu-tile-secondary-active .menu-tile-icon {
    width: 23px;
    height: 23px;
  }
}

/* ---- Mystic Arcana TCG Logo ---- */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.mystic-logo {
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.logo-stone {
  fill: rgba(26, 19, 12, 0.92);
  stroke: rgba(128, 94, 45, 0.58);
  stroke-width: 2;
}

.logo-ring {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
}
.logo-ring-outer {
  stroke-width: 1.25;
  stroke-dasharray: 7 6 2 6;
  opacity: 0.76;
}
.logo-ring-inner {
  stroke-width: 1;
  stroke-dasharray: 2 5;
  opacity: 0.54;
}
.logo-runes {
  fill: none;
  stroke: #b98b45;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}
.logo-card {
  fill: rgba(11, 8, 6, 0.72);
  stroke: #caa05a;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.logo-glyph {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-ring-outer {
  transform-origin: center;
  animation: rune-turn 46s linear infinite;
}

.logo-glyph {
  transform-origin: center;
  animation: rune-pulse 3.8s ease-in-out infinite;
}

@keyframes rune-turn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rune-pulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}
