/**
 * Optima Deck: FFXIII Paradigm Manager
 * Strict In-Game Final Fantasy XIII "Paradigms -> Customize" Menu Stylesheet
 * Zero Material UI boxes, zero rounded cards, pure angled clip-path crystal & metallic geometry.
 */

:root {
  --bg-teal: #0b2b36;
  --bg-navy: #040d14;
  --line-silver: rgba(255, 255, 255, 0.45);
  --line-bright: rgba(255, 255, 255, 0.82);
  --line-cyan: rgba(125, 211, 252, 0.65);
  --gold-leader: #FFB703;
  --cyan-glow: #38BDF8;

  /* Fonts */
  --font-header: 'Michroma', 'Rajdhani', sans-serif;
  --font-paradigm: 'Rajdhani', 'Michroma', sans-serif;
  --font-role: 'Archivo Narrow', 'Rajdhani', sans-serif;

  /* Column Grid Alignment: Left Menu Rail + 3 Equal Character/Role Columns */
  --matrix-columns: 31% repeat(3, 1fr);
}

*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-navy);
  background-image:
    radial-gradient(ellipse 110% 55% at 50% 18%, rgba(165, 195, 206, 0.28) 0%, rgba(11, 43, 54, 0.65) 48%, #040d14 100%),
    radial-gradient(circle at 30% 35%, #0b2b36 0%, #040d14 78%);
  color: #F8FAFC;
  font-family: var(--font-paradigm);
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Diagonal Scanlines & Atmospheric Mist Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 6px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 38%, rgba(0, 0, 0, 0.55) 100%);
}

.ff13-screen {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 28px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

/* ============================================================================
   1. MINIMALIST TOP BAR (SAVED SETUP PILLS + + NEW SETUP)
   ============================================================================ */
.setup-strip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.setup-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  flex: 1;
}

.setup-pill-tab {
  position: relative;
  padding: 6px 18px 6px 16px;
  font-family: var(--font-header);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.72);
  background: linear-gradient(180deg, rgba(16, 42, 54, 0.78) 0%, rgba(5, 16, 24, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.setup-pill-tab:hover {
  color: #FFFFFF;
  border-color: var(--line-bright);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.28) 0%, rgba(11, 43, 54, 0.95) 100%);
}

.setup-pill-tab.active {
  color: #040d14;
  font-weight: 700;
  background: linear-gradient(180deg, #FFFFFF 0%, #BAE6FD 55%, #7DD3FC 100%);
  border-color: #FFFFFF;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.setup-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.skew-action-btn {
  padding: 6px 14px;
  font-family: var(--font-header);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E2E8F0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(7, 22, 32, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  cursor: pointer;
  transition: all 0.14s ease;
}

.skew-action-btn:hover {
  color: #FFFFFF;
  border-color: #FFFFFF;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.35) 0%, rgba(11, 43, 54, 0.95) 100%);
}

.skew-action-btn.primary {
  border-color: #7DD3FC;
  color: #BAE6FD;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.28) 0%, rgba(8, 36, 48, 0.95) 100%);
}

.skew-action-btn.primary:hover {
  color: #040d14;
  background: linear-gradient(180deg, #FFFFFF 0%, #7DD3FC 100%);
}

.skew-action-btn.danger:hover {
  border-color: #E63946;
  color: #FFD1D6;
  background: linear-gradient(180deg, rgba(230, 57, 70, 0.45) 0%, rgba(45, 10, 16, 0.95) 100%);
}

/* ============================================================================
   2. IN-GAME FFXIII "HELP" BANNER
   ============================================================================ */
.ff13-help-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 5px 18px 5px 42px;
  background: linear-gradient(90deg, transparent 0%, rgba(15, 32, 42, 0.72) 8%, rgba(255, 255, 255, 0.14) 50%, rgba(15, 32, 42, 0.72) 92%, transparent 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.help-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transform: skewX(-22deg);
  padding: 1px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(148, 163, 184, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.help-skew-icon {
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.help-label-text {
  font-family: var(--font-header);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #E2E8F0;
}

.help-message-text {
  font-family: var(--font-paradigm);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 255, 255, 0.25);
}

/* ============================================================================
   3. UPPER STAGE: LEFT MENU RAIL + 3 CHARACTER PORTRAIT CARDS
   ============================================================================ */
.ff13-upper-stage {
  display: grid;
  grid-template-columns: var(--matrix-columns);
  gap: 10px;
  align-items: stretch;
  min-height: 235px;
}

/* Left Rail: "Paradigms" -> "Customize" -> "Paradigm Deck" */
.ff13-left-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 12px;
  position: relative;
}

.paradigms-section-label {
  font-family: var(--font-header);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 #040d14,
     1px -1px 0 #040d14,
    -1px  1px 0 #040d14,
     1px  1px 0 #040d14,
     0 2px 6px rgba(0, 0, 0, 0.85);
  padding-left: 118px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.65);
  padding-bottom: 2px;
  margin-bottom: 6px;
}

.customize-active-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 24px 6px 38px;
  width: 88%;
  background: linear-gradient(90deg, rgba(10, 18, 26, 0.92) 0%, rgba(52, 65, 78, 0.82) 70%, rgba(20, 30, 40, 0.4) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}

.ff13-hand-cursor {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
  animation: cursorFloat 1.4s ease-in-out infinite alternate;
  flex-shrink: 0;
}

@keyframes cursorFloat {
  0% { transform: translateX(-2px); }
  100% { transform: translateX(3px); }
}

.customize-bar-text {
  font-family: var(--font-header);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  text-shadow: 0 1px 3px #000000;
}

/* Inline Setup Title Editor in the Left Area */
.active-setup-editor {
  margin: auto 0;
  padding: 8px 14px 8px 18px;
  width: 90%;
  background: linear-gradient(90deg, rgba(7, 22, 32, 0.78) 0%, rgba(11, 43, 54, 0.35) 100%);
  border-left: 3px solid var(--cyan-glow);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.setup-name-kicker {
  display: block;
  font-family: var(--font-header);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: #7DD3FC;
  margin-bottom: 3px;
}

.setup-inline-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  font-family: var(--font-header);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 2px 0;
  outline: none;
}

.setup-inline-input:focus {
  border-bottom-color: var(--cyan-glow);
  color: #BAE6FD;
}

.paradigm-deck-caption {
  font-family: var(--font-header);
  font-size: 14.5px;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  padding-left: 72px;
  padding-bottom: 2px;
  text-shadow:
    -1px -1px 0 #040d14,
     1px -1px 0 #040d14,
    -1px  1px 0 #040d14,
     1px  1px 0 #040d14,
     0 2px 5px rgba(0, 0, 0, 0.95);
}

/* Right 3 Character Portrait Columns */
.ff13-char-columns {
  grid-column: 2 / 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.char-portrait-card {
  position: relative;
  height: 235px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.85);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.16s ease, filter 0.16s ease;
}

.char-portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 30%, rgba(4, 13, 20, 0.78) 100%);
  z-index: 2;
  pointer-events: none;
}

.char-portrait-card:hover {
  border-color: #FFFFFF;
  filter: brightness(1.1);
}

.char-portrait-artwork {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.char-portrait-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.char-portrait-card:hover .char-portrait-svg {
  transform: scale(1.035);
}

/* Top HUD inside each Character Portrait: HP Readout + LEADER / MEMBER Skewed Flag */
.char-card-top-hud {
  position: relative;
  z-index: 3;
  padding: 6px 12px 0 10px;
  display: flex;
   flex-direction: column;
  gap: 2px;
}

.char-hp-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}

.hp-label {
  font-family: var(--font-header);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 #040d14,
     1px -1px 0 #040d14,
    -1px  1px 0 #040d14,
     1px  1px 0 #040d14;
}

.hp-value {
  font-family: var(--font-header);
  font-size: 19px;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  text-shadow:
    -1.5px -1.5px 0 #040d14,
     1.5px -1.5px 0 #040d14,
    -1.5px  1.5px 0 #040d14,
     1.5px  1.5px 0 #040d14,
     0 2px 6px rgba(0, 0, 0, 0.9);
}

/* LEADER / MEMBER Skewed Emblem Badge (Matches FFXIII Top-Left Portrait Badge) */
.char-status-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: -2px;
  padding-left: 4px;
}

.status-skew-flag {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 16px;
  transform: skewX(-22deg);
  border: 1.5px solid #FFFFFF;
  background: linear-gradient(180deg, #CBD5E1 0%, #475569 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}

.status-skew-flag.leader {
  background: linear-gradient(180deg, #FEF08A 0%, #F59E0B 60%, #B45309 100%);
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.85), 0 2px 4px rgba(0, 0, 0, 0.85);
}

.status-role-word {
  position: relative;
  z-index: 2;
  font-family: var(--font-header);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-shadow:
    -1.5px -1.5px 0 #040d14,
     1.5px -1.5px 0 #040d14,
    -1.5px  1.5px 0 #040d14,
     1.5px  1.5px 0 #040d14,
     0 2px 4px rgba(0, 0, 0, 0.95);
}

/* Bottom Name Bar inside Character Column */
.char-card-bottom-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: linear-gradient(90deg, rgba(4, 13, 20, 0.92) 0%, rgba(11, 43, 54, 0.72) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.char-column-name {
  font-family: var(--font-header);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  text-transform: uppercase;
}

/* Quick 6-Character Pip Selector inside Portrait Footer (No <select> dropdowns) */
.char-pip-selector {
  display: inline-flex;
  gap: 3px;
}

.char-pip-dot {
  width: 17px;
  height: 15px;
  font-family: var(--font-role);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.75);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  cursor: pointer;
  padding: 0;
}

.char-pip-dot:hover {
  border-color: #FFFFFF;
  color: #FFFFFF;
  background: rgba(56, 189, 248, 0.45);
}

.char-pip-dot.active {
  background: #FFFFFF;
  color: #040d14;
  border-color: #FFFFFF;
}

/* ============================================================================
   4. CENTERPIECE: THE 6-ROW PARADIGM MATRIX
   ============================================================================ */
.ff13-deck-matrix {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 2px solid rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  padding: 4px 0;
  background: rgba(4, 10, 16, 0.72);
}

.ff13-deck-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--matrix-columns);
  gap: 10px;
  align-items: stretch;
  min-height: 44px;
  background: linear-gradient(180deg, rgba(18, 28, 38, 0.92) 0%, rgba(6, 12, 18, 0.96) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.ff13-deck-row:hover,
.ff13-deck-row.active-row {
  border-top-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
  box-shadow: 0 0 16px rgba(125, 211, 252, 0.25);
}

/* LEFT SIDE OF EACH BAR: Beveled Metallic Paradigm Name Plate with 45-Degree Right Slant */
.deck-row-left-plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px 0 14px;
  background: linear-gradient(
    180deg,
    rgba(195, 210, 218, 0.52) 0%,
    rgba(130, 148, 160, 0.42) 48%,
    rgba(78, 94, 106, 0.58) 100%
  );
  border-right: 2px solid rgba(255, 255, 255, 0.75);
  clip-path: polygon(0 0, 100% 0, calc(100% - 24px) 100%, 0 100%);
  transition: background 0.15s ease;
}

.ff13-deck-row:hover .deck-row-left-plate,
.ff13-deck-row.active-row .deck-row-left-plate {
  background: linear-gradient(
    180deg,
    rgba(224, 247, 250, 0.85) 0%,
    rgba(155, 212, 224, 0.68) 50%,
    rgba(94, 158, 174, 0.82) 100%
  );
}

.ff13-deck-row.is-default-paradigm .deck-row-left-plate {
  box-shadow: inset 4px 0 0 var(--gold-leader);
}

/* Row Number (1–6) */
.row-slot-number {
  font-family: var(--font-header);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  min-width: 16px;
  text-shadow: 0 1px 2px #000000;
}

.ff13-deck-row:hover .row-slot-number,
.ff13-deck-row.active-row .row-slot-number {
  color: #040d14;
  text-shadow: none;
  font-weight: 700;
}

/* Default Paradigm Yellow Emblem Toggle */
.default-emblem-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(4, 13, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.45);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.default-emblem-btn:hover {
  border-color: var(--gold-leader);
  color: var(--gold-leader);
  transform: scale(1.08);
}

.default-emblem-btn.active {
  background: linear-gradient(180deg, #FDE047 0%, #F59E0B 65%, #B45309 100%);
  border-color: #FFFFFF;
  color: #040d14;
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.9);
}

/* Hand Cursor Indicator on Active/Hovered Row */
.row-hand-indicator {
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  flex-shrink: 0;
}

.ff13-deck-row:hover .row-hand-indicator,
.ff13-deck-row.active-row .row-hand-indicator {
  opacity: 1;
  transform: translateX(0);
}

/* Auto-Resolved Paradigm Name (e.g., Relentless Assault, Diversity, Combat Clinic) */
.paradigm-resolved-name {
  font-family: var(--font-paradigm);
  font-size: 21px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 rgba(4, 13, 20, 0.95),
     1px -1px 0 rgba(4, 13, 20, 0.95),
    -1px  1px 0 rgba(4, 13, 20, 0.95),
     1px  1px 0 rgba(4, 13, 20, 0.95),
     0 0 12px rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* RIGHT SIDE OF EACH BAR: 3 ANGLED PARALLELOGRAM / CHEVRON ROLE PLATES */
.role-plate-cell {
  position: relative;
  display: flex;
  align-items: center;
}

.role-crystal-plate {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 24px;
  background: var(--plate-bg);
  border-top: 1px solid var(--plate-border);
  border-bottom: 1px solid var(--plate-border);
  border-left: 2px solid var(--plate-solid);
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

/* Glossy Top-Half Crystal Specular Highlight */
.role-crystal-plate::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.03) 100%);
  pointer-events: none;
}

.role-crystal-plate:hover,
.role-crystal-plate:focus-visible {
  filter: brightness(1.22);
  box-shadow: 0 0 16px var(--plate-glow);
  border-top-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
  outline: none;
}

.role-crystal-plate:active {
  transform: scale(0.985);
}

.role-plate-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  position: relative;
  z-index: 1;
}

/* Bold 3-Letter Code (COM, RAV, SEN, SYN, SAB, MED) + Full Role Title */
.role-code-tag {
  font-family: var(--font-role);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  color: #040d14;
  background: var(--plate-solid);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.role-full-name {
  font-family: var(--font-header);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--plate-text);
  text-shadow:
    -1px -1px 0 #040d14,
     1px -1px 0 #040d14,
    -1px  1px 0 #040d14,
     1px  1px 0 #040d14,
     0 0 10px var(--plate-glow);
}

.role-level-tag {
  position: relative;
  z-index: 1;
  font-family: var(--font-header);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 #040d14,
     1px -1px 0 #040d14,
    -1px  1px 0 #040d14,
     1px  1px 0 #040d14;
}

/* ============================================================================
   5. BOTTOM STATUS BAR (CLOCK, GIL & BUTTON PROMPTS)
   ============================================================================ */
.ff13-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 12px 0;
  font-family: var(--font-paradigm);
  font-size: 16px;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.85);
  text-shadow: 0 1px 2px #000000;
}

.bottom-left-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.clock-Readout,
.gil-readout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
}

.gil-coin-icon {
  color: #38BDF8;
}

.bottom-right-prompts {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.prompt-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
}

.btn-glyph {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.btn-glyph.square {
  color: var(--gold-leader);
  border-color: var(--gold-leader);
}

.btn-glyph.circle {
  color: #F43F5E;
}

.btn-glyph.triangle {
  color: #10B981;
}

/* ============================================================================
   MINIMAL JSON OVERLAY
   ============================================================================ */
.json-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 13, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.json-overlay[hidden] {
  display: none !important;
}

.json-dialog {
  width: 100%;
  max-width: 720px;
  background: linear-gradient(180deg, #0b2b36 0%, #040d14 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.json-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-header);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 8px;
}

.json-textarea {
  width: 100%;
  background: rgba(4, 10, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #BAE6FD;
  font-family: monospace;
  font-size: 12px;
  padding: 10px;
  outline: none;
}

.json-dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Responsive adjustments for smaller viewports */
@media (max-width: 1120px) {
  :root {
    --matrix-columns: 28% repeat(3, 1fr);
  }
  .role-full-name {
    font-size: 11.5px;
  }
  .paradigm-resolved-name {
    font-size: 17px;
  }
}

@media (max-width: 860px) {
  .ff13-upper-stage {
    grid-template-columns: 1fr;
  }
  .ff13-char-columns {
    grid-column: 1 / -1;
  }
  .ff13-deck-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px;
  }
}
