/* ==========================================================================
   AEROPLANE CHESS GUIDE - THEMED SYSTEM
   ========================================================================== */

:root {
  --bg-dark: #08121c;
  --table-felt-1: #1a3248;
  --table-felt-2: #0e1c2a;
  --table-felt-3: #08121c;
  --panel-bg: rgba(9, 23, 36, 0.88);
  --panel-border: rgba(255, 255, 255, 0.18);
  
  --wood-dark: #141b24;
  --wood-mid: #253342;
  --wood-light: #3d5063;
  
  --gold: #ffc95a;
  --crimson: #e45b55;
  --blue: #339af0;
  --green: #51cf66;
  --yellow: #fcc419;
  --ink: #f4f0e7;
  --muted: #aab8c6;
  
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body.aeroplane-app {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 10%, var(--table-felt-1) 0%, var(--table-felt-2) 47%, var(--table-felt-3) 100%);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

.app-header { position: sticky; top: 0; z-index: 100; height: var(--header-height); background: rgba(8, 18, 28, 0.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--panel-border); }
.header-inner { max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-tile { font-size: 2rem; background: var(--blue); border: 2px solid var(--gold); border-radius: 10px; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; }
.brand-text h1 { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.brand-text .badge { font-size: 0.72rem; font-weight: 900; background: var(--gold); color: #151b1a; padding: 2px 8px; border-radius: 99px; }
.brand-text .subtitle { font-size: 0.8rem; color: var(--muted); }

.header-search { flex: 0 1 400px; position: relative; display: flex; align-items: center; }
.header-search input { width: 100%; padding: 10px 16px 10px 42px; background: rgba(3, 15, 12, 0.75); border: 1px solid var(--panel-border); border-radius: 99px; color: var(--ink); }
.search-icon { position: absolute; left: 14px; opacity: 0.6; }

.table-outer-wrapper { max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.table-wood-frame { position: relative; background: linear-gradient(145deg, var(--wood-dark), var(--wood-mid), var(--wood-dark)); border-radius: 28px; padding: 18px; border: 4px solid var(--wood-light); box-shadow: 0 28px 80px rgba(0,0,0,0.75); }
.table-corner { position: absolute; width: 28px; height: 28px; border: 3.5px solid var(--gold); }
.corner-tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner-tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner-br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.table-felt-mat { background: linear-gradient(135deg, rgba(26,50,72,0.95), rgba(14,28,42,0.98)); border-radius: 20px; padding: 24px; border: 1px solid var(--panel-border); }

.table-mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; background: rgba(3, 15, 12, 0.85); border: 1px solid var(--panel-border); padding: 10px; border-radius: 16px; margin-bottom: 24px; }
.table-tab { flex: 0 0 auto; padding: 9px 16px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-border); color: var(--muted); font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.table-tab.active { background: var(--gold); color: #151b1a; border-color: var(--gold); box-shadow: 0 4px 14px rgba(255, 201, 90, 0.4); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.content-block { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 20px; padding: 28px; }
.tool-block { border-color: rgba(255, 201, 90, 0.4); background: radial-gradient(circle at 50% 20%, rgba(26,50,72,0.95), rgba(14,28,42,0.98)); }

.block-header { margin-bottom: 20px; }
.header-tag { font-size: 0.72rem; font-weight: 900; color: var(--gold); text-transform: uppercase; }
.block-header h2 { font-size: 1.55rem; font-weight: 900; color: var(--ink); }
.block-header p { color: var(--muted); font-size: 0.92rem; }

/* Hangar Box */
.board-container { display: flex; justify-content: center; margin: 20px 0; }
.aeroplane-board-box { width: 100%; max-width: 460px; aspect-ratio: 1; border: 4px solid var(--wood-light); border-radius: 16px; background: #0c1824; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.hangar-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; width: 100%; height: 100%; position: relative; }
.hangar { border-radius: 12px; padding: 16px; display: grid; place-items: center; font-weight: 900; font-size: 1.1rem; }
.hangar.red { background: rgba(228, 91, 85, 0.25); border: 2px solid var(--crimson); color: #ff8787; }
.hangar.yellow { background: rgba(252, 196, 25, 0.25); border: 2px solid var(--yellow); color: var(--gold); }
.hangar.blue { background: rgba(51, 154, 240, 0.25); border: 2px solid var(--blue); color: #74c0fc; }
.hangar.green { background: rgba(81, 207, 102, 0.25); border: 2px solid var(--green); color: #69db7c; }

.center-target { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--panel-bg); border: 2px solid var(--gold); border-radius: 50%; padding: 16px; font-weight: 900; font-size: 0.85rem; color: var(--gold); text-align: center; box-shadow: 0 0 20px rgba(255, 201, 90, 0.4); }

.piece-selector-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.piece-btn { padding: 8px 14px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); color: var(--muted); font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.piece-btn.active { background: var(--gold); color: #151b1a; border-color: var(--gold); }

.piece-detail-card { background: rgba(9, 23, 36, 0.8); border: 1px solid var(--panel-border); border-radius: 14px; padding: 20px; }
.detail-header { display: flex; align-items: center; gap: 14px; }
.piece-avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: var(--blue); border: 2px solid var(--gold); color: #fff; }

.callout-box { display: flex; gap: 14px; padding: 18px; border-radius: 14px; }
.danger-callout { background: rgba(255, 201, 90, 0.12); border: 1px solid rgba(255, 201, 90, 0.35); }
.callout-icon { font-size: 1.8rem; }

.text-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.info-card { background: rgba(9, 23, 36, 0.7); border: 1px solid var(--panel-border); border-radius: 14px; padding: 18px; }
.info-card.highlight-card { background: rgba(26, 50, 72, 0.4); border-color: rgba(255, 201, 90, 0.4); }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: rgba(9, 23, 36, 0.7); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 16px; }
.faq-item summary { font-weight: 800; color: var(--ink); cursor: pointer; }
.faq-item p { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }

/* ---- Phones. Added after a measured audit: these pages had no media query, so
   the nested table chrome took 180px of a 390px screen and the diagrams
   overflowed the page. Give the content its width back. ---- */
@media (max-width: 720px) {
  .header-inner { padding: 0 12px; gap: 10px; }
  .table-outer-wrapper { margin: 12px auto; padding: 0 10px; }
  .table-wood-frame { padding: 8px; }
  .table-felt-mat { padding: 12px; }
  .table-content-area { padding: 0; }
  .content-block { padding: 14px; }
  .block-header h2 { font-size: 1.15rem; }
  .text-card-grid { grid-template-columns: 1fr; gap: 12px; }
  .table-mode-tabs { padding: 6px; gap: 6px; }
}
