:root {
  --bg-dark: #15100c;
  --bg-mid: #271e16;
  --bg-warm: #3d2f22;

  --kraft-light: #ead9bf;
  --kraft-base: #d8c09c;
  --kraft-mid: #c5a67e;
  --kraft-deep: #a5835c;
  --kraft-edge: #b4936b;

  --ink: #221913;
  --ink-soft: #433429;
  --ink-muted: #6c5746;

  --rarity-common: #2b221c;
  --rarity-uncommon: #3b4f34;
  --rarity-rare: #234966;
  --rarity-superrare: #99261d;
  --rarity-legendary: #946414;
  --gold-bright: #e9c46a;

  --net-express: #2563eb;
  --net-express-soft: rgba(37, 99, 235, 0.22);
  --net-express-ink: #dbeafe;
  --net-regional: #1f8a5b;
  --net-regional-soft: rgba(31, 138, 91, 0.24);
  --net-regional-ink: #dcfce7;
  --net-cargo: #c2591a;
  --net-cargo-soft: rgba(194, 89, 26, 0.24);
  --net-cargo-ink: #ffedd5;
  --net-alpin: #c53030;
  --net-alpin-soft: rgba(197, 48, 48, 0.24);
  --net-alpin-ink: #fee2e2;
  --net-patrimoine: #b7791f;
  --net-patrimoine-soft: rgba(183, 121, 31, 0.24);
  --net-patrimoine-ink: #fef9c3;
  --net-universel: #576574;
  --net-universel-soft: rgba(87, 101, 116, 0.24);
  --net-universel-ink: #e2e8f0;

  --pack-w: clamp(210px, 26vw, 276px);
  --pack-h: calc(var(--pack-w) * 1.78);
  --pack-d: 14px;
  --tear-h: calc(var(--pack-h) * 0.125);

  --card-w: clamp(152px, 13.8vw, 196px);
  --card-h: calc(var(--card-w) * 1.48);

  --inspect-w: clamp(256px, 32vw, 318px);
  --inspect-h: calc(var(--inspect-w) * 1.48);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--kraft-light);
  font-family: 'Bitter', Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold-bright);
}

/* =========================================================================
   ATMOSPHERE & BACKGROUND
========================================================================= */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 68% 62% at 50% 46%, rgba(168, 128, 84, 0.22) 0%, rgba(61, 47, 34, 0.34) 42%, rgba(21, 16, 12, 0.96) 100%),
    radial-gradient(circle at 50% 50%, var(--bg-warm) 0%, var(--bg-mid) 52%, var(--bg-dark) 100%);
  pointer-events: none;
}

.stage-tracks-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.085;
  pointer-events: none;
  overflow: hidden;
}
.stage-tracks-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* =========================================================================
   APP SHELL & HEADER NAVIGATION
========================================================================= */
.app-shell {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px clamp(18px, 3.6vw, 48px) 48px;
  gap: 28px;
}

.announcement-bar {
  width: 100%;
  max-width: 1400px;
  background: rgba(148, 100, 20, 0.25);
  border: 1px solid rgba(233, 196, 106, 0.5);
  color: #fce7b2;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  text-align: center;
}

.top-bar {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px 4px;
  gap: 18px;
  z-index: 30;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--kraft-light);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.brand-word {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(1rem, 1.8vw, 1.38rem);
  text-transform: uppercase;
}

.brand-and {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: clamp(0.65rem, 1vw, 0.82rem);
  padding: 1px 3px 2px;
  border-top: 1.5px solid rgba(234, 217, 191, 0.72);
  border-bottom: 1.5px solid rgba(234, 217, 191, 0.72);
  transform: translateY(-2px);
}

.brand-sub {
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(234, 217, 191, 0.56);
  text-transform: uppercase;
  margin-left: 6px;
  display: none;
}
@media (min-width: 1120px) {
  .brand-sub { display: inline-block; }
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link {
  appearance: none;
  background: rgba(34, 25, 19, 0.62);
  border: 1px solid rgba(216, 192, 156, 0.22);
  color: rgba(234, 217, 191, 0.88);
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.nav-link:hover {
  background: rgba(65, 48, 35, 0.85);
  border-color: rgba(234, 217, 191, 0.55);
  transform: translateY(-1px);
}
.nav-link.is-active {
  background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
  border-color: #2b1f16;
  color: #1f1610;
}
.nav-link.is-admin {
  border-color: rgba(233, 196, 106, 0.55);
  color: var(--gold-bright);
}
.nav-link.is-admin.is-active {
  color: #1f1610;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(216, 192, 156, 0.25);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(26, 19, 14, 0.72);
}
.lang-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(234, 217, 191, 0.7);
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 9px;
  cursor: pointer;
}
.lang-btn.is-active {
  background: rgba(216, 192, 156, 0.25);
  color: var(--gold-bright);
}

/* =========================================================================
   BUTTONS & FORM CONTROLS
========================================================================= */
.btn-ghost {
  appearance: none;
  background: rgba(34, 25, 19, 0.7);
  border: 1px solid rgba(216, 192, 156, 0.3);
  color: var(--kraft-light);
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  backdrop-filter: blur(6px);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(65, 48, 35, 0.88);
  border-color: rgba(234, 217, 191, 0.65);
  transform: translateY(-1px);
}
.btn-ghost.is-active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.btn-warn-ghost {
  border-color: rgba(196, 72, 60, 0.55);
  color: #f3a69f;
}

.btn-primary {
  appearance: none;
  background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
  border: 1.5px solid #2b1f16;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 248, 232, 0.65);
  color: #1f1610;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 160ms ease, filter 160ms ease;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-xs { padding: 5px 10px; font-size: 0.74rem; }

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  color: var(--gold-bright);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  padding: 2px 4px;
}

.field-input {
  background: rgba(20, 14, 10, 0.82);
  border: 1px solid rgba(216, 192, 156, 0.32);
  color: var(--kraft-light);
  border-radius: 9px;
  padding: 11px 15px;
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.88rem;
  outline: none;
}
.field-input:focus {
  border-color: var(--gold-bright);
}
.field-xs {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.notif-btn {
  position: relative;
}
.notif-count {
  background: #b53429;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 1px 6px;
  font-weight: 700;
}

/* =========================================================================
   MAIN VIEW & KRAFT PANELS
========================================================================= */
.main-view {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.loading-splash {
  text-align: center;
  padding: 80px 24px;
  color: rgba(234, 217, 191, 0.74);
  font-size: 1.05rem;
}

.kraft-panel {
  background: rgba(34, 25, 19, 0.84);
  border: 1px solid rgba(216, 192, 156, 0.25);
  border-radius: 18px;
  padding: clamp(24px, 3vw, 38px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.panel-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.panel-head h2, .panel-head h3 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--kraft-light);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(233, 196, 106, 0.14);
  border: 1px solid rgba(233, 196, 106, 0.42);
  color: var(--gold-bright);
}
.tag-pill.is-ok {
  background: rgba(73, 130, 83, 0.24);
  border-color: #65ad72;
  color: #a4e3af;
}
.tag-pill.is-warn {
  background: rgba(181, 69, 60, 0.22);
  border-color: #cf6960;
  color: #f6aba4;
}

.muted-note {
  color: rgba(234, 217, 191, 0.74);
  font-size: 0.88rem;
  line-height: 1.6;
}
.ok-note {
  color: #a4e3af;
  font-size: 0.88rem;
  font-weight: 600;
}
.form-error, .form-feedback.err, .report-feedback.err {
  color: #f39a91;
  font-size: 0.86rem;
  margin-top: 8px;
}
.form-feedback.ok, .report-feedback.ok {
  color: #a4e3af;
  font-size: 0.86rem;
  margin-top: 8px;
}

.bottom-bar {
  width: 100%;
  max-width: 1400px;
  text-align: center;
  padding-top: 12px;
}
.legal-note {
  font-size: 0.74rem;
  color: rgba(234, 217, 191, 0.44);
}

/* =========================================================================
   3D BOOSTER ARENA (GUEST & BOOSTERS ROOM)
========================================================================= */
.guest-welcome-wrap,
.boosters-room-wrap {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.booster-arena {
  position: relative;
  width: 100%;
  min-height: clamp(440px, 60vh, 610px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.godpack-banner {
  position: absolute;
  top: 8px;
  z-index: 36;
  padding: 7px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #946414, #e9c46a, #946414);
  color: #1c130b;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 0 28px rgba(233, 196, 106, 0.75);
}

.booster-scene {
  position: relative;
  width: var(--pack-w);
  height: var(--pack-h);
  perspective: 1450px;
  perspective-origin: 50% 48%;
  z-index: 15;
  touch-action: none;
  cursor: grab;
  outline: none;
  user-select: none;
}
.booster-scene.is-dragging { cursor: grabbing; }
.booster-scene.is-locked { cursor: default; pointer-events: none; }

.booster-shadow {
  position: absolute;
  left: 50%;
  bottom: -30px;
  width: 90%;
  height: 42px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.28) 54%, transparent 78%);
  filter: blur(8px);
  pointer-events: none;
}

.booster-mover, .booster-pivot {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.booster-cap, .booster-body {
  position: absolute;
  left: 0;
  width: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.booster-cap { top: 0; height: calc(var(--tear-h) + 1px); z-index: 4; }
.booster-body { top: var(--tear-h); height: calc(var(--pack-h) - var(--tear-h)); z-index: 2; }
.booster-cap.is-torn { height: var(--tear-h); }

.pack-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--kraft-base);
}
.booster-cap .pack-face { border-radius: 3px 3px 0 0; }
.booster-body .pack-face { border-radius: 0 0 3px 3px; }
.pack-face.face-front { transform: translateZ(calc(var(--pack-d) / 2)); }
.pack-face.face-back { transform: rotateY(180deg) translateZ(calc(var(--pack-d) / 2)); }

.pack-art {
  position: absolute;
  width: calc(var(--pack-w) * 1.046);
  height: calc(var(--pack-h) * 1.015);
  left: calc(var(--pack-w) * -0.023);
  max-width: none;
  max-height: none;
  display: block;
  pointer-events: none;
}
.booster-cap .pack-art { top: calc(var(--pack-h) * -0.007); }
.booster-body .pack-art { top: calc(var(--pack-h) * -0.007 - var(--tear-h)); }

.pack-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, rgba(255,245,224,0) 15%, rgba(255,245,224,0.19) 46%, rgba(255,245,224,0.04) 64%, rgba(20,12,6,0.22) 100%);
  opacity: 0.48;
  mix-blend-mode: soft-light;
}

.pack-edge { position: absolute; backface-visibility: hidden; pointer-events: none; }
.pack-edge.edge-left { top: 0; left: 0; width: var(--pack-d); height: 100%; transform-origin: left center; transform: translateZ(calc(var(--pack-d)/-2)) rotateY(-90deg); background: linear-gradient(90deg,#8e6c46,#b59167,#8f6e49); }
.pack-edge.edge-right { top: 0; right: 0; width: var(--pack-d); height: 100%; transform-origin: right center; transform: translateZ(calc(var(--pack-d)/-2)) rotateY(90deg); background: linear-gradient(90deg,#8f6e49,#c19f76,#8a6945); }
.pack-edge.edge-top { top: 0; left: 0; width: 100%; height: var(--pack-d); transform-origin: top center; transform: translateZ(calc(var(--pack-d)/-2)) rotateX(90deg); background: linear-gradient(180deg,#a4835b,#ceb088,#987750); }
.pack-edge.edge-bottom { bottom: 0; left: 0; width: 100%; height: var(--pack-d); transform-origin: bottom center; transform: translateZ(calc(var(--pack-d)/-2)) rotateX(-90deg); background: linear-gradient(180deg,#846442,#b29067,#7d5e3c); }

.pack-interior {
  position: absolute; top: 2px; left: 6px; right: 6px; height: 52px;
  background: radial-gradient(ellipse 75% 85% at 50% 35%, rgba(255,214,138,0.92) 0%, rgba(196,132,48,0.45) 45%, #1d140d 88%);
  border-radius: 50% 50% 6px 6px / 14px 14px 4px 4px;
  box-shadow: 0 -8px 26px rgba(246,198,108,0.48);
  opacity: 0; pointer-events: none; transition: opacity 280ms ease;
}
.booster-body.is-torn .pack-interior { opacity: 1; }

.torn-fiber-rim {
  position: absolute; top: -1px; left: 0; width: 100%; height: 18px;
  transform: translateZ(calc(var(--pack-d) / 2 - 0.6px));
  background: linear-gradient(180deg, #f3e4cb 0%, #d4b990 70%, transparent 100%);
  opacity: 0; pointer-events: none;
}
.booster-body.is-torn .torn-fiber-rim { opacity: 0.95; }

.booster-cap.is-torn .pack-face {
  clip-path: polygon(0% 0%,100% 0%,100% 91%,95% 98%,90% 90%,84% 99%,78% 89%,72% 97%,66% 88%,60% 98%,54% 90%,48% 99%,42% 89%,36% 97%,30% 90%,24% 99%,18% 89%,12% 98%,6% 91%,0% 96%);
}
.booster-body.is-torn .pack-face {
  clip-path: polygon(0% 0.9%,6% 0.2%,12% 1.3%,18% 0.1%,24% 1.4%,30% 0.2%,36% 1.2%,42% 0.1%,48% 1.5%,54% 0.2%,60% 1.3%,66% 0.1%,72% 1.2%,78% 0.2%,84% 1.4%,90% 0.2%,95% 1.3%,100% 0.3%,100% 100%,0% 100%);
}
.booster-body.is-torn .torn-fiber-rim {
  clip-path: polygon(0% 8%,6% 2%,12% 35%,18% 0%,24% 38%,30% 4%,36% 32%,42% 0%,48% 40%,54% 5%,60% 34%,66% 0%,72% 33%,78% 4%,84% 38%,90% 4%,95% 34%,100% 8%,100% 100%,0% 100%);
}

.tear-flash {
  position: absolute; top: calc(var(--tear-h) - 2px); left: -6%; width: 112%; height: 5px;
  transform: translateZ(calc(var(--pack-d) / 2 + 4px)) scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, transparent 0%, #fff1c2 45%, #ffd06d 80%, #ffffff 100%);
  box-shadow: 0 0 18px 4px rgba(255,212,117,0.85); border-radius: 4px; opacity: 0; pointer-events: none;
}

.showcase-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 25;
  padding: 6px 2px;
}

.cards-spread {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.1vw, 14px);
  width: 100%;
  max-width: 1300px;
  perspective: 1600px;
}

.card-slot {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  perspective: 1200px;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.card-slot.is-interactive { pointer-events: auto; cursor: pointer; }
.card-hover-wrap {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.card-slot.is-interactive:hover { z-index: 32; }
.card-flipper {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.booster-controls-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 30;
}
.booster-sealed-btns, .revealed-actions, .center-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(26, 19, 14, 0.72);
  border: 1px solid rgba(216, 192, 156, 0.24);
  font-size: 0.8rem;
  color: rgba(234, 217, 191, 0.9);
}
.hint-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 8px var(--gold-bright);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* =========================================================================
   KRAFT CARD FACES
========================================================================= */
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 246, 228, 0.42) 0%, transparent 52%),
    radial-gradient(circle at 82% 88%, rgba(122, 89, 55, 0.24) 0%, transparent 56%),
    linear-gradient(155deg, #e5d2b5 0%, #d8bf9b 48%, #c7a77d 100%);
  color: var(--ink);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(42, 30, 20, 0.55), inset 0 1px 0 rgba(255, 247, 232, 0.65);
}
.card-face::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23k)' opacity='0.48'/%3E%3C/svg%3E");
  z-index: 2;
}
.card-face-front { transform: translateZ(1px); display: flex; flex-direction: column; padding: 7px; }
.card-face-back { transform: rotateY(180deg) translateZ(1px); }
.card-back-art { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); display: block; }
.card-back-border { position: absolute; inset: 6px; border: 1.8px solid rgba(34,25,19,0.82); border-radius: 6px; pointer-events: none; z-index: 4; }

.card-inner-border {
  position: relative; flex: 1 1 auto; display: flex; flex-direction: column;
  border: 1.8px solid var(--ink); border-radius: 6px; padding: 5px; z-index: 3;
  background: linear-gradient(180deg, rgba(255, 248, 234, 0.14) 0%, rgba(44, 30, 18, 0.05) 100%);
  overflow: hidden;
}

.card-face-front.is-legendary .card-inner-border { border-color: #5c3d0c; box-shadow: inset 0 0 18px rgba(212, 165, 68, 0.28); }
.card-face-front.is-superrare .card-inner-border { border-color: #7c1f17; }

.card-foil-sweep {
  position: absolute; inset: -40%; pointer-events: none; z-index: 5; opacity: 0;
  background: linear-gradient(112deg, transparent 34%, rgba(255,232,168,0.45) 47%, rgba(255,249,224,0.72) 50%, rgba(218,168,72,0.36) 54%, transparent 68%);
  transform: translateX(-85%) rotate(8deg);
}
.card-foil-sweep.play-foil { animation: foilSweep 1.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes foilSweep {
  0% { opacity: 0; transform: translateX(-85%) rotate(8deg); }
  25% { opacity: 0.92; }
  100% { opacity: 0.12; transform: translateX(85%) rotate(8deg); }
}

.card-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 6; opacity: 0; transition: opacity 200ms ease;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 35%), rgba(255,245,220,0.34) 0%, transparent 58%);
  mix-blend-mode: soft-light;
}
.card-slot.is-interactive:hover .card-sheen { opacity: 1; }

.new-badge {
  position: absolute; top: 4px; right: 4px; z-index: 8;
  background: #99261d; color: #fff5e1; font-family: 'Courier Prime', monospace;
  font-size: 0.55rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.06em;
}
.new-badge.is-var { background: #234966; }

.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 1px 2px 4px; border-bottom: 1.5px solid var(--ink);
}
.cost-stamp {
  position: relative;
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #f3e6cf 0%, #d4b991 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 0.78rem; color: var(--ink);
}
.cost-stamp.is-maint {
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #b7791f 100%);
  border-color: #4a2d05;
}
.cost-maint-sup {
  position: absolute; bottom: -3px; right: -6px;
  background: #744210; color: #fef3c7; border: 1px solid #f6e05e;
  font-family: 'Courier Prime', monospace; font-size: 0.44rem; font-weight: 700;
  padding: 0 3px; border-radius: 999px; line-height: 1.2;
}
.card-maint-note {
  position: relative; z-index: 1; margin-top: 2px;
  font-family: 'Courier Prime', monospace; font-size: 0.46rem; font-weight: 700;
  color: #744210; background: rgba(233, 196, 106, 0.34);
  border: 1px solid rgba(183, 121, 31, 0.48); border-radius: 3px;
  padding: 1px 4px; align-self: flex-start;
}
.stat-box.stat-maint {
  background: rgba(183, 121, 31, 0.28); border-color: rgba(233, 196, 106, 0.65); color: #fef3c7;
}
.hc-cost.is-maint,
.de-cost.is-maint {
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #b7791f 100%);
  border-color: #4a2d05;
  box-shadow: 0 0 0 1.5px rgba(233, 196, 106, 0.65);
}
.hc-maint-tag {
  font-family: 'Courier Prime', monospace; font-size: 0.58rem; font-weight: 700;
  color: #744210; background: rgba(233, 196, 106, 0.38);
  border: 1px solid rgba(183, 121, 31, 0.55); border-radius: 4px;
  padding: 1px 5px; text-align: center;
}
.inspect-pivot .cost-maint-sup { font-size: 0.6rem; bottom: -4px; right: -8px; padding: 1px 4px; }
.inspect-pivot .card-maint-note { font-size: 0.64rem; padding: 2px 6px; }
.card-title-wrap { flex: 1 1 auto; min-width: 0; text-align: center; }
.card-title {
  margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  font-size: clamp(0.6rem, 0.72vw, 0.74rem); line-height: 1.1; text-transform: uppercase; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.network-stamp {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 4px; border: 1.4px solid var(--ink);
  background: rgba(243, 230, 207, 0.72); display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.network-stamp svg { width: 14px; height: 14px; display: block; }
.network-stamp.net-express { background: var(--net-express); border-color: #163a8c; color: #fff; }
.network-stamp.net-regional { background: var(--net-regional); border-color: #125437; color: #fff; }
.network-stamp.net-cargo { background: var(--net-cargo); border-color: #7c350d; color: #fff; }
.network-stamp.net-alpin { background: var(--net-alpin); border-color: #7f1d1d; color: #fff; }
.network-stamp.net-patrimoine { background: var(--net-patrimoine); border-color: #744a0e; color: #fff; }
.network-stamp.net-universel { background: var(--net-universel); border-color: #36404a; color: #fff; }

.net-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; flex-shrink: 0;
}
.net-dot.net-express { background: #3b82f6; }
.net-dot.net-regional { background: #22c55e; }
.net-dot.net-cargo { background: #f97316; }
.net-dot.net-alpin { background: #ef4444; }
.net-dot.net-patrimoine { background: #eab308; }
.net-dot.net-universel { background: #94a3b8; }

.net-bg-express { background: linear-gradient(90deg, #1d4ed8, #2563eb); color: #fff; }
.net-bg-regional { background: linear-gradient(90deg, #166534, #1f8a5b); color: #fff; }
.net-bg-cargo { background: linear-gradient(90deg, #9a3412, #c2591a); color: #fff; }
.net-bg-alpin { background: linear-gradient(90deg, #991b1b, #c53030); color: #fff; }
.net-bg-patrimoine { background: linear-gradient(90deg, #854d0e, #b7791f); color: #fff; }
.net-bg-universel { background: linear-gradient(90deg, #3f4a56, #576574); color: #fff; }

.card-art-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 10; margin-top: 4px;
  border: 1.5px solid var(--ink); background: #231a13; overflow: hidden; flex-shrink: 0;
}
.card-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: sepia(0.18) contrast(1.05) brightness(0.97) saturate(0.9);
}
.card-photo.is-archival { filter: sepia(0.32) grayscale(0.7) contrast(1.12); }

.variant-pill {
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(21, 16, 12, 0.85); color: #f3e4cb;
  font-family: 'Courier Prime', monospace; font-size: 0.48rem; padding: 1px 5px; border-radius: 3px;
}

.gauge-pill {
  position: absolute; top: 4px; right: 4px; z-index: 4;
  background: rgba(20, 15, 11, 0.86); color: #ecdcc2;
  border: 1px solid rgba(216, 192, 156, 0.48);
  font-family: 'Courier Prime', monospace; font-size: 0.46rem; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: 0.03em;
}
.gauge-pill.is-metric {
  background: rgba(168, 36, 28, 0.92);
  color: #fff3e6;
  border-color: rgba(252, 165, 165, 0.72);
}

.card-subbanner {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 3px 1px; border-bottom: 1px dashed rgba(34, 25, 19, 0.42);
}
.card-family {
  font-family: 'Courier Prime', monospace; font-size: 0.5rem; font-weight: 700;
  text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rarity-stamp {
  flex: 0 0 auto; font-family: 'Courier Prime', monospace; font-weight: 700; font-size: 0.48rem;
  text-transform: uppercase; padding: 1px 4px; border: 1.2px solid currentColor; border-radius: 2px;
  transform: rotate(-1.5deg); line-height: 1.2;
}
.rarity-commune { color: var(--rarity-common); background: rgba(43,34,28,0.08); }
.rarity-peu-commune { color: var(--rarity-uncommon); background: rgba(59,79,52,0.12); }
.rarity-rare { color: var(--rarity-rare); background: rgba(35,73,102,0.12); }
.rarity-superrare { color: var(--rarity-superrare); background: rgba(153,38,29,0.12); }
.rarity-legendaire { color: #6b4508; border-color: #8f6111; background: linear-gradient(135deg, rgba(233,196,106,0.46), rgba(188,138,44,0.28)); }

.card-rules-box {
  position: relative; flex: 1 1 auto; margin-top: 4px; padding: 4px 5px;
  background: rgba(246, 236, 218, 0.48); border: 1px solid rgba(34, 25, 19, 0.34);
  border-radius: 3px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.rules-watermark { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.08; pointer-events: none; }
.card-rules-text {
  position: relative; z-index: 1; font-family: 'Bitter', Georgia, serif;
  font-size: 0.54rem; line-height: 1.26; color: var(--ink); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tech-line {
  position: relative; z-index: 1; margin-top: 2px; padding-top: 2px;
  border-top: 0.7px dotted rgba(34,25,19,0.3); font-family: 'Courier Prime', monospace;
  font-style: italic; font-size: 0.44rem; color: var(--ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-footer {
  margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 3px;
  padding-top: 3px; border-top: 1.4px solid var(--ink); flex-shrink: 0;
}
.stat-pills { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.stat-box {
  font-family: 'Courier Prime', monospace; font-weight: 700; font-size: 0.48rem; line-height: 1.05;
  padding: 2px 4px; border: 1.1px solid var(--ink); border-radius: 3px;
  background: rgba(244,232,212,0.78); color: var(--ink); white-space: nowrap;
}
.stat-box.stat-special { background: rgba(34,25,19,0.92); color: var(--kraft-light); }
.stat-box.stat-atk { background: #99261d; border-color: #5c130e; color: #fff; }
.stat-box.stat-def { background: #1f5378; border-color: #113047; color: #fff; }
.stat-box.stat-sig-red { background: #991b1b; border-color: #5e0f0f; color: #fee2e2; }
.stat-box.stat-sig-green { background: #166534; border-color: #0b3b1d; color: #dcfce7; }
.card-serial { flex: 0 0 auto; font-family: 'Courier Prime', monospace; font-size: 0.44rem; color: var(--ink-muted); display: flex; align-items: center; gap: 2px; }
.info-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px;
  border-radius: 50%; border: 1px solid var(--ink-soft); font-size: 0.46rem; font-weight: 700; color: var(--ink);
}

/* =========================================================================
   GUEST ONBOARDING & REGISTER PANEL
========================================================================= */
.guest-onboarding {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) {
  .guest-onboarding { grid-template-columns: 1fr; }
}
.onboarding-pitch h2, .onboarding-register h3 {
  margin-top: 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold-bright);
}
.pillars-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.pillar-chip {
  background: rgba(21, 16, 12, 0.65);
  border: 1px solid rgba(216, 192, 156, 0.25);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
}
.inline-reg-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inline-reg-form button[type="submit"] {
  grid-column: 1 / -1;
}
@media (max-width: 560px) {
  .inline-reg-form { grid-template-columns: 1fr; }
}
.onboarding-alt-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* =========================================================================
   HUB, COLLECTION BINDER, DECK BUILDER
========================================================================= */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.hub-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
@media (max-width: 860px) {
  .hub-grid { grid-template-columns: 1fr; }
}
.hub-quick-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.kpi-box {
  background: rgba(21, 16, 12, 0.65);
  border: 1px solid rgba(216, 192, 156, 0.2);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.kpi-val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.42rem;
  font-weight: 900;
  color: var(--gold-bright);
}
.kpi-lbl { font-size: 0.78rem; color: rgba(234,217,191,0.74); margin-top: 4px; }

.hub-mini-thumbs {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0;
}
.hub-mini-thumbs img {
  width: 72px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(216,192,156,0.35);
}

.booster-status-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 18px 24px;
}

.filters-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 24px;
}
.filters-bar .field-input { flex: 1 1 170px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem;
  background: rgba(21,16,12,0.65); border: 1px solid rgba(216,192,156,0.25);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
}

.cards-binder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
  gap: 24px;
}
.binder-item {
  display: flex; flex-direction: column; gap: 9px; cursor: pointer;
  transition: transform 180ms ease;
}
.binder-item:hover { transform: translateY(-4px); }
.binder-item.is-unowned .binder-card-frame { filter: grayscale(0.75) opacity(0.68); }
.binder-card-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.48;
}
.binder-meta {
  display: flex; justify-content: space-between; font-size: 0.8rem; color: rgba(234,217,191,0.82);
  padding: 0 4px;
}

.pagination-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; font-size: 0.88rem;
}

.binder-card-frame .card-title,
.db-card-frame .card-title { font-size: 0.72rem; }
.binder-card-frame .card-rules-text,
.db-card-frame .card-rules-text { font-size: 0.6rem; line-height: 1.26; -webkit-line-clamp: 5; }
.binder-card-frame .stat-box,
.db-card-frame .stat-box { font-size: 0.53rem; padding: 2px 5px; }
.binder-card-frame .card-serial > span:first-child,
.db-card-frame .card-serial > span:first-child { display: none; }

/* Deck Builder */
.deck-selector-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.deck-split {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(385px, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 1020px) {
  .deck-split { grid-template-columns: 1fr; }
}
.deck-filters-bar { margin-bottom: 10px; }
.deck-filters-bar .field-input { flex: 1 1 140px; min-width: 0; }
.deck-lib-hint {
  font-size: 0.78rem;
  color: rgba(234, 217, 191, 0.7);
  margin: 0 0 16px;
}
.deck-owned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 20px;
}
.db-card-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 9px;
  background: rgba(21, 16, 12, 0.72);
  border: 1px solid rgba(216, 192, 156, 0.22);
  border-radius: 14px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.db-card-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 192, 156, 0.45);
}
.db-card-tile.is-in-deck {
  border-color: rgba(233, 196, 106, 0.85);
  box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.db-in-deck-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  z-index: 12;
  background: linear-gradient(180deg, #f0d080 0%, #c99d3b 100%);
  color: #1f1610;
  border: 1.5px solid #2b1f16;
  border-radius: 999px;
  padding: 2px 10px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.db-card-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.52;
  cursor: pointer;
}
.db-card-ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(216, 192, 156, 0.2);
}
.db-avail {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  color: rgba(234, 217, 191, 0.78);
  white-space: nowrap;
}
.db-ctrl-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}
.db-ctrl-btns .btn-xs {
  white-space: nowrap;
}
.db-count-pill {
  font-family: 'Courier Prime', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-bright);
  min-width: 28px;
  text-align: center;
}

@media (min-width: 1021px) {
  .deck-list-col {
    position: sticky;
    top: 18px;
  }
}
.deck-meta-box {
  background: rgba(21,16,12,0.74); border: 1px solid rgba(216,192,156,0.28);
  border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 13px; margin-bottom: 16px;
}
.deck-counters, .deck-action-btns { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 0.82rem; }
.deck-net-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.deck-net-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  background: rgba(34, 25, 19, 0.88);
  border: 1px solid rgba(216, 192, 156, 0.24);
  color: rgba(234, 217, 191, 0.92);
}
.deck-net-pill.is-orphan {
  background: rgba(153, 27, 27, 0.34);
  border-color: rgba(248, 113, 113, 0.72);
  color: #fecaca;
}
.deck-net-warning {
  background: rgba(194, 89, 26, 0.24);
  border: 1px solid rgba(245, 158, 11, 0.65);
  color: #fde68a;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.45;
}
.deck-entries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 192, 156, 0.38) rgba(20, 14, 10, 0.5);
}
.deck-entries-list::-webkit-scrollbar,
.duel-log-box::-webkit-scrollbar {
  width: 8px;
}
.deck-entries-list::-webkit-scrollbar-track,
.duel-log-box::-webkit-scrollbar-track {
  background: rgba(20, 14, 10, 0.55);
  border-radius: 999px;
}
.deck-entries-list::-webkit-scrollbar-thumb,
.duel-log-box::-webkit-scrollbar-thumb {
  background: rgba(216, 192, 156, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.deck-entries-list::-webkit-scrollbar-thumb:hover,
.duel-log-box::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 196, 106, 0.58);
  background-clip: content-box;
}
.duel-log-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 192, 156, 0.38) rgba(20, 14, 10, 0.5);
}

.deck-entry-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(21,16,12,0.68);
  border: 1px solid rgba(216,192,156,0.2);
  border-radius: 11px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.deck-entry-row:hover {
  background: rgba(34, 25, 19, 0.88);
  border-color: rgba(233, 196, 106, 0.45);
}
.net-row-express { border-left: 4px solid var(--net-express); }
.net-row-regional { border-left: 4px solid var(--net-regional); }
.net-row-cargo { border-left: 4px solid var(--net-cargo); }
.net-row-alpin { border-left: 4px solid var(--net-alpin); }
.net-row-patrimoine { border-left: 4px solid var(--net-patrimoine); }
.net-row-universel { border-left: 4px solid var(--net-universel); }

.de-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.de-cost {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3e6cf 0%, #d4b991 100%);
  border: 1.5px solid #2b1f16;
  color: #1f1610;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.deck-entry-row img {
  width: 60px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(216, 192, 156, 0.3);
  flex-shrink: 0;
}
.de-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}
.de-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--kraft-light);
}
.de-info small {
  font-size: 0.72rem;
  color: rgba(234, 217, 191, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.de-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.de-qty-val {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 0.84rem;
  min-width: 24px;
  text-align: center;
  color: var(--gold-bright);
}
.de-bottom {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px dashed rgba(216, 192, 156, 0.16);
}
.de-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.de-stat-pills .stat-box {
  font-size: 0.67rem;
  padding: 2px 7px;
  border-radius: 4px;
}
.de-rules {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.38;
  color: rgba(234, 217, 191, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================================
   ARENA PVP LOBBY & TACTICAL BOARD
========================================================================= */
.arena-lobby-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px;
}
@media (max-width: 780px) { .arena-lobby-cards { grid-template-columns: 1fr; } }
.lobby-card {
  background: rgba(21,16,12,0.65); border: 1px solid rgba(216,192,156,0.25);
  border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 14px;
}
.lobby-card h3 { margin: 0; color: var(--gold-bright); font-family: 'Playfair Display', Georgia, serif; }
.friend-actions { display: flex; flex-direction: column; gap: 12px; }
.friend-join-row { display: flex; gap: 10px; }
.mm-status-box { background: rgba(39,30,22,0.85); border: 1px solid rgba(233,196,106,0.4); padding: 14px; border-radius: 10px; }
.mm-spinner-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mm-btn-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.room-code-display {
  font-family: 'Courier Prime', monospace; font-size: 2rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--gold-bright); background: rgba(21,16,12,0.85); border: 2px dashed rgba(233,196,106,0.5);
  padding: 16px 28px; border-radius: 12px; display: inline-block; margin: 16px 0;
}
.center-panel { text-align: center; }

.arena-board {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  background:
    radial-gradient(ellipse 80% 45% at 50% 42%, rgba(168, 128, 84, 0.14) 0%, transparent 72%),
    linear-gradient(180deg, rgba(30, 22, 16, 0.96) 0%, rgba(20, 15, 11, 0.98) 100%);
  border: 1.5px solid rgba(233, 196, 106, 0.34);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 244, 214, 0.12);
  border-radius: 18px;
  padding: clamp(12px, 1.5vw, 18px);
}
.duel-player-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  background: linear-gradient(180deg, rgba(48, 36, 26, 0.95) 0%, rgba(33, 24, 18, 0.95) 100%);
  border: 1px solid rgba(216,192,156,0.3);
  border-radius: 12px; padding: 9px 14px;
}
.duel-player-bar.is-opponent { border-top: 2px solid rgba(226, 87, 76, 0.55); }
.duel-player-bar.is-me { border-bottom: 2px solid rgba(34, 197, 94, 0.52); }
.duel-player-bar.is-targetable {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.55), 0 0 24px rgba(226, 87, 76, 0.65);
  cursor: pointer;
}
.dp-identity { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.dp-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  border: 1.5px solid rgba(233, 196, 106, 0.6);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.dp-avatar.is-opp { background: radial-gradient(circle at 35% 30%, #7f1d1d 0%, #3b1212 100%); }
.dp-avatar.is-me { background: radial-gradient(circle at 35% 30%, #166534 0%, #123522 100%); }
.dp-id { display: flex; flex-direction: column; gap: 2px; }
.dp-id strong { font-size: 0.94rem; color: var(--kraft-light); }
.dp-sub { font-size: 0.74rem; color: rgba(234,217,191,0.74); }
.opp-hand-fan {
  display: inline-flex; align-items: center; padding-left: 8px; margin-left: 4px;
}
.opp-card-back {
  width: 21px; height: 30px; border-radius: 3px; overflow: hidden;
  border: 1px solid rgba(233, 196, 106, 0.62);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  margin-left: -9px;
  transform: rotate(calc((var(--fan-i, 0) - 2.5) * 3.5deg));
  background: #c5a67e;
}
.opp-card-back img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-hp-wrap { flex: 1 1 210px; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dp-hp-bar {
  position: relative; width: 100%; height: 22px; background: rgba(14, 10, 7, 0.92);
  border-radius: 999px; overflow: hidden; border: 1.5px solid rgba(216,192,156,0.34);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65);
}
.dp-hp-fill {
  position: absolute; inset: 0 auto 0 0;
  transition: width 320ms ease;
}
.dp-hp-fill.is-opp { background: linear-gradient(90deg, #881c14 0%, #dc2626 70%, #f87171 100%); }
.dp-hp-fill.is-me { background: linear-gradient(90deg, #15803d 0%, #22c55e 75%, #86efac 100%); }
.dp-hp-text {
  position: relative; z-index: 2;
  font-family: 'Courier Prime', monospace; font-size: 0.76rem; font-weight: 700;
  display: block; text-align: center; line-height: 20px; color: #fff8ea;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
.dp-attack-cta {
  font-family: 'Courier Prime', monospace; font-size: 0.7rem; font-weight: 700;
  background: rgba(185, 28, 28, 0.92); color: #fff1f2; border: 1px solid #fca5a5;
  padding: 2px 10px; border-radius: 999px;
  animation: endTurnPulse 1.3s ease-in-out infinite;
}
.dp-resources { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.sillon-badge, .secret-badge {
  background: rgba(21,16,12,0.88); border: 1px solid rgba(233,196,106,0.48);
  padding: 4px 11px; border-radius: 999px; font-family: 'Courier Prime', monospace; font-size: 0.76rem; color: var(--gold-bright); font-weight: 700;
}

.arena-playmat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1.5px solid rgba(216, 192, 156, 0.25);
  background:
    radial-gradient(ellipse 78% 58% at 50% 50%, rgba(168, 128, 84, 0.16) 0%, rgba(28, 21, 15, 0.88) 72%, rgba(18, 13, 9, 0.96) 100%);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.55);
}

.net-sillon-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-family: 'Courier Prime', monospace; font-size: 0.74rem;
  background: rgba(21, 16, 12, 0.85); border: 1px solid rgba(216,192,156,0.3); color: var(--kraft-light);
}
.net-sillon-pill.net-express { border-color: rgba(59, 130, 246, 0.58); background: var(--net-express-soft); color: var(--net-express-ink); }
.net-sillon-pill.net-regional { border-color: rgba(34, 197, 94, 0.58); background: var(--net-regional-soft); color: var(--net-regional-ink); }
.net-sillon-pill.net-cargo { border-color: rgba(249, 115, 22, 0.58); background: var(--net-cargo-soft); color: var(--net-cargo-ink); }
.net-sillon-pill.net-alpin { border-color: rgba(239, 68, 68, 0.58); background: var(--net-alpin-soft); color: var(--net-alpin-ink); }
.net-sillon-pill.net-patrimoine { border-color: rgba(234, 179, 8, 0.58); background: var(--net-patrimoine-soft); color: var(--net-patrimoine-ink); }
.net-sillon-pill.is-empty { opacity: 0.45; }

.duel-stations-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 38px;
  padding: 5px 10px; background: rgba(16, 12, 9, 0.58);
  border: 1px solid rgba(216, 192, 156, 0.14); border-radius: 10px;
}
.stations-zone-tag {
  font-family: 'Courier Prime', monospace; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: rgba(233, 196, 106, 0.82); background: rgba(39, 29, 21, 0.85);
  border: 1px solid rgba(233, 196, 106, 0.25); padding: 3px 8px; border-radius: 6px;
}
.station-drop-hint {
  padding: 3px 10px; border-radius: 7px; font-size: 0.78rem;
  color: rgba(234, 217, 191, 0.72);
  border: 1px dashed rgba(216, 192, 156, 0.22);
}
.station-drop-hint.is-guided {
  color: #fde68a; background: rgba(233, 196, 106, 0.12);
  border-color: rgba(233, 196, 106, 0.68);
  animation: endTurnPulse 1.8s ease-in-out infinite;
}
.mini-station {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 11px; border-radius: 10px;
  background: rgba(34, 25, 19, 0.92); border: 1.5px solid rgba(216,192,156,0.35);
  cursor: pointer; transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease;
}
.mini-station:hover { transform: translateY(-2px); border-color: var(--gold-bright); }
.mini-station.is-tapped { opacity: 0.52; filter: grayscale(0.35); }
.mini-station.net-card-express { border-color: rgba(59, 130, 246, 0.6); }
.mini-station.net-card-regional { border-color: rgba(34, 197, 94, 0.6); }
.mini-station.net-card-cargo { border-color: rgba(249, 115, 22, 0.6); }
.mini-station.net-card-alpin { border-color: rgba(239, 68, 68, 0.6); }
.mini-station.net-card-patrimoine { border-color: rgba(234, 179, 8, 0.6); }
.ms-thumb {
  width: 44px; height: 32px; object-fit: cover; border-radius: 5px; border: 1px solid rgba(234,217,191,0.3); flex-shrink: 0;
}
.ms-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ms-name { font-size: 0.78rem; font-weight: 700; color: var(--kraft-light); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-family: 'Courier Prime', monospace; font-size: 0.66rem; }
.net-chip { display: inline-flex; align-items: center; color: rgba(234,217,191,0.92); font-weight: 700; }
.ms-sillon { color: var(--gold-bright); font-weight: 700; }
.ms-gauge { color: rgba(234,217,191,0.68); background: rgba(21,16,12,0.7); padding: 1px 5px; border-radius: 4px; }
.ms-state { padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.ms-state.is-ready { background: rgba(34, 197, 94, 0.22); color: #86efac; }
.ms-state.is-tapped { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.mini-secret {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; background: rgba(185, 28, 28, 0.38); border: 1.5px solid #f87171;
  color: #fee2e2; box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.duel-lane {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  min-height: 118px; padding: 8px 12px; border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(168, 128, 84, 0.08) 0 8px, transparent 8px 28px),
    linear-gradient(180deg, rgba(16, 12, 9, 0.62) 0%, rgba(28, 21, 15, 0.44) 50%, rgba(16, 12, 9, 0.62) 100%);
  border: 1px solid rgba(216, 192, 156, 0.22);
  overflow: hidden;
}
.lane-tracks-bg {
  position: absolute; inset: 7px 12px; z-index: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
}
.lane-track-bay {
  position: relative; border-radius: 8px;
  border: 1px dashed rgba(216, 192, 156, 0.14);
  background:
    linear-gradient(180deg, transparent 22%, rgba(216, 192, 156, 0.11) 23%, rgba(216, 192, 156, 0.11) 25%, transparent 26%, transparent 74%, rgba(216, 192, 156, 0.11) 75%, rgba(216, 192, 156, 0.11) 77%, transparent 78%);
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 4px 7px;
}
.lane-track-bay span {
  font-family: 'Courier Prime', monospace; font-size: 0.6rem; color: rgba(234, 217, 191, 0.22);
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .lane-tracks-bg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.lane-empty {
  position: relative; z-index: 1; align-self: center;
  background: rgba(21, 16, 12, 0.72); border: 1px solid rgba(216, 192, 156, 0.18);
  padding: 6px 16px; border-radius: 999px;
  color: rgba(234,217,191,0.62); font-size: 0.82rem;
}

.duel-unit {
  position: relative; z-index: 1; width: 146px;
  background: linear-gradient(160deg, #dfd0b4 0%, #b7966c 100%);
  color: var(--ink); border: 2px solid #2b1e14; border-radius: 13px; padding: 5px 5px 10px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.duel-unit.is-ready {
  box-shadow: 0 0 0 2.5px #4ade80, 0 0 18px rgba(34, 197, 94, 0.78), 0 8px 18px rgba(0,0,0,0.52);
}
.duel-unit.has-guard {
  border: 2.5px solid #f59e0b;
  border-radius: 15px;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35), 0 8px 18px rgba(0, 0, 0, 0.58);
}
.duel-unit.is-ready.has-guard {
  box-shadow: 0 0 0 2.5px #4ade80, 0 0 20px rgba(34, 197, 94, 0.8), 0 8px 18px rgba(0, 0, 0, 0.58);
}
.duel-unit.has-shield::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  border: 2px solid rgba(125, 211, 252, 0.9);
  background: radial-gradient(circle at 50% 35%, rgba(254, 240, 138, 0.14), rgba(56, 189, 248, 0.08) 70%, transparent);
  box-shadow: inset 0 0 12px rgba(253, 224, 71, 0.42), 0 0 14px rgba(56, 189, 248, 0.48);
  pointer-events: none;
  z-index: 2;
}
.duel-unit.is-selected { transform: translateY(-6px); box-shadow: 0 0 0 3.5px #fff3c4, 0 0 22px rgba(233,196,106,0.92); z-index: 6; }
.duel-unit.is-targetable { box-shadow: 0 0 0 3px #ef4444, 0 0 20px rgba(239, 68, 68, 0.88); }
.duel-unit.is-immobilized { opacity: 0.72; filter: saturate(0.5); }

.unit-guard-crest {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  color: #fef3c7; border: 1.5px solid #fde68a; border-radius: 999px;
  padding: 1px 7px; font-family: 'Courier Prime', monospace; font-size: 0.55rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.68); pointer-events: none;
}

.unit-portrait-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border: 1.5px solid #1f1610; border-radius: 7px; overflow: hidden; background: #1e1610;
}
.unit-portrait-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unit-net-pip {
  position: absolute; top: 4px; left: 4px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 999px;
  font-family: 'Courier Prime', monospace; font-size: 0.54rem; font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.65);
}
.unit-net-pip svg { width: 10px; height: 10px; display: block; }
.unit-top-right {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px;
}
.unit-sleep-badge {
  background: rgba(15, 23, 42, 0.88); color: #bae6fd;
  border: 1px solid rgba(148, 163, 184, 0.5); font-size: 0.58rem; line-height: 1;
  padding: 3px 4px; border-radius: 999px;
}
.unit-kw-strip {
  position: absolute; left: 4px; right: 4px; bottom: 4px; z-index: 3;
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap; pointer-events: none;
}
.unit-kw-pip {
  background: rgba(18, 13, 9, 0.88); color: #fef3c7;
  border: 1px solid rgba(233, 196, 106, 0.55); border-radius: 999px;
  font-size: 0.58rem; padding: 1px 5px; font-weight: 800; line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}
.unit-kw-pip.is-shield { background: #1e3a8a; border-color: #60a5fa; color: #dbeafe; }
.unit-kw-pip.is-direct { background: #065f46; border-color: #34d399; color: #d1fae5; }
.unit-kw-pip.is-crush { background: #7f1d1d; border-color: #f87171; color: #fee2e2; }
.unit-kw-pip.is-fx { background: #451a03; border-color: #fbbf24; color: #fde047; }
.unit-plate {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}

.unit-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.unit-badge {
  background: rgba(21,16,12,0.9); color: #f6ecda;
  border: 1px solid rgba(233, 196, 106, 0.4);
  font-size: 0.62rem; padding: 2px 6px; border-radius: 4px; font-weight: 700;
}
.unit-badge.shield { background: #1e3a8a; border-color: #60a5fa; color: #dbeafe; }
.unit-badge.guard { background: #78350f; border-color: #fbbf24; color: #fef3c7; }
.unit-badge.direct { background: #065f46; border-color: #34d399; color: #d1fae5; }
.unit-badge.crush { background: #7f1d1d; border-color: #f87171; color: #fee2e2; }
.unit-delay {
  background: #c27817; color: #fff;
  font-size: 0.58rem; font-weight: 700; padding: 2px 5px; border-radius: 999px;
}
.unit-delay.is-max { background: #a82018; }
.unit-name { font-weight: 700; font-size: 0.72rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unit-tonnage-bar {
  position: relative; height: 14px; border-radius: 5px; overflow: hidden;
  background: rgba(34,25,19,0.22); border: 1px solid rgba(34,25,19,0.45);
  display: flex; align-items: center; justify-content: center;
}
.unit-tonnage-bar .tonnage-fill {
  position: absolute; inset: 0 auto 0 0; background: rgba(183, 121, 31, 0.55); transition: width 220ms ease;
}
.unit-tonnage-bar span {
  position: relative; z-index: 1; font-family: 'Courier Prime', monospace; font-size: 0.56rem; font-weight: 700; color: var(--ink);
}

.unit-state-pill {
  font-family: 'Courier Prime', monospace; font-size: 0.58rem; font-weight: 700;
  text-align: center; padding: 2px 5px; border-radius: 4px;
}
.unit-state-pill.is-ready { background: rgba(31, 138, 91, 0.2); color: #124e33; }
.unit-state-pill.is-wait { background: rgba(34, 25, 19, 0.14); color: var(--ink-soft); }
.unit-state-pill.is-warn { background: rgba(168, 32, 24, 0.22); color: #7f1d1d; }

.unit-orbs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  margin: 1px -5px -11px; position: relative; z-index: 4;
}
.hs-stat-orb {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  font-family: 'Courier Prime', monospace; font-weight: 900; font-size: 0.72rem; line-height: 1;
  padding: 3px 7px; border-radius: 999px; border: 1.8px solid #1c130d;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.72); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}
.hs-stat-orb.is-atk { background: linear-gradient(180deg, #ea580c 0%, #991b1b 100%); }
.hs-stat-orb.is-hp { background: linear-gradient(180deg, #b91c1c 0%, #450a0a 100%); border-color: #2c1414; }
.hs-stat-orb.is-buffed {
  color: #bbf7d0; border-color: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.58), 0 3px 8px rgba(0, 0, 0, 0.72);
}
.hs-stat-orb.is-damaged {
  color: #fecaca; border-color: #f87171;
  background: linear-gradient(180deg, #991b1b 0%, #3b0808 100%);
  box-shadow: 0 0 9px rgba(248, 113, 113, 0.6), 0 3px 8px rgba(0, 0, 0, 0.72);
}

.unit-stats { display: flex; justify-content: space-between; font-family: 'Courier Prime', monospace; font-weight: 700; font-size: 0.74rem; margin-top: auto; }
.u-atk { background: #99261d; color: #fff; padding: 2px 7px; border-radius: 4px; }
.u-def { background: #234966; color: #fff; padding: 2px 7px; border-radius: 4px; }
.unit-info-btn {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--ink); background: rgba(246,236,218,0.94); color: var(--ink); font-size: 0.66rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

.duel-mid-strip {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(39, 29, 21, 0.92), rgba(64, 48, 32, 0.95) 50%, rgba(39, 29, 21, 0.92));
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 10px;
}
.turn-status { font-size: 0.88rem; }
.turn-status.is-my-turn strong { color: var(--gold-bright); }
.duel-coach-pill {
  padding: 5px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid rgba(233, 196, 106, 0.4);
  background: rgba(21, 16, 12, 0.72); color: #fce7b2;
}
.duel-coach-pill.is-done {
  border-color: rgba(74, 222, 128, 0.65); background: rgba(22, 101, 52, 0.35); color: #dcfce7;
}
.duel-coach-pill.is-attack {
  border-color: rgba(248, 113, 113, 0.65); background: rgba(153, 27, 27, 0.34); color: #fee2e2;
}
.duel-coach-pill.is-wait {
  border-color: rgba(148, 163, 184, 0.38); color: rgba(226, 232, 240, 0.85);
}
.btn-end-turn-glow {
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.65), 0 0 18px rgba(233, 196, 106, 0.75);
  animation: endTurnPulse 1.5s ease-in-out infinite;
}
.duel-prompt { background: rgba(233,196,106,0.22); border: 1px solid var(--gold-bright); padding: 5px 14px; border-radius: 999px; font-size: 0.8rem; }
.duel-mid-btns { display: flex; gap: 8px; }

.duel-hand-dock {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 12px 10px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(44, 33, 24, 0.78) 0%, rgba(20, 14, 10, 0.92) 100%);
  border: 1px solid rgba(216, 192, 156, 0.24);
}
.hand-dock-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 0 4px;
}
.hand-dock-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 0.86rem; color: var(--gold-bright);
}
.hand-dock-rule {
  font-size: 0.74rem; color: rgba(234, 217, 191, 0.74);
}

.duel-hand-tray {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 192, 156, 0.38) rgba(20, 14, 10, 0.5);
}
.hand-card {
  flex: 0 0 144px; background: linear-gradient(160deg, #f5ead6 0%, #dcc196 100%); color: var(--ink);
  border: 2px solid #2b1e14; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
  transition: transform 160ms ease, box-shadow 160ms ease;
  opacity: 1 !important;
}
.hand-card.is-playable {
  box-shadow: 0 0 0 2.5px #4ade80, 0 0 18px rgba(74, 222, 128, 0.7), 0 10px 22px rgba(0, 0, 0, 0.65);
  cursor: pointer;
}
.hand-card.is-playable:hover {
  box-shadow: 0 0 0 3px #86efac, 0 20px 38px rgba(0, 0, 0, 0.85);
}
.hand-card.is-selected-hand {
  box-shadow: 0 0 0 3px #fde047, 0 0 22px rgba(250, 204, 21, 0.85);
}
.hand-card.is-unplayable {
  opacity: 1 !important;
  background: linear-gradient(160deg, #ded1ba 0%, #bca98b 100%);
  border-color: #3a2c20;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.62);
  cursor: pointer;
}
.hc-mana-gem {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%) !important;
  color: #fff !important;
  border: 1.5px solid #dbeafe !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.hand-card.is-unplayable .hc-mana-gem {
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%) !important;
  color: #cbd5e1 !important;
  border-color: #64748b !important;
}
.hc-mana-gem.is-maint {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
  border-color: #fde68a !important;
}

.hc-top {
  display: flex; align-items: center; justify-content: space-between; gap: 5px;
  padding: 3px 6px; border-radius: 6px; font-size: 0.68rem;
}
.hc-cost {
  width: 20px; height: 20px; border-radius: 50%; background: #f3e6cf; color: var(--ink); border: 1.4px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex-shrink: 0;
}
.hc-net { font-family: 'Courier Prime', monospace; font-size: 0.62rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: center; }
.hc-inspect {
  background: rgba(243, 230, 207, 0.9); color: var(--ink); border: 1px solid var(--ink);
  border-radius: 50%; width: 19px; height: 19px; font-size: 0.62rem; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.hc-img-wrap { position: relative; width: 100%; }
.hc-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1.2px solid var(--ink); border-radius: 5px; display: block; }
.hc-name { font-weight: 700; font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-stat-pills {
  display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
}
.hc-stat-pills .stat-box { font-size: 0.54rem; padding: 2px 5px; }
.hc-rules {
  font-size: 0.63rem; line-height: 1.24; color: var(--ink-soft);
  background: rgba(246, 236, 218, 0.52); border: 1px solid rgba(34, 25, 19, 0.22);
  border-radius: 4px; padding: 3px 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hc-status-pill {
  font-family: 'Courier Prime', monospace; font-size: 0.62rem; font-weight: 700;
  text-align: center; padding: 3px 6px; border-radius: 5px; line-height: 1.2;
}
.hc-status-pill.is-ok { background: rgba(31, 138, 91, 0.22); color: #125135; border: 1px solid rgba(31, 138, 91, 0.5); }
.hc-status-pill.is-net { background: rgba(185, 28, 28, 0.16); color: #7f1d1d; border: 1px solid rgba(185, 28, 28, 0.45); }
.hc-status-pill.is-cost,
.hc-status-pill.is-loco { background: rgba(194, 89, 26, 0.18); color: #7c2d12; border: 1px solid rgba(194, 89, 26, 0.45); }
.hc-status-pill.is-limit,
.hc-status-pill.is-wait { background: rgba(51, 65, 85, 0.16); color: #334155; border: 1px solid rgba(51, 65, 85, 0.35); }
.hc-actions { display: flex; gap: 5px; margin-top: auto; }
.hc-actions .btn-primary { flex: 1; }

.duel-footer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 12px; background: rgba(14, 10, 7, 0.78);
  border: 1px solid rgba(216, 192, 156, 0.2); border-radius: 9px;
}
.duel-last-log {
  flex: 1 1 auto; min-width: 0; font-family: 'Courier Prime', monospace; font-size: 0.74rem;
  color: rgba(234, 217, 191, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.duel-log-box {
  max-height: 132px; overflow-y: auto; background: rgba(14,10,7,0.85);
  border: 1px solid rgba(216, 192, 156, 0.2);
  border-radius: 10px; padding: 10px 14px; font-family: 'Courier Prime', monospace; font-size: 0.74rem; line-height: 1.5;
}
.log-t { color: var(--gold-bright); }

@keyframes endTurnPulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.025); }
}

.duel-wait-overlay {
  position: fixed; inset: 0; z-index: 55; background: rgba(12, 8, 6, 0.86); backdrop-filter: blur(7px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(14px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.duel-wait-overlay > .kraft-panel,
.mulligan-modal,
.finish-modal { margin: auto; }
.mulligan-modal { max-width: 1120px; width: 100%; text-align: center; }
.finish-modal { max-width: 680px; width: 100%; text-align: center; }
.duel-log-modal { max-width: 660px; width: 100%; text-align: left; padding: 16px; }
.dlm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dlm-head h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; color: var(--gold-bright); font-size: 1.02rem; }
.duel-log-modal .duel-log-box { max-height: min(62vh, 460px); }
.mulligan-cards {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 26px 0;
}
.mulligan-item {
  width: 184px; display: flex; flex-direction: column; gap: 10px; cursor: pointer;
}
.mulligan-card-frame {
  position: relative; width: 184px; height: calc(184px * 1.48); border-radius: 10px;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}
.mulligan-item:not(.is-marked):hover .mulligan-card-frame {
  transform: translateY(-4px);
}
.mulligan-item.is-marked .mulligan-card-frame {
  transform: translateY(6px);
  filter: brightness(0.84) sepia(0.22);
  box-shadow: 0 0 0 3px #e2574c;
}
.mull-inspect-btn {
  position: absolute; bottom: 5px; right: 5px; z-index: 12; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--ink); background: rgba(246,236,218,0.95);
  color: var(--ink); font-size: 0.66rem; font-weight: 700; cursor: pointer;
}
.mull-toggle-btn {
  appearance: none;
  background: rgba(31, 138, 91, 0.24);
  border: 1.5px solid rgba(34, 197, 94, 0.65);
  color: #bbf7d0;
  font-family: 'Courier Prime', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.mull-toggle-btn.is-marked {
  background: rgba(185, 28, 28, 0.34);
  border-color: #ef4444;
  color: #fecaca;
}
.finish-btns { display: flex; gap: 14px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* =========================================================================
   MARKETPLACE, RULES & ADMIN PANEL
========================================================================= */
.mk-subtitle-tight { margin: 4px 0 0; }
.mk-alert-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 13px 18px; border-radius: 13px;
  background: linear-gradient(90deg, rgba(183, 121, 31, 0.28), rgba(233, 196, 106, 0.2), rgba(183, 121, 31, 0.28));
  border: 1.5px solid rgba(233, 196, 106, 0.72);
  color: #fef3c7; font-weight: 600; font-size: 0.9rem;
}

.mk-ticket-builder {
  display: grid;
  grid-template-columns: 224px 52px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 75% 70% at 50% 50%, rgba(168, 128, 84, 0.14) 0%, rgba(20, 14, 10, 0.78) 100%);
  border: 1px solid rgba(216, 192, 156, 0.25);
}
@media (max-width: 860px) {
  .mk-ticket-builder { grid-template-columns: 1fr; }
  .mk-swap-connector { display: flex; justify-content: center; }
}
.mk-step-col {
  display: flex; flex-direction: column; gap: 10px;
}
.mk-step-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800; font-size: 0.92rem;
  color: var(--gold-bright); letter-spacing: 0.02em;
}
.mk-slot-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 290px; border-radius: 14px; padding: 12px;
  background: rgba(21, 16, 12, 0.72); border: 2px dashed rgba(233, 196, 106, 0.42);
  color: var(--kraft-light); cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.mk-slot-box.is-empty:hover:not(:disabled) {
  border-color: var(--gold-bright); background: rgba(45, 34, 24, 0.85); transform: translateY(-2px);
}
.mk-slot-box.is-empty:disabled { opacity: 0.55; cursor: not-allowed; }
.mk-slot-box.is-filled {
  border-style: solid; border-color: rgba(233, 196, 106, 0.72); cursor: default;
}
.mk-plus-ring {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px dashed rgba(233, 196, 106, 0.72);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 700; color: var(--gold-bright);
  background: rgba(233, 196, 106, 0.1);
}
.mk-slot-card-wrap {
  width: 176px; cursor: pointer; transition: transform 160ms ease;
}
.mk-slot-card-wrap:hover { transform: translateY(-3px); }
.mk-slot-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.mk-swap-connector { display: flex; align-items: center; justify-content: center; }
.mk-swap-emblem {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(180deg, #ead9bf 0%, #c4a377 100%);
  border: 2px solid #2b1f16; color: #1f1610;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 900;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
}
.mk-swap-emblem.is-sm { width: 32px; height: 32px; font-size: 0.95rem; flex-shrink: 0; }

.mk-step-want { align-self: stretch; justify-content: space-between; }
.mk-mode-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.mk-mode-tab {
  appearance: none; flex: 1 1 180px;
  background: rgba(21, 16, 12, 0.72); border: 1px solid rgba(216, 192, 156, 0.25);
  color: rgba(234, 217, 191, 0.85); border-radius: 10px; padding: 10px 14px;
  font-family: 'Bitter', Georgia, serif; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.mk-mode-tab:hover { border-color: rgba(233, 196, 106, 0.6); }
.mk-mode-tab.is-active {
  background: rgba(233, 196, 106, 0.2); border-color: var(--gold-bright); color: var(--gold-bright);
}

.mk-rarity-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px;
  background: rgba(21, 16, 12, 0.56); border: 1px solid rgba(216, 192, 156, 0.16); border-radius: 12px;
}
.mk-rchip {
  appearance: none; background: rgba(39, 30, 22, 0.88); border: 1px solid rgba(216, 192, 156, 0.26);
  color: rgba(234, 217, 191, 0.88); border-radius: 999px; padding: 6px 14px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.mk-rchip:hover { border-color: rgba(233, 196, 106, 0.6); }
.mk-rchip.is-selected {
  background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
  border-color: #2b1f16; color: #1f1610; font-weight: 700;
}

.mk-wanted-exact-box { position: relative; }
.mk-wanted-autocomplete { position: relative; }
.mk-wanted-autocomplete .field-input { width: 100%; }
.mk-want-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 25;
  background: #1d150f; border: 1.5px solid rgba(233, 196, 106, 0.55);
  border-radius: 12px; box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72);
  max-height: 290px; overflow-y: auto; padding: 6px;
}
.mk-want-row {
  appearance: none; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: transparent; border: 0; border-radius: 8px; color: var(--kraft-light); cursor: pointer;
}
.mk-want-row:hover { background: rgba(233, 196, 106, 0.16); }
.mk-want-row img { width: 52px; height: 36px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.mk-wr-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-wr-info strong { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-wr-info small { font-size: 0.72rem; color: rgba(234, 217, 191, 0.72); }
.mk-want-empty { padding: 12px; text-align: center; font-size: 0.82rem; color: rgba(234, 217, 191, 0.65); }

.mk-wanted-selected {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: rgba(22, 101, 52, 0.24); border: 1.5px solid rgba(74, 222, 128, 0.55); border-radius: 12px;
}
.mk-wanted-selected img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(216,192,156,0.4); }
.mk-ws-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mk-instant-pill {
  display: inline-flex; align-self: flex-start;
  background: rgba(22, 101, 52, 0.65); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.65);
  border-radius: 999px; padding: 2px 9px; font-size: 0.68rem; font-weight: 700;
}

.mk-publish-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 4px;
}
.mk-publish-row .field-input { flex: 1 1 220px; }

.mk-board-tabs {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
  border-bottom: 1px solid rgba(216, 192, 156, 0.2); padding-bottom: 14px;
}
.mk-board-tab {
  appearance: none; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(21, 16, 12, 0.68); border: 1px solid rgba(216, 192, 156, 0.24);
  color: rgba(234, 217, 191, 0.86); border-radius: 999px; padding: 9px 18px;
  font-family: 'Bitter', Georgia, serif; font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
.mk-board-tab.is-active {
  background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
  border-color: #2b1f16; color: #1f1610;
}
.mk-tab-badge {
  background: #b91c1c; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 0.72rem; font-weight: 700;
}

.mk-empty-hall {
  text-align: center; padding: 38px 20px; border-radius: 14px;
  background: rgba(21, 16, 12, 0.56); border: 1.5px dashed rgba(216, 192, 156, 0.24);
}
.mk-empty-ico { font-size: 2.3rem; margin-bottom: 8px; }
.mk-empty-hall h4 { margin: 0 0 6px; color: var(--gold-bright); font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; }

.mk-offers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px;
}
@media (max-width: 520px) {
  .mk-offers-grid { grid-template-columns: 1fr; }
}
.mk-listing-ticket {
  display: grid; grid-template-columns: 162px minmax(0, 1fr); gap: 16px; align-items: start;
  background: rgba(21, 16, 12, 0.72); border: 1px solid rgba(216, 192, 156, 0.25);
  border-radius: 14px; padding: 14px;
}
@media (max-width: 460px) {
  .mk-listing-ticket { grid-template-columns: 1fr; }
}
.mk-ticket-card { cursor: pointer; transition: transform 160ms ease; }
.mk-ticket-card:hover { transform: translateY(-3px); }
.mk-ticket-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; height: 100%; }
.mk-ticket-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.78rem; }
.mk-ticket-want {
  padding: 9px 12px; border-radius: 10px;
  background: rgba(39, 30, 22, 0.72); border: 1px solid rgba(216, 192, 156, 0.2);
  font-size: 0.8rem;
}
.mk-ticket-want.is-exact {
  background: rgba(22, 101, 52, 0.18); border-color: rgba(74, 222, 128, 0.45);
}
.mk-want-target-row { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.mk-want-target-row img { width: 52px; height: 36px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.mk-want-target-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mk-note {
  margin: 0; padding: 7px 10px; border-radius: 8px;
  background: rgba(233, 196, 106, 0.08); border-left: 2.5px solid rgba(233, 196, 106, 0.5);
  font-style: italic; font-size: 0.78rem; color: rgba(246, 231, 203, 0.9);
}
.mk-ticket-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.mk-missing-badge {
  font-size: 0.75rem; color: rgba(234, 217, 191, 0.65);
  background: rgba(39, 30, 22, 0.7); border: 1px solid rgba(216, 192, 156, 0.2);
  padding: 6px 10px; border-radius: 8px;
}

.mk-props-section + .mk-props-section { margin-top: 26px; }
.mk-props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; margin-top: 12px; }
@media (max-width: 520px) { .mk-props-grid { grid-template-columns: 1fr; } }
.mk-prop-duel-card {
  display: flex; flex-direction: column; gap: 12px;
  background: rgba(21, 16, 12, 0.72); border: 1px solid rgba(216, 192, 156, 0.25);
  border-radius: 14px; padding: 14px;
}
.mk-prop-header { font-size: 0.84rem; color: rgba(234, 217, 191, 0.92); }
.mk-prop-pair { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); gap: 10px; align-items: center; }
.mk-prop-card-wrap { cursor: pointer; transition: transform 150ms ease; }
.mk-prop-card-wrap:hover { transform: translateY(-2px); }
.mk-prop-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.mk-picker-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(12, 8, 6, 0.84); backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mk-picker-modal {
  max-width: 1120px; width: 100%; max-height: 88dvh;
  display: flex; flex-direction: column; gap: 14px; overflow: hidden;
}
.mk-picker-modal h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; color: var(--gold-bright); }
.mk-pk-filters { margin-bottom: 4px; }
.mk-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 18px;
  overflow-y: auto; padding: 12px 6px 6px;
  scrollbar-width: thin; scrollbar-color: rgba(216, 192, 156, 0.38) rgba(20, 14, 10, 0.5);
}
.mk-pk-item {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 9px; border-radius: 13px;
  background: rgba(21, 16, 12, 0.78); border: 1.5px solid rgba(216, 192, 156, 0.26);
  cursor: pointer; transition: transform 160ms ease, border-color 160ms ease;
}
.mk-pk-item:hover { transform: translateY(-3px); border-color: var(--gold-bright); }
.mk-pk-item.is-dup { border-color: rgba(233, 196, 106, 0.75); }
.mk-dup-badge {
  position: absolute; top: -9px; right: 10px; z-index: 12;
  background: linear-gradient(180deg, #f0d080 0%, #c99d3b 100%);
  color: #1f1610; border: 1.5px solid #2b1f16; border-radius: 999px;
  padding: 2px 9px; font-family: 'Courier Prime', monospace; font-size: 0.66rem; font-weight: 700;
}
.mk-pk-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-family: 'Courier Prime', monospace; font-size: 0.72rem; color: rgba(234, 217, 191, 0.85);
}

.rules-list { line-height: 1.7; padding-left: 22px; }
.rules-list li { margin-bottom: 14px; }

.admin-bot-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  background: rgba(21,16,12,0.68); border: 1px solid rgba(233,196,106,0.38); border-radius: 12px; padding: 20px; margin: 20px 0;
}
.admin-bot-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-announce-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.admin-announce-row .field-input { flex: 1 1 280px; }
.admin-reports-list { display: flex; flex-direction: column; gap: 18px; }
.admin-report-card {
  background: rgba(21,16,12,0.72); border: 1px solid rgba(216,192,156,0.24); border-radius: 12px; padding: 20px;
}
.ar-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.ar-msg { margin: 10px 0; font-style: italic; color: #f6e7cb; }
.ar-variants-strip { display: flex; gap: 12px; overflow-x: auto; padding: 10px 0; }
.ar-var-item {
  flex: 0 0 128px; background: rgba(39,30,22,0.8); border: 1.5px solid rgba(216,192,156,0.25);
  border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 6px;
}
.ar-var-item.is-reported { border-color: #d95a4f; box-shadow: 0 0 10px rgba(217,90,79,0.5); }
.ar-var-item.is-disabled { opacity: 0.4; }
.ar-var-item img { width: 100%; height: 74px; object-fit: cover; border-radius: 4px; }
.ar-var-btns { display: flex; gap: 4px; justify-content: space-between; align-items: center; }
.var-star { font-size: 0.7rem; color: var(--gold-bright); font-weight: 700; }
.ar-reply-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ar-reply-row .field-input { flex: 1 1 240px; }

.adm-card-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(21,16,12,0.62); border-radius: 10px; margin-bottom: 10px;
}
.adm-card-row img { width: 76px; height: 50px; object-fit: cover; border-radius: 5px; }
.adm-card-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.adm-user-row {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px 14px; background: rgba(21,16,12,0.6); border-radius: 9px; margin-bottom: 8px; font-size: 0.86rem;
}

/* =========================================================================
   INSPECT MODAL & AUTH MODAL & TOASTS
========================================================================= */
.inspect-modal {
  position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(14, 10, 7, 0.88); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 220ms ease;
}
.inspect-modal.is-open { opacity: 1; pointer-events: auto; }
.inspect-layout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; max-width: 980px; width: 100%;
}
.inspect-scene { width: var(--inspect-w); height: var(--inspect-h); perspective: 1400px; cursor: grab; touch-action: none; }
.inspect-scene.is-dragging { cursor: grabbing; }
.inspect-pivot { width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }

.inspect-pivot .card-face { border-radius: 14px; }
.inspect-pivot .card-face-front { padding: 11px; }
.inspect-pivot .cost-stamp { width: 32px; height: 32px; font-size: 1.15rem; }
.inspect-pivot .network-stamp { width: 32px; height: 32px; }
.inspect-pivot .network-stamp svg { width: 20px; height: 20px; }
.inspect-pivot .gauge-pill { font-size: 0.66rem; padding: 3px 7px; }
.inspect-pivot .card-title { font-size: 1rem; }
.inspect-pivot .card-family { font-size: 0.72rem; }
.inspect-pivot .rarity-stamp { font-size: 0.68rem; }
.inspect-pivot .card-rules-text { font-size: 0.86rem; line-height: 1.38; -webkit-line-clamp: 6; }
.inspect-pivot .card-tech-line { font-size: 0.68rem; }
.inspect-pivot .stat-box { font-size: 0.78rem; padding: 4px 7px; }

.inspect-controls { display: flex; flex-direction: column; gap: 14px; max-width: 440px; width: 100%; }
.inspect-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.inspect-credits {
  font-family: 'Courier Prime', monospace; font-size: 0.78rem; line-height: 1.5;
  color: rgba(234,217,191,0.86); background: rgba(28,20,15,0.85);
  border: 1px solid rgba(216,192,156,0.24); border-radius: 10px; padding: 12px 14px;
}
.inspect-variants { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.variant-thumb-btn {
  flex: 0 0 86px; background: rgba(21,16,12,0.85); border: 1.5px solid rgba(216,192,156,0.28);
  border-radius: 7px; padding: 4px; color: var(--kraft-light); cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-size: 0.64rem;
}
.variant-thumb-btn.is-selected { border-color: var(--gold-bright); }
.variant-thumb-btn img { width: 100%; height: 50px; object-fit: cover; border-radius: 4px; }
.inspect-report-form {
  display: flex; flex-direction: column; gap: 10px; background: rgba(21,16,12,0.85);
  border: 1px solid rgba(216,192,156,0.28); border-radius: 12px; padding: 14px;
}

.simple-modal {
  position: fixed; inset: 0; z-index: 70; background: rgba(12,8,6,0.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.simple-modal-box { position: relative; max-width: 480px; width: 100%; max-height: 86dvh; overflow-y: auto; }
.modal-x-btn {
  position: absolute; top: 14px; right: 14px; background: none; border: 0; color: var(--kraft-light); font-size: 1.25rem; cursor: pointer;
}
.modal-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.modal-links-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.notif-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.notif-item { background: rgba(21,16,12,0.68); border: 1px solid rgba(216,192,156,0.22); border-radius: 10px; padding: 12px 14px; }
.notif-item.is-unread { border-color: var(--gold-bright); }
.notif-item p { margin: 5px 0; font-size: 0.86rem; }

.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: #271e16; border: 1px solid var(--gold-bright); color: var(--kraft-light);
  padding: 12px 16px; border-radius: 11px; box-shadow: 0 12px 30px rgba(0,0,0,0.58); font-size: 0.86rem;
  transition: opacity 260ms ease;
}
.toast-ok { border-color: #65ad72; }
.toast-err { border-color: #df6b61; }
.toast.is-fading { opacity: 0; }

@media (max-width: 720px) {
  :root {
    --card-w: clamp(134px, 40vw, 166px);
  }
  .booster-arena {
    min-height: 390px;
  }
  .mulligan-item { width: 146px; }
  .mulligan-card-frame { width: 146px; height: calc(146px * 1.48); }
  .hand-card { flex: 0 0 156px; }
  .duel-unit { width: 150px; }
}

/* =========================================================================
   DUEL COMBAT ANIMATIONS & "LA CASSE" (SCRAPYARD PILE + MODAL)
========================================================================= */
.casse-pile-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(21, 16, 12, 0.9);
  border: 1px solid rgba(216, 192, 156, 0.36);
  color: var(--kraft-light);
  border-radius: 999px;
  padding: 4px 11px 4px 6px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.casse-pile-btn:hover {
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}
.casse-pile-btn.is-receiving {
  animation: casseReceivePulse 480ms ease-out;
}
.casse-thumb {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(216, 192, 156, 0.45);
  filter: sepia(0.45) contrast(1.1);
}
.casse-empty-ico {
  font-size: 0.76rem;
}
.casse-count {
  color: var(--gold-bright);
}

.casse-modal {
  max-width: 1080px;
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
}
.casse-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  margin-top: 12px;
}
.casse-card-item {
  cursor: pointer;
  transition: transform 160ms ease;
}
.casse-card-item:hover {
  transform: translateY(-4px);
}
.casse-card-item .card-photo {
  filter: sepia(0.35) grayscale(0.42) contrast(1.06);
}

.arena-board.is-shaking {
  animation: boardShake 320ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.duel-player-bar.is-hit-flash,
.hs-hero-frame.is-hit-flash {
  animation: barHitFlash 460ms ease-out;
}

.duel-unit.anim-unit-enter {
  animation: unitRailEnter 340ms cubic-bezier(0.22, 1, 0.36, 1);
}
.duel-unit.anim-coupled-pulse {
  animation: coupledPulse 420ms ease-out;
}
.mini-station.anim-station-enter {
  animation: stationSnapEnter 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.hand-card.anim-card-draw {
  animation: handCardDraw 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.duel-floating-pop {
  position: fixed;
  z-index: 80;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.25rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  animation: duelPopFloat 960ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.duel-floating-pop.is-dmg {
  color: #fecaca;
  background: rgba(153, 27, 27, 0.88);
  border: 1.5px solid #f87171;
}
.duel-floating-pop.is-buff {
  color: #dcfce7;
  background: rgba(22, 101, 52, 0.88);
  border: 1.5px solid #4ade80;
}
.duel-floating-pop.is-shield {
  color: #dbeafe;
  background: rgba(30, 64, 175, 0.9);
  border: 1.5px solid #60a5fa;
}
.duel-floating-pop.is-crush {
  color: #ffedd5;
  background: rgba(154, 52, 18, 0.92);
  border: 1.5px solid #fb923c;
}
.duel-floating-pop.is-blocked {
  color: #fff1f2;
  background: rgba(185, 28, 28, 0.95);
  border: 2px solid #fca5a5;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.8);
}

.duel-flying-scrap {
  position: fixed;
  z-index: 82;
  pointer-events: none;
  background: linear-gradient(155deg, #d8c09c, #9f7c54);
  border: 2px solid #991b1b;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), 0 0 18px rgba(220, 38, 38, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform-origin: center center;
}
.duel-flying-scrap img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 5px;
  filter: sepia(0.5) grayscale(0.55) contrast(1.1);
}
.duel-flying-scrap .scrap-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #221913;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duel-flying-scrap .scrap-stamp {
  background: #b91c1c;
  color: #fff;
  font-family: 'Courier Prime', monospace;
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.duel-signal-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(12, 8, 6, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.duel-signal-reveal-overlay.is-fading {
  opacity: 0;
}
.signal-reveal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: unitRailEnter 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.signal-reveal-title {
  background: linear-gradient(90deg, #7f1d1d, #dc2626, #7f1d1d);
  color: #fff;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 8px 22px;
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.7);
}
.signal-reveal-card {
  position: relative;
  width: 210px;
  height: calc(210px * 1.48);
}

.duel-turn-banner {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 42;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(21,16,12,0.1), rgba(34,25,19,0.96) 20%, rgba(34,25,19,0.96) 80%, rgba(21,16,12,0.1));
  border-top: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  color: var(--gold-bright);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 44px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  animation: turnBannerAnim 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes boardShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-6px, 3px, 0); }
  40% { transform: translate3d(6px, -3px, 0); }
  60% { transform: translate3d(-4px, -2px, 0); }
  80% { transform: translate3d(4px, 2px, 0); }
}
@keyframes barHitFlash {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9); background: rgba(153, 27, 27, 0.55); }
  100% { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
}
@keyframes casseReceivePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.85); border-color: #ef4444; }
  45% { transform: scale(1.16); box-shadow: 0 0 18px rgba(239, 68, 68, 0.75); border-color: #fca5a5; }
  100% { transform: scale(1); box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
@keyframes unitRailEnter {
  0% { opacity: 0; transform: translate3d(-26px, 14px, 0) scale(0.9); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes coupledPulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.8); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.45); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); transform: scale(1); }
}
@keyframes stationSnapEnter {
  0% { opacity: 0; transform: translateY(-10px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes handCardDraw {
  0% { opacity: 0; transform: translate3d(38px, 0, 0) scale(0.88); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes duelPopFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -65%) scale(1.08); }
  80% { opacity: 1; transform: translate(-50%, -125%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(0.92); }
}
@keyframes turnBannerAnim {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

/* =========================================================================
   LEGENDARY BOOSTER REVEAL FX
========================================================================= */
.booster-arena {
  position: relative;
}
.legendary-screen-flash {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(255, 236, 168, 0.36) 0%, rgba(233, 196, 106, 0.16) 45%, rgba(18, 12, 6, 0.48) 100%);
  animation: legendaryFlashAnim 2.1s ease-out forwards;
}
.card-slot.is-legendary-tease .card-hover-wrap {
  animation: legendaryTeaseShake 440ms ease-in-out infinite;
  box-shadow: 0 0 28px rgba(244, 204, 112, 0.95), 0 0 60px rgba(245, 158, 11, 0.65);
  border-radius: 12px;
}
.card-slot.is-legendary-slot {
  z-index: 32;
}
.card-slot.is-legendary-slot .card-face-front.is-legendary {
  box-shadow: 0 0 0 2.5px #fde68a, 0 0 34px rgba(245, 158, 11, 0.85), 0 18px 36px rgba(0, 0, 0, 0.72);
}
.legendary-sunburst {
  position: absolute;
  inset: -44%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 231, 155, 0.42) 0deg 12deg,
    transparent 12deg 24deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 28%, transparent 70%);
  mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 28%, transparent 70%);
  animation: legendarySpin 14s linear infinite, legendaryBurstIn 420ms ease-out;
}
.legendary-shockwave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.3);
  border-radius: 50%;
  border: 3px solid rgba(255, 238, 173, 0.95);
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.85);
  pointer-events: none;
  z-index: 25;
  animation: legendaryShockwaveAnim 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.legendary-drop-ribbon {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Courier Prime', monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #2b1904;
  background: linear-gradient(90deg, #f59e0b, #fef08a, #f59e0b);
  border: 1.5px solid #fffbeb;
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.78);
  animation: ribbonDropIn 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes legendaryFlashAnim {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes legendaryTeaseShake {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  25% { transform: translate3d(-4px, -2px, 0) rotate(-2deg) scale(1.09); }
  50% { transform: translate3d(4px, 2px, 0) rotate(2deg) scale(1.1); }
  75% { transform: translate3d(-3px, 1px, 0) rotate(-1.5deg) scale(1.08); }
}
@keyframes legendarySpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes legendaryBurstIn {
  0% { opacity: 0; transform: scale(0.35); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes legendaryShockwaveAnim {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.1); }
}
@keyframes ribbonDropIn {
  0% { opacity: 0; transform: translate(-50%, -14px) scale(0.75); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* =========================================================================
   DUEL 45S TIMER, SHOCKWAVES & ANIMATIONS
========================================================================= */
.duel-timer-box {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 108px;
  padding: 4px 10px;
  border-radius: 9px;
  background: rgba(16, 12, 9, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.55);
  font-family: 'Courier Prime', monospace;
}
.duel-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #bbf7d0;
}
.duel-timer-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.duel-timer-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 320ms linear, background 200ms ease;
}
.duel-timer-box.is-warn {
  border-color: rgba(245, 158, 11, 0.8);
}
.duel-timer-box.is-warn .duel-timer-head { color: #fde68a; }
.duel-timer-box.is-warn .duel-timer-fill { background: linear-gradient(90deg, #d97706, #fbbf24); }
.duel-timer-box.is-danger {
  border-color: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65);
  animation: endTurnPulse 0.75s ease-in-out infinite;
}
.duel-timer-box.is-danger .duel-timer-head { color: #fecaca; }
.duel-timer-box.is-danger .duel-timer-fill { background: linear-gradient(90deg, #991b1b, #ef4444); }

.duel-impact-ring {
  position: fixed;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 79;
  transform: translate(-50%, -50%) scale(0.25);
  border: 3px solid rgba(253, 224, 71, 0.92);
  box-shadow: 0 0 22px rgba(249, 115, 22, 0.75);
  animation: duelImpactRingAnim 540ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.duel-impact-ring.is-buff {
  border-color: rgba(74, 222, 128, 0.92);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7);
}
.duel-impact-ring.is-signal {
  border-color: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 24px rgba(220, 38, 38, 0.85);
}
@keyframes duelImpactRingAnim {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.75); }
}

.mini-station.anim-station-spend {
  animation: stationSpendPulse 520ms ease-out;
}
@keyframes stationSpendPulse {
  0% { box-shadow: 0 0 0 0 rgba(233, 196, 106, 0.9); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 14px rgba(233, 196, 106, 0); transform: scale(1); }
}
.finish-modal.is-animated-finish {
  animation: unitRailEnter 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================================
   TUTORIAL COACH PANEL & LOBBY CARD
========================================================================= */
.lobby-card-tutorial {
  border-color: rgba(74, 222, 128, 0.45);
  background: linear-gradient(155deg, rgba(22, 62, 42, 0.42), rgba(34, 25, 19, 0.85));
}
.tutorial-coach-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(95deg, rgba(16, 48, 35, 0.92), rgba(39, 30, 20, 0.94));
  border: 1.5px solid rgba(74, 222, 128, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.tuto-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.tuto-badge {
  font-family: 'Courier Prime', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.55);
  border: 1px solid rgba(74, 222, 128, 0.55);
  padding: 3px 10px;
  border-radius: 999px;
}
.tuto-progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tuto-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.tuto-dot.is-done { background: #22c55e; border-color: #86efac; }
.tuto-dot.is-current {
  background: #facc15;
  border-color: #fef08a;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.85);
}
.tuto-actions { display: flex; gap: 6px; }
.tuto-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--gold-bright);
}
.tuto-desc {
  font-size: 0.82rem;
  line-height: 1.42;
  color: #f3ebdc;
}
.hand-card.is-tuto-spotlight {
  box-shadow: 0 0 0 3px #facc15, 0 0 24px rgba(250, 204, 21, 0.85);
  animation: endTurnPulse 1.4s ease-in-out infinite;
}
.rules-tutorial-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-color: rgba(74, 222, 128, 0.5);
  background: linear-gradient(95deg, rgba(20, 56, 40, 0.72), rgba(38, 29, 21, 0.9));
}
.rules-tutorial-banner h3 { margin: 0 0 4px; color: var(--gold-bright); }
.rules-tutorial-banner p { margin: 0; }

/* =========================================================================
   LEADERBOARD ELO & FRIENDS SYSTEM
========================================================================= */
.social-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lb-search-row {
  display: flex;
  gap: 8px;
  flex: 0 1 280px;
}
.lb-guest-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(21, 16, 12, 0.65);
  border: 1px solid rgba(233, 196, 106, 0.32);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 12px;
}
.lb-podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}
.lb-podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(21, 16, 12, 0.78);
  border: 1.5px solid rgba(216, 192, 156, 0.28);
  text-align: center;
}
.lb-podium-card.podium-1 {
  border-color: rgba(250, 204, 21, 0.78);
  background: radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.16), rgba(21, 16, 12, 0.86) 72%);
}
.lb-podium-card.podium-2 { border-color: rgba(203, 213, 225, 0.62); }
.lb-podium-card.podium-3 { border-color: rgba(217, 119, 6, 0.62); }
.lb-podium-card.is-me { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.65); }
.lb-medal { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.05rem; color: var(--gold-bright); }
.lb-pod-name { display: inline-flex; align-items: center; gap: 6px; font-size: 0.96rem; }
.lb-pod-elo { font-family: 'Courier Prime', monospace; font-weight: 700; font-size: 1.1rem; color: #fef3c7; }
.lb-pod-stats { font-size: 0.74rem; color: rgba(234, 217, 191, 0.72); }

.lb-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: grid;
  grid-template-columns: 56px minmax(140px, 1.4fr) 130px 90px 120px auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(21, 16, 12, 0.64);
  border: 1px solid rgba(216, 192, 156, 0.16);
  font-size: 0.84rem;
}
.lb-row.lb-head-row {
  background: transparent;
  border-color: transparent;
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: rgba(234, 217, 191, 0.65);
}
.lb-row.is-self-row {
  border-color: rgba(74, 222, 128, 0.65);
  background: rgba(22, 78, 48, 0.34);
}
.lb-rank-num { font-family: 'Courier Prime', monospace; font-weight: 700; color: var(--gold-bright); }
.lb-player-cell { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.lb-player-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-elo-val { font-family: 'Courier Prime', monospace; font-weight: 700; color: #fde68a; }
.lb-rec-cell { font-family: 'Courier Prime', monospace; font-size: 0.76rem; color: rgba(234, 217, 191, 0.82); }
.lb-act-cell { display: flex; justify-content: flex-end; }
@media (max-width: 780px) {
  .lb-row {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas: "r p a" "t e rec";
  }
  .lb-head-row { display: none; }
}

.elo-tier-badge {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.elo-tier-badge.tier-legend { color: #fde047; background: rgba(161, 98, 7, 0.36); }
.elo-tier-badge.tier-master { color: #fca5a5; background: rgba(153, 27, 27, 0.34); }
.elo-tier-badge.tier-inspector { color: #93c5fd; background: rgba(30, 64, 175, 0.34); }
.elo-tier-badge.tier-conductor { color: #86efac; background: rgba(22, 101, 52, 0.34); }
.elo-tier-badge.tier-apprentice { color: #cbd5e1; background: rgba(51, 65, 85, 0.34); }

.presence-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.presence-dot.is-online {
  background: #22c55e;
  border-color: #bbf7d0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}

.friends-add-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.friends-add-bar .field-input { flex: 1 1 220px; }
.friends-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(16, 12, 9, 0.75);
  border: 1px solid rgba(233, 196, 106, 0.32);
}
.fr-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(34, 25, 19, 0.72);
}
.friends-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(21, 16, 12, 0.72);
  border: 1px solid rgba(216, 192, 156, 0.24);
}
.friend-card.has-open-room {
  border-color: rgba(74, 222, 128, 0.65);
  background: rgba(20, 56, 38, 0.42);
}
.friend-card.is-incoming { border-color: rgba(250, 204, 21, 0.58); }
.fc-info { display: flex; align-items: center; gap: 10px; }
.fc-info > div { display: flex; flex-direction: column; gap: 3px; }
.fc-info small { color: rgba(234, 217, 191, 0.72); font-size: 0.76rem; }
.fc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.friend-state-pill {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.friend-state-pill.is-friend { color: #86efac; background: rgba(22, 101, 52, 0.35); border: 1px solid rgba(74, 222, 128, 0.5); }
.friend-state-pill.is-pending { color: #fde68a; background: rgba(146, 64, 14, 0.35); border: 1px solid rgba(245, 158, 11, 0.5); }

.arena-quick-friends {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(216, 192, 156, 0.24);
}
.aqf-head {
  font-family: 'Courier Prime', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 6px;
}
.aqf-list { display: flex; flex-direction: column; gap: 6px; }
.aqf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(16, 12, 9, 0.58);
}
.aqf-row small { color: rgba(234, 217, 191, 0.65); margin-left: 4px; }
.aqf-empty { margin-top: 6px; }
.notif-act { margin-top: 8px; }

/* =========================================================================
   PC ARENA TACTICAL CLARITY & DESKTOP CARD INSPECTOR
========================================================================= */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.is-duel-active {
  overflow: hidden;
  height: var(--vvh, 100dvh);
}
body.is-duel-active .announcement-bar,
body.is-duel-active .top-bar,
body.is-duel-active .bottom-bar,
body.is-duel-active .mobile-bottom-nav {
  display: none !important;
}
body.is-duel-active .app-shell {
  height: var(--vvh, 100dvh);
  min-height: 0;
  max-height: var(--vvh, 100dvh);
  max-width: 100vw;
  overflow: hidden;
  padding: calc(6px + var(--safe-top)) clamp(6px, 1vw, 12px) calc(6px + var(--safe-bottom));
  gap: 0;
}
body.is-duel-active .main-view {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 1720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.is-duel-active #view-arena {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.arena-desktop-shell {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.arena-board,
.hs-arena-table {
  height: 100%;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 10px 6px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 75% 58% at 50% 48%, rgba(196, 152, 98, 0.16) 0%, rgba(42, 30, 20, 0.94) 68%, rgba(20, 14, 10, 0.99) 100%);
  border: 2px solid rgba(233, 196, 106, 0.44);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 244, 214, 0.14);
}

/* Opponent Rim (Tier 1) */
.hs-rim.is-opp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  flex-shrink: 0;
  min-width: 0;
}
.hs-wing {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hs-wing.is-left { justify-content: flex-start; }
.hs-wing.is-right { justify-content: flex-end; flex-wrap: nowrap; }
.hs-wing-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hs-hero-arch-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.hs-hero-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a2a1d 0%, #1c140d 100%);
  border: 2px solid rgba(233, 196, 106, 0.56);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 244, 214, 0.18);
  min-width: 0;
  max-width: 100%;
}
.hs-hero-frame.is-opp { border-color: rgba(239, 68, 68, 0.65); }
.hs-hero-frame.is-me { border-color: rgba(74, 222, 128, 0.55); width: 100%; }
.hs-hero-frame.is-targetable {
  border-color: #f87171;
  box-shadow: 0 0 0 2.5px rgba(248, 113, 113, 0.65), 0 0 24px rgba(226, 87, 76, 0.72);
  cursor: pointer;
}
.hs-hero-portrait {
  width: 38px;
  height: 40px;
  border-radius: 19px 19px 7px 7px;
  border: 2px solid #e9c46a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}
.hs-hero-portrait.is-opp { background: radial-gradient(circle at 35% 30%, #991b1b 0%, #450a0a 100%); }
.hs-hero-portrait.is-me { background: radial-gradient(circle at 35% 30%, #166534 0%, #0d2b1b 100%); }
.hs-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 96px;
  flex: 1 1 auto;
}
.hs-hero-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.hs-hero-name {
  font-size: 0.82rem;
  color: var(--kraft-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hs-hero-sub {
  font-family: 'Courier Prime', monospace;
  font-size: 0.66rem;
  color: rgba(234, 217, 191, 0.7);
  white-space: nowrap;
}
.dp-hp-bar.is-slim { height: 12px; }
.dp-hp-bar.is-slim .dp-hp-text { font-size: 0.58rem; line-height: 10px; }
.hs-hero-hp-orb {
  background: linear-gradient(180deg, #ef4444 0%, #991b1b 100%);
  border: 2px solid #fde68a;
  color: #fff;
  font-family: 'Courier Prime', monospace;
  font-weight: 900;
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.72);
  flex-shrink: 0;
}
.hs-hero-hp-orb.is-me {
  background: linear-gradient(180deg, #16a34a 0%, #14532d 100%);
  border-color: #bbf7d0;
}
.hs-hero-frame .secret-badge.is-zero { display: none; }
.hs-deck-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--kraft-light);
  background: rgba(16, 12, 9, 0.85);
  border: 1px solid rgba(216, 192, 156, 0.34);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Sillon Mana Crystal Tray */
.hs-sillon-rack {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  background: rgba(12, 9, 6, 0.88);
  border: 1.5px solid rgba(233, 196, 106, 0.42);
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 100%;
}
.hs-crystals-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.hs-crystal {
  width: 11px;
  height: 15px;
  clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  flex-shrink: 0;
}
.hs-crystal.net-express { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.85); }
.hs-crystal.net-regional { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.85); }
.hs-crystal.net-cargo { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.85); }
.hs-crystal.net-alpin { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.85); }
.hs-crystal.net-patrimoine { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.85); }
.hs-crystal.is-spent {
  background: rgba(51, 65, 85, 0.45);
  box-shadow: none;
  opacity: 0.42;
}
.hs-crystal.is-empty-slot {
  background: rgba(148, 163, 184, 0.25);
  box-shadow: none;
}
.hs-sillon-count {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  color: var(--gold-bright);
  white-space: nowrap;
}

/* Compact Stations Dock Chips */
body.is-duel-active .duel-stations-row,
.hs-stations-dock {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 6px;
  background: rgba(12, 9, 6, 0.62);
  border: 1px solid rgba(216, 192, 156, 0.18);
  border-radius: 10px;
}
body.is-duel-active .duel-stations-row::-webkit-scrollbar { display: none; }
body.is-duel-active .mini-station {
  flex-shrink: 0;
  padding: 2px 7px 2px 4px;
  gap: 5px;
  border-radius: 8px;
}
body.is-duel-active .ms-thumb { width: 28px; height: 20px; border-radius: 4px; }
body.is-duel-active .ms-name { font-size: 0.7rem; max-width: 112px; }
.ms-crystal {
  font-family: 'Courier Prime', monospace;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
}
.ms-crystal.is-ready { background: rgba(22, 163, 74, 0.35); color: #86efac; border: 1px solid rgba(74, 222, 128, 0.6); }
.ms-crystal.is-tapped { background: rgba(71, 85, 105, 0.35); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }

/* Open Railway Playmat (Tier 2) */
body.is-duel-active .arena-playmat,
.hs-battlefield {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  padding: 6px 12px;
  gap: 4px;
  border-radius: 16px;
  border: 1.5px solid rgba(233, 196, 106, 0.32);
  background:
    radial-gradient(ellipse 76% 64% at 50% 50%, rgba(196, 154, 102, 0.2) 0%, rgba(44, 32, 22, 0.92) 70%, rgba(22, 16, 11, 0.98) 100%);
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.62);
  overflow: visible;
}
body.is-duel-active .duel-lane {
  position: relative;
  flex: 1 1 0;
  min-height: 118px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px 14px;
  gap: 14px;
  flex-wrap: nowrap;
  overflow: visible;
  background: transparent;
  border: 0;
}
@media (max-width: 1320px) {
  body.is-duel-active .duel-lane {
    overflow-x: auto;
    justify-content: flex-start;
  }
}
.hs-track-bed {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  height: 52px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.72;
}
.hs-sleepers {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(110, 78, 48, 0.5) 0 8px, transparent 8px 26px);
  border-radius: 4px;
}
.hs-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(180deg, rgba(234, 217, 191, 0.55), rgba(82, 62, 46, 0.78));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.hs-rail.is-top { top: 8px; }
.hs-rail.is-bottom { bottom: 8px; }

body.is-duel-active .duel-unit {
  flex: 0 0 142px;
  width: 142px;
  padding: 5px 5px 10px;
  gap: 3px;
}

/* Center Divider & Hearthstone End Turn Lever */
body.is-duel-active .duel-mid-strip,
.hs-center-rail {
  flex-shrink: 0;
  min-width: 0;
  padding: 3px 6px;
  gap: 8px;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
}
.hs-center-rail::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(233, 196, 106, 0.35) 15%, rgba(233, 196, 106, 0.35) 85%, transparent);
  pointer-events: none;
  z-index: 0;
}
.hs-mid-info,
.hs-mid-lever {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hs-mid-info .turn-status {
  background: rgba(20, 14, 10, 0.9);
  border: 1px solid rgba(233, 196, 106, 0.36);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.turn-short { display: none; }
.hs-end-turn-btn {
  appearance: none;
  cursor: pointer;
  min-width: 132px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 2px solid #fde68a;
  background: linear-gradient(180deg, #f3d282 0%, #b7791f 100%);
  color: #1f140a;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}
.hs-end-turn-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.hs-end-turn-btn.is-ready-glow {
  background: linear-gradient(180deg, #4ade80 0%, #15803d 100%);
  border-color: #dcfce7;
  color: #052e16;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.65), 0 0 20px rgba(34, 197, 94, 0.82);
  animation: endTurnPulse 1.45s ease-in-out infinite;
}
.hs-opp-turn-plate {
  font-family: 'Courier Prime', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.85);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.duel-mobile-tool { display: none; }

/* Player Console + Recessed Hand Well (Tier 3) */
.hs-player-zone {
  display: grid;
  grid-template-columns: minmax(210px, 0.92fr) minmax(0, 2fr) minmax(210px, 0.95fr);
  gap: 10px;
  align-items: end;
  height: 186px;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
  z-index: 25;
}
.hs-console-left,
.hs-console-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: rgba(18, 13, 9, 0.82);
  border: 1px solid rgba(216, 192, 156, 0.24);
  border-radius: 14px;
  padding: 7px 9px;
}
.hs-net-pills-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 4px;
  min-width: 0;
}
.hs-net-pills-row::-webkit-scrollbar { display: none; }
.hs-net-pills-row .net-sillon-pill { font-size: 0.66rem; padding: 2px 7px; flex-shrink: 0; }
.hs-right-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}

body.is-duel-active .duel-hand-dock,
.hs-hand-well {
  position: relative;
  z-index: 30;
  min-width: 0;
  max-width: 100%;
  height: 186px;
  padding: 0 4px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border: 0;
  overflow: visible;
}
.hs-hand-cradle-bg {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 120px;
  border-radius: 26px 26px 12px 12px;
  background: radial-gradient(ellipse 75% 85% at 50% 100%, rgba(12, 8, 5, 0.94) 0%, rgba(28, 20, 14, 0.68) 64%, transparent 100%);
  border-top: 1px solid rgba(233, 196, 106, 0.22);
  pointer-events: none;
  z-index: 0;
}
.hand-count-pill {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--gold-bright);
  background: rgba(16, 11, 8, 0.92);
  border: 1px solid rgba(233, 196, 106, 0.4);
  padding: 1px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
body.is-duel-active .duel-hand-tray {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: 0 6px 4px;
  gap: 6px;
  overflow: visible;
}
body.is-duel-active .hand-card {
  position: relative;
  width: 144px;
  min-width: 144px;
  max-width: 144px;
  height: 182px;
  flex: 0 0 144px;
  margin-left: var(--hc-ml, 0px);
  padding: 5px 5px 10px;
  gap: 3px;
  opacity: 1 !important;
  transform: translateY(var(--hc-drop, 0px)) rotate(var(--hc-rot, 0deg));
  transform-origin: bottom center;
  transition: transform 170ms cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 170ms ease;
  overflow: visible;
  z-index: 1;
}
body.is-duel-active .hand-card:hover {
  height: auto;
  min-height: 214px;
  transform: translateY(-64px) scale(1.24) rotate(0deg) !important;
  z-index: 55;
  box-shadow: 0 0 0 2.5px var(--gold-bright), 0 20px 38px rgba(0, 0, 0, 0.85);
}
body.is-duel-active .hand-card .hc-img-wrap {
  width: 100%;
  height: 66px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 5px;
  border: 1.2px solid #1f1610;
}
body.is-duel-active .hand-card .hc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.hc-title-row { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
body.is-duel-active .hand-card .hc-name { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
body.is-duel-active .hand-card:hover .hc-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.is-duel-active .hand-card .hc-rules { font-size: 0.58rem; line-height: 1.24; -webkit-line-clamp: 2; padding: 2px 4px; }
body.is-duel-active .hand-card:hover .hc-rules { -webkit-line-clamp: 4; }
.hc-hover-drawer { display: none; flex-direction: column; gap: 4px; margin-top: 2px; }
body.is-duel-active .hand-card:hover .hc-hover-drawer { display: flex; }
body.is-duel-active .hand-card .hc-play-btn { min-height: 28px; font-size: 0.7rem; padding: 4px 6px; }
.hc-bottom-stats {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  margin: auto -4px -10px; position: relative; z-index: 3;
}
.hc-mid-pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: 100%;
}
.hc-mid-pill {
  font-family: 'Courier Prime', monospace; font-size: 0.56rem; font-weight: 800;
  background: rgba(34, 25, 19, 0.88); color: #fde68a; border: 1px solid rgba(233, 196, 106, 0.45);
  border-radius: 999px; padding: 2px 6px; white-space: nowrap;
}
.hc-mid-pill.is-wide { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

@media (max-height: 820px) and (min-width: 961px) {
  .hs-player-zone,
  body.is-duel-active .duel-hand-dock,
  .hs-hand-well { height: 158px; }
  body.is-duel-active .hand-card {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
    height: 156px;
    flex: 0 0 132px;
  }
  body.is-duel-active .hand-card .hc-img-wrap { height: 52px; }
}

/* Floating Hearthstone Hover Card Popover */
.arena-hover-preview {
  position: fixed;
  z-index: 62;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(18, 13, 9, 0.94);
  border: 1.5px solid rgba(233, 196, 106, 0.65);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  max-width: 430px;
}
.ahp-card {
  position: relative;
  width: 204px;
  height: calc(204px * 1.48);
  flex-shrink: 0;
}
.ahp-card .card-title { font-size: 0.76rem; }
.ahp-card .card-rules-text { font-size: 0.62rem; -webkit-line-clamp: 5; }
.ahp-side {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 150px;
  max-width: 196px;
}
.ahp-rules {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--kraft-light);
  background: rgba(39, 29, 21, 0.75);
  border: 1px solid rgba(216, 192, 156, 0.25);
  border-radius: 8px;
  padding: 7px 9px;
}
.ahp-attach-title {
  font-family: 'Courier Prime', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
}
.ahp-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
body.is-duel-active .tutorial-coach-panel {
  flex-shrink: 0;
  padding: 7px 11px;
  gap: 3px;
}
body.is-duel-active .tuto-desc { font-size: 0.74rem; line-height: 1.32; }

.arena-inspector-aside {
  position: static;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: rgba(233, 196, 106, 0.42);
}
.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--gold-bright);
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(216, 192, 156, 0.24);
}
.ai-toolbar { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.ai-last-log {
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem;
  line-height: 1.35;
  color: rgba(234, 217, 191, 0.84);
  background: rgba(14, 10, 7, 0.74);
  border: 1px solid rgba(216, 192, 156, 0.2);
  border-radius: 8px;
  padding: 6px 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}
.ai-idle {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-idle-ico { font-size: 2rem; text-align: center; }
.ai-idle h4 { margin: 0; color: var(--kraft-light); font-size: 0.95rem; text-align: center; }
.ai-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(21, 16, 12, 0.65);
  border: 1px solid rgba(216, 192, 156, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.42;
}
.ai-step-item strong { color: var(--gold-bright); }
.ai-kw-legend, .ai-kw-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.72rem;
  line-height: 1.38;
  color: rgba(234, 217, 191, 0.86);
  background: rgba(21, 16, 12, 0.56);
  border: 1px dashed rgba(216, 192, 156, 0.24);
  border-radius: 9px;
  padding: 8px 10px;
}
.ai-card-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-card-preview {
  position: relative;
  width: 220px;
  height: calc(220px * 1.48);
  margin: 0 auto;
}
.ai-card-preview .card-title { font-size: 0.78rem; }
.ai-card-preview .card-rules-text { font-size: 0.64rem; -webkit-line-clamp: 5; }
.ai-meta-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ai-role-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(233, 196, 106, 0.14);
  border: 1px solid rgba(233, 196, 106, 0.42);
  padding: 3px 9px;
  border-radius: 999px;
}
.ai-cost-line {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fde68a;
}
.ai-live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ai-section-lbl {
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(233, 196, 106, 0.85);
  margin-top: 2px;
}
.ai-effect-txt, .ai-howto-txt {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.44;
  color: var(--kraft-light);
}
.ai-howto-txt {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.22);
  border-left: 2.5px solid #4ade80;
  padding: 6px 9px;
  border-radius: 6px;
}
.ai-attach-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-3d-btn { align-self: flex-start; margin-top: 4px; }

.hc-role-strip {
  font-family: 'Courier Prime', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hc-inspect, .unit-info-btn {
  width: 22px;
  height: 22px;
  font-size: 0.68rem;
}
.unit-attach-chip {
  background: #78350f;
  color: #fef3c7;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 800;
}
.unit-state-pill.is-selected-pill {
  background: #fde047;
  color: #2b1904;
}
.unit-state-pill.is-target-pill {
  background: #dc2626;
  color: #fff;
  animation: endTurnPulse 1.1s ease-in-out infinite;
}
.duel-prompt.is-attack-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   INSPECT MODAL TOP CLOSE BUTTON
========================================================================= */
.inspect-top-close {
  position: fixed;
  top: calc(14px + var(--safe-top));
  right: 16px;
  z-index: 75;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(34, 25, 19, 0.94);
  border: 1.5px solid var(--gold-bright);
  color: var(--kraft-light);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* =========================================================================
   MOBILE NAVIGATION BAR, BOTTOM SHEET & RESPONSIVE DECK TABS
========================================================================= */
.mobile-only-btn { display: none; }
.mobile-bottom-nav { display: none; }
.deck-mobile-tabs { display: none; }

.mobile-sheet-backdrop,
.arena-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(10, 7, 5, 0.76);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mobile-sheet-card,
.arena-card-sheet {
  width: 100%;
  max-width: 620px;
  max-height: 84dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px 20px 0 0;
  padding: 12px 18px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 0;
  animation: sheetSlideUp 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheetSlideUp {
  0% { transform: translateY(36px); opacity: 0.4; }
  100% { transform: translateY(0); opacity: 1; }
}
.mobile-sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(234, 217, 191, 0.35);
  margin: 0 auto 2px;
}
.mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold-bright);
  font-size: 1.05rem;
}
.mobile-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mob-sheet-item {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 64px;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(21, 16, 12, 0.8);
  border: 1px solid rgba(216, 192, 156, 0.25);
  color: var(--kraft-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.mob-sheet-item span:first-child { font-size: 1.35rem; }
.mob-sheet-item.is-active {
  background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
  color: #1f1610;
  border-color: #2b1f16;
}
.mob-sheet-item.is-tutorial {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(22, 78, 48, 0.42);
}
.mobile-sheet-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(216, 192, 156, 0.22);
}

.acs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.acs-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.acs-title-wrap h3 {
  margin: 2px 0 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--kraft-light);
  font-size: 1.05rem;
}
.acs-title-wrap small { color: #fde68a; font-size: 0.78rem; }
.acs-body {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 420px) {
  .acs-body { grid-template-columns: 1fr; }
}
.acs-thumb-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acs-thumb-col img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid rgba(233, 196, 106, 0.45);
}
.acs-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.acs-stats .stat-box { font-size: 0.68rem; padding: 3px 6px; }
.acs-text-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.acs-actions .btn-primary { flex: 1 1 180px; min-height: 44px; }

/* =========================================================================
   RESPONSIVE BREAKPOINTS (TABLET <= 1180px & MOBILE <= 860px / 540px)
========================================================================= */
@media (max-width: 1180px) {
  .arena-desktop-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .arena-inspector-aside {
    display: none;
  }
  .duel-mobile-tool {
    display: inline-flex;
  }
}

@media (max-width: 960px) {
  .deck-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .dmt-btn {
    appearance: none;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(216, 192, 156, 0.3);
    background: rgba(21, 16, 12, 0.78);
    color: var(--kraft-light);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
  }
  .dmt-btn.is-active {
    background: linear-gradient(180deg, #dfcaa7 0%, #c4a377 100%);
    color: #1f1610;
    border-color: #2b1f16;
  }
  .deck-split:not(.mobile-show-deck) .deck-list-col { display: none; }
  .deck-split.mobile-show-deck .deck-library-col { display: none; }
}

@media (max-width: 860px) {
  .app-shell {
    padding: calc(10px + var(--safe-top)) 10px calc(86px + var(--safe-bottom));
    gap: 14px;
  }
  body.is-duel-active .app-shell {
    padding: calc(3px + var(--safe-top)) 4px calc(3px + var(--safe-bottom));
    gap: 0;
  }
  body.is-duel-active .announcement-bar,
  body.is-duel-active .top-bar,
  body.is-duel-active .bottom-bar,
  body.is-duel-active .mobile-bottom-nav {
    display: none !important;
  }

  .top-bar {
    padding: 4px 2px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .main-nav { display: none !important; }
  .top-actions .lang-switch,
  .top-actions #btn-logout {
    display: none;
  }
  .mobile-only-btn {
    display: inline-flex;
    min-width: 42px;
    min-height: 40px;
    justify-content: center;
  }
  .top-actions {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .top-actions button {
    min-height: 40px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 48;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(22, 16, 12, 0.96);
    border-top: 1px solid rgba(233, 196, 106, 0.36);
    backdrop-filter: blur(10px);
    padding: 4px 4px calc(4px + var(--safe-bottom));
  }
  .mbn-btn {
    appearance: none;
    background: transparent;
    border: 0;
    color: rgba(234, 217, 191, 0.72);
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.66rem;
    font-weight: 600;
    cursor: pointer;
  }
  .mbn-btn.is-active {
    color: var(--gold-bright);
  }
  .mbn-ico {
    position: relative;
    font-size: 1.15rem;
    line-height: 1;
  }
  .mbn-badge {
    position: absolute;
    top: -5px;
    right: -11px;
    background: #b91c1c;
    color: #fff;
    border-radius: 999px;
    font-size: 0.58rem;
    padding: 1px 5px;
    font-weight: 700;
  }
  .mbn-dot {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
  }
  .mbn-lbl {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .kraft-panel {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .panel-grid, .hub-grid { gap: 14px; }
  .panel-head { margin-bottom: 12px; gap: 10px; }
  .panel-head h2 { font-size: 1.18rem; }

  /* Card grids compact 2-col on mobile */
  .cards-binder-grid,
  .deck-owned-grid,
  .mk-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .db-card-tile { padding: 6px; gap: 6px; }
  .db-card-frame .card-rules-text,
  .binder-card-frame .card-rules-text {
    font-size: 0.54rem;
    -webkit-line-clamp: 3;
  }

  /* Booster pack revealed cards cleanly stacked 2x3 in flow on mobile */
  .booster-arena.is-revealed-stage {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 8px;
  }
  .booster-arena.is-revealed-stage .booster-scene {
    display: none;
  }
  .booster-arena.is-revealed-stage .showcase-stage {
    position: relative;
    inset: auto;
    pointer-events: auto;
  }
  .booster-arena.is-revealed-stage .cards-spread-6 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .booster-arena.is-revealed-stage .card-slot {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.48;
  }

  /* Inspect modal scrollable on mobile */
  .inspect-modal {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(56px + var(--safe-top)) 14px calc(24px + var(--safe-bottom));
  }
  .inspect-layout {
    gap: 16px;
  }
  .inspect-scene {
    --inspect-w: min(270px, 78vw);
    --inspect-h: calc(var(--inspect-w) * 1.48);
  }
  .inspect-btn-row button {
    min-height: 42px;
  }
}

@media (max-width: 960px) {
  /* ARENA FULL MOBILE READABILITY */
  .arena-hover-preview { display: none !important; }
  body.is-duel-active .arena-board,
  .hs-arena-table {
    padding: 4px;
    gap: 3px;
    border-radius: 10px;
  }
  body.is-duel-active .tutorial-coach-panel,
  .tutorial-coach-panel {
    padding: 5px 7px;
    gap: 2px;
  }
  .tuto-title { font-size: 0.78rem; }
  .tuto-desc { font-size: 0.65rem; line-height: 1.24; }

  .hs-rim.is-opp {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "hero stats"
      "stations stations";
    gap: 3px 6px;
    padding: 0;
  }
  .hs-hero-arch-wrap { grid-area: hero; min-width: 0; justify-content: flex-start; }
  .hs-wing.is-right { grid-area: stats; width: auto; gap: 4px; }
  .hs-wing.is-left { grid-area: stations; width: 100%; }
  .hs-hero-frame { width: 100%; padding: 2px 6px 2px 4px; gap: 6px; }
  .opp-hand-fan { display: none; }
  .hs-hero-portrait { width: 24px; height: 26px; font-size: 0.8rem; border-radius: 12px 12px 5px 5px; }
  .hs-hero-meta { min-width: 0; }
  .hs-hero-name { font-size: 0.72rem; }
  .hs-hero-sub,
  .hs-hero-frame .dp-hp-bar.is-slim { display: none; }
  .hs-hero-hp-orb { font-size: 0.64rem; padding: 2px 7px; }
  .hs-sillon-rack { padding: 2px 7px; }
  .hs-crystals-row { display: none; }
  .hs-sillon-count { font-size: 0.66rem; }
  .hs-deck-pill { font-size: 0.64rem; padding: 2px 6px; }
  .casse-pile-btn { padding: 2px 7px; font-size: 0.64rem; gap: 4px; }
  .casse-pile-btn .casse-lbl { display: none; }

  body.is-duel-active .arena-playmat,
  .hs-battlefield {
    overflow: hidden;
    padding: 3px 5px;
    gap: 2px;
  }
  body.is-duel-active .duel-stations-row,
  .hs-stations-dock {
    padding: 2px 5px;
    min-height: 23px;
    gap: 4px;
  }
  .stations-zone-tag { flex-shrink: 0; font-size: 0.54rem; padding: 1px 5px; }
  body.is-duel-active .mini-station { flex-shrink: 0; padding: 1px 6px 1px 3px; gap: 4px; }
  body.is-duel-active .ms-thumb { width: 20px; height: 15px; }
  body.is-duel-active .ms-name { font-size: 0.62rem; max-width: 88px; }
  .ms-crystal { font-size: 0.58rem; padding: 0 5px; }

  /* Lanes horizontally scrollable single row on mobile */
  body.is-duel-active .duel-lane,
  .duel-lane {
    flex: 1 1 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 88px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 6px 10px;
    gap: 8px;
  }
  body.is-duel-active .duel-unit,
  .duel-unit {
    flex: 0 0 98px;
    width: 98px;
    padding: 3px 3px 8px;
    gap: 2px;
  }
  .duel-unit .unit-portrait-frame { aspect-ratio: auto; height: 46px; }
  .unit-net-pip span { display: none; }
  .unit-name { font-size: 0.62rem; }
  .unit-tonnage-bar { height: 11px; }
  .unit-tonnage-bar span { font-size: 0.5rem; }
  .unit-orbs-row { margin: 1px -3px -8px; }
  .hs-stat-orb { font-size: 0.58rem; padding: 2px 5px; }
  .unit-guard-crest { font-size: 0.46rem; padding: 1px 5px; top: -7px; }

  /* Compact Single-Line Center Rail on Mobile */
  body.is-duel-active .duel-mid-strip,
  .hs-center-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    gap: 4px;
  }
  .hs-center-rail::before { display: none; }
  .hs-mid-info { width: auto; flex: 0 0 auto; gap: 4px; }
  .hs-center-rail.has-active-prompt .hs-mid-info { width: 100%; }
  .hs-mid-info .turn-status { font-size: 0.68rem; padding: 3px 8px; }
  .turn-full { display: none; }
  .turn-short { display: inline; font-weight: 800; color: var(--gold-bright); }
  .duel-coach-pill { display: none; }
  .duel-prompt {
    flex: 1 1 100%;
    text-align: center;
    font-size: 0.64rem;
    padding: 3px 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hs-mid-lever {
    flex: 1 1 auto;
    width: auto;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
  }
  .duel-timer-box {
    flex-direction: row;
    min-width: 0;
    padding: 3px 7px;
    border-radius: 999px;
  }
  .duel-timer-track { display: none; }
  .duel-timer-head { font-size: 0.68rem; }
  .hs-end-turn-btn, .hs-opp-turn-plate {
    flex: 1 1 auto;
    max-width: 150px;
    min-width: 0;
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .duel-mobile-tool { display: inline-flex; }
  .duel-tool-btn, .duel-concede-btn { flex: 0 0 auto; min-height: 30px; padding: 3px 7px !important; font-size: 0.68rem; }
  .duel-tool-btn span { font-size: 0.62rem; }
  .hs-console-right .duel-concede-btn { display: none; }

  .hs-player-zone {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "mystations mystations"
      "myhero mystats"
      "myhand myhand";
    height: auto;
    gap: 3px 6px;
  }
  .hs-console-left { display: contents; }
  #me-stations-row { grid-area: mystations; }
  #me-network-target { grid-area: myhero; }
  .hs-console-right {
    grid-area: mystats;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    gap: 4px;
    background: transparent;
    border: 0;
  }
  .hs-net-pills-row { display: none; }

  body.is-duel-active .duel-hand-dock,
  .hs-hand-well {
    grid-area: myhand;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 2px;
    gap: 0;
  }
  .hs-hand-cradle-bg,
  .hand-count-pill { display: none; }
  body.is-duel-active .duel-hand-tray,
  .duel-hand-tray {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 2px 3px 8px;
  }
  body.is-duel-active .hand-card,
  .hand-card {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    height: 122px;
    flex: 0 0 110px;
    margin-left: 0 !important;
    transform: none !important;
    padding: 4px 4px 8px;
    gap: 2px;
  }
  body.is-duel-active .hand-card:hover {
    height: 122px;
    min-height: 0;
    transform: none !important;
  }
  body.is-duel-active .hand-card .hc-img-wrap { height: 46px; }
  .hc-top { padding: 2px 4px; font-size: 0.58rem; }
  .hc-cost { width: 16px; height: 16px; font-size: 0.6rem; }
  .hc-inspect { display: none; }
  .hc-rules, .hc-hover-drawer { display: none !important; }
  .hc-role-strip { display: block !important; font-size: 0.52rem; text-align: center; }
  .hc-name { font-size: 0.64rem; }
  body.is-duel-active .hand-card .hc-bottom-stats > .hc-mid-pill { display: none; }
  .unit-info-btn {
    width: 18px;
    height: 18px;
    font-size: 0.58rem;
  }

  .duel-wait-overlay {
    padding: calc(10px + var(--safe-top)) 8px calc(12px + var(--safe-bottom));
  }
  .mulligan-modal { padding: 12px 10px; }
  .mulligan-modal h2 { font-size: 1.05rem; margin-bottom: 4px; }
  .mulligan-modal p { font-size: 0.74rem; margin: 4px 0; }
  .mulligan-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0;
  }
  .mulligan-item { width: 100%; gap: 4px; }
  .mulligan-card-frame { width: 100%; height: auto; aspect-ratio: 1 / 1.44; }
  .mulligan-card-frame .card-rules-text { -webkit-line-clamp: 2; font-size: 0.45rem; }
  .mull-toggle-btn { font-size: 0.66rem; padding: 4px 6px; }
}

@media (max-width: 768px) {
  input.field-input, select.field-input, textarea.field-input {
    font-size: 16px !important;
  }
}

@media (max-width: 540px) {
  .lb-row {
    grid-template-columns: 38px 1fr auto;
    gap: 6px 8px;
    padding: 8px 9px;
  }
  .friend-card {
    flex-direction: column;
    align-items: stretch;
  }
  .fc-actions { width: 100%; }
  .fc-actions button { flex: 1; min-height: 40px; }
}
