/* ============================================================================
   EAGLE ACES — game-local styles (arcade-cabinet bezel framing)
   ----------------------------------------------------------------------------
   FIX 1: fill the empty side margins beside the centered portrait playfield
   with a brushed-metal arcade-cabinet bezel so the full widescreen reads like
   a real cabinet, not a letterbox. Pure CSS/SVG — no images, no audio, no
   full-frame flashing. The .ea-cabinet flex row is injected by js/bezel.js.
   ============================================================================ */

/* Reclaim vertical space so the portrait playfield fits TALLER on a laptop:
   tighten the section's top padding, the title margin, and the instructions
   block height. Scoped to this game's page via the .ea-cabinet ancestor's
   <main>; safe (these only affect Eagle Aces' own document). */
main.usa-section { padding-block: var(--s-4, 1rem); }
main.usa-section > h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.05;
}
main.usa-section > .usa-instructions {
  margin-bottom: 0.55rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* The cabinet spans the full content width and lays the two bezel wings on
   either side of the centered #eagle-stage playfield. */
.ea-cabinet {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  width: 100%;
  /* Pull beyond the .usa-container padding so the cabinet runs nearly edge to
     edge on a wide laptop (the playfield itself stays centered + capped). */
  margin-inline: calc(var(--s-4, 1rem) * -1);
}

/* The playfield keeps its fit-stage height; don't let flex stretch/shrink it. */
.ea-cabinet > #eagle-stage {
  flex: 0 0 auto;
  z-index: 1;
}

/* ---- the side wings -------------------------------------------------------- */
.ea-bezel-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  align-self: stretch;          /* match the playfield height */
  overflow: hidden;
  border-radius: var(--r-lg, 16px);
  /* brushed gun-metal navy, same family as the kit's Liberty-Steel bezel */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(27,64,106,0.5), transparent 60%),
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px,
      transparent 1px, transparent 3px),
    linear-gradient(180deg, #122b47, #0a1c30 55%, #05101f);
  box-shadow:
    inset 0 0 0 1px rgba(201,162,39,0.10),
    inset 0 2px 0 rgba(255,255,255,0.04),
    0 10px 34px rgba(0,0,0,0.5);
}
.ea-bezel-left  { margin-right: 14px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.ea-bezel-right { margin-left: 14px;  border-top-left-radius: 6px;  border-bottom-left-radius: 6px; }

/* below ~860px viewport, collapse the wings — the playfield goes full-bleed */
@media (max-width: 860px) {
  .ea-bezel-panel { display: none; }
  .ea-cabinet { margin-inline: 0; }
}

/* On a tall phone (portrait, narrow) the field design-res is chosen to fill the
   screen height — so reclaim as much vertical space as possible from the page
   chrome above it (the immersive ⛶ mode hides chrome entirely; this is for the
   windowed view). Tighten the section padding, title, and shrink the
   instructions block so the playfield sits high and uses the tall screen. */
@media (max-width: 700px) and (orientation: portrait) {
  main.usa-section { padding-block: 0.4rem; }
  main.usa-section > h1 { margin: 0 0 0.25rem; font-size: clamp(1.2rem, 5vw, 1.6rem); }
  main.usa-section > .usa-instructions {
    margin-bottom: 0.35rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.72rem;
    line-height: 1.32;
  }
}

/* a red/white/blue accent rail running down the inner edge of each wing */
.ea-bezel-rail {
  position: absolute;
  top: 6%;
  bottom: 6%;
  width: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg,
    #B22234 0%, #B22234 33%,
    #f7f3e8 33%, #f7f3e8 66%,
    #1b406a 66%, #1b406a 100%);
  opacity: 0.9;
  box-shadow: 0 0 14px rgba(201,162,39,0.25);
}
.ea-bezel-left  .ea-bezel-rail { right: 16px; }
.ea-bezel-right .ea-bezel-rail { left: 16px; }
/* a secondary thinner gold pinstripe outboard of the main rail */
.ea-bezel-rail--b {
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(201,162,39,0.7), transparent);
  box-shadow: none;
}
.ea-bezel-left  .ea-bezel-rail--b { right: 30px; }
.ea-bezel-right .ea-bezel-rail--b { left: 30px; }

/* faint star field across the panel */
.ea-bezel-stars {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 18%, rgba(247,243,232,0.8), transparent),
    radial-gradient(1.2px 1.2px at 64% 30%, rgba(201,162,39,0.8), transparent),
    radial-gradient(1.2px 1.2px at 38% 52%, rgba(247,243,232,0.7), transparent),
    radial-gradient(1.6px 1.6px at 78% 64%, rgba(178,34,52,0.7), transparent),
    radial-gradient(1.2px 1.2px at 28% 78%, rgba(247,243,232,0.7), transparent),
    radial-gradient(1.3px 1.3px at 58% 88%, rgba(201,162,39,0.7), transparent);
}

/* the medallion mark, vertically centered in the wing */
.ea-bezel-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 0 8px;
}
.ea-medallion {
  width: clamp(64px, 9vw, 132px);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55));
}
.ea-bezel-word {
  font-family: var(--font-display, var(--font-sans, system-ui));
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: clamp(12px, 1.4vw, 20px);
  color: #f7f3e8;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.ea-bezel-sub {
  font-family: var(--font-sans, system-ui);
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: clamp(8px, 0.8vw, 11px);
  color: var(--accent, #C9A227);
  text-transform: uppercase;
  white-space: nowrap;
}

/* vignette so the panel edges fall into shadow (depth) */
.ea-bezel-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,0.45) 100%);
  mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
  .ea-bezel-stars { opacity: 0.35; }
}
