:root {
  /* —— Design system Arena Minerilor —— */
  --ink: #f4efe4;
  --dim: #c8bfae;
  --muted: #9a8f7e;
  --bg: #1b140e;
  --panel: rgba(18, 12, 8, 0.92);
  --panel-solid: #16100c;
  --gold: #f2c14e;
  --gold-soft: #ffe08a;
  --line: #6b5340;
  --line-dark: #3a2a1c;
  --brown: #2c2118;
  --brown-hover: #3a2c20;
  --green: #3f7d32;
  --green-border: #b6e38a;
  --danger: #a33;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 28px;
  --radius: 0;
  --shadow-panel: 0 0 0 4px #c4a574, 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-btn: 0 3px 0 #1a120c;
  --panel-max: 860px;
  --panel-pad: 22px 22px 16px;
  --btn-h: 44px;
  --font-title: "Pixelify Sans", "Nunito", system-ui, sans-serif;
  --font-mc: var(--font-title);
  --font-pixel: "Silkscreen", "Pixelify Sans", "Nunito", system-ui, sans-serif;
  --font-ui: "Nunito", system-ui, "Segoe UI", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 28px;
  --ease-screen: 180ms ease;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #87c6ef;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-ui);
  color: var(--ink);
  letter-spacing: normal;
  font-size: 15px;
  line-height: 1.45;
  text-transform: none;
  touch-action: manipulation;
}
body.playing {
  touch-action: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
.help-touch { display: none; }
.lock-touch { display: none; }
body.touch-ui .help-desktop,
body.touch-ui .keycaps-desktop,
body.touch-ui .controls-panel { display: none; }
body.touch-ui .help-touch { display: block; }
body.touch-ui .lock-desktop { display: none; }
body.touch-ui .lock-touch { display: inline; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hurt {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, transparent 40%, rgba(160, 20, 20, 0.0) 75%);
  opacity: 0; transition: opacity 0.25s linear;
}
#toast {
  position: fixed; top: 16%; left: 50%; transform: translateX(-50%);
  font-size: 15px; line-height: 1.45; color: var(--gold); text-shadow: 0 3px 0 #3a2508;
  pointer-events: none; opacity: 0; transition: opacity 0.3s;
  text-align: center; max-width: min(90vw, 560px); z-index: 8;
  font-family: var(--font-ui); font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
#toast.kill {
  color: #fff;
  text-shadow: 0 2px 0 #5a1010, 0 0 18px rgba(255, 60, 60, 0.55);
}
#alert-banner {
  position: fixed; top: 28%; left: 50%; transform: translateX(-50%);
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
  z-index: 9; text-align: center; max-width: min(92vw, 640px);
  padding: 12px 18px;
  background: rgba(120, 10, 10, 0.82);
  border: 3px solid #ff3b3b;
  box-shadow: 0 0 24px rgba(255, 40, 40, 0.45);
  color: #ffe66d;
  font-size: 12px; font-weight: 700; line-height: 1.4;
  font-family: var(--font-mc);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#alert-banner.on { opacity: 1; animation: alertPulse 0.45s ease-in-out 3; }
@keyframes alertPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.04); }
}

#menu, #lobby, #result, #ranks, #faq, #character, #shop {
  position: fixed; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(ellipse 58% 72% at 50% 46%, rgba(18, 12, 8, 0.55) 0%, rgba(18, 12, 8, 0.35) 100%),
    linear-gradient(180deg, #4fa4d8 0%, #79c7f5 42%, #8b5a32 42%, #6b4224 100%);
  padding: 24px;
  z-index: 5;
}
/* Classic Minecraft options / pause-menu dirt tile (darkened) */
#ranks, #faq, #shop, #character {
  overflow: hidden;
  background: #1a120c;
}
.mc-dirt-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
  background-color: #1a120c;
  background-image:
    linear-gradient(rgba(10, 8, 6, 0.72), rgba(10, 8, 6, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%236b4423'/%3E%3Crect x='0' y='0' width='16' height='16' fill='%237a5230'/%3E%3Crect x='16' y='16' width='16' height='16' fill='%237a5230'/%3E%3Crect x='16' y='0' width='16' height='16' fill='%235c3a1e'/%3E%3Crect x='0' y='16' width='16' height='16' fill='%235c3a1e'/%3E%3Crect x='2' y='3' width='3' height='2' fill='%238a6238'/%3E%3Crect x='9' y='8' width='2' height='3' fill='%234a2e16'/%3E%3Crect x='20' y='4' width='4' height='2' fill='%238a6238'/%3E%3Crect x='24' y='11' width='3' height='2' fill='%234a2e16'/%3E%3Crect x='4' y='20' width='3' height='2' fill='%238a6238'/%3E%3Crect x='11' y='26' width='2' height='3' fill='%234a2e16'/%3E%3Crect x='22' y='19' width='3' height='2' fill='%238a6238'/%3E%3Crect x='27' y='25' width='2' height='3' fill='%234a2e16'/%3E%3Cpath d='M0 0h32v1H0zm0 15h32v2H0zm0 16h32v1H0zM0 0v32h1V0zm15 0v32h2V0zm16 0v32h1V0z' fill='%23000000' fill-opacity='.22'/%3E%3C/svg%3E");
  background-size: auto, 64px 64px;
  background-repeat: no-repeat, repeat;
}
#menu, #lobby, #result {
  background: transparent;
  overflow: hidden;
}
.hidden { display: none !important; }

/* —— Minecraft-style start-menu backdrop —— */
.mc-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  image-rendering: pixelated;
  transition: transform 180ms ease-out;
  will-change: transform;
}
.mc-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #c8ecff 0%, transparent 55%),
    linear-gradient(180deg, #4fa4d8 0%, #79c7f5 38%, #a8dcfa 72%, #cfe9fb 100%);
}
.mc-sun {
  position: absolute;
  top: 10%;
  right: 14%;
  width: clamp(48px, 7vw, 72px);
  height: clamp(48px, 7vw, 72px);
  background: #ffe566;
  box-shadow:
    0 0 0 6px rgba(255, 229, 102, 0.28),
    0 0 36px rgba(255, 210, 70, 0.45);
  animation: mcSunPulse 6s ease-in-out infinite;
}
@keyframes mcSunPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.mc-cloud {
  position: absolute;
  background: #f4fbff;
  box-shadow:
    18px 8px 0 #f4fbff,
    36px 4px 0 #f4fbff,
    10px -8px 0 #f4fbff,
    28px -6px 0 #e8f4fa;
  opacity: 0.92;
  border-radius: 0;
}
.mc-cloud-a {
  top: 14%;
  left: -8%;
  width: 54px;
  height: 22px;
  animation: mcDrift 56s linear infinite;
}
.mc-cloud-b {
  top: 22%;
  left: 30%;
  width: 70px;
  height: 26px;
  opacity: 0.85;
  animation: mcDrift 72s linear infinite reverse;
}
.mc-cloud-c {
  top: 11%;
  left: 62%;
  width: 48px;
  height: 20px;
  animation: mcDrift 64s linear infinite;
}
@keyframes mcDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(32vw, 0, 0); }
}
.mc-hills {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 34%;
  height: 26%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.mc-hills-far {
  bottom: 36%;
  height: 30%;
  opacity: 0.9;
  background:
    linear-gradient(#7a8694, #7a8694) 4% 100% / 10% 55% no-repeat,
    linear-gradient(#6e7a88, #6e7a88) 12% 100% / 12% 78% no-repeat,
    linear-gradient(#7a8694, #7a8694) 22% 100% / 9% 48% no-repeat,
    linear-gradient(#657180, #657180) 30% 100% / 14% 92% no-repeat,
    linear-gradient(#7a8694, #7a8694) 42% 100% / 11% 62% no-repeat,
    linear-gradient(#6e7a88, #6e7a88) 52% 100% / 13% 85% no-repeat,
    linear-gradient(#7a8694, #7a8694) 64% 100% / 10% 50% no-repeat,
    linear-gradient(#657180, #657180) 72% 100% / 15% 95% no-repeat,
    linear-gradient(#6e7a88, #6e7a88) 86% 100% / 12% 70% no-repeat,
    linear-gradient(#7a8694, #7a8694) 96% 100% / 10% 58% no-repeat;
  filter: brightness(0.92);
  animation: mcParallaxFar 28s ease-in-out infinite alternate;
}
.mc-hills-mid {
  bottom: 34%;
  height: 22%;
  background:
    linear-gradient(#8a9199, #8a9199) 0 100% / 8% 40% no-repeat,
    linear-gradient(#7d858e, #7d858e) 7% 100% / 10% 70% no-repeat,
    linear-gradient(#8a9199, #8a9199) 16% 100% / 9% 52% no-repeat,
    linear-gradient(#6f777f, #6f777f) 24% 100% / 12% 88% no-repeat,
    linear-gradient(#8a9199, #8a9199) 35% 100% / 8% 45% no-repeat,
    linear-gradient(#7d858e, #7d858e) 42% 100% / 11% 75% no-repeat,
    linear-gradient(#8a9199, #8a9199) 52% 100% / 9% 55% no-repeat,
    linear-gradient(#6f777f, #6f777f) 60% 100% / 13% 90% no-repeat,
    linear-gradient(#7d858e, #7d858e) 72% 100% / 10% 60% no-repeat,
    linear-gradient(#8a9199, #8a9199) 81% 100% / 12% 80% no-repeat,
    linear-gradient(#6f777f, #6f777f) 92% 100% / 10% 50% no-repeat;
  animation: mcParallaxMid 22s ease-in-out infinite alternate;
}
@keyframes mcParallaxFar {
  from { transform: translateX(-1.5%); }
  to { transform: translateX(1.5%); }
}
@keyframes mcParallaxMid {
  from { transform: translateX(-2.5%); }
  to { transform: translateX(2.5%); }
}
.mc-terrain {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 1vw;
  gap: 0;
  z-index: 1;
}
.mc-col {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  height: var(--h, 55%);
  margin: 0 -1px;
  background:
    linear-gradient(#5d9c37, #5d9c37) 0 0 / 100% 14px no-repeat,
    linear-gradient(#4a8a2c, #4a8a2c) 0 14px / 100% 6px no-repeat,
    repeating-linear-gradient(
      90deg,
      #8b5a32 0 50%,
      #7a4e2a 50% 100%
    ),
    #8b5a32;
  background-size: 100% 14px, 100% 6px, 28px 28px, auto;
  background-position: 0 0, 0 14px, 0 20px, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
  box-shadow:
    inset 0 20px 0 rgba(0, 0, 0, 0.06),
    inset -3px 0 0 rgba(0, 0, 0, 0.12),
    inset 3px 0 0 rgba(255, 255, 255, 0.06);
  position: relative;
}
.mc-col::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background:
    repeating-linear-gradient(
      90deg,
      #7d7d7d 0 50%,
      #6a6a6a 50% 100%
    );
  background-size: 28px 28px;
  opacity: 0.92;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.18);
}
.mc-col.c1 { --h: 48%; }
.mc-col.c2 { --h: 62%; }
.mc-col.c3 { --h: 72%; }
.mc-col.c4 { --h: 58%; }
.mc-col.c5 { --h: 80%; }
.mc-col.c6 { --h: 68%; }
.mc-col.c7 { --h: 54%; }
.mc-col.c8 { --h: 76%; }
.mc-col.c9 { --h: 64%; }
.mc-col.c10 { --h: 88%; }
.mc-col.c11 { --h: 60%; }
.mc-col.c12 { --h: 50%; }
.mc-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10%;
  z-index: 2;
  background:
    repeating-linear-gradient(
      90deg,
      #6b4224 0 32px,
      #5c381c 32px 64px
    ),
    #5c381c;
  box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.25);
}
.mc-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(ellipse 58% 72% at 50% 46%, rgba(18, 12, 8, 0.62) 0%, rgba(18, 12, 8, 0.28) 52%, rgba(18, 12, 8, 0.42) 100%),
    linear-gradient(180deg, rgba(20, 14, 10, 0.12) 0%, rgba(20, 14, 10, 0.55) 100%);
}
@media (max-width: 560px) {
  .mc-hills-far { height: 24%; bottom: 38%; }
  .mc-hills-mid { height: 18%; bottom: 36%; }
  .mc-terrain { height: 38%; }
  .mc-col::after { height: 32%; }
  .mc-cloud-c { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-sun,
  .mc-cloud,
  .mc-hills-far,
  .mc-hills-mid { animation: none; }
}

/* —— Arena waiting / result backdrop (dusk play vibe) —— */
.mc-bg-arena .mc-sky {
  background:
    radial-gradient(ellipse 90% 55% at 78% -5%, #5a3a78 0%, transparent 48%),
    radial-gradient(ellipse 70% 40% at 20% 10%, #3a4a7a 0%, transparent 50%),
    linear-gradient(180deg, #1e2a4a 0%, #3d4f7a 28%, #8a5a48 58%, #6b4224 78%, #4a2e18 100%);
}
.mc-bg-arena .mc-moon {
  top: 12%;
  right: 16%;
  background: #e8eef8;
  box-shadow:
    0 0 0 5px rgba(220, 230, 245, 0.22),
    0 0 28px rgba(180, 200, 255, 0.35);
  animation: mcSunPulse 8s ease-in-out infinite;
}
.mc-bg-arena .mc-cloud {
  background: #d8c8c0;
  box-shadow:
    18px 8px 0 #d8c8c0,
    36px 4px 0 #c8b4a8,
    10px -8px 0 #d0bcb0,
    28px -6px 0 #b8a090;
  opacity: 0.78;
}
.mc-bg-arena .mc-hills-far {
  filter: brightness(0.72) saturate(0.85);
}
.mc-bg-arena .mc-hills-mid {
  filter: brightness(0.8) saturate(0.9);
}
.mc-bg-arena .mc-col {
  background:
    linear-gradient(#4a7a2c, #4a7a2c) 0 0 / 100% 14px no-repeat,
    linear-gradient(#3a6a22, #3a6a22) 0 14px / 100% 6px no-repeat,
    repeating-linear-gradient(
      90deg,
      #7a4e2a 0 50%,
      #6b4224 50% 100%
    ),
    #6b4224;
  background-size: 100% 14px, 100% 6px, 28px 28px, auto;
  background-position: 0 0, 0 14px, 0 20px, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
}
.mc-bg-arena .mc-shade {
  background:
    radial-gradient(ellipse 52% 68% at 50% 48%, rgba(12, 8, 6, 0.72) 0%, rgba(12, 8, 6, 0.38) 55%, rgba(12, 8, 6, 0.58) 100%),
    linear-gradient(180deg, rgba(10, 8, 16, 0.28) 0%, rgba(18, 10, 6, 0.62) 100%);
}
.mc-bg-arena .mc-particles {
  opacity: 0.45;
  background-image:
    radial-gradient(circle 1px at 18% 28%, #ffe9a8 0, transparent 2px),
    radial-gradient(circle 1px at 72% 18%, #fff 0, transparent 2px),
    radial-gradient(circle 1px at 42% 55%, #ffe9a8 0, transparent 2px),
    radial-gradient(circle 1px at 88% 48%, #fff 0, transparent 2px),
    radial-gradient(circle 1.5px at 55% 35%, #ffd070 0, transparent 2.5px);
}

.panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-width: var(--panel-max);
  background: var(--panel);
  border: 4px solid var(--line-dark);
  box-shadow: var(--shadow-panel);
  padding: var(--panel-pad);
}
.panel-screen,
.panel.wide,
.panel-home,
.shop-panel,
.faq-panel,
.ranks-panel {
  width: min(var(--panel-max), 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.char-panel {
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}
.eyebrow {
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--gold);
  font-size: var(--fs-sm);
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.35;
}
h1, h2 {
  margin: 0 0 10px;
  font-size: var(--fs-xl);
  line-height: 1.25;
  text-shadow: 0 3px 0 #3a2508;
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
}
h2 { font-size: var(--fs-lg); }
.lead, .help, .net {
  color: var(--dim);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}
.help { padding-left: 18px; font-size: 13px; line-height: 1.55; }
.help b { color: white; font-family: var(--font-ui); }

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  margin: 16px 0 4px;
  font-family: var(--font-ui);
  text-transform: none;
}
input, select {
  font: inherit;
  font-family: var(--font-ui);
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
  padding: 10px 12px;
  border: 3px solid var(--line);
  background: #2a1d14;
  color: white;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  font-size: 13px;
  font-family: var(--font-ui);
  text-transform: none;
}
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }

/* —— Button system —— */
.btn,
.seg-btn,
.seg button,
.actions button,
#begin, #leave, #again, #solo, #online,
#close-ranks, #close-faq, #shop-back, #char-save, #char-reset, #char-back,
#rematch, #result-ranks {
  font-family: var(--font-pixel);
  font-weight: 700;
  cursor: pointer;
  border: 3px solid #4d3826;
  background: var(--brown);
  color: var(--ink);
  min-height: var(--btn-h);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-btn);
  transition: transform 80ms ease, box-shadow 80ms ease, filter 80ms ease, background 120ms ease;
}
.btn:hover, .seg-btn:hover, .seg button:hover,
.actions button:hover, #begin:hover, #leave:hover {
  filter: brightness(1.08);
  background: var(--brown-hover);
}
.btn:active, .seg-btn:active, .seg button:active,
.actions button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1a120c;
}
.btn:focus-visible, .seg-btn:focus-visible, .nav-tab:focus-visible,
.seg button:focus-visible, .shop-card:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}
.btn-primary, .primary {
  background: var(--green) !important;
  border-color: var(--green-border) !important;
  color: #fff !important;
  flex: 1;
}
.btn-secondary {
  background: #6a4a18 !important;
  border-color: var(--gold) !important;
  color: #fff !important;
  flex: 1;
}
.btn-ghost, .ghost {
  background: transparent !important;
  border-color: #5c4634 !important;
  color: var(--ink) !important;
  flex: 1;
}
.btn-danger { background: var(--danger) !important; border-color: #f88 !important; color: #fff !important; }
.btn-play { font-size: var(--fs-lg) !important; min-height: 52px; flex: 1.4 !important; }
.btn-icon { flex: 0 0 auto !important; min-width: var(--btn-h); padding-left: 10px; padding-right: 10px; }
.btn-tiny { min-height: 32px; font-size: var(--fs-xs); padding: 6px 10px; }
.seg-btn.on, .seg button.on {
  background: #5a3d14;
  border-color: var(--gold);
  color: #fff;
  box-shadow: none;
}
.seg-compact .seg-btn, .seg-compact button {
  min-height: 34px;
  min-width: 48px;
  padding: 6px 10px;
  font-size: var(--fs-xs);
  border-width: 2px;
  box-shadow: none;
}
.seg-compact .seg-btn.on { background: #4a7a38; border-color: #8fd06a; }
.seg-toggle .seg-btn { min-height: 40px; flex: 1; }

#slots, #board, #final-board { list-style: none; padding: 0; margin: 12px 0; }
#slots li, #final-board li, #board li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px; background: rgba(255,255,255,.04);
  border-left: 6px solid var(--c, #888); font-family: var(--font-ui); font-size: 13px; line-height: 1.4;
}
#board li span { flex: 1; min-width: 0; }
#board .mine-stat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #ddd; margin-right: 4px;
}
#board .mine-stat i {
  width: 12px; height: 12px; display: inline-block;
  border: 1px solid rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
#board {
  position: fixed; top: 16px; right: 16px; width: min(280px, 46vw); margin: 0;
  text-shadow: 0 2px 0 #000;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: normal;
}
#board li { background: rgba(0,0,0,.45); }
#board .score-row.leader {
  box-shadow: 0 0 14px rgba(255, 210, 61, 0.55), inset 0 0 0 1px rgba(255, 210, 61, 0.35);
  background: rgba(40, 28, 8, 0.72);
}
#board .score-num {
  display: inline-block;
  transform-origin: right center;
  transition: transform 0.08s ease-out;
  color: #fff6c8;
}
#board .crown {
  display: inline-block;
  color: #ffd23d;
  margin-right: 4px;
  text-shadow: 0 0 8px rgba(255, 210, 61, 0.75);
}
#board .score-row.aura {
  box-shadow: 0 0 16px rgba(180, 70, 255, 0.55), inset 0 0 0 1px rgba(200, 120, 255, 0.45);
  background: rgba(50, 12, 70, 0.72);
}
#board .aura-mark {
  display: inline-block;
  color: #d080ff;
  margin-right: 5px;
  font-size: 10px;
  text-shadow: 0 0 10px rgba(180, 80, 255, 0.95), 0 0 4px #b44dff;
  animation: auraPulse 0.9s ease-in-out infinite;
}
#board .pname.has-aura {
  color: #f0d0ff;
  text-shadow:
    0 0 8px rgba(180, 80, 255, 0.95),
    0 0 14px rgba(140, 40, 220, 0.75),
    0 2px 0 #000;
}
@keyframes auraPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.vis-quality { margin-top: 4px; }
.vis-quality .seg button { min-width: 52px; font-size: 12px; }
.voice-row { margin-top: 8px; margin-bottom: 12px; }
.hud-mic {
  position: fixed;
  bottom: 88px;
  right: 16px;
  z-index: 8;
  font-family: var(--font-mc);
  font-size: 10px;
  letter-spacing: 0.02em;
  border: 3px solid #4d3826;
  background: #2c2118;
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
  text-transform: none;
}
.hud-mic.on {
  background: #6a4a18;
  border-color: var(--gold);
  color: white;
}
.hud-mic.hidden { display: none !important; }

#timer {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); border: 3px solid #3a2a1c; padding: 8px 16px;
  font-size: 16px; min-width: 110px; text-align: center; font-family: var(--font-mc);
}
#combo-hud {
  position: fixed; top: 58px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; z-index: 6; min-width: 110px;
}
#combo-hud.hidden { display: none !important; }
#combo-mult {
  font-size: 18px; font-weight: 700; color: #ffe66d; font-family: var(--font-mc);
  text-shadow: 0 2px 0 #3a2508, 0 0 12px rgba(242, 193, 78, 0.55);
  letter-spacing: 0.04em;
}
#combo-mult.hot { color: #ff8a3d; transform: scale(1.08); }
#combo-bar {
  width: 120px; height: 8px; background: rgba(0,0,0,.55);
  border: 2px solid #5c4634; overflow: hidden;
}
#combo-bar-fill {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #f2c14e, #ff8a3d);
  transform-origin: left center;
  transform: scaleX(1);
}
#float-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 7; overflow: hidden;
}
.float-score {
  position: absolute; transform: translate(-50%, 0);
  font: 700 14px var(--font-mc);
  color: #fff6a8;
  text-shadow: 0 2px 0 #3a2508, 0 0 10px rgba(255, 200, 60, 0.5);
  white-space: nowrap;
}
#cross {
  position: fixed; left: 50%; top: 50%; width: 16px; height: 16px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#fff, #fff) center/2px 16px no-repeat,
    linear-gradient(#fff, #fff) center/16px 2px no-repeat;
  filter: drop-shadow(0 0 1px #000);
}
#target-name, #status-line, #lock-hint {
  position: fixed; left: 50%; transform: translateX(-50%);
  text-shadow: 0 2px 0 #000; pointer-events: none;
  font-family: var(--font-ui);
  letter-spacing: normal;
  text-transform: none;
}
#target-name { bottom: 118px; font-size: 13px; line-height: 1.4; }
#status-line { bottom: 96px; color: #ffd0d0; font-size: 13px; }
#lock-hint {
  top: 50%; margin-top: 28px; background: rgba(0,0,0,.55); padding: 6px 10px; font-size: 13px; line-height: 1.4;
}

#hotbar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.slot {
  width: 86px; height: 74px; background: rgba(20,14,10,.72);
  border: 3px solid #5c4634; position: relative; text-align: center;
}
.slot.on { border-color: #fff2c2; box-shadow: 0 0 0 2px #f2c14e; }
.slot.locked { opacity: 0.38; filter: grayscale(0.85); }
.slot.locked::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(0,0,0,.28) 6px, rgba(0,0,0,.28) 8px);
  pointer-events: none;
}
.slot span { position: absolute; left: 4px; top: 2px; font-size: 11px; font-family: var(--font-ui); }
.slot em {
  position: absolute; left: 0; right: 0; bottom: 4px;
  font-style: normal; font-size: 11px; font-family: var(--font-ui);
  line-height: 1.2; letter-spacing: normal; text-transform: none;
}
.slot b { position: absolute; right: 4px; top: 2px; color: var(--gold); font-size: 12px; font-family: var(--font-ui); }
.ico { display: block; width: 30px; height: 30px; margin: 14px auto 0; background: #ddd; position: relative; }
.ico.pick {
  background:
    linear-gradient(#8a5a2b, #8a5a2b) 13px 8px / 5px 20px no-repeat,
    linear-gradient(#c5cad0, #c5cad0) 4px 6px / 22px 6px no-repeat,
    linear-gradient(#3a4048, #3a4048) 2px 5px / 5px 8px no-repeat,
    linear-gradient(#3a4048, #3a4048) 23px 5px / 5px 8px no-repeat;
}
.ico.pistol {
  background:
    linear-gradient(#1a1c1f, #1a1c1f) 4px 10px / 20px 8px no-repeat,
    linear-gradient(#b7bcc4, #b7bcc4) 6px 6px / 18px 5px no-repeat,
    linear-gradient(#e2b340, #e2b340) 8px 17px / 6px 10px no-repeat;
}
.ico.bomb { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f2c14e, #222 60%); }
#rank-list.rank-list { max-height: none; flex: 1; overflow: auto; }
#rank-meta { margin: 8px 0 4px; font-size: 13px; font-family: var(--font-ui); }
.faq-scroll {
  margin: 0 0 14px;
  padding: 2px 4px 4px 0;
  max-height: min(62vh, 560px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.faq-intro {
  margin: 6px 0 4px;
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-ui);
  letter-spacing: normal;
  text-transform: none;
}
.faq-section { margin: 0; }
.faq-heading {
  margin: 0 0 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-transform: none;
  font-family: var(--font-mc);
  color: #ffe08a;
  background:
    linear-gradient(90deg, rgba(106, 74, 24, 0.65), rgba(42, 29, 20, 0.35));
  border: 2px solid #5c4634;
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.18), 0 2px 0 #1a120c;
  text-shadow: 0 2px 0 #2a1a08;
}
.faq-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #3a2a1a;
  background: rgba(20, 14, 10, 0.55);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.12);
}
.faq-item dt {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--font-mc);
  font-size: 12px;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0.02em;
}
.faq-item dd {
  margin: 0;
  color: var(--dim);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}
.faq-item dd b { color: #fff; }

/* Blocuri din arenă — fancy dirt-panel cards */
.faq-blocks-note {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  font-family: var(--font-ui);
  letter-spacing: normal;
  text-transform: none;
}
.faq-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.faq-block {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 10px;
  border: 3px solid #4d3826;
  background:
    linear-gradient(180deg, rgba(60, 42, 28, 0.55), rgba(18, 12, 8, 0.72)),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0,0,0,.06) 7px, rgba(0,0,0,.06) 8px);
  box-shadow:
    inset 0 0 0 1px rgba(242, 193, 78, 0.14),
    0 3px 0 #1a120c;
}
.faq-block-swatch {
  width: 40px;
  height: 40px;
  border: 3px solid #2a1d14;
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.22),
    inset -2px -2px 0 rgba(0,0,0,.35),
    0 0 0 1px rgba(0,0,0,.4);
  image-rendering: pixelated;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18) 0 45%, transparent 45%),
    var(--swatch, #888);
}
.faq-block-swatch.danger {
  box-shadow:
    inset 2px 2px 0 rgba(255,120,120,.25),
    inset -2px -2px 0 rgba(0,0,0,.4),
    0 0 10px rgba(214, 59, 59, 0.35);
}
.faq-block-swatch.rare {
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.28),
    inset -2px -2px 0 rgba(0,0,0,.35),
    0 0 12px rgba(168, 240, 255, 0.35);
}
.faq-block-body { min-width: 0; }
.faq-block-body strong {
  display: block;
  margin: 0 0 4px;
  color: #fff;
  font-family: var(--font-mc);
  font-size: 12px;
  line-height: 1.4;
  text-shadow: 0 2px 0 #1a120c;
  text-transform: none;
}
.faq-block-body span {
  display: block;
  color: var(--dim);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}
.faq-block-body span b { color: var(--gold); }
.faq-block-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  font-family: var(--font-mc);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe08a;
  border: 1px solid #6a4a18;
  background: rgba(106, 74, 24, 0.45);
}
@media (max-width: 560px) {
  .faq-blocks { grid-template-columns: 1fr; }
}
.round-meta {
  margin: 4px 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #d8c4a0;
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: normal;
}
.round-meta b { color: var(--gold); }
.menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 0 0 12px;
}
/* legacy linkish removed — use .nav-tab */

/* —— Character customize —— */
.char-panel { width: min(720px, 100%); }
.char-lead { margin: 0 0 14px; font-size: 14px; font-family: var(--font-ui); text-transform: none; }
.char-lead b { color: white; }
.char-layout {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 18px;
  align-items: stretch;
}
.char-preview-wrap {
  position: relative;
  width: 100%;
  min-width: 200px;
  background:
    linear-gradient(180deg, rgba(90, 160, 210, 0.35), rgba(42, 29, 20, 0.55)),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0,0,0,.08) 7px, rgba(0,0,0,.08) 8px);
  border: 3px solid #4d3826;
  box-shadow: inset 0 0 0 2px #2a1d14;
  min-height: 320px;
  height: 320px;
}
#char-preview {
  display: block;
  width: 100%;
  height: 320px;
  min-height: 320px;
}
.meta-info-line {
  font-size: 13px !important;
  margin: 4px 0 8px !important;
}
.char-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.char-label {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mc);
  color: var(--gold);
}
.char-skins {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.char-skin-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  max-width: 96px;
  padding: 8px 6px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid #4d3826;
  box-shadow: inset 0 0 0 1px #2a1d14;
  color: var(--dim);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.char-skin-chip:hover { border-color: #c4a06a; }
.char-skin-chip.on {
  border-color: #f2c14e;
  box-shadow: 0 0 0 1px #f2c14e, inset 0 0 0 1px #2a1d14;
  color: #f2e6c8;
}
.char-skin-face-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border: 2px solid #6b5340;
  box-shadow: inset 0 0 0 1px #2a1d14;
  overflow: hidden;
  background: #2a1d14;
  image-rendering: pixelated;
}
.char-skin-face {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0;
  position: relative;
  z-index: 1;
}
.char-skin-face.ready {
  opacity: 1;
}
.char-skin-chip .char-skin-face-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  box-shadow: none;
}
.char-skin-chip .shop-thumb-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid #6b5340;
  box-shadow: inset 0 0 0 1px #2a1d14;
}
.char-skin-chip-name {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.char-skin-note {
  margin: 0;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--dim);
  line-height: 1.35;
}
#char-customize {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
#char-customize.hidden,
.char-skin-note.hidden,
#char-reset.hidden {
  display: none !important;
}
.char-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 4px;
}
.char-colors label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--dim);
  background: rgba(255,255,255,.04);
  border: 2px solid #4d3826;
  padding: 6px 8px;
}
.char-colors input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 2px solid #6b5340;
  background: #2a1d14;
  cursor: pointer;
}
.char-actions { margin-top: auto; }
#char-hair-styles { flex-wrap: wrap; }
@media (max-width: 640px) {
  .char-layout { grid-template-columns: 1fr; }
  .char-preview-wrap { min-height: 240px; height: 240px; }
  #char-preview { min-height: 240px; height: 240px; }
}

#hp-wrap {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
#hp {
  width: 180px; height: 16px;
  background: #3a1515; border: 3px solid #2a0d0d;
  box-shadow:
    0 0 10px rgba(255, 70, 70, 0.55),
    0 0 22px rgba(220, 40, 40, 0.4),
    inset 0 0 6px rgba(255, 120, 120, 0.25);
}
#hp i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(180deg, #ff8a8a, #ff4d4d 45%, #c0392b);
  box-shadow: 0 0 12px rgba(255, 90, 90, 0.85), inset 0 1px 0 rgba(255, 220, 220, 0.35);
}

#final-board { font-size: 16px; }
.net { min-height: 1.2em; color: #ffb4b4; }

#kill-feed {
  position: fixed; top: 70px; left: 16px; width: min(280px, 42vw);
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none; z-index: 6; font-family: var(--font-ui);
}
#kill-feed .kf {
  background: rgba(0,0,0,.55); border-left: 4px solid #ff6b6b;
  padding: 5px 8px; font-size: 12px; line-height: 1.4; color: #fff;
  text-shadow: 0 1px 0 #000;
  letter-spacing: normal;
  text-transform: none;
}
#kill-feed .kf.revenge { border-color: #f2c14e; color: #ffe66d; }

#announcer {
  position: fixed; top: 36%; left: 50%; transform: translate(-50%, -50%);
  font-size: 18px; font-weight: 700; line-height: 1.35; color: #ffe66d;
  font-family: var(--font-mc);
  text-shadow: 0 3px 0 #5a2010, 0 0 24px rgba(255,80,40,.55);
  opacity: 0; pointer-events: none; z-index: 10;
  transition: opacity 0.2s; text-align: center; letter-spacing: 0.06em;
}
#announcer.on { opacity: 1; animation: announcePop 0.5s ease; }
@keyframes announcePop {
  0% { transform: translate(-50%, -50%) scale(0.7); }
  60% { transform: translate(-50%, -50%) scale(1.08); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

#gold-rush-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(circle at center, transparent 35%, rgba(160, 20, 20, 0.45) 100%);
  animation: rushPulse 1.1s ease-in-out infinite;
}
#gold-rush-vignette.hidden { display: none !important; }
@keyframes rushPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

/* First-person purple aura: glow around you, not a floor ring */
#aura-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, transparent 0%, transparent 42%, rgba(140, 40, 220, 0.22) 68%, rgba(90, 10, 160, 0.55) 100%),
    radial-gradient(circle at 50% 100%, rgba(160, 60, 255, 0.2), transparent 45%);
  mix-blend-mode: screen;
  animation: auraVignettePulse 1.4s ease-in-out infinite;
}
#aura-vignette.hidden { display: none !important; }
#aura-vignette::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 80px 24px rgba(160, 50, 255, 0.35);
  pointer-events: none;
}
@keyframes auraVignettePulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

#powerup-hud {
  /* Sit above #hp-wrap (lives row + HP bar), not overlapping hearts */
  position: fixed; left: 16px; bottom: 78px; display: flex; flex-direction: column; gap: 4px;
  pointer-events: none; z-index: 6; font-family: var(--font-mc);
}
#powerup-hud .pu {
  background: rgba(0,0,0,.55); border: 2px solid #f2c14e; color: #ffe6a0;
  padding: 4px 8px; font-size: 12px; line-height: 1.35; min-width: 140px;
  font-family: var(--font-ui);
  letter-spacing: normal;
  text-transform: none;
}
#powerup-hud .pu.aura {
  border-color: #c070ff;
  color: #e8c0ff;
  background: rgba(60, 10, 90, 0.65);
  box-shadow: 0 0 12px rgba(160, 60, 255, 0.45);
}

#board .marked { outline: 1px solid rgba(255, 210, 61, 0.5); }

#result {
  overflow: hidden;
}
#result-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
#result .panel {
  z-index: 3;
}
.panel-result {
  position: relative;
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}
.victory-showcase {
  margin: 4px 0 10px;
  text-align: center;
}
.victory-showcase.hidden { display: none !important; }
.victory-congrats {
  margin: 0 0 10px;
  font-family: var(--font-mc);
  font-size: clamp(18px, 3.2vw, 26px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-soft);
  text-shadow:
    0 2px 0 #3a2508,
    0 0 20px rgba(242, 193, 78, 0.45);
  animation: victoryCongratsIn 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
@keyframes victoryCongratsIn {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.victory-stage {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px;
  align-items: center;
  text-align: left;
}
.victory-preview.char-preview-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  height: 220px;
  border: 3px solid #f2c14e;
  box-shadow:
    inset 0 0 0 2px #2a1d14,
    0 0 0 1px rgba(242, 193, 78, 0.35),
    0 0 28px rgba(242, 193, 78, 0.28);
  overflow: hidden;
  animation: victoryStageIn 0.85s ease both;
}
@keyframes victoryStageIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}
.victory-preview #result-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: transparent;
}
.victory-glow {
  pointer-events: none;
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 70%, rgba(242, 193, 78, 0.35), transparent 55%);
  animation: victoryGlowPulse 2.2s ease-in-out infinite;
}
@keyframes victoryGlowPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.victory-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: victoryCongratsIn 0.75s 0.08s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
.victory-copy #winner {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 32px);
  line-height: 1.15;
}
.victory-score {
  margin: 4px 0 0;
  font-family: var(--font-mc);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.04em;
  color: var(--gold-soft);
  text-shadow:
    0 3px 0 #3a2508,
    0 0 22px rgba(242, 193, 78, 0.5);
  line-height: 1;
}
.victory-score-unit {
  font-size: 0.45em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: middle;
}
#victory-score-val {
  display: inline-block;
  animation: victoryScorePop 0.9s cubic-bezier(0.22, 1.35, 0.36, 1) 0.15s both;
}
@keyframes victoryScorePop {
  from { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
.victory-sub {
  margin: 2px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.winner-plain {
  margin: 0 0 8px;
  text-align: center;
}
.winner-plain.hidden { display: none !important; }
@media (max-width: 560px) {
  .victory-stage {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .victory-preview.char-preview-wrap {
    max-width: 200px;
    margin: 0 auto;
    min-height: 200px;
    height: 200px;
  }
  .victory-copy { align-items: center; }
}
#champion-badge {
  /* Anchored inside .panel-result so text stays fully within the gold chenar */
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  z-index: 5;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 28px);
  box-sizing: border-box;
  font-family: var(--font-mc);
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold-soft);
  text-shadow:
    0 3px 0 #3a2508,
    0 0 18px rgba(242, 193, 78, 0.55);
  padding: 8px 18px;
  border: 3px solid #c4a574;
  background: linear-gradient(180deg, rgba(60, 42, 22, 0.92), rgba(28, 18, 10, 0.94));
  box-shadow: 0 4px 0 #1a120c, 0 0 28px rgba(242, 193, 78, 0.25);
  opacity: 0;
}
#champion-badge.hidden {
  display: none;
}
#champion-badge.show {
  display: block;
  opacity: 1;
  animation: champPop 2.8s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
#champion-badge.tie {
  color: #d8f0c4;
  border-color: #7a9a5a;
  text-shadow: 0 3px 0 #1e2e12, 0 0 16px rgba(63, 125, 50, 0.45);
}
@keyframes champPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.55) translateY(8px); }
  12% { opacity: 1; transform: translateX(-50%) scale(1.06) translateY(0); }
  22% { transform: translateX(-50%) scale(0.98); }
  70% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.03) translateY(-6px); }
}

#winner.celebrate {
  color: var(--gold-soft);
  text-shadow:
    0 2px 0 #3a2508,
    0 0 14px rgba(242, 193, 78, 0.65),
    0 0 28px rgba(63, 125, 50, 0.35);
  animation: winnerGlow 1.1s ease-in-out 3;
}
#winner.celebrate-tie {
  color: #e8f5d8;
  text-shadow:
    0 2px 0 #1e2e12,
    0 0 12px rgba(182, 227, 138, 0.45);
  animation: winnerGlow 1.1s ease-in-out 2;
}
@keyframes winnerGlow {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.18); transform: scale(1.03); }
}

#podium {
  display: flex; justify-content: center; align-items: flex-end; gap: 10px;
  margin: 12px 0 8px; min-height: 110px;
}
#podium .step {
  box-sizing: border-box;
  width: 96px; min-height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; padding: 8px 6px 8px;
  background: rgba(255,255,255,.06); border: 2px solid #5c4634;
  font-family: var(--font-ui); font-size: 12px; line-height: 1.35;
  letter-spacing: normal; text-transform: none;
  overflow: hidden; word-break: break-word; overflow-wrap: anywhere;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#podium .step span { opacity: 0.85; font-size: 11px; }
#podium .step div {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#podium .step.p1 { min-height: 100px; border-color: #f2c14e; }
#podium .step.p2 { min-height: 84px; }
#podium .step.p3 { min-height: 72px; }
#podium .step b {
  display: block; color: var(--gold); margin-top: auto; padding-top: 4px;
  font-size: 13px; line-height: 1.2;
}
#podium .step.p1.celebrate {
  overflow: visible;
  z-index: 1;
  border-color: var(--gold-soft);
  background: linear-gradient(180deg, rgba(242, 193, 78, 0.22), rgba(255,255,255,0.06));
  box-shadow:
    0 0 0 2px rgba(242, 193, 78, 0.35),
    0 0 22px rgba(242, 193, 78, 0.35);
  animation: podiumChamp 0.9s ease-in-out 4;
}
#podium .step.p1.celebrate::before {
  content: "♛";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 2px 0 #3a2508, 0 0 10px rgba(242, 193, 78, 0.7);
  animation: crownBob 0.7s ease-in-out 5;
  pointer-events: none;
}
#podium .step.celebrate-tie {
  border-color: #8fbf6a;
  box-shadow: 0 0 14px rgba(63, 125, 50, 0.35);
  animation: podiumChamp 1s ease-in-out 2;
}
@keyframes podiumChamp {
  0%, 100% { transform: scale(1) translateY(0); }
  40% { transform: scale(1.08) translateY(-6px); }
  70% { transform: scale(1.02) translateY(-2px); }
}
@keyframes crownBob {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-4deg); }
  50% { transform: translateX(-50%) translateY(-4px) rotate(4deg); }
}
#final-board li.celebrate-tie {
  color: var(--gold-soft);
  text-shadow: 0 0 10px rgba(182, 227, 138, 0.35);
}
.match-stats {
  font-family: var(--font-ui); font-size: 13px; color: var(--dim);
  margin: 8px 0; line-height: 1.5;
  letter-spacing: normal; text-transform: none;
}
#rematch.btn-play { flex: 1.4 !important; }

.meta-unlocks {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.meta-unlocks .field { margin-bottom: 8px; }
.meta-unlocks select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: #1a120c;
  color: var(--ink);
  border: 2px solid var(--line);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
}

/* —— Shop skins (same centered panel rhythm as Personaj) —— */
.shop-panel { width: min(720px, 100%); }
.shop-test-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  background: #3a2814;
  border: 1px solid #f2c14e;
  color: #ffe08a;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}
.shop-test-badge.hidden { display: none; }
.shop-layout {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 18px;
  align-items: stretch;
}
.shop-preview-wrap {
  position: relative;
  align-self: stretch;
  min-height: min(70vh, 520px);
  height: min(70vh, 520px);
  background:
    linear-gradient(180deg, rgba(90, 160, 210, 0.35), rgba(42, 29, 20, 0.55)),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0,0,0,.08) 7px, rgba(0,0,0,.08) 8px);
  border: 3px solid #4d3826;
  box-shadow: inset 0 0 0 2px #2a1d14;
}
#shop-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
}
.shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  overflow: visible;
  align-content: start;
}
.shop-card {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px;
  background: #1a120c;
  border: 3px solid #5c4634;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.shop-card:hover { border-color: #c4a06a; }
.shop-card.on { border-color: #f2c14e; box-shadow: 0 0 0 1px #f2c14e; }
.shop-card.locked { opacity: 0.45; cursor: not-allowed; }
.shop-thumb {
  width: 64px; height: 64px; flex: 0 0 64px;
  background: #2a1d14;
  border: 2px solid #4d3826;
  display: grid; place-items: center;
  image-rendering: pixelated;
  overflow: hidden;
}
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.shop-thumb-fallback { font-size: 22px; }
.shop-thumb-swatch {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated;
}
.shop-thumb-swatch.thumb-miner {
  background:
    linear-gradient(#e0b090, #e0b090) 18px 8px / 28px 22px no-repeat,
    linear-gradient(#3d6e9a, #3d6e9a) 16px 28px / 32px 28px no-repeat,
    #2a1d14;
}
.shop-thumb-swatch.thumb-brute {
  background:
    linear-gradient(#f2c14e, #f2c14e) 8px 36px / 14px 10px no-repeat,
    linear-gradient(#e8b896, #e8b896) 18px 6px / 30px 26px no-repeat,
    linear-gradient(#1a1a1e, #1a1a1e) 16px 30px / 34px 30px no-repeat,
    #2a1d14;
}
.shop-thumb-swatch.thumb-kitty {
  background:
    linear-gradient(#ff8fb8, #ff8fb8) 14px 4px / 10px 10px no-repeat,
    linear-gradient(#ff8fb8, #ff8fb8) 40px 4px / 10px 10px no-repeat,
    linear-gradient(#ffe6f0, #ffe6f0) 18px 10px / 28px 24px no-repeat,
    linear-gradient(#f7a8c8, #f7a8c8) 16px 32px / 32px 26px no-repeat,
    #2a1d14;
}
.shop-thumb-swatch.thumb-boldly,
.shop-thumb-swatch.thumb-fancy {
  background:
    linear-gradient(#39ff14, #39ff14) 26px 30px / 12px 14px no-repeat,
    linear-gradient(#3b2418, #3b2418) 18px 4px / 28px 14px no-repeat,
    linear-gradient(#e8b896, #e8b896) 20px 12px / 24px 16px no-repeat,
    linear-gradient(#0e0e12, #0e0e12) 16px 28px / 32px 28px no-repeat,
    #0a0a0e;
}
.shop-thumb-swatch.thumb-heart {
  display: grid;
  place-items: center;
  background: #2a1d14;
}
.shop-heart-svg {
  display: block;
  filter: drop-shadow(0 0 4px rgba(255, 90, 106, 0.55));
}
.shop-scroll {
  max-height: min(70vh, 520px);
  overflow: auto;
  padding-right: 4px;
}
.shop-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid #4d3826;
}
.shop-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.shop-section-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mc);
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.shop-section-title strong { color: #ff7a88; font-family: var(--font-ui); }
.shop-lives-hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
  letter-spacing: normal;
  text-transform: none;
}
.shop-thumb-swatch.thumb-pick-classic {
  background:
    linear-gradient(#d5dae0, #d5dae0) 18px 10px / 28px 10px no-repeat,
    linear-gradient(#8a5a2b, #8a5a2b) 28px 20px / 8px 32px no-repeat,
    #2a1d14;
}
.shop-thumb-swatch.thumb-pick-gold {
  background:
    linear-gradient(#f2c14e, #f2c14e) 18px 10px / 28px 10px no-repeat,
    linear-gradient(#6b4a22, #6b4a22) 28px 20px / 8px 32px no-repeat,
    #2a1d14;
}
.shop-thumb-swatch.thumb-pick-nether {
  background:
    linear-gradient(#c45a3a, #c45a3a) 18px 10px / 28px 10px no-repeat,
    linear-gradient(#3a1a18, #3a1a18) 28px 20px / 8px 32px no-repeat,
    #2a1d14;
}
.shop-thumb.shop-thumb-glow {
  box-shadow:
    0 0 10px var(--pick-glow, rgba(242, 193, 78, 0.75)),
    0 0 18px var(--pick-glow, rgba(242, 193, 78, 0.45)),
    inset 0 0 8px var(--pick-glow, rgba(242, 193, 78, 0.25));
  border-color: color-mix(in srgb, var(--pick-glow, #f2c14e) 70%, #4d3826);
}
.shop-thumb.shop-thumb-glow .thumb-pick-gold {
  filter: drop-shadow(0 0 5px rgba(242, 193, 78, 0.9));
}
.shop-thumb.shop-thumb-glow .thumb-pick-nether {
  filter: drop-shadow(0 0 5px rgba(196, 90, 58, 0.95));
}
.shop-thumb-swatch.thumb-fox,
.shop-thumb-swatch.thumb-sheep {
  display: grid;
  place-items: center;
  background: #2a1d14;
}
.shop-fox-svg,
.shop-sheep-svg {
  display: block;
  image-rendering: pixelated;
}
.shop-fox-svg {
  filter: drop-shadow(0 0 3px rgba(224, 122, 40, 0.45));
}
.shop-sheep-svg {
  filter: drop-shadow(0 0 3px rgba(242, 240, 234, 0.4));
}
#lives-hud {
  position: static;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  color: #ffb0b8;
  font-family: var(--font-mc);
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(255, 80, 100, 0.45);
  line-height: 1.2;
  max-width: 100%;
}
#lives-hud .lives-label {
  flex: 0 0 auto;
  position: static;
  color: #ffd0d6;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}
#lives-hud .lives-icons {
  flex: 0 0 auto;
  position: static;
  color: #ff5a6a;
  font-size: 13px;
  letter-spacing: 2px;
  filter: drop-shadow(0 0 4px rgba(255, 70, 90, 0.7));
  white-space: nowrap;
  margin: 0;
  padding: 0;
}
#lives-hud .lives-count {
  flex: 0 0 auto;
  min-width: 1.1em;
  color: #fff;
  background: rgba(80, 10, 18, 0.75);
  border: 1px solid #6a2028;
  padding: 1px 5px;
  line-height: 1.3;
}
.shop-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-card-body strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  font-family: var(--font-mc);
  text-transform: none;
}
.shop-card-body span {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  color: var(--dim);
}
.shop-card-body em {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--gold);
}
@media (max-width: 640px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-preview-wrap {
    min-height: 260px;
    height: 280px;
  }
}

/* ========== UI redesign add-ons ========== */
.screen-anim { animation: screenIn var(--ease-screen) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c4a574 #1a120c; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #1a120c; border: 1px solid #3a2a1c; }
*::-webkit-scrollbar-thumb { background: #8a6238; border: 2px solid #1a120c; }
*::-webkit-scrollbar-thumb:hover { background: #c4a574; }

.select-mc, select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 10px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px !important;
}

.panel-footer.sticky-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px solid #3a2a1c;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--panel-solid) 30%);
  z-index: 2;
}

/* Home */
.panel-home {
  gap: 8px;
  overflow: auto;
}
.home-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.home-brand { flex: 1; min-width: 0; }
.home-head-top h1 { margin: 0; }
.home-head-tools {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}
.home-gear {
  min-width: 32px !important;
  min-height: 32px !important;
  height: 32px;
  padding: 0 !important;
  font-size: 16px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.lang-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
  /* Reserve width for 7 locale buttons so head tools don't jump 38→302 on initI18n. */
  min-width: 264px;
  min-height: 32px;
}
.lang-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 6px;
  border: 2px solid #4d3826;
  background: #2a1d14;
  box-shadow: inset 0 0 0 1px #1a120c;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f2ebe0;
  line-height: 1;
  display: grid;
  place-items: center;
}
.lang-btn:hover { border-color: var(--gold-soft); }
.lang-btn.on {
  border-color: #fff;
  background: #3a2a1c;
  box-shadow: inset 0 0 0 1px #2a1d14, 0 0 0 1px rgba(255, 255, 255, 0.35);
  color: #fff;
}
.home-tag {
  font-size: 13px !important;
  margin: 4px 0 0 !important;
  color: #e0b56a !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-pixel) !important;
}
.home-lead-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(200px, 240px);
  gap: 14px;
  align-items: stretch;
}
.home-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-main > .name-field { margin: 0; }
.home-aside {
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 0;
}
.home-aside .mini-preview.char-preview-wrap,
.home-preview-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 260px;
  height: 280px;
  /* Fixed stage height — do not flex-grow into empty #home-rank (caused 333→276 jump on refresh). */
  flex: 0 0 auto;
  margin: 0;
  border: 3px solid #c4a574;
  box-shadow: inset 0 0 0 2px #2a1d14, 0 3px 0 #1a120c;
  overflow: hidden;
  background-color: #6a9bb8;
  background-image:
    linear-gradient(180deg, #8ec4e0 0%, #6a9bb8 42%, #3d5a48 78%, #2a1d14 100%),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0,0,0,.06) 7px, rgba(0,0,0,.06) 8px);
}
#menu-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  cursor: grab;
  background: transparent;
}
.home-preview-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  pointer-events: none;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 0 #1a120c, 0 0 6px rgba(0,0,0,.45);
}
.home-pet-label {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 8px;
  border: 2px solid #e89ab8;
  background: rgba(40, 18, 28, 0.82);
  color: #ffc0d8;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}
.home-pet-label.hidden { display: none; }
.home-pet-hit {
  position: absolute;
  right: 6%;
  bottom: 18%;
  width: 38%;
  height: 42%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.home-pet-hit.hidden { display: none; }
.home-pet-hit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Reserve card height so preview stage doesn't collapse then jump when rank HTML injects (~71px). */
.home-rank {
  min-height: 72px;
}
.home-rank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 2px solid #c4a574;
  background: rgba(18, 12, 8, 0.72);
  box-shadow: inset 0 0 0 1px #2a1d14;
}
.home-rank-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home-rank-meta strong {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe08a;
}
.home-rank-lp {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #e0b56a;
  text-transform: uppercase;
}
.home-rank-bar {
  height: 10px;
  background: #1a120c;
  border: 2px solid #5c4634;
  overflow: hidden;
}
.home-rank-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c49a2a, #f2c14e);
}
.rank-badge {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  position: relative;
  border: 2px solid #c4a574;
  background: #1a120c;
  box-shadow: inset 0 0 0 2px #3a2810, 0 2px 0 #1a120c;
  font-family: var(--font-pixel);
  color: #f2ebe0;
  overflow: hidden;
}
.rank-badge-sm { width: 28px; height: 28px; }
.rank-badge-lg { width: 52px; height: 52px; }
.rank-badge-svg {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}
.rank-badge-svg svg {
  width: 86%;
  height: 86%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.rank-badge-div {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
}
.rank-badge-shield { display: none; }
.rank-badge-label { display: none; }
.rank-badge.tier-placement,
.rank-badge.tier-unranked {
  background: linear-gradient(180deg, #6a6a72, #2e2e34);
  color: #e8e8f0;
  border-color: #8a8a96;
}
.ranked-result.is-placement-reveal .rank-badge {
  animation: rank-reveal-pop 0.85s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
.ranked-banner.ranked-reveal {
  animation: rank-reveal-msg 0.9s ease both;
  color: #ffe08a;
  text-shadow: 0 0 10px rgba(242, 193, 78, 0.45);
}
@keyframes rank-reveal-pop {
  0% { transform: scale(0.55); opacity: 0.35; filter: brightness(0.7); }
  55% { transform: scale(1.14); opacity: 1; filter: brightness(1.15); }
  100% { transform: scale(1); opacity: 1; filter: none; }
}
@keyframes rank-reveal-msg {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}
.rank-badge-glow-legend {
  box-shadow: inset 0 0 0 2px #3a2810, 0 0 8px rgba(255, 107, 61, 0.55), 0 2px 0 #1a120c;
}
.rank-badge-glow-mythic {
  box-shadow: inset 0 0 0 2px #3a2810, 0 0 10px rgba(255, 154, 31, 0.7), 0 0 16px rgba(230, 52, 98, 0.35), 0 2px 0 #1a120c;
  animation: mythic-glow 1.8s ease-in-out infinite;
}
@keyframes mythic-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
.rank-row.is-top1 .rank-pos { color: #f2c14e; }
.rank-row.is-top2 .rank-pos { color: #c0c8d0; }
.rank-row.is-top3 .rank-pos { color: #cd7f32; }
.ranked-banner.mythic {
  color: #ffd84a;
  text-shadow: 0 0 8px rgba(255, 154, 31, 0.6);
}
.ranked-delta {
  font-family: var(--font-pixel);
  font-size: 18px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.ranked-result.is-promo .ranked-delta.up {
  animation: lp-pop 0.55s ease;
}
@keyframes lp-pop {
  0% { transform: scale(0.7); opacity: 0.4; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.ranked-result-wrap {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 2px solid #c4a574;
  background: rgba(18, 12, 8, 0.78);
  box-shadow: inset 0 0 0 1px #2a1d14;
}
.ranked-result-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.ranked-result-place {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e0b56a;
}
.ranked-result-title {
  margin: 2px 0 0;
  font-family: var(--font-pixel);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe08a;
}
.ranked-delta.up { color: #7dff9a; }
.ranked-delta.down { color: #ff7d7d; }
.ranked-delta.flat { color: #c0c8d0; }
.ranked-banner {
  margin: 8px 0 0;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ranked-banner.promo { color: #7dff9a; }
.ranked-banner.demo { color: #ff9a7d; }
.ranked-banner.shield { color: #7ef0ff; }
.ranked-banner.placed { color: #f2c14e; }
.lobby-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.lobby-name .rank-badge {
  flex: 0 0 auto;
}
.lobby-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#board .name-cell .rank-badge,
#slots .rank-badge,
#final-board .rank-badge {
  width: 22px;
  height: 22px;
  border-width: 1px;
  margin-right: 4px;
  box-shadow: inset 0 0 0 1px #3a2810;
}
#board .name-cell .rank-badge-svg svg,
#slots .rank-badge-svg svg {
  width: 90%;
  height: 90%;
}
.rank-row .rank-badge {
  margin-right: 4px;
}

.home-level-card {
  padding: 8px 10px;
  border: 2px solid #c4a574;
  background: rgba(18, 12, 8, 0.72);
  box-shadow: inset 0 0 0 1px #2a1d14;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-level-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f2ebe0;
}
.home-level-label strong { color: #ffe08a; }
.home-level-xp { color: #c8bfae; font-size: 11px; }
.home-xp-bar {
  height: 12px;
  background: #1a120c;
  border: 2px solid #5c4634;
  overflow: hidden;
}
.home-xp-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3a7ab8, #6ec0f0);
}
.home-best-line {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e0b56a;
}
.mini-pb { margin: 0; font-size: 12px; color: #e0b56a; font-family: var(--font-pixel); }
.mini-pb-val {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 700;
  color: var(--gold-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.mini-pb-unit {
  font-size: 11px;
  font-weight: 700;
  color: #e0b56a;
}
.name-row { display: flex; gap: 8px; align-items: stretch; }
.name-row input#name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-pixel);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.avatar-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 3px solid #5c4634;
  background: #1e1610;
  box-shadow: inset 0 0 0 2px #2a1d14, 0 2px 0 #1a120c;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  align-self: center;
  image-rendering: pixelated;
  text-transform: none !important;
}
.avatar-btn:hover,
.avatar-btn:focus-visible {
  border-color: #8a6a48;
  outline: none;
  box-shadow: inset 0 0 0 2px #3a2818, 0 0 0 2px rgba(255, 210, 61, 0.35);
}
.avatar-btn:disabled { opacity: 0.55; cursor: default; }
.avatar-face {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
}
.avatar-img {
  display: none !important;
}
.avatar-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, #3a2a1c 0%, #2a1d14 50%, #1e1610 100%),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0,0,0,.12) 7px, rgba(0,0,0,.12) 8px);
}
.avatar-btn:not(.has-face) .avatar-placeholder { display: block; }
.avatar-btn.has-face .avatar-placeholder { display: none; }
#avatar-undo:disabled { opacity: 0.4; cursor: default; }
#board .pavatar,
#final-board .pavatar {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0,0,0,.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  object-fit: cover;
  flex: 0 0 auto;
  image-rendering: pixelated;
  vertical-align: middle;
  margin-right: 5px;
}
#board .name-cell {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.field-hint { font-size: 12px; color: var(--muted); }

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 8px 6px;
  border: 2px solid #5c4634;
  background: #241910;
  color: #f4efe4;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 0 #1a120c;
  text-decoration: none;
}
.nav-tab:hover { border-color: #c4a06a; background: #2e2218; }
.nav-tab.on { border-color: var(--gold); background: #3a2a14; color: #fff; }
.nav-ico { font-size: 13px; line-height: 1; }
.nav-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: #e04040;
  border: 2px solid #1a120c;
  box-shadow: 0 0 0 1px #802020;
}
.nav-dot[hidden] { display: none !important; }

.mode-card {
  border: 3px solid #c4a574;
  background: rgba(22, 16, 12, 0.88);
  box-shadow: inset 0 0 0 1px #2a1d14, 0 3px 0 #1a120c;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-card-solo { flex: 1 1 auto; }
.mode-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.mode-card-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 0 #1a120c;
}
.mode-card-meta {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8ae9c;
  white-space: nowrap;
}
.mode-diff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.mode-diff-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e8dfd0;
}
.mode-card .seg-compact .seg-btn {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 58px;
  color: #f2ebe0;
}
.mode-card .seg-compact .seg-btn.on {
  background: #55a64d;
  border-color: #b6e38a;
  color: #fff;
}
.mode-play-solo {
  width: 100% !important;
  flex: none !important;
  min-height: 58px !important;
  font-size: 22px !important;
  letter-spacing: 0.12em !important;
  box-shadow: 0 5px 0 #1f4a18, inset 0 1px 0 rgba(255,255,255,.18) !important;
}
.mode-play-solo:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #1f4a18, inset 0 1px 0 rgba(255,255,255,.18) !important;
}
.mode-card-online { padding: 12px 12px 10px; }
.mode-online-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.mode-online-row .mode-card-title {
  flex: 1;
  min-width: 0;
  padding-top: 10px;
}
.mode-online-cta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  max-width: 220px;
}
.mode-online-note {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #e0b56a;
  text-align: center;
}
.mode-play-online {
  flex: 0 0 auto !important;
  width: 100%;
  min-width: 148px;
  min-height: 46px !important;
  font-size: 13px !important;
  letter-spacing: 0.05em !important;
  white-space: nowrap;
}
.btn-ranked-hidden { display: none !important; }
.ranked-queue-status {
  margin: 6px 0 0;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #e0b56a;
}
.ranked-queue-status.hidden { display: none; }

.lobby-wait {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 3px solid #5a3d24;
  box-shadow: inset 0 0 0 2px #1a120c, 0 0 0 2px #2a1a10;
  background:
    linear-gradient(180deg, rgba(255, 140, 40, 0.12), rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0 2px,
      transparent 2px 4px
    ),
    #1c140e;
  text-align: center;
}
.lobby-wait.on { display: flex; }
.lobby-wait.is-ready {
  border-color: #3f7a2e;
  background:
    linear-gradient(180deg, rgba(80, 180, 60, 0.14), rgba(0, 0, 0, 0.35)),
    #141c10;
}
.lobby-wait-spin {
  width: 22px;
  height: 22px;
  border: 3px solid #4d3826;
  border-top-color: #ff9a2e;
  border-radius: 50%;
  animation: lobby-spin 0.85s linear infinite;
  image-rendering: pixelated;
}
.lobby-wait.is-ready .lobby-wait-spin {
  display: none;
}
@keyframes lobby-spin {
  to { transform: rotate(360deg); }
}
.lobby-wait-count {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #ffb04a;
  text-shadow: 0 2px 0 #000;
}
.lobby-wait.is-ready .lobby-wait-count { color: #8dff6a; }
.lobby-wait-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f2ebe0;
}
.lobby-wait-hint {
  margin: 0;
  max-width: 28rem;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #c9b79a;
}
#begin:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.online-warn,
.bot-diff-row,
.round-meta { display: none !important; }

.settings-panel {
  display: none;
  gap: 6px;
  flex-direction: column;
  padding: 8px 10px;
  border: 2px solid #4d3826;
  background: rgba(0,0,0,.35);
  margin-top: 8px;
}
.settings-panel.open { display: flex; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-family: var(--font-pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2ebe0;
}

.controls-panel {
  margin-top: 10px;
  border: 2px solid #4d3826;
  background: rgba(0, 0, 0, 0.28);
  padding: 0;
}
.controls-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8dfd0;
  user-select: none;
}
.controls-summary::-webkit-details-marker { display: none; }
.controls-summary::before {
  content: "▸ ";
  color: var(--gold);
}
.controls-panel[open] .controls-summary::before { content: "▾ "; }
.controls-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 4px 10px 10px;
  align-items: center;
}
.ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ctrl-label {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f2ebe0;
}
.keycaps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 28px;
  padding: 3px 7px;
  border: 2px solid #6b5340;
  background: #1a120c;
  box-shadow: 0 2px 0 #0d0906, inset 0 1px 0 rgba(255,255,255,.08);
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.keycap-wide { min-width: 56px; font-size: 11px; }
.help-line {
  margin: 8px 0 0;
  font-size: 13px;
  color: #c8bfae;
  font-family: var(--font-pixel);
  letter-spacing: 0.03em;
}

.mc-particles {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image:
    radial-gradient(circle 1px at 20% 30%, #fff 0, transparent 2px),
    radial-gradient(circle 1px at 70% 20%, #fff 0, transparent 2px),
    radial-gradient(circle 1px at 40% 60%, #fff 0, transparent 2px),
    radial-gradient(circle 1px at 85% 50%, #fff 0, transparent 2px);
  animation: mcDrift 80s linear infinite;
}

/* Character colors */
.color-card {
  background: rgba(255,255,255,.04);
  border: 2px solid #4d3826;
  padding: 8px;
  cursor: pointer;
}
.color-card:hover { border-color: #c4a06a; }
.color-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--dim);
}
.color-card-head input[type="color"] {
  width: 40px; height: 32px; padding: 0; border: 2px solid #6b5340; cursor: pointer;
}
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 28px; height: 28px; min-width: 28px; min-height: 28px;
  border: 2px solid #2a1d14;
  background: var(--sw);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.2);
  cursor: pointer;
  padding: 0;
}
.swatch.on { outline: 2px solid var(--gold); outline-offset: 1px; }
/* character preview uses classic striped backdrop above — do not override */
.xp-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0 8px;
}
.xp-level { font-family: var(--font-title); font-weight: 700; color: var(--gold); font-size: 13px; }
.xp-bar {
  height: 12px; background: #1a120c; border: 2px solid #5c4634; overflow: hidden;
}
.xp-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #f2c14e, #8fd06a); }
.xp-label { font-size: 11px; color: var(--dim); font-family: var(--font-ui); white-space: nowrap; }
.meta-pb-line { margin: 0 0 8px; font-size: 13px; font-family: var(--font-ui); color: var(--dim); }
.save-toast {
  margin: 6px 0 0; color: #8fd06a; font-family: var(--font-title); font-weight: 700; font-size: 13px;
}

/* Shop */
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shop-test-badge {
  border-style: dashed !important;
  pointer-events: none;
  user-select: none;
  font-size: 11px !important;
  align-self: flex-start;
}
.sticky-title {
  position: sticky; top: 0; z-index: 1;
  background: #16100c;
  padding: 8px 0 6px;
}
.shop-card {
  align-items: stretch;
}
.shop-card-body { flex: 1; }
.shop-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #5c4634;
  background: #241910;
}
.shop-badge.equipped { background: #2a4a22; border-color: #8fd06a; color: #c8f0b0; }
.shop-badge.owned { background: #3a2a14; border-color: #c4a06a; color: var(--gold-soft); }
.shop-badge.locked { background: #1a120c; color: var(--muted); }
.shop-badge.buy { background: #3f7d32; border-color: #b6e38a; color: #fff; }
.shop-actions { margin-top: 14px; }
.shop-preview-wrap {
  overflow: hidden;
}

/* Ranks */
.ranks-panel { min-height: min(70vh, 640px); }
.rank-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  flex: 1;
  overflow: auto;
  max-height: none;
}
.rank-row {
  display: grid;
  grid-template-columns: 40px 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,.04);
  border: 2px solid #3a2a1c;
  font-family: var(--font-ui);
  font-size: 14px;
}
.rank-pos { font-family: var(--font-title); font-weight: 700; text-align: center; }
.rank-avatar {
  width: 28px; height: 28px;
  border: 2px solid #4d3826;
  background-color: #2a1d14;
  image-rendering: pixelated;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.rank-avatar.has-photo {
  image-rendering: auto;
  padding: 0;
}
.rank-avatar.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-avatar.thumb-miner {
  background:
    linear-gradient(#e0b090,#e0b090) 6px 2px / 16px 12px no-repeat,
    linear-gradient(#3d6e9a,#3d6e9a) 4px 14px / 20px 12px no-repeat,
    #2a1d14;
}
.rank-avatar.thumb-brute {
  background:
    linear-gradient(#f2c14e,#f2c14e) 2px 18px / 7px 5px no-repeat,
    linear-gradient(#e8b896,#e8b896) 6px 2px / 16px 13px no-repeat,
    linear-gradient(#1a1a1e,#1a1a1e) 4px 14px / 20px 12px no-repeat,
    #2a1d14;
}
.rank-avatar.thumb-kitty {
  background:
    linear-gradient(#ff8fb8,#ff8fb8) 5px 1px / 5px 5px no-repeat,
    linear-gradient(#ff8fb8,#ff8fb8) 16px 1px / 5px 5px no-repeat,
    linear-gradient(#ffe6f0,#ffe6f0) 6px 4px / 14px 12px no-repeat,
    linear-gradient(#f7a8c8,#f7a8c8) 4px 14px / 18px 12px no-repeat,
    #2a1d14;
}
.rank-avatar.thumb-boldly,
.rank-avatar.thumb-fancy {
  background:
    linear-gradient(#39ff14,#39ff14) 11px 14px / 6px 7px no-repeat,
    linear-gradient(#3b2418,#3b2418) 6px 1px / 16px 7px no-repeat,
    linear-gradient(#e8b896,#e8b896) 7px 5px / 14px 8px no-repeat,
    linear-gradient(#0e0e12,#0e0e12) 4px 13px / 20px 13px no-repeat,
    #0a0a0e;
}
.rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { color: var(--gold-soft); font-family: var(--font-title); font-weight: 700; }
.rank-row.medal-gold { border-color: #f2c14e; background: rgba(80, 55, 10, 0.45); }
.rank-row.medal-silver { border-color: #c0c8d0; background: rgba(60, 65, 75, 0.4); }
.rank-row.medal-bronze { border-color: #c47a3a; background: rgba(70, 40, 15, 0.4); }
.rank-row.is-me { box-shadow: inset 0 0 0 2px var(--gold); }
.rank-empty {
  text-align: center;
  padding: 36px 16px;
  border: 2px dashed #5c4634;
  color: var(--dim);
  font-family: var(--font-ui);
}
.rank-empty-ico { font-size: 28px; display: block; margin-bottom: 8px; }
.rank-empty-sub { font-size: 12px; color: var(--muted); }
.rank-loading { font-family: var(--font-ui); color: var(--gold); }

/* FAQ */
.faq-panel .faq-scroll { flex: 1; max-height: none; }
.faq-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.faq-acc { border: 2px solid #3a2a1a; background: rgba(20,14,10,.55); margin-bottom: 8px; }
.faq-acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.faq-acc-btn::after {
  content: "+";
  margin-left: auto;
  color: var(--gold);
  font-weight: 700;
}
.faq-acc.open .faq-acc-btn::after { content: "−"; }
.faq-acc-body {
  display: none;
  padding: 0 12px 12px 36px;
  color: var(--dim);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}
.faq-acc.open .faq-acc-body { display: block; }
.faq-acc-ico { width: 1.2em; text-align: center; }
.faq-filtered-out { display: none !important; }
.faq-search-field { margin: 8px 0; }

/* FAQ ranked badge glossary */
.faq-ranked-body { padding-left: 12px; }
.faq-ranked-intro { margin: 0 0 8px; }
.faq-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.faq-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 2px solid #3a2a1a;
  background: rgba(12, 8, 6, 0.45);
}
.faq-rank-row .rank-badge {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}
.faq-rank-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.faq-rank-name {
  color: #f2ebe0;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.faq-rank-how {
  font-size: 12px;
  line-height: 1.35;
  color: var(--dim);
}

@media (max-width: 700px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-aside {
    display: grid;
    grid-template-columns: minmax(140px, 42%) 1fr;
    align-items: stretch;
    gap: 10px;
    text-align: left;
  }
  .home-aside .home-level-card { grid-column: 1 / -1; }
  .home-aside .mini-preview.char-preview-wrap,
  .home-preview-stage,
  #menu-preview {
    min-height: 180px;
    height: 180px;
  }
  .home-head-top { flex-wrap: wrap; gap: 8px; }
  .home-head-tools { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .mode-online-row { flex-direction: column; align-items: stretch; }
  .mode-online-row .mode-card-title { padding-top: 0; }
  .mode-online-cta { max-width: none; width: 100%; }
  .mode-play-online { width: 100% !important; }
  .nav-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { flex-wrap: wrap; }
  .actions .btn { width: 100%; flex: 1 1 100% !important; }
  .btn, .nav-tab { min-height: 44px; }
  .panel-home, .panel-screen { max-height: min(94vh, 100dvh); overflow: auto; }
  .panel { padding: 18px 14px 16px; }
  #menu, #lobby, #result, #ranks, #faq, #character, #shop {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    align-items: start;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .char-actions, .shop-actions, #result .actions, #lobby .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .faq-tabs { flex-wrap: wrap; }
  .faq-tabs .nav-tab { flex: 1 1 auto; min-width: calc(50% - 4px); }
}

/* —— Touch / mobile match controls —— */
:root {
  --touch-btn-scale: 1;
  --touch-opacity: 0.82;
}
body.touch-playing,
body.touch-playing #view {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
.touch-only-settings { display: none; }
body.touch-settings-show .touch-only-settings,
body.touch-ui .touch-only-settings { display: flex; }
.touch-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.touch-range input[type="range"] { flex: 1; min-width: 80px; accent-color: var(--gold); }
.touch-range span {
  min-width: 44px;
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--gold-soft);
  text-align: right;
}
.touch-schema {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 2px solid #5c4634;
  background: rgba(20, 14, 10, 0.55);
}
body.touch-ui .touch-schema { display: grid; }
.touch-schema-col {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f0e6d4;
  line-height: 1.25;
}
.touch-schema-ico { font-size: 14px; }
#touch-controls {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  touch-action: none;
  opacity: var(--touch-opacity);
}
#touch-controls.hidden { display: none !important; }
.touch-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: auto;
  touch-action: none;
}
.touch-move { left: 0; z-index: 2; }
.touch-look { right: 0; z-index: 1; }
body.touch-lefty .touch-move { left: auto; right: 0; }
body.touch-lefty .touch-look { right: auto; left: 0; }
.joy-base {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: calc(120px * var(--touch-btn-scale));
  height: calc(120px * var(--touch-btn-scale));
  border-radius: 50%;
  border: 3px solid rgba(196, 165, 116, 0.55);
  background: rgba(18, 12, 8, 0.38);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
  opacity: 0.72;
  transition: opacity 0.15s;
  pointer-events: none;
}
body.touch-lefty .joy-base:not(.floating) {
  left: auto;
  right: max(18px, env(safe-area-inset-right));
}
.joy-base.active,
.joy-base.floating { opacity: 1; }
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(48px * var(--touch-btn-scale));
  height: calc(48px * var(--touch-btn-scale));
  margin: calc(-24px * var(--touch-btn-scale)) 0 0 calc(-24px * var(--touch-btn-scale));
  border-radius: 50%;
  background: rgba(242, 193, 78, 0.85);
  border: 3px solid #6a4a18;
  box-shadow: 0 3px 0 #1a120c;
  transform: translate(0, 0);
  will-change: transform;
}
.touch-actions {
  position: absolute;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 4;
  max-width: min(46vw, 280px);
  pointer-events: auto;
  touch-action: none;
}
body.touch-lefty .touch-actions {
  right: auto;
  left: max(8px, env(safe-area-inset-left));
}
.touch-btn {
  flex: 0 0 auto;
  width: calc(68px * var(--touch-btn-scale));
  height: calc(46px * var(--touch-btn-scale));
  min-width: 58px;
  min-height: 44px;
  padding: 0 4px;
  border: 3px solid #5c4634;
  background: rgba(44, 33, 24, 0.88);
  color: #f4efe4;
  font-family: var(--font-ui);
  font-size: calc(11px * var(--touch-btn-scale));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 #1a120c;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-btn:active,
.touch-btn.on {
  background: #5a3d14;
  border-color: var(--gold);
  transform: translateY(1px);
  box-shadow: 0 1px 0 #1a120c;
}
.touch-btn-fire {
  width: calc(76px * var(--touch-btn-scale));
  height: calc(46px * var(--touch-btn-scale));
  min-height: 44px;
  font-size: calc(12px * var(--touch-btn-scale));
  background: rgba(63, 125, 50, 0.9);
  border-color: var(--green-border);
}
.touch-btn-fire:active,
.touch-btn-fire.on {
  background: #4a7a38;
  border-color: #fff2c2;
}
.touch-tools {
  display: none !important;
}
.touch-tool {
  width: 56px;
  min-width: 48px;
  height: 56px;
  min-height: 48px;
  border: 3px solid #5c4634;
  background: rgba(20, 14, 10, 0.88);
  color: var(--gold);
  font-family: var(--font-ui);
  box-shadow: 0 2px 0 #1a120c;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  line-height: 1;
}
.touch-tool-ico { font-size: 16px; line-height: 1; }
.touch-tool em {
  font-style: normal;
  font-size: 10px;
  color: #fff2c2;
}
.touch-tool-name {
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d8c8a8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.touch-tool.on {
  border-color: #fff2c2;
  box-shadow: 0 0 0 2px #f2c14e;
}
.touch-tool.locked { opacity: 0.38; filter: grayscale(0.85); }

.rotate-phone {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(10, 6, 4, 0.92);
  color: #f4efe4;
  text-align: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.rotate-phone.hidden { display: none !important; }
.rotate-phone-card {
  border: 3px solid var(--gold);
  background: #2a1d14;
  padding: 22px 28px;
  max-width: 280px;
}
.rotate-phone-ico {
  display: block;
  font-size: 42px;
  margin-bottom: 10px;
  animation: rotate-hint 1.6s ease-in-out infinite;
}
.rotate-phone-sub { color: var(--gold-soft); font-size: 13px; margin-top: 6px; }
@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(90deg); }
  60% { transform: rotate(90deg); }
}

/* Mobile home layout */
@media (max-width: 720px), ((pointer: coarse) and (max-width: 920px)) {
  body.touch-ui .panel-home {
    width: min(100%, 520px);
    padding: 12px 12px 14px;
  }
  body.touch-ui .home-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
  }
  body.touch-ui .home-aside {
    width: 100%;
  }
  body.touch-ui .home-preview-stage,
  body.touch-ui #menu-preview {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 5 / 6;
    margin: 0 auto;
  }
  body.touch-ui #menu-preview { max-height: 180px; }
  body.touch-ui .nav-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.touch-ui .nav-tab { min-height: 48px; }
  body.touch-ui .home-lead-sr,
  body.touch-ui .keycaps-desktop,
  body.touch-ui .controls-panel { display: none !important; }
  body.touch-ui .mode-card { min-height: 0; }
}

body.touch-ui.playing #hotbar {
  left: max(132px, calc(16px + env(safe-area-inset-left) + 110px));
  right: max(200px, calc(16px + env(safe-area-inset-right) + 210px));
  bottom: max(8px, env(safe-area-inset-bottom));
  width: auto;
  transform: none;
  justify-content: center;
  gap: 6px;
  z-index: 12;
  pointer-events: none;
}
body.touch-lefty.touch-ui.playing #hotbar {
  left: max(200px, calc(16px + env(safe-area-inset-left) + 210px));
  right: max(132px, calc(16px + env(safe-area-inset-right) + 110px));
}
body.touch-ui.playing #hotbar .slot {
  width: 58px;
  height: 52px;
  pointer-events: auto;
  touch-action: manipulation;
}
body.touch-ui.playing #hotbar .slot em { font-size: 9px; }
body.touch-ui.playing #hotbar .ico { margin-top: 10px; transform: scale(0.85); }
body.touch-ui.playing #hp-wrap {
  left: max(12px, env(safe-area-inset-left));
  bottom: auto;
  top: max(12px, env(safe-area-inset-top));
}
body.touch-ui.playing #powerup-hud {
  left: max(12px, env(safe-area-inset-left));
  bottom: auto;
  top: max(56px, calc(44px + env(safe-area-inset-top)));
}
body.touch-ui.playing #hp { width: min(140px, 36vw); height: 12px; }
body.touch-ui.playing #timer {
  top: max(10px, env(safe-area-inset-top));
  font-size: 14px;
  padding: 6px 12px;
  min-width: 96px;
}
body.touch-ui.playing #board,
body.touch-ui.playing #timer,
body.touch-ui.playing #cross,
body.touch-ui.playing #hp-wrap,
body.touch-ui.playing #kill-feed,
body.touch-ui.playing #target-name,
body.touch-ui.playing #status-line,
body.touch-ui.playing #combo-hud,
body.touch-ui.playing #powerup-hud {
  pointer-events: none;
}
body.touch-ui.playing #board {
  top: max(48px, calc(36px + env(safe-area-inset-top)));
  right: max(8px, env(safe-area-inset-right));
  width: min(160px, 38vw);
  font-size: 10px;
}
body.touch-ui.playing #board li { padding: 4px 6px; margin-bottom: 3px; }
body.touch-ui.playing #kill-feed {
  top: max(48px, calc(36px + env(safe-area-inset-top)));
  left: max(8px, env(safe-area-inset-left));
  width: min(140px, 34vw);
  font-size: 10px;
}
body.touch-ui.playing #target-name { bottom: max(70px, calc(62px + env(safe-area-inset-bottom))); font-size: 12px; }
body.touch-ui.playing #status-line { bottom: max(54px, calc(46px + env(safe-area-inset-bottom))); font-size: 12px; }
body.touch-ui.playing #lock-hint {
  top: 42%;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 13px;
  max-width: min(88vw, 320px);
  text-align: center;
  line-height: 1.35;
}
body.touch-ui.playing #combo-hud { top: max(48px, calc(40px + env(safe-area-inset-top))); }
body.touch-ui.playing .hud-mic {
  bottom: auto;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
body.touch-ui.playing #cross { width: 14px; height: 14px; pointer-events: none; }

/* Phone / short window: menu must scroll. Do not clip #menu. */
@media (pointer: coarse), (max-width: 960px), (max-height: 540px) {
  #menu, #lobby, #result, #ranks, #faq, #character, #shop {
    top: 0;
    bottom: auto;
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: start;
    justify-items: center;
    padding:
      max(14px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }
  #menu .panel,
  #menu .panel-home,
  #lobby .panel,
  #result .panel,
  .panel-home,
  .panel-screen,
  .panel.wide,
  .shop-panel,
  .faq-panel,
  .ranks-panel,
  .char-panel {
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .home-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
  }
  .home-aside {
    width: 100%;
  }
  .home-aside .mini-preview.char-preview-wrap.home-preview-stage,
  .home-aside .home-preview-stage,
  #menu #menu-preview {
    min-height: 0;
    height: 140px;
    max-height: 150px;
  }
}

@media (max-width: 700px) and (pointer: coarse) {
  .help-desktop,
  .keycaps-desktop { display: none; }
  .help-touch { display: block; }
}

/* Phone: one tool bar, actions under the scoreboard, menus scroll. */
@media (pointer: coarse), (max-width: 960px), (max-height: 540px) {
  #menu,
  #lobby,
  #result,
  #ranks,
  #faq,
  #character,
  #shop {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: 100dvh;
    max-height: 100dvh;
    align-items: start;
    justify-items: center;
  }
  #menu .panel,
  #lobby .panel,
  #result .panel,
  .panel-home,
  .panel-screen,
  .panel.wide {
    max-height: none !important;
    overflow: visible !important;
  }
}

body.touch-ui #touch-controls .touch-tools,
body.touch-ui .touch-tools {
  display: none !important;
}

body.touch-ui.playing .touch-actions {
  top: auto;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  left: auto;
  width: 84px;
  max-width: 28vw;
  max-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
  z-index: 14;
}

body.touch-ui.playing .touch-btn,
body.touch-ui.playing .touch-btn-fire {
  width: 100%;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  font-size: 11px;
}

body.touch-ui.playing #board {
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  width: min(168px, 40vw);
  max-height: calc(100dvh - 196px);
  overflow: hidden;
  z-index: 6;
  pointer-events: none;
}

body.touch-ui.playing #hotbar {
  left: max(124px, calc(12px + env(safe-area-inset-left) + 108px));
  right: max(100px, calc(12px + env(safe-area-inset-right) + 92px));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 13;
  pointer-events: none;
}

body.touch-ui.playing #hotbar .slot {
  width: 64px;
  height: 56px;
  min-width: 44px;
  min-height: 44px;
  pointer-events: auto;
  touch-action: manipulation;
}

body.touch-lefty.touch-ui.playing .touch-actions {
  right: auto;
  left: max(8px, env(safe-area-inset-left));
}

body.touch-lefty.touch-ui.playing #hotbar {
  left: max(100px, calc(12px + env(safe-area-inset-left) + 92px));
  right: max(124px, calc(12px + env(safe-area-inset-right) + 108px));
}
