/* ========================================
   TEAMSURGE UI SYSTEM — PREMIUM OVERHAUL
   ui.css
======================================== */

/* ========================================
   ROOT DESIGN TOKENS
======================================== */

:root {

  --accent: #00d4ff;
  --accent-strong: #00f0ff;

  --accent-soft:
    rgba(0,212,255,0.18);

  --bg-dark: #050505;

  --card:
    rgba(255,255,255,0.055);

  --card-hover:
    rgba(255,255,255,0.085);

  --border:
    rgba(255,255,255,0.08);

  --text-soft:
    rgba(255,255,255,0.72);

  --shadow:
    0 10px 40px rgba(0,0,0,0.45);

  --glow:
    0 0 24px rgba(0,212,255,0.16);

  --radius: 20px;
}

/* ========================================
   GLOBAL RESET
======================================== */

html,
body {
  margin: 0;
  padding: 0;

  min-height: 100vh;

  font-family:
    Inter,
    Arial,
    sans-serif;

  color: white;

  overflow-x: hidden;

  scroll-behavior: smooth;

  background:
    radial-gradient(circle at top left, rgba(0,212,255,.10), transparent 30%),
    radial-gradient(circle at top right, rgba(124,77,255,.10), transparent 35%),
    linear-gradient(180deg, #070b17 0%, #050816 100%);
}

/* ========================================
   BODY LAYOUT
======================================== */

body {
  position: relative;

  isolation: isolate;

  display: flex;
  flex-direction: column;

  min-height: 100vh;

  opacity: 1;

  transition: none;
}

/* page wrapper */
.page-content {
  flex: 1;

  display: flex;
  flex-direction: column;

  position: relative;
  z-index: 2;
}

/* all content above bg */
body > * {
  position: relative;
  z-index: 2;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 0;

  pointer-events: none;

  background:
    radial-gradient(circle at top left, rgba(0,212,255,0.08), transparent 18%),
    radial-gradient(circle at bottom right, rgba(124,77,255,0.10), transparent 20%);
}

/* GRID OVERLAY (optional, aus player.css) */
body::before {
  content: "";
  position: fixed;
  inset: 0;

  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);

  background-size: 60px 60px;

  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);

  pointer-events: none;
  z-index: 0;
}

/* =========================
   DISABLE IMAGE DRAGGING
========================= */

img{
    -webkit-user-drag:none;
    user-drag:none;

    pointer-events:none;
}

/* ========================================
   SAFE TOP LAYOUT SPACING SYSTEM
======================================== */

.hidden {
  display: none !important;
}

/* Topbar ist normaler Dokumentfluss */
.page-content,
main {
  padding-top: 0;
}

/* ========================================
   INTRO SCREEN
======================================== */

#intro-screen {
  position: fixed;
  inset: 0;

  background:
    radial-gradient(
      circle at center,
      #111 0%,
      #050505 100%
    );

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 100000;

  overflow: hidden;
}

body.intro-active {
  overflow: hidden;
}

/* ========================================
   INTRO CONTENT
======================================== */

.intro-content {
  text-align: center;
  color: white;
}

.intro-content img {

  width: 190px;

  opacity: 0;

  transform:
    scale(0.65)
    translateZ(0);

  animation:
    logoIn 1s ease forwards;

  filter:
    drop-shadow(
      0 0 28px rgba(255,255,255,0.16)
    );

  will-change:
    transform,
    opacity;

  backface-visibility: hidden;
}

.intro-content p {

  margin-top: 16px;

  font-size: 13px;

  letter-spacing: 3px;

  opacity: 0;

  color:
    rgba(255,255,255,0.72);

  animation:
    textIn 1s ease forwards;

  animation-delay: 0.6s;
}

/* ========================================
   INTRO EXIT
======================================== */

#intro-screen.closing {
  animation:
    screenSlideUp
    0.75s
    cubic-bezier(0.7, 0, 0.2, 1)
    forwards;

  animation-delay: 2s;
}

#intro-screen.closing img {
  animation:
    logoBeat 2.6s linear forwards;
}

#intro-screen.closing p {
  animation:
    textFadeOut 1.5s ease forwards;
}

/* ========================================
   TOP UI (STABLE GLASS HEADER)
======================================== */

.top-ui {
  position: relative;
  margin: 18px 18px 0;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  gap: 14px;

  padding: 10px 14px;
  border-radius: 26px;

  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

/* prevent collapse */
.top-left,
.top-center,
.top-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* alignment control */
.top-left {
  justify-content: flex-start;
}

.top-center {
  justify-content: center;
}

.top-right {
  justify-content: flex-end;
}

/* ========================================
   GLASS SYSTEM
======================================== */

.ui-glass {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);

  border-radius: 16px;

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 8px 24px rgba(0,0,0,0.28);

  transition: all 0.25s ease;
}

/* ========================================
   BACK BUTTON (PREMIUM NAV BUTTON)
======================================== */

.back-btn {
  height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;

  border-radius: 16px;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;

  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28);

  position: relative;
  overflow: hidden;

  transition: all 0.25s ease;
}

/* subtle top highlight */
.back-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;

  width: 60%;
  height: 1px;

  transform: translateX(-50%);

  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.7),
    transparent
  );

  opacity: 0.35;
}

/* glow sweep effect */
.back-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;

  width: 120%;
  height: 100%;

  background: linear-gradient(
    120deg,
    transparent,
    rgba(0, 212, 255, 0.18),
    transparent
  );

  transition: 0.6s ease;
}

/* hover */
.back-btn:hover {
  transform: translateY(-3px) scale(1.03);

  border-color: rgba(0, 212, 255, 0.35);

  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(0, 212, 255, 0.15);
}

.back-btn:hover::after {
  left: 120%;
}

/* click feel */
.back-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ========================================
   SOCIAL ICONS (PREMIUM NEON HUD STYLE)
======================================== */

.social-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* wrapper */
.social-icon {
  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28);

  overflow: hidden;

  transition: all 0.25s ease;
}

/* ICON */
.social-icon img {
  width: 20px;
  height: 20px;

  filter: brightness(0) invert(1);
  opacity: 0.85;

  transition: all 0.25s ease;
  z-index: 2;
}

/* NEON BORDER GLOW */
.social-icon::before {
  content: "";
  position: absolute;
  inset: -2px;

  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.0),
    rgba(0, 212, 255, 0.35),
    rgba(255, 45, 94, 0.25),
    rgba(0, 212, 255, 0.0)
  );

  opacity: 0;
  transition: 0.3s ease;

  filter: blur(6px);
}

/* TOP HIGHLIGHT LINE */
.social-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;

  width: 60%;
  height: 1px;

  transform: translateX(-50%);

  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.8),
    transparent
  );

  opacity: 0.3;
  transition: 0.3s ease;
}

/* HOVER EFFECT */
.social-icon:hover {
  transform: translateY(-3px) scale(1.05);

  border-color: rgba(0, 212, 255, 0.35);

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(0, 212, 255, 0.18);
}

.social-icon:hover img {
  opacity: 1;
  transform: scale(1.1);
}

.social-icon:hover::before {
  opacity: 1;
}

/* ACTIVE / CLICK FEEL */
.social-icon:active {
  transform: translateY(-1px) scale(0.98);
}

/* subtle floating animation */
@keyframes socialFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

.social-icon {
  animation: socialFloat 6s ease-in-out infinite;
}

.social-icon:nth-child(2) {
  animation-delay: 1.5s;
}

.social-icon:nth-child(3) {
  animation-delay: 3s;
}

/* ========================================
   LIVE BANNER (PREMIUM ESPORTS STYLE)
======================================== */

.live-banner {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  min-height: 46px;
  padding: 6px 10px;

  border-radius: 16px;

  background: linear-gradient(
    135deg,
    rgba(255, 45, 94, 0.10),
    rgba(0, 212, 255, 0.06)
  );

  border: 1px solid rgba(255, 45, 94, 0.25);

  box-shadow:
    0 0 24px rgba(255, 45, 94, 0.12),
    inset 0 0 18px rgba(255, 255, 255, 0.03);

  position: relative;
  overflow: hidden;
}

/* moving glow line */
.live-banner::before {
  content: "";
  position: absolute;
  inset: -2px;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 45, 94, 0.35),
    rgba(0, 212, 255, 0.25),
    transparent
  );

  transform: translateX(-100%);
  animation: liveShine 4s linear infinite;

  opacity: 0.6;
}

/* subtle pulse border */
.live-banner::after {
  content: "";
  position: absolute;
  inset: 0;

  border-radius: inherit;

  box-shadow: 0 0 18px rgba(255, 45, 94, 0.15);
  animation: livePulse 2.5s ease-in-out infinite;
}

/* inner layout */
.live-content {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 0 8px;
}

/* LEFT AREA */
.live-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* pulsing dot */
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;

  background: #ff2d5e;

  box-shadow:
    0 0 10px rgba(255, 45, 94, 0.8),
    0 0 22px rgba(255, 45, 94, 0.4);

  animation: dotPulse 1.4s infinite ease-in-out;
}

/* label */
.live-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;

  background: linear-gradient(90deg, #ff2d5e, #ff4d79);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* subtitle */
.live-sub {
  font-size: 12px;
  opacity: 0.75;
  color: rgba(255,255,255,0.75);
}

/* ========================================
   LIVE BUTTON (PREMIUM CTA STYLE)
======================================== */

.live-btn {
  height: 34px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;

  color: white;
  text-decoration: none;

  background: linear-gradient(
    135deg,
    rgba(255, 45, 94, 0.25),
    rgba(0, 212, 255, 0.15)
  );

  border: 1px solid rgba(255, 45, 94, 0.35);

  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.25),
    0 0 18px rgba(255, 45, 94, 0.18);

  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* hover glow sweep */
.live-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 120%;
  height: 100%;

  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );

  transition: 0.6s;
}

.live-btn:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(255, 45, 94, 0.6);
  box-shadow:
    0 10px 30px rgba(255, 45, 94, 0.25),
    0 0 28px rgba(0, 212, 255, 0.18);
}

.live-btn:hover::before {
  left: 120%;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

@keyframes liveShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes livePulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ========================================
   RESPONSIVE SMART TOPBAR LAYOUT
======================================== */

.top-ui {
  position: relative;
  margin: 18px 18px 0;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  gap: 14px;

  padding: 10px 14px;
  border-radius: 26px;

  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

/* LEFT / CENTER / RIGHT */
.top-left,
.top-center,
.top-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-left { justify-content: flex-start; }
.top-center { justify-content: center; }
.top-right { justify-content: flex-end; }

/* ========================================
   MOBILE: SMART REARRANGE
======================================== */

@media (max-width: 768px) {

  .top-ui {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "social back"
      "live live";

    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
  }

  /* SOCIAL */
  .top-left {
    grid-area: social;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
  }

  /* BACK BUTTON */
  .top-center {
    grid-area: back;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  /* LIVE */
  .top-right {
    grid-area: live;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* prevent overflow glitches */
  .social-bar {
    flex-wrap: nowrap;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .back-btn {
    height: 40px;
    font-size: 12px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .live-banner {
    width: 100%;
  }

  /* komplette Live-Zeile bleibt horizontal */
  .live-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* linker Block: Dot + Text (HORIZONTAL behalten!) */
  .live-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  /* Text darunter im gleichen Block */
  .live-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .live-label {
    line-height: 1;
  }

  .live-sub {
    font-size: 12px;
    opacity: 0.75;
    line-height: 1.2;
  }

  /* Button bleibt rechts sauber */
  .live-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* CENTER LIVE INFO */

@media (max-width: 768px) {

  .live-banner {
    justify-content: center; /* wichtig: Inhalt nicht rechts kleben lassen */
  }

  .live-content {
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 10px;
  }

  .live-left {
    justify-content: center;
    align-items: center;
  }

  .live-label,
  .live-sub {
    text-align: center;
  }

  .live-sub {
    display: block; /* sorgt für saubere zweite Zeile */
  }

  .live-btn {
    margin-left: 0;
  }
}

/* EXTRA SMALL: compact HUD */
@media (max-width: 420px) {

  .top-ui {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "social back"
      "live live";
    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
  }

  .top-left {
    grid-area: social;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .top-center {
    grid-area: back;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .top-right {
    grid-area: live;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* important: verhindert wrapping/overlap chaos */
  .social-bar {
    flex-wrap: nowrap;
  }

  .back-btn {
    white-space: nowrap;
  }

  .live-banner {
    width: 100%;
  }
}

/* ========================================
   PAGE TRANSITION
======================================== */

.page-transition {
  position: fixed;
  inset: 0;

  background:
    radial-gradient(circle at center, #111 0%, #000 100%);

  opacity: 0;
  pointer-events: none;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    opacity 0.22s ease;

  will-change: opacity;

  z-index: 99999;
}

.page-transition.active {
  opacity: 1;
  transition-delay: 0s;
}

/* logo */
.transition-logo {

  width: 240px;

  opacity: 0;

  transform:
    scale(0.9)
    translateY(10px);

  filter: blur(10px);

  transition: 0.5s ease;
}

.transition-logo {
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    filter 0.4s ease;
}

.page-transition.active .transition-logo {

  opacity: 0.92;

  transform:
    scale(1)
    translateY(0);

  filter: blur(0);
}

.page-transition.active {
  backdrop-filter: blur(6px);
}

/* ========================================
   PAGE LEAVE EFFECT
======================================== */

body.leaving .page-content {

  transform:
    scale(1.02);

  filter: blur(4px);

  transition: 0.25s ease;
}

/* ========================================
   FOOTER
======================================== */

.site-footer {

  position: relative;

  z-index: 0;

  margin-top: auto;

  padding: 24px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 8px;

  overflow: hidden;

  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.015)
    );

  border-top:
    1px solid rgba(255,255,255,0.08);

  backdrop-filter: blur(16px);

  color:
    rgba(255,255,255,0.72);

  font-size: 13px;

  letter-spacing: 0.4px;

  box-shadow:
    0 -10px 40px rgba(0,0,0,0.35);
}

/* glow line */
.site-footer::before {

  content: "";

  position: absolute;

  top: 0;
  left: 50%;

  transform: translateX(-50%);

  width: 220px;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(0,212,255,0.9),
      transparent
    );

  opacity: 0.8;
}

/* ambient glow */
.site-footer::after {

  content: "";

  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at top,
      rgba(0,212,255,0.08),
      transparent 70%
    );

  pointer-events: none;
}

/* ========================================
   FOOTER LINKS
======================================== */

.footer-legal-link {

  color: white;

  text-decoration: none;

  padding: 6px 12px;

  border-radius: 12px;

  transition:
    transform 0.2s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease;
}

.footer-legal-link:hover {

  color: var(--accent);

  background:
    rgba(255,255,255,0.06);

  transform:
    translateY(-2px);

  box-shadow:
    0 0 18px rgba(0,212,255,0.18);
}

/* ========================================
   KEYFRAMES
======================================== */

@keyframes logoIn {

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes textIn {

  to {
    opacity: 0.72;
  }
}

@keyframes textFadeOut {

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes screenSlideUp {

  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100%);
  }
}

@keyframes socialBarIn {

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* cinematic beat */
@keyframes logoBeat {

  0% {
    transform: scale(1);
    opacity: 1;
  }

  8% {
    transform: scale(1.12);
  }

  10% {
    transform: scale(1.2);
  }

  14% {
    transform: scale(1.14);
  }

  18% {
    transform: scale(1.07);
  }

  22% {
    transform: scale(1.05);
  }

  30% {
    transform: scale(1.1);
  }

  34% {
    transform: scale(1.35);
  }

  36% {
    transform: scale(1.6);
  }

  40% {
    transform: scale(1.45);
  }

  44% {
    transform: scale(1.25);
  }

  50% {
    transform: scale(1.1);
  }

  60% {
    transform: scale(1.22);
  }

  64% {
    transform: scale(1.5);
  }

  66% {
    transform: scale(2);
  }

  70% {
    transform: scale(1.7);
  }

  74% {
    transform: scale(1.45);
  }

  78% {
    transform: scale(1.25);
  }

  88% {
    transform: scale(1.5);
    opacity: 1;
  }

  94% {
    transform: scale(2.2);
  }

  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 768px) {

  .transition-logo {
    width: 190px;
  }

  .site-footer {

    padding:
      20px 16px;

    text-align: center;

    font-size: 12px;
  }
}

@media (max-width: 420px) {

  .social-bar {
    gap: 10px;
  }

  .social-icon {

    width: 38px;
    height: 38px;
  }

  .transition-logo {
    width: 160px;
  }

  .intro-content img {
    width: 150px;
  }
}

.page-content {
  display: block;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  background: #0a0a0f;
}

html:not(.app-ready) body {
  opacity: 0;
  overflow: hidden;
}

body::before {
  opacity: 0;
  animation: bgIn 0.6s ease forwards;
}

@keyframes bgIn {
  to { opacity: 1; }
}