/* Optional green gothic: repeating tracery and engraved rules on forest green.
   Scoped to data-design=gothic; the original design remains the default. */
html[data-design=gothic] body.ft-site[data-page] {
  --bg: #0c1410;
  --surface: #131f18;
  --raised: #1b2b20;
  --text: #edf3e8;
  --muted: #a4b6a6;
  --line: #304e3b;
  --green: #b6e582;
  --green-ink: #15270a;
  --amber: #edbc77;
  --red: #f1a39b;
  --gothic-success: #a5c9ac;
  --gothic-accent: #b6e582;
  --gothic-glow: #387e4c1a;
  --gothic-ornament-opacity: .28;
  --font-gothic: 'Grenze Gotisch', 'Zodiak', Georgia, serif;
  --editorial-panel: var(--surface);
  --editorial-radius: 4px;
  --editorial-header: linear-gradient(110deg, #72b78b0b, transparent 70%);
  --editorial-lead: linear-gradient(120deg, #72b78b12, transparent 75%);
  --editorial-bands: none;
  --home-header-start: var(--raised);
  --home-header-end: var(--surface);
  --home-key-surface: var(--raised);
  --home-key-border: var(--line);
  --home-button-top: var(--green);
  --home-button-bottom: var(--green);
  --radius: 4px;
  --radius-sm: 4px;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0, var(--gothic-glow), transparent 65%), url('../images/gothic/tracery.svg');
  background-size: 100% 950px, 120px 180px;
  background-repeat: no-repeat, repeat;
}

html[data-theme=light][data-design=gothic] body.ft-site[data-page] {
  --bg: #eff4eb;
  --surface: #fbfdf8;
  --raised: #e4eddf;
  --text: #17291d;
  --muted: #566c5c;
  --line: #bed0bb;
  --green: #356544;
  --green-ink: #f6fff3;
  --amber: #805414;
  --red: #a13e38;
  --gothic-success: #356544;
  --gothic-accent: #356544;
  --gothic-glow: #65a46720;
  --gothic-ornament-opacity: .55;
}

/* The masthead reads like a club crest above an engraved nameplate. */
html[data-design=gothic] body.ft-site[data-page] .site-header {
  position: relative;
  background: var(--bg);
  border-bottom: 3px double var(--line);
}
html[data-design=gothic] body.ft-site[data-page] .brand {
  font-family: var(--font-gothic);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.4px;
  line-height: 1;
  color: var(--text);
}
html[data-design=gothic] body.ft-site[data-page] .brand-light { font-weight: 600; }
html[data-design=gothic] body.ft-site[data-page] .brand small {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 8px;
}
html[data-design=gothic] body.ft-site[data-page] .brand-mark {
  width: 43px;
  height: 51px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 18px;
  border: 1px solid var(--gothic-accent);
  border-radius: 22px 22px 19px 19px / 8px 8px 26px 26px;
  background: var(--surface);
  color: var(--gothic-accent);
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--line);
}
html[data-design=gothic] body.ft-site[data-page] #navigation a {
  border-radius: 3px;
  transition: background-color .18s ease, color .18s ease;
}
html[data-design=gothic] body.ft-site[data-page] .site-header #navigation a[aria-current=page] {
  color: var(--green-ink);
  background: var(--green);
  border-color: var(--green);
  border-radius: 3px;
}
html[data-design=gothic] body.ft-site[data-page] .icon-button {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 50%;
}

/* Large architectural ornament stays behind the title, outside reading cards. */
html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header) {
  position: relative;
  isolation: isolate;
  border-bottom: 3px double var(--line);
}
html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header)::after {
  content: '';
  position: absolute;
  inset: 0 16px 0 auto;
  width: 280px;
  z-index: -1;
  background: url('../images/gothic/rose-window.svg') center 36% / 230px auto no-repeat;
  opacity: var(--gothic-ornament-opacity);
  pointer-events: none;
}
html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header) h1,
html[data-design=gothic] body.ft-site[data-page="404"] .empty h1 {
  font-family: var(--font-gothic);
  font-size: clamp(46px, 5.8vw, 82px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.8px;
  text-wrap: balance;
}
html[data-design=gothic] body.ft-site[data-page] :is(.eyebrow, .ft-eyebrow) {
  color: var(--gothic-accent);
  font-size: 11px;
  letter-spacing: 2.2px;
}
html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header) :is(.eyebrow, .ft-eyebrow)::before {
  content: '\2726';
  display: inline-block;
  margin-right: 10px;
  font-size: 13px;
}

/* Opaque interiors keep the repeating pattern away from tables and copy. */
html[data-design=gothic] body.ft-site[data-page] :is(.panel, .fixtures-league, .preview-panel, .fpl-import, .stats-fixture-card, .stats-numbers, .stats-efficiency, .news-feature-deck, .archive-match-card, .article-card, .ft-admin .card, .ft-checks .summary, .ft-checks .status, .ft-checks .next-steps) {
  background-color: var(--surface);
  border-color: var(--line);
  border-radius: 4px;
}
html[data-design=gothic] body.ft-site[data-page] :is(.panel-head, .fixtures-league-header, .home-briefing-header, .home-fantasy-header, .preview-masthead) {
  background: linear-gradient(110deg, #72b78b12, transparent 65%), var(--surface);
  border-bottom: 3px double var(--line);
  border-radius: 3px 3px 0 0;
  box-shadow: none;
}
html[data-design=gothic] body.ft-site[data-page] :is(.panel-head, .fixtures-league-header) h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .1px;
  text-transform: none;
}
html[data-design=gothic] body.ft-site[data-page] .panel-head h2::before {
  content: '\2727';
  margin-right: 9px;
  color: var(--gothic-accent);
}
html[data-design=gothic] body.ft-site[data-page] :is(.home-feature-layout > .feature, .stats-player-hero, .recap-scoreboard, .recap-fantasy) {
  background-color: var(--surface);
  border-radius: 4px;
}
html[data-design=gothic] body.ft-site[data-page] :is(.home-briefing-header, .home-fantasy-header) {
  background-image: linear-gradient(90deg, var(--surface) 35%, transparent), url('../images/gothic/tracery.svg');
  background-size: auto, 100px 150px;
}
html[data-design=gothic] body.ft-site[data-page] #fantasy > .metrics {
  background: var(--surface);
  border-block: 3px double var(--line);
  border-radius: 3px;
}
html[data-design=gothic] body.ft-site[data-page] #fantasy > .metrics > .metric:not(:last-child)::after {
  transform: none;
  inset-block: 18px;
}
html[data-design=gothic] body.ft-site[data-page] .metric strong { color: var(--gothic-accent); }

/* Green actions, square seals, and a visible keyboard-focus ring. */
html[data-design=gothic] body.ft-site[data-page] :is(.button, .ft-button, .fpl-btn, .btn-primary):not(.secondary):not(.fpl-btn--ghost):not(.fpl-btn--danger) {
  border: 1px solid var(--green);
  border-radius: 3px;
  background: var(--green);
  color: var(--green-ink);
  box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 3px color-mix(in srgb, var(--green-ink) 24%, transparent);
}
html[data-design=gothic] body.ft-site[data-page] :is(.button.secondary, .ft-button.secondary, .fpl-btn--ghost, .btn-ghost) {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
}
html[data-design=gothic] body.ft-site[data-page] :is(.tag, .fpl-chip, .fpl-tab, .league-tab, .news-upgrade .tab) { border-radius: 3px; }
html[data-design=gothic] body.ft-site[data-page] :is(.fpl-tab.is-active, .league-tab.active, .news-upgrade .tab.active, .segment button.active) {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-ink);
}
html[data-design=gothic] body.ft-site[data-page] :is(input:not([type=checkbox]):not([type=range]), select, textarea) {
  border-color: var(--line);
  border-radius: 3px;
  background-color: var(--bg);
  color: var(--text);
}
html[data-design=gothic] body.ft-site[data-page] :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--gothic-accent);
  outline-offset: 4px;
}
html[data-design=gothic] body.ft-site[data-page] :is(.positive, .transfer-direction.incoming) { color: var(--gothic-success); }
html[data-design=gothic] body.ft-site[data-page] .dot:not(.amber) { background: var(--gothic-success); }

/* A dark cloister-green pitch connects the new palette to the football. */
html[data-design=gothic] body.ft-site[data-page=fantasy] .fpl-pitch {
  background: repeating-linear-gradient(to bottom, #16251f 0 12.5%, #1a2b24 12.5% 25%);
  border: 1px solid #5f8b6b;
  border-radius: 48% 48% 3px 3px / 5% 5% 3px 3px;
  box-shadow: inset 0 0 0 5px #111c17, inset 0 0 0 6px #85c99b40;
}
html[data-design=gothic] body.ft-site[data-page=fantasy] :is(.pitch-lines, .goal),
html[data-design=gothic] body.ft-site[data-page=fantasy] .pitch-lines::before,
html[data-design=gothic] body.ft-site[data-page=fantasy] .pitch-lines::after { border-color: #b5d6b755; }
html[data-design=gothic] body.ft-site[data-page=fantasy] .bench { border-top: 3px double var(--line); }
html[data-design=gothic] body.ft-site[data-page=fantasy] .health-ring { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
html[data-design=gothic] body.ft-site[data-page=fantasy] .fpl-drawer-panel {
  background: var(--surface);
  border: 1px solid var(--line);
}
html[data-design=gothic] body.ft-site[data-page] > footer {
  position: relative;
  border-top: 3px double var(--line);
  background: var(--bg);
  padding-top: 30px;
}
html[data-design=gothic] body.ft-site[data-page] > footer::before {
  content: '\2726';
  position: absolute;
  inset: -12px auto auto 50%;
  transform: translateX(-50%);
  padding-inline: 14px;
  background: var(--bg);
  color: var(--gothic-accent);
  font-size: 16px;
}

@media (max-width: 800px) {
  html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header)::after { right: 0; width: 180px; background-size: 180px auto; }
  html[data-design=gothic] body.ft-site[data-page] .brand { font-size: 29px; }
}
@media (max-width: 520px) {
  html[data-design=gothic] body.ft-site[data-page] { background-size: 100% 700px, 96px 144px; }
  html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header)::after { width: 150px; background-size: 150px auto; opacity: .16; }
  html[data-design=gothic] body.ft-site[data-page] :is(.hero, .ft-hero, .live-header) h1 { font-size: clamp(42px, 10.5vw, 56px); }
  html[data-design=gothic] body.ft-site[data-page] .brand { font-size: 27px; }
  html[data-design=gothic] body.ft-site[data-page] .brand small { font-size: 8px; letter-spacing: 1.5px; }
  html[data-design=gothic] body.ft-site[data-page] :is(.panel-head, .fixtures-league-header) h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-design=gothic] body.ft-site[data-page] #navigation a { transition: none; }
}
