@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:ital,wght@0,500;1,500&display=swap');

:root {
  --gold: #d9b25f;
  --gold-bright: #f3d98a;
  --bg: #060606;
  --panel: #0d0d10;
  --blue: #4a8fd6;
  --green: #4caf6e;
  --purple: #a25fd6;
  --teal: #3fb8b0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(ellipse 60% 45% at 50% 0%, #1c1a14 0%, #0a0908 45%, var(--bg) 100%);
  color: #e9e2cf;
  font-family: 'Cormorant Garamond', serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 40px 0;
}

.player-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #e9e2cf;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 6px;
}

.icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

.settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.brand {
  text-align: center;
  margin-top: -4px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 4px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(160deg, #3a2f14, #171208);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold-bright);
  font-size: 1.3rem;
  box-shadow: 0 0 18px rgba(217, 178, 95, 0.35);
}

.brand h1 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.35em;
  font-size: 1.9rem;
  margin: 2px 0 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 60%, #9c7a3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  margin: 0;
  letter-spacing: 0.45em;
  font-size: 0.8rem;
  color: #cbb98a;
  text-transform: uppercase;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 70px;
  overflow: hidden;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(217, 178, 95, 0.5);
  background: rgba(20, 18, 12, 0.4);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.nav-left { left: 20px; }
.nav-right { right: 20px; }

.card-viewport {
  position: relative;
  width: 100%;
  max-width: 780px;
  height: 100%;
  overflow: hidden;
}

.card-row {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 22px;
  will-change: transform;
}

.game-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(190px, 22vw, 250px);
  height: clamp(360px, 78vh, 560px);
  border-radius: 18px;
  background: linear-gradient(160deg, #14161a 0%, #0a0b0d 60%, #060607 100%);
  padding: clamp(16px, 2.6vh, 26px) 20px clamp(18px, 2.8vh, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0.5;
  filter: saturate(0.65);
  transform: scale(0.86);
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}

.game-card:hover {
  opacity: 0.75;
}

.card-blue   { border: 1px solid var(--blue);   box-shadow: 0 0 26px rgba(74,143,214,0.35), inset 0 0 30px rgba(74,143,214,0.06); }
.card-green  { border: 1px solid var(--green);  box-shadow: 0 0 34px rgba(76,175,110,0.55), inset 0 0 30px rgba(76,175,110,0.08); }
.card-purple { border: 1px solid var(--purple); box-shadow: 0 0 26px rgba(162,95,214,0.35), inset 0 0 30px rgba(162,95,214,0.06); }
.card-teal   { border: 1px solid var(--teal);   box-shadow: 0 0 26px rgba(63,184,176,0.35), inset 0 0 30px rgba(63,184,176,0.06); }

.game-card.selected {
  opacity: 1;
  filter: none;
  transform: translateY(-10px) scale(1.04);
  cursor: default;
  z-index: 2;
}

.game-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: clamp(1rem, 2vh, 1.3rem);
  color: var(--gold-bright);
  margin: 6px 0 clamp(10px, 2vh, 22px);
  line-height: 1.3;
}

.game-art {
  position: relative;
  width: 100%;
  height: clamp(120px, 26vh, 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(10px, 2vh, 20px);
}

/* Rummy tiles */
.tile {
  position: absolute;
  width: 46px;
  height: 62px;
  background: linear-gradient(160deg, #f2ead6, #d8cba0);
  border-radius: 6px;
  border: 1px solid #8a7a4d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #7a1f1f;
  box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}
.tile-1 { top: 30px; left: 40px; transform: rotate(-6deg); color: #7a1f1f; }
.tile-2 { top: 24px; left: 92px; color: #8a7326; }
.tile-3 { top: 30px; left: 144px; transform: rotate(6deg); color: #234f8a; }
.tile-4 { top: 100px; left: 20px; transform: rotate(-14deg); color: #7a1f1f; }

/* Cucaracha board */
.board-round {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #6b4a24, #2c1d0e 75%);
  border: 3px solid #7a5a2c;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

.cockroach {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

.marble {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset -2px -2px 3px rgba(0,0,0,0.4), 0 2px 3px rgba(0,0,0,0.5);
}
.m1 { top: 4px;  left: 70px; background: #c94a3d; }
.m2 { top: 24px; left: 130px; background: #2f8f3f; }
.m3 { top: 80px; left: 148px; background: #d6c94a; }
.m4 { top: 130px; left: 100px; background: #3a6fc4; }
.m5 { top: 130px; left: 30px; background: #d6c94a; }
.m6 { top: 24px; left: 14px; background: #2f8f3f; }

.dice-float {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
}
.dice-top { top: 0; }

.die {
  font-size: 1.9rem;
  color: #f2ead6;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}
.d2 { transform: translateY(10px); }

/* Bendito 7 board */
.board-grid {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 6px;
  padding: 10px;
  background: linear-gradient(160deg, #6b4a24, #3a260f);
  border: 2px solid #8a6a34;
  border-radius: 8px;
  margin-top: 30px;
}

.board-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7a5a2c;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #f2ead6;
}

.board-grid span:nth-child(7) {
  background: #3a1f4a;
  color: var(--gold-bright);
  border: 1px solid var(--purple);
}

/* Por que siempre yo wheel */
.board-wheel {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1a2a33 0%, #0d1a20 60%, #060b0d 100%);
  border: 3px solid #2f5a5a;
}

.board-wheel::before {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, #0a0a0a, #000);
  border: 2px solid #1c1c1c;
}

.board-wheel .marble {
  width: 16px;
  height: 16px;
}
.wm1 { top: 6px;   left: 76px;  background: #c94a3d; }
.wm2 { top: 34px;  left: 132px; background: #3a6fc4; }
.wm3 { top: 90px;  left: 148px; background: #e8e0c8; }
.wm4 { top: 138px; left: 118px; background: #222; }
.wm5 { top: 138px; left: 40px;  background: #d6c94a; }
.wm6 { top: 90px;  left: 8px;   background: #2f8f3f; }
.wm7 { top: 34px;  left: 24px;  background: #c94a3d; }
.wm8 { top: 60px;  left: 76px;  background: #3a6fc4; }

.game-desc {
  font-size: clamp(0.85rem, 1.8vh, 1.05rem);
  color: #cfc7ab;
  line-height: 1.35;
  margin: 0 0 clamp(10px, 2vh, 24px);
}

.enter-btn {
  margin-top: auto;
  width: 100%;
  padding: clamp(9px, 1.6vh, 12px) 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.15em;
  font-size: clamp(0.8rem, 1.6vh, 0.95rem);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-blue .enter-btn   { color: #bcd7f7; border: 1.5px solid var(--blue);   box-shadow: 0 0 14px rgba(74,143,214,0.5); }
.card-green .enter-btn  { color: #c7f0d3; border: 1.5px solid var(--green);  box-shadow: 0 0 18px rgba(76,175,110,0.6); }
.card-purple .enter-btn { color: #e4cdf7; border: 1.5px solid var(--purple); box-shadow: 0 0 14px rgba(162,95,214,0.5); }
.card-teal .enter-btn   { color: #c3efec; border: 1.5px solid var(--teal);   box-shadow: 0 0 14px rgba(63,184,176,0.5); }

.enter-btn:hover {
  transform: scale(1.04);
}

.floor {
  flex: 0 0 auto;
  position: relative;
  margin: -60px auto 0;
  width: 78%;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(217,178,95,0.18), transparent 70%);
  filter: blur(2px);
}

/* ===== GameCenter — modales genéricos ===== */

.gc-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 2, 0.72);
  backdrop-filter: blur(2px);
}

.gc-overlay.is-hidden { display: none; }

.gc-modal {
  width: min(360px, 90vw);
  background: linear-gradient(160deg, #17140d, #0a0908 70%);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 28px 26px 24px;
  box-shadow: 0 0 40px rgba(217, 178, 95, 0.25);
  text-align: center;
}

.gc-modal h3 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.gc-modal-note {
  color: #cfc7ab;
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.gc-modal input[type="text"],
.gc-modal input[type="number"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(217,178,95,0.4);
  border-radius: 8px;
  color: #e9e2cf;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  padding: 10px 12px;
  margin-bottom: 8px;
  outline: none;
}

.gc-modal input:focus {
  border-color: var(--gold);
}

.gc-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.gc-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  transition: transform 0.15s ease;
}

.gc-btn:hover { transform: scale(1.03); }

.gc-btn-gold {
  color: #1b1408;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--gold);
}

.gc-btn-ghost {
  color: #cfc7ab;
  border: 1px solid rgba(217,178,95,0.4);
}
