/* ══════════════════════════════════════════════════════════════════════════
   base.css — ShufflGames Design System
   Laden auf JEDER Seite. Enthält: Tokens, Reset, Layout-Primitives,
   alle wiederverwendbaren Komponenten.

   VERWENDUNG:
     <link rel="stylesheet" href="css/base.css" />
     <link rel="stylesheet" href="css/[pagename].css" />  ← seiten-spezifisch danach
══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────────────────────
   Alle Farben, Abstände und Typo-Werte zentral hier ändern.
   Zum Anpassen für ein neues Spiel: Hauptakzent von --gold/--purple
   auf eigene Farben setzen und ggf. --orb-1/2/3 in .orb-* anpassen.
─────────────────────────────────────────────────────────────────────────── */
:root {
    /* Hintergründe */
    --bg-base:    #0d0a1a;          /* Seiten-Hintergrund        */
    --bg-deep:    #080612;          /* Noch dunklere Flächen     */
    --bg-surface: rgba(22, 16, 42, 0.70);
    --bg-card:    rgba(18, 13, 35, 0.85);   /* Standard-Karte   */

    /* Rahmen */
    --border:        rgba(255, 255, 255, 0.07);
    --border-bright: rgba(255, 107, 53, 0.35);
    --border-gold:   rgba(245, 200,  66, 0.35);

    /* Text */
    --text-main:  #f0ecff;
    --text-muted: #7a6e9a;
    --text-dim:   #3d3558;

    /* Akzentfarben — Guessle: Orange / Rot / Pink */
    --purple:       #ff6b35;
    --purple-light: #ff8c42;
    --pink:         #ff4444;
    --pink-glow:    rgba(255,  68,  68, 0.30);
    --blue:         #4d6bfe;
    --gold:         #f5c842;        /* Primär-Akzent (Buttons, Highlights)  */
    --gold-glow:    rgba(245, 200,  66, 0.35);
    --orange:       #ff8c42;
    --green:        #00e5a0;
    --green-glow:   rgba(  0, 229, 160, 0.20);

    /* Leuchten */
    --glow-purple: rgba(255, 107, 53, 0.50);

    /* Radien */
    --radius-card:  20px;
    --radius-inner: 14px;
    --radius-pill:  100px;

    /* Schriften */
    --font-display: 'Syne',    sans-serif;   /* Headlines, Labels        */
    --font-body:    'DM Sans', sans-serif;   /* Fließtext, Buttons       */

    /* Dekorativ — Skala-Gradient (von kalt nach warm) */
    --scale-gradient: linear-gradient(90deg,
        #f5c842 0%, #ff8c42 28%, #ff6b35 50%, #ff4444 72%, #e040fb 100%);

    /* Team-Farben (nur relevant bei Team-Modi) */
    --team-a:      #4d6bfe;
    --team-a-glow: rgba( 77, 107, 254, 0.40);
    --team-a-soft: rgba( 77, 107, 254, 0.08);
    --team-b:      #ff8c42;
    --team-b-glow: rgba(255, 140,  66, 0.40);
    --team-b-soft: rgba(255, 140,  66, 0.08);

    /* 6-Team-Farben */
    --team-1:      #4d6bfe;
    --team-1-glow: rgba( 77, 107, 254, 0.40);
    --team-1-soft: rgba( 77, 107, 254, 0.06);
    --team-2:      #ff8c42;
    --team-2-glow: rgba(255, 140,  66, 0.40);
    --team-2-soft: rgba(255, 140,  66, 0.06);
    --team-3:      #00e5a0;
    --team-3-glow: rgba(  0, 229, 160, 0.40);
    --team-3-soft: rgba(  0, 229, 160, 0.06);
    --team-4:      #e040fb;
    --team-4-glow: rgba(224,  64, 251, 0.40);
    --team-4-soft: rgba(224,  64, 251, 0.06);
    --team-5:      #f5c842;
    --team-5-glow: rgba(245, 200,  66, 0.40);
    --team-5-soft: rgba(245, 200,  66, 0.06);
    --team-6:      #00d4ff;
    --team-6-glow: rgba(  0, 212, 255, 0.40);
    --team-6-soft: rgba(  0, 212, 255, 0.06);

    /* Glassmorphism-Shorthand */
    --glass:        rgba(14, 10, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-hi:     rgba(255, 255, 255, 0.04);
}


/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-y: scroll;
}
html::-webkit-scrollbar { display: none; }

body {
    background-color: var(--bg-base);
    color:            var(--text-main);
    font-family:      var(--font-body);
    min-height:       100vh;
    overflow-x:       hidden;
    scrollbar-width:  none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }


/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes drift1 { from { transform: translate(  0px,   0px); } to { transform: translate( 40px,  60px); } }
@keyframes drift2 { from { transform: translate(  0px,   0px); } to { transform: translate(-60px, -40px); } }
@keyframes drift3 { from { transform: translate(  0px,   0px); } to { transform: translate( 30px, -50px); } }
@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(  0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes dot-pulse {
    0%, 80%, 100% { opacity: .3; transform: scale(.8);  }
    40%           { opacity: 1;  transform: scale(1.15); }
}


/* ══════════════════════════════════════════════════════════════════════════
   KOMPONENTEN — alphabetisch
══════════════════════════════════════════════════════════════════════════ */

/* ── Avatar-Picker ───────────────────────────────────────────────────────── */
/*  HTML-Struktur:
    <div class="avatar-block">
      <div class="arrow-col">
        <button class="arrow-btn" id="face-prev">…</button>
        <button class="arrow-btn" id="color-prev">…</button>
        <button class="arrow-btn" id="bg-prev">…</button>
      </div>
      <div class="avatar-preview" id="avatar-preview">
        <img id="avatar-img" src="" alt="Avatar" />
      </div>
      <div class="arrow-col"> … </div>
    </div>
*/
.avatar-block {
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; margin: 1rem 0;
}
.avatar-preview {
    position: relative; width: 110px; height: 110px;
    border-radius: 50%; overflow: hidden;
    border: 2px solid var(--border-gold);
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow .35s;
    --glow-color: rgba(245, 200, 66, .5);
}
.avatar-preview:hover { box-shadow: 0 0 30px var(--glow-color); }
.avatar-preview img   { width: 100%; height: 100%; object-fit: cover; display: block; }
.arrow-col  { display: flex; flex-direction: column; gap: .55rem; }
.arrow-btn  {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(245, 200, 66, .10); border: 1px solid rgba(245, 200, 66, .25);
    color: var(--gold); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; flex-shrink: 0;
}
.arrow-btn svg  { width: 18px; height: 18px; fill: currentColor; }
.arrow-btn:hover {
    background: rgba(245, 200, 66, .25); transform: scale(1.12);
    box-shadow: 0 0 10px rgba(245, 200, 66, .3);
}


/* ── Hintergrund-Layer ───────────────────────────────────────────────────── */
/*  Immer als erstes Kind von <body>.
    <div class="bg-layer">
      <div class="orb orb-1"></div>
      <div class="orb orb-2"></div>
      <div class="orb orb-3"></div>
      <div class="scanlines"></div>
      <canvas id="particles-canvas"></canvas>
    </div>
    Farbe der Orbs: .orb-1/2/3 background anpassen. */
.bg-layer {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
#particles-canvas { position: absolute; inset: 0; opacity: .6; }
.scanlines {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
        transparent, transparent 3px,
        rgba(0,0,0,.04) 3px, rgba(0,0,0,.04) 4px);
}
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); pointer-events: none;
}
/* Orb-Farben: Guessle — warm orange / rot */
.orb-1 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, #903010 0%, transparent 70%);
    top: -20vh; left: -15vw; opacity: .6;
    animation: drift1 18s ease-in-out infinite alternate;
}
.orb-2 {
    width: 45vw; height: 45vw;
    background: radial-gradient(circle, #601a0a 0%, transparent 70%);
    top: 40vh; right: -10vw; opacity: .5;
    animation: drift2 22s ease-in-out infinite alternate;
}
.orb-3 {
    width: 35vw; height: 35vw;
    background: radial-gradient(circle, #5c2a00 0%, transparent 70%);
    bottom: -5vh; left: 30vw; opacity: .3;
    animation: drift3 16s ease-in-out infinite alternate;
}


/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    font-family: var(--font-display); font-size: .88rem; font-weight: 700;
    letter-spacing: .02em; padding: .75rem 1.6rem;
    border-radius: var(--radius-pill); border: none; cursor: pointer; outline: none;
    transition: all .35s cubic-bezier(.16, 1, .3, 1); text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #0d0a1a; box-shadow: 0 4px 20px rgba(245, 200, 66, .25);
}
.btn-primary:hover:not(:disabled):not(.btn-disabled) {
    box-shadow: 0 8px 35px rgba(245, 200, 66, .50); transform: translateY(-2px);
}
.btn-secondary {
    background: rgba(255, 107, 53, .12); color: var(--purple-light);
    border: 1px solid rgba(255, 107, 53, .25);
}
.btn-secondary:hover:not(:disabled):not(.btn-disabled) {
    background: rgba(255, 107, 53, .22); border-color: var(--purple-light);
    transform: translateY(-2px);
}
.btn-full     { width: 100%; }
.btn-disabled { opacity: .4; pointer-events: none; }


/* ── Kamera-Modal ────────────────────────────────────────────────────────── */
/*  Overlay-Wrapper: position:fixed, display:flex im JS einschalten.
    <div id="cam-setup-modal" style="display:none; …overlay-styles…">
      <div class="matchle-cam-modal"> … </div>
    </div> */
.matchle-cam-modal {
    background: var(--glass); border: 1px solid rgba(255, 107, 53, .3);
    border-radius: var(--radius-card); padding: 1.75rem;
    width: 90%; max-width: 460px;
    display: flex; flex-direction: column; gap: 1.1rem;
    box-shadow: 0 40px 80px rgba(0,0,0,.8), 0 0 60px rgba(255,107,53,.08);
    backdrop-filter: blur(40px);
    animation: fadeUp .35s ease both;
}
.cam-modal-header {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: .45rem;
}
.cam-modal-icon  { font-size: 2rem; }
.cam-modal-title {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--purple-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cam-modal-desc { font-size: .82rem; color: var(--text-muted); }
.cam-preview-wrap {
    position: relative; border-radius: var(--radius-inner); overflow: hidden;
    background: #000; aspect-ratio: 16/9;
}
.cam-preview-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-preview-placeholder {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; color: var(--text-dim); font-size: .8rem;
}
.cam-device-select {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 12px; padding: .7rem 1rem; color: var(--text-main);
    font-family: var(--font-body); font-size: .88rem; outline: none;
    cursor: pointer; width: 100%; transition: border-color .2s;
}
.cam-device-select:focus { border-color: rgba(255, 107, 53, .4); }
.cam-device-select option { background: var(--bg-deep); }
.cam-modal-actions { display: flex; flex-direction: column; gap: .65rem; }


/* ── Kamera-Toggle-Button (Topbar) ───────────────────────────────────────── */
.topbar-cam-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: .4rem .85rem;
    color: var(--text-muted); font-family: var(--font-body); font-size: .78rem;
    cursor: pointer; transition: all .2s; white-space: nowrap;
}
.topbar-cam-btn:hover  { border-color: var(--green); color: var(--green); }
.topbar-cam-btn.active {
    border-color: var(--green); color: var(--green);
    background: rgba(0, 229, 160, .07);
    box-shadow: 0 0 12px rgba(0, 229, 160, .12);
}
.cam-toggle-icon svg,
.cam-toggle-icon { display: inline-flex; align-items: center; line-height: 1; }

.nav-cam-btn {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 50%; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .95rem; transition: all .2s; flex-shrink: 0;
}
.nav-cam-btn:hover  { border-color: var(--green); background: rgba(0,229,160,.07); }
.nav-cam-btn.active { border-color: var(--green); background: rgba(0,229,160,.10); }


/* ── Karten ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.75rem 2rem;
    backdrop-filter: blur(24px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.card-label {
    font-family: var(--font-display); font-size: .65rem; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted);
    text-align: center;
}


/* ── Dekorative Ringe (Hero) ─────────────────────────────────────────────── */
.hero-deco {
    position: fixed; right: 5%; bottom: 7%;
    width: 180px; height: 180px; z-index: 1; opacity: .12; pointer-events: none;
}
.deco-ring {
    position: absolute; border-radius: 50%;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation: spin linear infinite;
}
.ring-1 { width: 100%; height: 100%; border: 1px solid var(--gold);   animation-duration: 25s; }
.ring-2 { width:  72%; height:  72%; border: 1px solid var(--orange); animation-duration: 18s; animation-direction: reverse; opacity: .7; }
.ring-3 { width:  45%; height:  45%; border: 1px solid var(--pink);   animation-duration: 12s; opacity: .5; }
.deco-dot {
    position: absolute; width: 8px; height: 8px;
    background: var(--gold); border-radius: 50%;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    box-shadow: 0 0 16px var(--gold-glow), 0 0 40px var(--gold-glow);
}


/* ── Eingabe-Felder ──────────────────────────────────────────────────────── */
.input-group  { display: flex; flex-direction: column; gap: .45rem; }
.input-label  {
    font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
}
.hint-constraint { color: var(--text-dim); font-weight: 400; }
.input-field {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 12px; padding: .8rem 1rem; color: var(--text-main);
    font-family: var(--font-body); font-size: .95rem; font-weight: 400;
    outline: none; transition: border-color .25s, box-shadow .25s; width: 100%;
}
.input-field::placeholder { color: var(--text-dim); }
.input-field:focus {
    border-color: rgba(245, 200, 66, .4);
    box-shadow: 0 0 0 3px rgba(245, 200, 66, .1);
}
.code-input {
    text-transform: uppercase; letter-spacing: .2em; font-size: 1.05rem;
    font-family: var(--font-display); font-weight: 700; text-align: center;
}


/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav {
    position: relative; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.6rem 5%; border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background: rgba(13, 10, 26, .4);
}
.logo {
    font-family: var(--font-display); font-size: 1.4rem;
    font-weight: 800; letter-spacing: -.03em; text-decoration: none;
}
.logo-shuffl { color: var(--text-main); }
.logo-games {
    background: linear-gradient(135deg, var(--purple-light), var(--pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-badge {
    font-family: var(--font-display); font-size: .7rem; font-weight: 700;
    letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted);
    border: 1px solid var(--border); padding: .35rem .9rem;
    border-radius: var(--radius-pill); background: rgba(255,255,255,.03);
}


/* ── Tagline-Zeile (dekorativ) ───────────────────────────────────────────── */
.tagline-row {
    display: flex; align-items: center; gap: 1rem;
    justify-content: center; margin-bottom: 1.5rem;
}
.tagline-line {
    display: block; height: 1px; width: 45px;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.tagline-line:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.tagline-text {
    font-size: .72rem; font-weight: 500; letter-spacing: .18em;
    text-transform: uppercase; color: var(--gold);
}


/* ── Toast ───────────────────────────────────────────────────────────────── */
/*  <div id="status-toast"></div>  — per showToast() in shared.js ansteuern */
#status-toast {
    position: fixed; bottom: 2rem; left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    padding: .6rem 1.4rem; font-size: .85rem; color: var(--text-main);
    backdrop-filter: blur(24px); opacity: 0;
    transition: opacity .3s, transform .3s;
    box-shadow: 0 8px 30px rgba(0,0,0,.5); pointer-events: none;
}
#status-toast.show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}


/* ── Wartepunkte (Ladeanimation) ─────────────────────────────────────────── */
/*  <div class="waiting-dots"><span></span><span></span><span></span></div>  */
.waiting-dots { display: flex; gap: .45rem; }
.waiting-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--purple-light); opacity: .3;
    animation: dot-pulse 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }


/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — globale Breakpoints
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .nav { padding: 1.2rem 4%; }
}
@media (max-width: 480px) {
    .nav { padding: 1rem 4%; }
    .logo { font-size: 1.2rem; }
}

/* WQHD (≥ 2400 px) — 25 % hochskalieren.
   HINWEIS: CSS `zoom` skaliert `vh` nicht mit → min-height auf 80vh setzen.
   Seiten-spezifisches CSS muss .index-layout / .lobby-wrap mit 80vh
   überschreiben wenn zoom greift. */
@media (min-width: 2400px) {
    body          { zoom: 1.25; }
    .index-layout { min-height: calc(80vh - 73px); }
    .lobby-wrap   { min-height: calc(80vh - 73px); }
}
