@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #04091e;
  --navy2:   #080f2a;
  --card:    #0d1535;
  --border:  #1a2448;
  --gold:    #c9a84c;
  --gold2:   #f0c96a;
  --green:   #00d46a;
  --red:     #ff3b3b;
  --blue:    #4f8ef7;
  --text:    #e8eaf6;
  --muted:   #6b7db3;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
}

/* ── BACKGROUND CANVAS ── */
#gs-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

#app { position: relative; z-index: 1; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── HEADER ── */
.gs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 9, 30, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.gs-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.gs-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── HERO BANNER ── */
.gs-hero {
  background: linear-gradient(135deg, #04091e 0%, #0a1540 50%, #04091e 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.gs-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.gs-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 12px;
}

.gs-hero h1 span {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gs-hero p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── TABS ── */
.gs-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 24px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.gs-tab {
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  background: transparent;
  color: var(--muted);
}

.gs-tab:hover { color: var(--text); background: var(--card); }

.gs-tab.active {
  background: var(--gold);
  color: #04091e;
  border-color: var(--gold);
}

/* ── SECTION LABEL ── */
.gs-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.gs-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── MATCH CARDS ── */
.gs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.gs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.gs-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,168,76,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.1);
}

.gs-card-thumb {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.gs-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.gs-card:hover .gs-card-thumb img { transform: scale(1.04); }

.gs-card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4,9,30,0.95) 0%, rgba(4,9,30,0.2) 60%, transparent 100%);
}

.gs-live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 4px;
}

.gs-live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.gs-card-body {
  padding: 16px;
}

.gs-card-competition {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.gs-card-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.gs-team { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gs-team-name { font-size: 0.8rem; font-weight: 700; text-align: center; line-height: 1.2; }
.gs-team-home { align-items: flex-start; }
.gs-team-away { align-items: flex-end; }
.gs-team-home .gs-team-name { text-align: left; }
.gs-team-away .gs-team-name { text-align: right; }

.gs-vs {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 1px;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
}

.gs-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
}

.gs-countdown {
  color: var(--gold);
  font-weight: 600;
}

/* ── PLAY BUTTON OVERLAY ── */
.gs-play-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(201,168,76,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.gs-card:hover .gs-play-btn { opacity: 1; }

/* ── FIFA FIXTURES ── */
.gs-fixtures-hero {
  background: linear-gradient(135deg, #0a1540, #04091e);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 28px;
  text-align: center;
}

.gs-fixtures-hero h2 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}

.gs-fixtures-hero h2 span {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gs-fixtures-hero p { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

.gs-date-group { margin-bottom: 24px; }

.gs-date-header {
  position: sticky;
  top: 64px;
  z-index: 10;
  background: var(--navy);
  padding: 10px 0 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.gs-date-header span {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.gs-fixture-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 6px;
  transition: border-color 0.2s;
}

.gs-fixture-row:hover { border-color: rgba(201,168,76,0.3); }

.gs-fixture-home { font-size: 0.85rem; font-weight: 600; text-align: right; }
.gs-fixture-away { font-size: 0.85rem; font-weight: 600; }

.gs-fixture-vs {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}

.gs-fixture-meta { text-align: right; min-width: 90px; }
.gs-fixture-time { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.gs-fixture-stage {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gold);
  margin-top: 2px;
}

/* ── SPINNER ── */
.gs-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gs-spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.gs-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.gs-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.gs-empty p { font-size: 0.9rem; }

/* ── MODAL ── */
.gs-modal {
  position: fixed;
  inset: 0;
  background: rgba(4,9,30,0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.gs-modal-header {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gs-modal-title { font-size: 0.85rem; font-weight: 700; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

.gs-modal-close {
  width: 36px;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gs-modal-close:hover { background: var(--border); }

.gs-modal iframe {
  width: 100%;
  max-width: 960px;
  height: 70vh;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ── FOOTER ── */
.gs-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ── MAIN CONTENT ── */
.gs-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .gs-fixture-row { grid-template-columns: 1fr auto 1fr; }
  .gs-fixture-meta { display: none; }
  .gs-hero { padding: 32px 16px 28px; }
}

/* ── CHAT PANEL ── */
.gs-chat {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 320px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--card);
  box-shadow: 0 -4px 40px rgba(0,0,0,0.5);
  max-height: calc(100vh - 80px);
  transition: max-height 0.3s ease;
}

.gs-chat:not(.open) {
  max-height: 44px;
}

.gs-chat:not(.open) .gs-chat-body,
.gs-chat:not(.open) .gs-chat-input-row,
.gs-chat:not(.open) .gs-chat-gate,
.gs-chat:not(.open) .gs-chat-footer {
  display: none;
}

.gs-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  user-select: none;
  border-radius: 12px 12px 0 0;
  background: var(--navy2);
}

.gs-chat-header:hover { background: var(--border); }

.gs-chat-online {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(0, 212, 106, 0.1);
  border: 1px solid rgba(0, 212, 106, 0.2);
  padding: 2px 8px;
  border-radius: 100px;
}

.gs-chat-toggle { color: var(--muted); font-size: 0.75rem; }

.gs-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.gs-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 85%;
}

.gs-chat-msg.own { align-self: flex-end; align-items: flex-end; }

.gs-chat-name {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.gs-chat-msg.own .gs-chat-name { color: var(--blue); }

.gs-chat-text {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 10px 10px 10px 2px;
  padding: 7px 11px;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}

.gs-chat-msg.own .gs-chat-text {
  background: rgba(79, 142, 247, 0.15);
  border-color: rgba(79, 142, 247, 0.3);
  border-radius: 10px 10px 2px 10px;
}

.gs-chat-time {
  font-size: 0.6rem;
  color: var(--muted);
}

.gs-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.gs-chat-input {
  flex: 1;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.gs-chat-input:focus { border-color: rgba(201,168,76,0.5); }
.gs-chat-input::placeholder { color: var(--muted); }

.gs-chat-send {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #04091e;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.gs-chat-send:hover { background: var(--gold2); }

@media (max-width: 480px) {
  .gs-chat { right: 0; width: 100%; border-radius: 12px 12px 0 0; }
}

/* ── FLOATING PLAYER ── */
.gs-player {
  position: fixed;
  z-index: 160;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,168,76,0.15);
  overflow: hidden;
  transition: width 0.25s, height 0.25s;
  min-width: 280px;
}

.gs-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  height: 36px;
  background: var(--navy2);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.gs-player-bar:active { cursor: grabbing; }

.gs-player-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.gs-player-btn {
  width: 26px;
  height: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gs-player-btn:hover { background: var(--border); }

.gs-player iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}

/* ── AUTH MODAL ── */
.gs-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,9,30,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.gs-auth-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.gs-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--navy2);
  border-radius: 8px;
  padding: 4px;
}

.gs-auth-tabs button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.2s;
}

.gs-auth-tabs button.active {
  background: var(--gold);
  color: #04091e;
}

.gs-auth-error {
  font-size: 0.75rem;
  color: var(--red);
  background: rgba(255,59,59,0.1);
  border: 1px solid rgba(255,59,59,0.2);
  border-radius: 6px;
  padding: 8px 12px;
}

.gs-auth-input {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.gs-auth-input:focus { border-color: rgba(201,168,76,0.5); }
.gs-auth-input::placeholder { color: var(--muted); }

.gs-auth-submit {
  background: var(--gold);
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #04091e;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.gs-auth-submit:hover { background: var(--gold2); }
.gs-auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── CHAT EXTRAS ── */
.gs-chat-user {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  padding: 2px 8px;
  border-radius: 100px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gs-chat-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.gs-chat-gate p { font-size: 0.8rem; color: var(--muted); }

.gs-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
}

.gs-signout-btn {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
}

.gs-signout-btn:hover { color: var(--red); border-color: var(--red); }
