* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;   /* iOS no selecciona texto al mantener pulsado */
  -webkit-touch-callout: none;                     /* iOS no muestra la lupa/menú */
}

:root {
  --bg: #0f0d1a;
  --bg2: #1a1530;
  --accent: #ff3d77;
  --accent2: #7b2ff7;
  --text: #ffffff;
  --muted: #a99fc4;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg2), var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 24px calc(48px + env(safe-area-inset-bottom));
  text-align: center;
}
.screen.active { display: flex; }

/* ---------- SETUP ---------- */
.logo { font-size: 56px; margin-top: 16px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

h1 {
  font-size: 42px; font-weight: 800; letter-spacing: -1px; margin-top: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 12px 0 24px; }

.players-box { width: 100%; max-width: 420px; }
.input-row { display: flex; gap: 10px; }
#nameInput {
  flex: 1; padding: 16px; border-radius: 14px; border: none;
  background: rgba(255,255,255,0.07); color: var(--text); font-size: 16px;
  outline: none; border: 1.5px solid transparent; transition: border .2s;
}
#nameInput:focus { border-color: var(--accent2); }
#nameInput { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.add-btn {
  width: 54px; border: none; border-radius: 14px; font-size: 26px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; cursor: pointer;
}
.add-btn:active { transform: scale(0.92); }

.players-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.chip {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 100px;
  background: rgba(255,255,255,0.09); font-size: 14px; font-weight: 600;
  animation: pop .25s ease; }
.chip span.x { color: var(--accent); font-weight: 800; cursor: pointer; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }

.gametype { width: 100%; max-width: 420px; margin-top: 26px; }
.gametype-options { display: flex; gap: 10px; }
.gt-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 6px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04); color: var(--text); font-size: 26px; cursor: pointer; transition: .2s; }
.gt-btn span { font-size: 14px; font-weight: 700; color: var(--muted); }
.gt-btn.active { border-color: #ffd84d; background: rgba(255,216,77,0.12); transform: translateY(-2px); }
.gt-btn.active span { color: #fff; }

.intensity { width: 100%; max-width: 420px; margin-top: 22px; }

/* Selector de estilo de La Moneda */
.cs-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 6px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04); color: var(--text); font-size: 26px; cursor: pointer; transition: .2s; }
.cs-btn span { font-size: 14px; font-weight: 700; color: var(--muted); }
.cs-btn.active { border-color: var(--accent); background: rgba(255,61,119,0.12); transform: translateY(-2px); }
.cs-btn.active span { color: #fff; }
.cs-btn[data-style="mixto"].active { border-color: #ff1f5a; background: rgba(255,31,90,0.18); box-shadow: 0 0 22px rgba(255,31,90,0.4); }
.intensity-label { color: var(--muted); font-size: 13px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.intensity-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.int-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04); color: var(--text); font-size: 22px; cursor: pointer; transition: .2s; }
.int-btn span { font-size: 13px; font-weight: 600; color: var(--muted); }
.int-btn.active { border-color: var(--accent); background: rgba(255,61,119,0.12); transform: translateY(-2px); }
.int-btn.active span { color: #fff; }
.bestia-btn.active { border-color: #ff1f5a; background: rgba(255,31,90,0.18); box-shadow: 0 0 22px rgba(255,31,90,0.4); }
.bestia-note { color: #ff6f9c; font-size: 12px; margin-top: 12px; opacity: 0; height: 0; transition: opacity .25s; }
.bestia-note.show { opacity: 1; height: auto; }

.night-btn {
  width: 100%; max-width: 420px; margin-top: 14px; padding: 15px; border-radius: 16px;
  border: 2px solid rgba(123,47,247,0.5); cursor: pointer; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2b2150, #3a2a7a); transition: .2s; }
.night-btn.active {
  border-color: #b48bff; background: linear-gradient(135deg, #4a2fa0, #7b2ff7);
  box-shadow: 0 0 26px rgba(123,47,247,0.55); transform: translateY(-2px); }

.start-btn {
  margin-top: auto; width: 100%; max-width: 420px; padding: 18px; border: none; border-radius: 16px;
  font-size: 19px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(255,61,119,0.35); transition: .2s; }
.start-btn:disabled { opacity: .35; box-shadow: none; }
.start-btn:not(:disabled):active { transform: scale(0.97); }

/* ---------- GAME ---------- */
#game { justify-content: center; position: relative; }
.exit-btn {
  position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.08); color: var(--muted); font-size: 18px; cursor: pointer; }
.level-badge {
  position: absolute; top: 26px; left: 24px; font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 100px; background: rgba(255,255,255,0.08); }

.card {
  width: 100%; max-width: 440px; min-height: 340px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(123,47,247,0.18), rgba(255,61,119,0.10));
  border: 1.5px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 28px; cursor: pointer; }
.card.flip { animation: flip .35s ease; }
@keyframes flip { 0% { transform: rotateY(0) scale(1); opacity: 1; } 50% { transform: rotateY(90deg) scale(.96); opacity: 0; } 100% { transform: rotateY(0) scale(1); opacity: 1; } }

.card-tag {
  font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px; }
.challenge { font-size: 26px; font-weight: 700; line-height: 1.35; }
.challenge strong { color: #ffd84d; }

.next-btn {
  margin-top: 28px; width: 100%; max-width: 440px; padding: 18px; border: none; border-radius: 16px;
  font-size: 18px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(123,47,247,0.35); transition: .2s; }
.next-btn:active { transform: scale(0.97); }
.footer-hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* Contador de copas (Modo Noche) */
.copas-bar { display: none; align-items: center; gap: 12px; margin-top: 22px; }
.copas-bar.show { display: flex; }
.copas-count { font-size: 15px; font-weight: 700; color: var(--muted); }
.copas-count b { color: #ffd84d; font-size: 18px; }
.copa-btn {
  padding: 11px 18px; border: none; border-radius: 100px; cursor: pointer;
  font-size: 14px; font-weight: 800; color: #1a1530;
  background: linear-gradient(135deg, #ffd84d, #ffb020); }
.copa-btn:active { transform: scale(0.92); }

/* ---------- LA MONEDA ---------- */
#coin { justify-content: center; }

/* Panel "mantener pulsado para ver" */
.hold-panel {
  width: 100%; max-width: 440px; min-height: 150px; border-radius: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 28px 24px;
  border: 1.5px solid rgba(255,255,255,0.1); touch-action: none; position: relative;
  background: linear-gradient(160deg, rgba(123,47,247,0.18), rgba(255,61,119,0.10)); transition: .15s; }
.hold-panel.revealed { border-color: #ffd84d; background: linear-gradient(160deg, rgba(255,216,77,0.18), rgba(255,176,32,0.10)); }
.hold-cover { font-size: 17px; font-weight: 800; color: var(--muted); line-height: 1.5; }
.hold-question { display: none; font-size: 22px; font-weight: 700; line-height: 1.35; }
.hold-panel.revealed .hold-cover { display: none; }
.hold-panel.revealed .hold-question { display: block; }
.coin-wrap { perspective: 700px; margin: 30px 0; }
.coin {
  width: 130px; height: 130px; position: relative; transform-style: preserve-3d;
  transition: transform 1.3s cubic-bezier(.25,.8,.35,1); }
.coin-face {
  position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900; color: #6b4e00; line-height: 1.1;
  background: radial-gradient(circle at 35% 30%, #ffe680, #ffb020);
  box-shadow: inset 0 0 0 7px rgba(0,0,0,0.12), 0 12px 30px rgba(255,176,32,0.4); }
.coin-back { transform: rotateX(180deg); }
.coin-result { font-size: 19px; font-weight: 800; min-height: 56px; max-width: 420px; line-height: 1.35; }

/* Aviso de subida de nivel */
.level-up {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(15,13,26,0.85); backdrop-filter: blur(6px); z-index: 50;
  font-size: 30px; font-weight: 900; text-align: center; padding: 40px; line-height: 1.4; }
.level-up.show { display: flex; animation: levelUpAnim 2.2s ease forwards; }
@keyframes levelUpAnim {
  0% { opacity: 0; transform: scale(0.7); }
  15% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}
