/* =============================================
   GUI — Medieval 9-slice decoration system
   Corners: top-left image rotated per corner
   Borders: horizontal image tiled along edges
   ============================================= */

.gui-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
  border-radius: inherit;
}

/* ---- Corners ---- */

.gui-corner {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  user-select: none;
  background-image: var(--gui-corner-url);
  background-size: contain;
  background-repeat: no-repeat;
}

.gui-corner-tl {
  top: 0;
  left: 0;
}

.gui-corner-tr {
  top: 0;
  right: 0;
  transform: rotate(90deg);
}

.gui-corner-br {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
}

.gui-corner-bl {
  bottom: 0;
  left: 0;
  transform: rotate(270deg);
}

/* ---- All menu buttons: shared frame + surface structure ---- */

.menu-button {
  isolation: isolate;
  --gui-corner-url: url('/gui/gui_corner3_dark_50.png');
  background: none;
  border: none;
  box-shadow: none;
}

.menu-button:hover {
  box-shadow: none;
  border-color: transparent;
}

/* Metallic frame: replaces the landing.css hover-overlay ::before.
   opacity: 1 overrides the menu-button::before opacity: 0 from landing.css. */
.menu-button::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: none;
  border: 8px solid #2a2e35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 1;
  pointer-events: none;
  z-index: 9;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.menu-button:hover::before {
  border-color: #353a42;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* Surface layer: structural properties shared by all types */
.menu-button::after {
  content: '';
  position: absolute;
  inset: 13px;
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.72),
    inset 0 5px 14px rgba(0, 0, 0, 0.45),
    inset 0 -3px 8px rgba(0, 0, 0, 0.30);
  z-index: -1;
  pointer-events: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.menu-button:hover::after {
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.6),
    inset 0 5px 14px rgba(0, 0, 0, 0.35),
    inset 0 -3px 8px rgba(0, 0, 0, 0.22);
}

.menu-button:active::after {
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.85),
    inset 0 6px 18px rgba(0, 0, 0, 0.6),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
}

.menu-button .gui-corner {
  width: 65px;
  height: 65px;
}

/* Typography depth */
.menu-button i {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 0 10px rgba(255, 255, 255, 0.15);
}

.menu-button .button-title {
  font-family: "Cinzel", serif;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.6),
    0 0 6px rgba(255, 200, 80, 0.2);
}

.menu-button .button-subtitle {
  opacity: 0.65;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* ---- Per-type surface colors ---- */

/* Primary: amber/gold */
.primary-button::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.07) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #ffb347 0%, #e8891a 42%, #3d1e00 100%);
}
.primary-button:hover::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.09) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #ffc060 0%, #d4891e 55%, #3d1e00 100%);
}
.primary-button:active::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 45%, #e8891a 0%, #b06010 45%, #3d1e00 100%);
}

/* Secondary: steel blue */
.secondary-button::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #72b8e8 0%, #457b9d 42%, #0a1929 100%);
}
.secondary-button:hover::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.08) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #8ecef5 0%, #5490b8 55%, #0a1929 100%);
}
.secondary-button:active::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 45%, #457b9d 0%, #2a5070 45%, #0a1929 100%);
}

/* Community: deep purple */
.community-button::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.06) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #9b6fd4 0%, #6a4c93 42%, #1a0b30 100%);
}
.community-button:hover::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.21) 0%, rgba(255,255,255,0.08) 30%, transparent 55%),
    radial-gradient(ellipse at 50% 35%, #b588e8 0%, #7e5aad 55%, #1a0b30 100%);
}
.community-button:active::after {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 45%, #6a4c93 0%, #4a306e 45%, #1a0b30 100%);
}

/* Primary icon/title keep the warm glow */
.primary-button i {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 0 10px rgba(255, 180, 80, 0.45);
}
.primary-button .button-title {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.6),
    0 0 6px rgba(255, 200, 100, 0.35);
}

/* ---- Game logo ---- */

.game-logo-img {
  max-width: 48%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ---- Get Started ribbon header ---- */

.section-header {
  background: var(--gui-ribbon-url) center / 100% 100% no-repeat;
  backdrop-filter: none;
  border-radius: 0;
  border-bottom: none;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
  color: var(--text);
}

/* ---- Borders ---- */

.gui-border {
  position: absolute;
  pointer-events: none;
  user-select: none;
  background-image: url('/gui/gui_border_dark_2_1x24h.png');
  background-repeat: repeat-x;
  background-size: auto 100%;
}

/* Top: horizontal, 4px from top edge, spans between corners */
.gui-border-t {
  top: 4px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Bottom: horizontal, 4px from bottom edge, spans between corners */
.gui-border-b {
  bottom: 4px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Left: oversized horizontal div rotated 90° CW around its top-left corner.
   left:14px so after rotation the 10px height sweeps x=4..14 (4px from edge).
   CW math: local BL (0,10) → parent (14-10, 0) = (4, 0). */
.gui-border-l {
  left: 14px;
  top: 0;
  width: 3000px;
  height: 10px;
  transform: rotate(90deg);
  transform-origin: 0 0;
}

/* Right: same CW rotation.
   left:calc(100%-4px) so after rotation 10px height sweeps x=(W-14)..(W-4).
   CW math: local BL (0,10) → parent (W-4-10, 0) = (W-14, 0). */
.gui-border-r {
  left: calc(100% - 4px);
  top: 0;
  width: 3000px;
  height: 10px;
  transform: rotate(90deg);
  transform-origin: 0 0;
}
