:root{
  --bg:#0b1020;
  --panel:#0f1833;
  --panel2:#0c1430;
  --text:#e8efff;
  --muted:#aab7e6;
  --stroke:rgba(255,255,255,.10);
  --accent:#35d2ff;
  --accent2:#ff4fd8;
  --warn:#ffcc66;
  --danger:#ff5b6e;

  --radius:18px;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --shadow2: 0 10px 22px rgba(0,0,0,.25);
  --btnh: 54px;
  --maxw: 920px;

  /* Logo gran */
  --logoMaxW: 800px;
  --logoMaxH: 170px;

  font-synthesis-weight: none;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 30% -10%, rgba(53,210,255,.22), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(255,79,216,.16), transparent 60%),
    radial-gradient(900px 600px at 40% 110%, rgba(255,204,102,.10), transparent 60%),
    var(--bg);
  color:var(--text);
}

.app{
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 14px 22px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* LOGO sense marc, centrat */
.logoHeader{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 6px 0 2px;
}

.heroLogo{
  width: min(var(--logoMaxW), 92vw);
  height: auto;
  max-height: var(--logoMaxH);
  object-fit: contain;
  display:block;
  user-select:none;
  -webkit-user-drag:none;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.40));
}

/* CONTINGUT PRINCIPAL */
.view{
  flex:1;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.footer{ padding: 0 6px; }

.hint{
  color: var(--muted);
  font-size: 13px;
  text-align:center;
  opacity: .95;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: 14px;
}

.grid{ display:grid; gap:12px; }

.row{
  display:flex;
  gap:10px;
  align-items:center;
}

/* header dins la card de setup */
.cardHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.cardHeader .titleBlock{ min-width: 0; }

label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input{
  width:100%;
  height: 46px;
  border-radius: 14px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline: none;
}

input::placeholder{ color: rgba(232,239,255,.45); }

/* BOTONS més visibles */
.btn{
  height: var(--btnh);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.22);
  background:
    radial-gradient(900px 70px at 30% 20%, rgba(53,210,255,.45), transparent 60%),
    radial-gradient(900px 70px at 70% 80%, rgba(255,79,216,.35), transparent 60%),
    linear-gradient(135deg, rgba(53,210,255,.28), rgba(255,79,216,.22));
  color: var(--text);
  font-weight: 900;
  letter-spacing:.2px;
  padding: 0 18px;
  cursor:pointer;
  transition: transform .06s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  user-select:none;
  -webkit-tap-highlight-color: transparent;

  box-shadow:
    0 14px 32px rgba(0,0,0,.28),
    0 0 0 1px rgba(53,210,255,.10) inset;
}

.btn:hover{
  filter: brightness(1.08);
  border-color: rgba(255,255,255,.30);
  box-shadow:
    0 18px 44px rgba(0,0,0,.34),
    0 0 22px rgba(53,210,255,.10),
    0 0 22px rgba(255,79,216,.08);
}

.btn:active{ transform: scale(.99); filter: brightness(1.12); }

.btnWide{ width:100%; }

.btnGhost{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow:
    0 10px 20px rgba(0,0,0,.25),
    0 0 0 1px rgba(255,255,255,.06) inset;
  font-weight: 850;
}

/* ESPAI EXTRA ABANS DEL BOTÓ COMENÇAR */
.btnStartSpace{ margin-top: 14px; }

.h1{
  font-size: 22px;
  font-weight: 900;
  margin: 2px 0 4px;
}

.p{
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.35;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: var(--muted);
  font-size: 13px;
}

.bigTap{
  width:100%;
  min-height: 180px;
  border-radius: 22px;
  border: 1px dashed rgba(255,255,255,.20);
  background: rgba(0,0,0,.24);
  display:grid;
  place-items:center;
  padding: 18px;
  cursor:pointer;
}

.bigTap .bigText{
  font-size: 28px;
  font-weight: 950;
  text-align:center;
  line-height: 1.1;
}

.bigTap .smallText{
  margin-top: 10px;
  color: var(--muted);
  text-align:center;
}

.revealBox{
  width:100%;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.28);
  padding: 16px;
}

.word{
  font-size: 34px;
  font-weight: 1000;
  text-align:center;
  margin: 10px 0 0;
}

.impostor{
  font-size: 28px;
  font-weight: 1000;
  text-align:center;
  margin: 10px 0 0;
  color: var(--warn);
}

.sep{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 10px 0;
}

.playerRow{
  display:grid;
  grid-template-columns: 88px 1fr 42px;
  gap:10px;
  align-items:center;
}

.iconBtn{
  width: 42px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.30);
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}

/* --- Selecció de temes per botons --- */

.themeToggleBtn{
  height: 60px;
  border-radius: 18px;
}

.themeToggleBtn.isOff{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow:
    0 10px 20px rgba(0,0,0,.25),
    0 0 0 1px rgba(255,255,255,.06) inset;
}

.themeGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
}

@media (min-width: 720px){
  .themeGrid{
    grid-template-columns: repeat(3, 1fr);
  }
}

.themeBtn{
  height: 52px;
  border-radius: 16px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.25);
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
  transition: transform .06s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
}

.themeBtn:hover{
  filter: brightness(1.06);
  border-color: rgba(255,255,255,.26);
}

.themeBtn:active{ transform: scale(.99); }

.themeBtn.isSelected{
  border-color: rgba(53,210,255,.40);
  box-shadow:
    0 16px 34px rgba(0,0,0,.30),
    0 0 22px rgba(53,210,255,.10),
    0 0 0 1px rgba(53,210,255,.12) inset;
  background:
    radial-gradient(900px 70px at 30% 20%, rgba(53,210,255,.35), transparent 60%),
    radial-gradient(900px 70px at 70% 80%, rgba(255,79,216,.18), transparent 60%),
    rgba(0,0,0,.18);
}

.themeGrid.isDisabled{
  opacity: .45;
  pointer-events: none;
}

/* --- MODAL (Instruccions) --- */

.modalOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px);
  display:flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal{
  width: min(720px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    radial-gradient(900px 120px at 25% 0%, rgba(53,210,255,.14), transparent 60%),
    radial-gradient(900px 120px at 85% 10%, rgba(255,79,216,.10), transparent 60%),
    rgba(10,16,34,.88);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  padding: 16px;
}

.modalHeader{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap:12px;
}

.modalTitle{
  font-size: 20px;
  font-weight: 950;
  margin: 0;
}

.modalClose{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.28);
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}

.modalBody{
  margin-top: 12px;
  color: var(--text);
}

.modalBody h3{
  margin: 12px 0 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .2px;
  text-transform: uppercase;
}

.modalBody p{
  margin: 0 0 10px;
  color: var(--text);
  opacity: .95;
  line-height: 1.35;
}

.modalBody ol{
  margin: 8px 0 12px 18px;
  padding: 0;
  color: var(--text);
  line-height: 1.35;
}

.modalBody li{
  margin: 6px 0;
  color: var(--text);
  opacity: .95;
}

.modalActions{
  margin-top: 12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
