/* =======================
   SkullCheck – Unified CSS
   ======================= */

:root{
  --bg:#071219;
  --panel:#0c1c24;
  --panel-2:#0a1820;
  --brand:#19d3a3;
  --brand-2:#26b6e8;
  --text:#eaf6ff;
  --muted:#a9c1d1;
  --danger:#ff6b77;
  --ok:#21e0a4;
  --shadow:0 14px 44px rgba(0,0,0,.48);
  --col-min:360px; /* JS kann das überschreiben */
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html,body{
  margin:0;
  color:var(--text);
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Inter,Roboto,Arial;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(38,182,232,.13), transparent 60%),
    radial-gradient(1200px 800px at 110% 10%, rgba(25,211,163,.12), transparent 60%),
    var(--bg);
  background-attachment:fixed,fixed,fixed;
}

/* Falls du zentral mit Prozent-Padding arbeitest, übernimmt das JS dynamisch.
   grid-wrapper bleibt wie gewohnt „in der Ecke“ */
.grid-wrapper{
  position:absolute; top:2%; left:2%;
  width:96%; height:96%;
}

/* ---------- Typo & Links ---------- */
a{ color:#bcd3e4; text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset:2px; }

/* ---------- Headline ---------- */
.uberschrift_App{
  position:absolute; top:12%; left:50%; transform:translate(-50%,-50%);
  font-size:clamp(32px,10vw,120px);
  letter-spacing:.3px; margin:0;
  color:var(--text);
  text-shadow:0 10px 40px rgba(0,0,0,.35);
  pointer-events:none;
}

/* ---------- Header / Startseite ---------- */
.start-header{ position:fixed; top:14px; left:14px; z-index:40; }
.start-header.is-hidden{ display:none !important; }

/* ---------- Profile Pic ---------- */
.div_profile_pic{
  position:absolute; top:20px; right:20px;
  width:45px; height:45px; border-radius:50%;
  background:#1f2c35; border:2.5px solid #fff;
  display:flex; align-items:center; justify-content:center;
  font-size:60px; color:#fff;
}

/* ---------- Buttons ---------- */
button,.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  background:linear-gradient(180deg, rgba(25,211,163,.10), rgba(38,182,232,.07));
  border-radius:14px;
  padding:.8rem 1.1rem;
  font-weight:600; letter-spacing:.2px;
  transition:box-shadow .22s ease, background .22s ease, border-color .22s ease, opacity .22s ease;
  box-shadow:0 8px 28px rgba(38,182,232,.12);
  cursor:pointer;
}
button:hover{
  /* Glow – kein vertikales Wackeln */
  box-shadow:0 12px 42px rgba(25,211,163,.35), 0 0 0 2px rgba(25,211,163,.22) inset;
}
button:disabled{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.12);
  color:#9fb0c6; opacity:.75; cursor:not-allowed; box-shadow:none;
}
.btn-ghost{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
}
.btn.danger{
  background:linear-gradient(180deg, rgba(255,107,119,.18), rgba(255,107,119,.08));
  border-color:rgba(255,107,119,.28);
  box-shadow:0 12px 36px rgba(255,107,119,.16);
}
.cta{
  background:linear-gradient(180deg, rgba(25,211,163,.22), rgba(38,182,232,.18));
  border-color:rgba(25,211,163,.28);
  box-shadow:0 14px 38px rgba(25,211,163,.20);
  min-width:240px; padding:.9rem 1.2rem; border-radius:14px;
}

/* ---------- Main Navigation ---------- */
.div_Main_navigation{
  position:absolute; top:33%; left:50%; transform:translate(-50%,0);
  display:grid; gap:18px;
}

/* ---------- Inputs ---------- */
input[type="text"], input[type="number"], input[type="search"], select{
  width:100%; background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color:var(--text); border-radius:12px; padding:.65rem .8rem; outline:none;
}
input[type="range"]{
  width:100%; accent-color:var(--brand);
  -webkit-appearance:none; height:6px; border-radius:999px;
  background:rgba(255,255,255,.18); outline:none;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
  background:linear-gradient(180deg, var(--brand), var(--brand-2));
  border:2px solid rgba(255,255,255,.65);
  box-shadow:0 4px 14px rgba(0,0,0,.35);
}
input[type="checkbox"]{
  width:18px; height:18px; border-radius:6px; appearance:none; cursor:pointer;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.15);
  display:inline-grid; place-content:center; transition:background .18s, border-color .18s, box-shadow .18s;
}
input[type="checkbox"]::before{
  content:""; width:10px; height:10px; border-radius:3px; transform:scale(0);
  transition:transform .14s ease-out;
  background:linear-gradient(180deg, rgba(25,211,163,.9), rgba(38,182,232,.9));
  box-shadow:0 4px 14px rgba(38,182,232,.25);
}
input[type="checkbox"]:checked::before{ transform:scale(1); }

/* ---------- How to play Pill (fix) ---------- */
#button_Main_htp,
.button_Main_htp{
  position:fixed !important;
  bottom:max(22px, 2.2vh);
  left:max(22px, 2vw);
  z-index:35;
  padding:.48rem .78rem;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
#button_Main_htp:hover,
.button_Main_htp:hover{ transform:none !important; }  /* <- kein „nach unten schweifen“ */

/* ---------- Backdrop & Modals ---------- */
.backdrop{
  position:fixed; inset:0; z-index:30;
  background:rgba(4,10,15,.38);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  opacity:0; pointer-events:none; transition:opacity .18s ease-out;
}
.backdrop.show{ opacity:1; pointer-events:auto; }

:root{ --modal-x:50vw; --modal-y:50vh; }
.modal-sheet{
  position:fixed; z-index:31; left:50%; top:50%; transform:translate(-50%,-50%);
  width:clamp(320px,88vw,680px); max-width:680px; max-height:none; overflow:visible;
  padding:clamp(16px,3vw,28px);
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid rgba(255,255,255,.08); border-radius:18px;
  box-shadow:var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  opacity:0; pointer-events:none;
}
.modal-sheet h1,.modal-sheet h3{
  text-align:center; font-size:clamp(22px,3.4vw,30px); margin:8px 0 26px 0; color:var(--text);
}
.modal-sheet._anim-seed{ transform:translate(calc(var(--modal-x) - 50vw), calc(var(--modal-y) - 50vh)) scale(.82); }
.modal-sheet.in{ opacity:1; pointer-events:auto; animation:uiModalIn .18s cubic-bezier(.2,.8,.25,1); }
.modal-sheet.out{ animation:uiModalOut .14s ease-in forwards; }
@keyframes uiModalIn{ from{ transform:translate(calc(var(--modal-x) - 50vw), calc(var(--modal-y) - 50vh)) scale(.82); opacity:0; } to{ transform:translate(-50%,-50%) scale(1); opacity:1; } }
@keyframes uiModalOut{ from{ transform:translate(-50%,-50%) scale(1); opacity:1; } to{ transform:translate(calc(var(--modal-x) - 50vw), calc(var(--modal-y) - 50vh)) scale(.85); opacity:0; } }

/* Offene Seiten vereinheitlichen */
#div_Main_settingsGame,
#div_Main_Ontop_openGamesPage,
#div_Main_Ontop_settingsPage{ width:clamp(320px,88vw,640px); }

/* Datei-Input hübsch */
input[type="file"]{
  width:100%; padding:.65rem .8rem;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10);
  color:var(--text); border-radius:12px;
}
input[type="file"]::file-selector-button{
  margin-right:.6rem; border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg, rgba(25,211,163,.16), rgba(38,182,232,.10));
  color:var(--text); border-radius:10px; padding:.45rem .7rem; cursor:pointer;
}

/* Back-Buttons (nicht grau) */
.button_Main_Game_back,
.button_Main_Ontop_openGamesPage_back,
.button_Main_Ontop_sett_back,
.button_Main_Ontop_htpPage_back,
#button_Main_Game_back,
#button_Main_Ontop_openGamesPage_back,
#button_Main_Ontop_sett_back,
#button_Main_Ontop_htpPage_back{
  background:linear-gradient(180deg, rgba(25,211,163,.14), rgba(38,182,232,.10));
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  border-radius:12px; padding:.55rem .9rem; margin-top:12px;
}

/* ---------- Game Table ---------- */
#div_gameTable{
  display:none; background:transparent; border:none; box-shadow:none; margin:0;
  padding:clamp(10px,2vw,16px);
}
#div_gameTable.is-live{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(var(--col-min), 1fr));
  gap:clamp(10px,1.2vw,18px);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:clamp(10px,1.6vw,20px);
  background:rgba(0,0,0,.12);
  backdrop-filter:blur(2px);
}
#div_gameTable .column{
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:clamp(10px,1vw,14px);
}
#div_gameTable .player-header{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:8px; font-size:15px;
}
#div_gameTable .row{
  display:grid;
  grid-template-columns:90px repeat(3,72px) 1fr; /* Runde | guess | right | extra | Punkte */
  gap:8px; align-items:center; min-height:36px;
}
#div_gameTable .row .field{
  background:rgba(0,0,0,.28);
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  border-radius:10px; padding:.55rem .6rem; text-align:center; font-weight:700; font-size:16px;
}
/* Runde & Punkte = plain Text (keine Chips) */
#div_gameTable .row span:first-child,
#div_gameTable .row span:last-child{
  background:none !important; border:none !important; padding:0 !important;
  color:#cfe6f7; font-size:14px;
}
#div_gameTable .row span:first-child{ text-align:left; }
#div_gameTable .row span:last-child{ text-align:right; }

/* End Game Pill */
#button_endGameButton{ display:none; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); }
#button_endGameButton.pill-bottom-right{
  position:fixed !important; right:max(18px,2vw); bottom:max(18px,2.2vh); z-index:45;
  border-radius:999px !important; padding:.55rem .9rem !important;
}
#button_endGameButton:hover{
  box-shadow:0 12px 36px rgba(255,77,94,.35), 0 0 0 2px rgba(255,77,94,.35) inset;
}

/* ---------- Results / Tribune ---------- */
.tribune-container{ text-align:center; display:none; padding:clamp(12px,3vw,22px); }
.tribune-container.show{ display:block; }
.title{ font-size:clamp(24px,4vw,36px); margin:28px 0 40px; }
.tribune{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:22px;
}
.player{
  color:#fff;
  background:rgba(0,0,0,.28);
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px; padding:16px 10px;
  box-shadow:0 8px 26px rgba(0,0,0,.35); backdrop-filter:blur(4px);
}
.player .rank{ font-size:22px; font-weight:800; color:#bfeaf7; }
.player .name{ margin-top:8px; font-size:18px; }
.player .score{ margin-top:6px; font-size:16px; color:#9ec7d8; }

/* ---------- Footer / Legal ---------- */
#legal-buttons{
  position:fixed; left:20px; bottom:20px; z-index:20;
  display:flex; gap:10px; flex-wrap:wrap;
}
#legal-buttons a, #legal-buttons button{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  color:#d8e6f2; font-size:.75rem; padding:6px 10px; border-radius:10px;
}
#legal-buttons a:hover, #legal-buttons button:hover{
  background:rgba(255,255,255,.06);
}

/* ---------- Version/Made by ---------- */
.version-row{
  position:fixed !important; right:14px !important; bottom:12px !important;
  transform:none !important;
  display:flex; gap:12px; align-items:center; font-size:.9em; color:#ddd; z-index:1000;
}
.version-row #div_version_app,
.version-row .version{ position:static !important; transform:none !important; color:#ddd !important; }
.madeby{
  color:#ddd !important; text-decoration:none;
  border-left:1px solid rgba(255,255,255,.25); padding-left:10px; opacity:.9;
}
.madeby:hover{ opacity:1; }

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .modal-sheet{ width:92vw; max-width:92vw; }
  #div_Main_settingsGame input[type="range"]{ width:86%; }
}
