/* ============================================================
   FULL iOS THEME — SoccerFootballSim
   White + Light Grey + iOS Blue Gradient
   ============================================================ */

/* GLOBAL COLORS */
:root {
  --primary: #2f6bff;
  --primary-dark: #1a4dde;
  --primary-600: #1a4dde;
  --primary-light: #60a5fa;

  --primary-gradient: linear-gradient(180deg, #2f6bff, #1a4dde);
  --primary-gradient-soft: linear-gradient(90deg, #2563eb, #60a5fa);

  --bg-ios: linear-gradient(180deg, #ffffff 0%, #f5f6fa 100%);
  --card-ios: linear-gradient(145deg, #ffffff, #f2f3f7);
  --card-ios-soft: linear-gradient(145deg, #fafbff, #eef0f4);

  --border-ios: rgba(220,224,235,0.9);
  --shadow-ios: 0 14px 38px rgba(14, 23, 42, 0.08);
}

/* GLOBAL PAGE BACKGROUND */
body {
  background: var(--bg-ios) !important;
  color: #0f172a;
}

/* ============================================================
   HEADERS + NAVIGATION
   ============================================================ */

.site-header {
  background: var(--card-ios) !important;
  border-bottom: 1px solid var(--border-ios) !important;
  box-shadow: 0 6px 22px rgba(14, 23, 42, 0.06) !important;
  backdrop-filter: blur(12px);
}

/* Active nav link */
.nav a.active,
.nav a:hover {
  color: var(--primary) !important;
  background: rgba(47,107,255,0.08) !important;
}

/* Navigation buttons */
.nav-toggle span {
  background: #4b5563 !important;
}

/* ============================================================
   GLOBAL CARDS (ALL PAGES)
   ============================================================ */

.card,
.picker-card,
.quick-card,
.match-stats.card,
.match-feed.card,
.fixture-round,
.team-picker-panel,
.builder-sidebar,
.result-panel,
.team-modal,
.share-modal,
.match-stats-modal {
  background: var(--card-ios) !important;
  border-radius: 22px !important;
  border: 1px solid var(--border-ios) !important;
  box-shadow: var(--shadow-ios) !important;
  padding: 18px !important;
}

/* Soft variant */
.card-soft {
  background: var(--card-ios-soft) !important;
  border-radius: 22px !important;
}

/* ============================================================
   BUTTONS — iOS PILL STYLE
   ============================================================ */

.btn,
.sim-btn,
.stack-btn {
  border-radius: 999px !important;
  font-weight: 700 !important;
  padding: 12px 20px !important;
  transition: all .18s ease;
}

/* Primary button */
.btn-primary,
#simulateBtn,
#quickSimBtn,
#backToDashboard {
  background: var(--primary-gradient) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 10px 26px rgba(47,107,255,0.32) !important;
}

.btn-primary:hover {
  background: linear-gradient(180deg,#3b72ff,#1a4dde) !important;
}

/* Outline button */
.btn-outline,
.stack-btn.btn-outline {
  border: 2px solid var(--primary) !important;
  color: var(--primary) !important;
}

.btn-outline:hover {
  background: rgba(47,107,255,0.1) !important;
}

/* Quick Match VS Sim button */
.sim-btn {
  font-size: 1rem !important;
  padding: 10px 26px !important;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */

input,
select {
  border-radius: 14px !important;
  border: 1px solid var(--border-ios) !important;
  background: #ffffff !important;
  padding: 12px 14px !important;
  font-size: 1rem !important;
  box-shadow: 0 6px 16px rgba(15,23,42,0.05) !important;
}

input:focus,
select:focus {
  border-color: var(--primary) !important;
  outline: 2px solid rgba(47,107,255,0.25) !important;
}

/* ============================================================
   GLOBAL LOGOS (ANY SQUARE/ROUNDED IMAGES)
   ============================================================ */

img.team-logo,
img.preview-logo,
img.preview-kit,
img.team-line-logo,
img.team-modal-logo {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* ============================================================
   QUICK MATCH LOBBY
   ============================================================ */

.selected-preview {
  background: var(--card-ios-soft) !important;
  border-radius: 24px !important;
  padding: 18px !important;
  box-shadow: var(--shadow-ios);
}

.preview-team {
  background: #ffffff !important;
  border: 1px solid var(--border-ios) !important;
  border-radius: 999px !important;
  padding: 16px 14px !important;
}

/* ============================================================
   LIVE MATCH VIEW
   ============================================================ */

/* Header */
.live-wrapper {
  background: var(--card-ios) !important;
  border-radius: 28px !important;
  box-shadow: var(--shadow-ios) !important;
  padding: 26px !important;
}

.scoreboard {
  background: var(--card-ios-soft) !important;
  border: 1px solid var(--border-ios) !important;
  border-radius: 26px !important;
}

/* Score text */
.score-line {
  font-size: 3rem !important;
}

/* Team panels */
.team-panel {
  border-radius: 24px !important;
  background: var(--card-ios-soft) !important;
  box-shadow: var(--shadow-ios) !important;
}

/* Stats section */
.stats-grid .stat-bar {
  height: 8px !important;
  border-radius: 999px !important;
}

.stat-bar-fill.home {
  background: var(--primary-gradient-soft) !important;
}

.stat-bar-fill.away {
  background: linear-gradient(90deg,#9ca3af,#d1d5db) !important;
}

/* Hide match feed (optional) */
.match-feed {
  display: none !important;
}

/* ============================================================
   TABS (Dashboard, Builder, League, UCL)
   ============================================================ */

.tab-btn {
  border-radius: 999px !important;
  background: #f3f4f7 !important;
  border: 1px solid var(--border-ios) !important;
}

.tab-btn.active {
  background: var(--primary) !important;
  color: white !important;
}

/* ============================================================
   FIXTURE LIST, TABLES, STANDINGS
   ============================================================ */

.fixture-round,
.fixture-match,
.standing-row,
.table .row {
  background: var(--card-ios) !important;
  border-radius: 22px !important;
  border: 1px solid var(--border-ios) !important;
}

/* ============================================================
   MODALS (Team modal, share modal, stats modal)
   ============================================================ */

.team-modal,
.share-modal,
.match-stats-modal {
  background: var(--card-ios) !important;
  border-radius: 26px !important;
  box-shadow: 0 40px 80px rgba(14,23,42,0.25) !important;
}

.share-card,
.match-stats-card {
  background: var(--card-ios-soft) !important;
  border-radius: 28px !important;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3 {
  font-family: "Anton", sans-serif !important;
}

body, p, span, button, input, select {
  font-family: "Oxanium", sans-serif !important;
}

/* ============================================================
   RESPONSIVE iOS TWEAKS
   ============================================================ */

@media (max-width: 900px) {
  .live-wrapper, .picker-card, .quick-card {
    border-radius: 22px !important;
    padding: 18px !important;
  }
}

@media (max-width: 480px) {
  .score-line {
    font-size: 2.4rem !important;
  }
}

/* ============================================================
   QUICK MATCH UI — iOS LOBBY
   ============================================================ */

.quick-match-layout .qm-container{
  grid-column:1 / -1;
}
.qm-container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px;
}

.section-title {
  font-family: "Anton";
  font-size: 28px;
  margin-bottom: 16px;
}

.qm-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.qm-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.qm-team {
  flex: 1;
  text-align: center;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}
.qm-team-button{
  border:none;
  background:none;
  padding:0;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  width:100%;
}

.qm-logo {
  width: clamp(96px, 12vw, 140px);
  height: clamp(96px, 12vw, 140px);
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
  background: transparent;
}
.qm-logo.is-generic{
  border-radius:50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.qm-logo.is-nation{
  border-radius:50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.qm-team-name {
  font-family: "Anton";
  font-size: 22px;
  margin-bottom: 6px;
}

.qm-vs {
  font-family: "Anton";
  font-size: 24px;
}

.qm-select {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-family: "Oxanium";
}
.qm-select.full {
  margin-top: 14px;
}

.qm-options {
  margin: 16px 0;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.qm-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  margin-right: 8px;
}

.qm-toggle input {
  display: none;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  background: #ccc;
  border-radius: 22px;
  top: 0;
  left: 0;
  width: 44px;
  height: 22px;
  transition: .3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

.qm-toggle input:checked + .toggle-slider {
  background: #2f6bff;
}
.qm-toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.qm-btn-blue {
  display: block;
  width: 100%;
  padding: 14px;
  background: #2f6bff;
  border-radius: 14px;
  font-family: "Oxanium";
  font-size: 18px;
  color: white;
  border: none;
  margin-top: 16px;
}

.qm-btn-outline {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-family: "Oxanium";
  font-size: 18px;
  color: #2f6bff;
  background: none;
  border: 2px solid #2f6bff;
  margin-top: 12px;
}

.qm-premium {
  margin-top: 14px;
  text-align: center;
  font-family: "Oxanium";
  font-size: 14px;
  opacity: 0.6;
}

@media (max-width: 640px){
  .qm-card{
    padding: 20px 16px;
  }
  .qm-team-row{
    flex-wrap: nowrap;
    gap: 16px;
    justify-content: space-between;
  }
  .qm-team{
    align-items:center;
    text-align:center;
  }
  .qm-team-button{
    flex-direction:row;
    align-items:center;
    gap:12px;
  }
  .qm-logo{
    width:88px;
    height:88px;
    aspect-ratio: 1 / 1;
    margin-bottom:0;
    border-radius:0;
  }
  .qm-team-name{
    font-size:18px;
    margin:0;
  }
  .qm-vs{
    font-size:18px;
  }
  .qm-select{
    width:100%;
  }
}

/* QM picker overlay */
.qm-picker-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.45);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:200;
}
.qm-picker-overlay[hidden]{
  display:none !important;
}
.qm-picker-panel{
  width:min(520px, 90vw);
  background: var(--card-ios);
  border-radius:20px;
  padding:16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
  border:1px solid var(--border-ios);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.qm-picker-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.qm-picker-head h3{
  margin:0;
  font-family:"Anton", sans-serif;
}
.qm-picker-close{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
  line-height:1;
  color:#1f2937;
}
.qm-picker-search input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border-ios);
  font-family:"Oxanium";
  font-size:16px;
  box-shadow: 0 6px 14px rgba(15,23,42,0.05);
}
.qm-picker-results{
  max-height:360px;
  overflow:auto;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
}
.qm-picker-item{
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border-ios);
  background: var(--card-ios-soft);
  cursor:pointer;
  font-family:"Oxanium";
  font-size:15px;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.qm-picker-item:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 14px rgba(15,23,42,0.08);
  background:white;
}
.qm-picker-empty{
  grid-column:1 / -1;
  text-align:center;
  margin:8px 0;
  color:#6b7280;
  font-family:"Oxanium";
}

/* ============================================================
   LIVE MATCH ENGINE — iOS
   ============================================================ */

.live-engine{
  margin-bottom:32px;
}
.live-engine .live-header {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.6);
  padding: 12px 14px;
  border-radius: 28px;
  backdrop-filter: blur(10px);
  margin-bottom: 26px;
}

.live-engine .lh-team {
  text-align: center;
  display:flex;
  flex-direction:column;
  align-items:center;
  max-width: 120px;
  margin: 0 auto;
}
.live-engine .lh-logo {
  width: 60px;
  height: 60px;
  border-radius: 0;
  object-fit: cover;
  box-shadow: none;
  background: transparent;
}
.live-engine .lh-logo.is-generic{
  border-radius:50%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.live-engine .lh-logo.is-nation{
  border-radius:50%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.live-engine .lh-team h3 {
  font-family: "Anton";
  margin: 4px 0 0;
  font-size: 16px;
}
.live-engine .lh-team p {
  font-family: "Oxanium";
  font-size: 12px;
  opacity: 0.7;
}

.live-engine .lh-score {
  text-align: center;
  min-width: 70px;
}
.live-engine .lh-minute {
  font-family: "Oxanium";
  opacity: 0.7;
}
.live-engine .lh-main-score {
  font-family: "Anton";
  font-size: 36px;
  margin: 2px 0;
}
.live-engine .lh-stadium {
  font-family: "Oxanium";
  font-size: 14px;
  opacity: 0.7;
}

/* MINI STATS CARDS */
.live-engine .live-stats-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}
.live-engine .ls-card {
  width: min(420px, 100%);
  background: white;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.live-engine .ls-card h4 {
  font-family: "Anton";
  margin-bottom: 6px;
  text-align:center;
}
.live-engine .ls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.live-engine .bar {
  flex: 1;
  height: 6px;
  margin: 0 6px;
  background: linear-gradient(90deg,#2f6bff,#8baaff);
  border-radius: 6px;
}
.live-engine .ls-bar .stat-bar {
  flex: 1;
  height: 10px;
  margin: 0 8px;
}
.live-engine .ls-bar .ls-value {
  font-family: "Oxanium";
  font-weight: 700;
  min-width: 54px;
  text-align: center;
}

/* SNAPSHOT */
.live-engine .snapshot-card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  font-family: "Oxanium";
  margin-bottom: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.live-engine .snapshot-card h3 {
  font-family: "Anton";
  margin-bottom: 10px;
}

/* ACTION BAR */
.live-engine .live-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.live-engine .action-btn {
  padding: 12px;
  background: #2f6bff;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: "Oxanium";
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(47,107,255,0.22);
}

.live-engine .action-btn.outline {
  background: none;
  border: 1px solid #2f6bff;
  color: #2f6bff;
}

.live-engine .action-btn.red {
  background: #ff4b4b;
}
