:root {
  --orange-1: #ffb21f;
  --orange-2: #ff6a00;
  --ink: #2e1300;
  --yellow: #ffe600;
  --dark: rgba(8, 24, 8, 0.86);
  --line: rgba(255, 255, 255, 0.55);
  --ok: #39ff6a;
  --font-title: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a3a10; overflow: hidden; }
body { font-family: var(--font-body); color: #fff; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1280px; height: 800px; overflow: hidden; transform-origin: center;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.38) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0.08  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, #2f9a2c 0 80px, #2a8f28 80px 160px);
}
.pitch { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pitch path, .pitch line { fill: none; stroke: var(--line); stroke-width: 22; opacity: 0.55; }
.pitch line { stroke-width: 24; }
#screen { position: absolute; inset: 0; }
#screen.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Botones y títulos ---------- */
.ribbon {
  display: block; width: 440px; height: 56px; margin: 8px auto; border: 0; cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  background: linear-gradient(#ffc02e, var(--orange-2) 85%);
  color: var(--ink); font: 30px var(--font-title); letter-spacing: 0.5px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); transition: transform 0.12s, filter 0.12s;
}
.ribbon:hover { transform: scale(1.04); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)) brightness(1.08); }
.ribbon:active { transform: scale(0.98); }
.ribbon.small { width: 320px; height: 48px; font-size: 24px; }

.ribbon-title {
  display: inline-block; padding: 10px 80px 12px; font: 44px var(--font-title); letter-spacing: 1px;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.35));
}
.ribbon-title.red { background: linear-gradient(#ff2a2a, #d10a0a); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.ribbon-title.gold { background: linear-gradient(#fff36b, #ffc400); color: #d0021b; }

.logo {
  margin: 0; text-align: center; font: 150px/1 var(--font-title); letter-spacing: 4px;
  color: var(--yellow); -webkit-text-stroke: 5px #7a1400; paint-order: stroke fill;
  text-shadow: 0 8px 0 #4a0c00, 0 14px 22px rgba(0, 0, 0, 0.5);
}
.logo.small { font-size: 110px; }
.big-title {
  font: 84px/1 var(--font-title); color: var(--yellow); -webkit-text-stroke: 4px #7a1400; paint-order: stroke fill;
  text-shadow: 0 6px 0 #4a0c00;
}
.big-title.lost { color: #ff5a4a; -webkit-text-stroke-color: #3b0000; text-shadow: 0 6px 0 #200; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 12px; border: 2px solid #b98a00; cursor: pointer;
  background: linear-gradient(#fff6b8, #ffd24a); color: #3b2600; font-size: 20px; font-weight: 900;
  box-shadow: 0 3px 0 #8a6400;
}
.icon-btn.corner { position: absolute; right: 18px; bottom: 16px; }
.back-btn {
  background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.35); color: #fff; cursor: pointer;
  font: 18px var(--font-title); padding: 8px 18px; border-radius: 999px;
}
.back-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.back-btn.under { display: block; margin: 10px auto 0; }

.overlay { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.62); }
.hidden { display: none !important; }
.dialog {
  background: var(--dark); border-radius: 32px; padding: 36px 50px; text-align: center; min-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.dialog.wide { width: 760px; }
.dlg-title { font: 46px var(--font-title); margin-bottom: 14px; }
.dlg-comp { font: 26px var(--font-title); color: var(--yellow); margin-bottom: 30px; }
.dlg-label { font: 38px var(--font-title); margin-bottom: 8px; }
.center-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.name-input {
  display: block; width: 440px; margin: 0 auto 24px; text-align: center; background: rgba(0, 0, 0, 0.35);
  border: 0; border-bottom: 3px solid var(--yellow); color: var(--yellow); font: 46px var(--font-title); outline: none; padding: 6px;
}

/* ---------- Cartas ---------- */
/* Carta: marco negro, cabecera negra con pestaña blanca de media y escudo, retrato pixel-art sobre gris a rayas
   y banda dorada con el nombre. */
.card {
  position: relative; width: 130px; height: 186px; flex: none; border-radius: 11px; overflow: hidden; user-select: none;
  background: #f4f4f4; border: 3px solid #111; box-shadow: inset 0 0 0 3px #fff, 0 5px 12px rgba(0, 0, 0, 0.45);
}
.c-top { position: absolute; left: 6px; right: 6px; top: 6px; height: 40px; background: #121212; border-radius: 6px 6px 0 0; }
.c-rat {
  position: absolute; left: 0; top: 0; width: 56px; height: 34px; padding: 3px 0 0 8px; background: #fff; color: #111;
  font: 27px/1 var(--font-title); clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); border-top-left-radius: 6px;
}
.c-crest { position: absolute; right: 5px; top: 3px; width: 34px; height: 34px; }
.c-crest svg { width: 100%; height: 100%; display: block; }
.c-photo {
  position: absolute; left: 6px; right: 6px; top: 46px; height: 92px; overflow: hidden;
  background: repeating-linear-gradient(115deg, #e6e6e6 0 11px, #d2d2d2 11px 24px);
  border-left: 2px solid #121212; border-right: 2px solid #121212;
}
.c-face {
  position: absolute; left: 50%; bottom: -6px; width: 124px; height: 124px; transform: translateX(-50%);
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.c-band {
  position: absolute; left: 6px; right: 6px; top: 138px; bottom: 6px; padding: 4px 4px 0; text-align: center; line-height: 1.05;
  background: linear-gradient(#e2bd3d, #c49a1c); border-top: 3px solid #121212; border-radius: 0 0 6px 6px;
}
.c-name { font-family: var(--font-title); color: #1a1300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-club { font-size: 10px; font-weight: 900; color: #3d2d00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.c-hint { display: none; }

.card.legend { background: linear-gradient(135deg, #fff3b0, #d4a017 40%, #fff1a8 60%, #b8860b); border-color: #6b4e00; }
.card.legend .c-top { background: linear-gradient(#3a2a00, #6b4e00); }
.card.legend .c-rat { background: linear-gradient(135deg, #fff7c2, #f3c623); }
.card.legend .c-photo { background: repeating-linear-gradient(115deg, #fbeeb8 0 11px, #efd98a 11px 24px); border-color: #6b4e00; }
.card.legend .c-band { background: linear-gradient(#fff6cf, #e9cf73); border-top-color: #6b4e00; }
.card.legend::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%);
  background-size: 250% 100%; animation: shine 3.2s linear infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.card.back { background: #fff; border-color: #7a0010; }
.b-inner {
  position: absolute; inset: 6px; border-radius: 8px; border: 2px solid #fff; display: grid; place-items: center; align-content: center; gap: 4px;
  background:
    repeating-linear-gradient(45deg, transparent 0 7px, rgba(255,255,255,.18) 7px 9px),
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(255,255,255,.18) 7px 9px),
    linear-gradient(#d8182d, #b30d20);
  box-shadow: inset 0 0 0 3px #b30d20, inset 0 0 0 5px rgba(255,255,255,.6);
}
.b-ball { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 44px; box-shadow: 0 0 0 4px #b30d20, 0 0 0 7px #fff; }
.b-logo { font: 17px var(--font-title); color: #fff; margin-top: 10px; letter-spacing: 1px; text-shadow: 0 2px 0 #7a0010; }

.card.mini { zoom: 0.62; }
.card.xi { zoom: 0.6; }
.card.big { zoom: 1.55; }

/* ---------- Menú ---------- */
.menu { position: absolute; inset: 0; text-align: center; }
.logo-fan { position: absolute; left: 640px; top: 16px; }
.fan-card {
  position: absolute; left: 0; top: 0; zoom: 0.78;
  transform: translateX(calc(var(--i) * 110px - 65px)) translateY(calc(var(--i) * var(--i) * 10px)) rotate(calc(var(--i) * 9deg));
  transform-origin: 50% 100%;
}
.menu .logo { position: absolute; left: 0; right: 0; top: 200px; }
.logo-sub { position: absolute; left: 0; right: 0; top: 352px; font: 24px var(--font-title); color: #fff; text-shadow: 0 2px 0 #000; }
.menu-btns { position: absolute; left: 0; right: 0; top: 396px; }
.menu-btns .gap { height: 10px; }
.winrate { position: absolute; left: 0; right: 0; bottom: 22px; font: 28px var(--font-title); text-shadow: 0 3px 0 #000; }

/* ---------- Páginas genéricas ---------- */
.page, .panel { position: absolute; inset: 0; padding: 22px 28px; background: rgba(0, 0, 0, 0.28); }
.page-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.page-title { font: 42px var(--font-title); color: var(--yellow); text-shadow: 0 3px 0 #000; }
.page-hint { font: 22px var(--font-title); margin-left: auto; opacity: 0.9; }

.tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 20px; border-radius: 999px; border: 2px solid rgba(255,255,255,.3); cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff; font: 20px var(--font-title);
}
.tab.on { background: linear-gradient(#ffc02e, var(--orange-2)); color: var(--ink); border-color: transparent; }
.comp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.comp-tile {
  position: relative; height: 150px; padding: 16px 18px; text-align: left; cursor: pointer; color: #fff;
  background: var(--dark); border: 3px solid rgba(255,255,255,.14); border-radius: 18px;
  transition: transform 0.12s, border-color 0.12s;
}
.comp-tile:hover:not([disabled]) { transform: translateY(-3px); border-color: var(--yellow); }
.comp-tile.cup { background: linear-gradient(160deg, rgba(20, 40, 110, 0.92), var(--dark)); }
.comp-tile.legends { background: linear-gradient(160deg, rgba(150, 110, 10, 0.95), rgba(60, 40, 0, 0.92)); }
.comp-tile[disabled] { opacity: 0.55; cursor: not-allowed; }
.tile-kind { font: 14px var(--font-title); color: var(--yellow); letter-spacing: 1px; text-transform: uppercase; }
.tile-name { font: 28px/1.05 var(--font-title); margin: 6px 0 8px; }
.tile-meta { font-size: 14px; font-weight: 800; opacity: 0.8; }
.tile-warn { font-size: 13px; font-weight: 900; color: #ffb0a0; margin-top: 6px; }
.tile-trophy { position: absolute; right: 12px; top: 10px; width: 36px; text-align: center; }
.tile-trophy b { font: 14px var(--font-title); }

/* ---------- Cuadro del torneo ---------- */
.bracket { position: absolute; inset: 0; }
.br-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.br-lines path { fill: none; stroke: #fff; stroke-width: 3; }
.br-box {
  position: absolute; width: 132px; height: 34px; padding: 5px 9px; border-radius: 8px; background: #fff; color: #111;
  font: 16px/24px var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
}
.br-box.you { background: var(--yellow); }
.br-box.out { opacity: 0.55; text-decoration: line-through; }
.br-box.champ { border: 3px solid #e2b007; line-height: 18px; text-align: center; }
.br-round { position: absolute; left: 14px; top: 10px; font-size: 34px; padding: 8px 60px; z-index: 2; }
.br-comp { position: absolute; right: 24px; top: 24px; font: 24px var(--font-title); text-shadow: 0 2px 0 #000; }
.br-trophy { position: absolute; left: 590px; top: 180px; width: 100px; }
.br-final-lbl { position: absolute; left: 0; right: 0; top: 314px; text-align: center; font: 20px var(--font-title); text-shadow: 0 2px 0 #000; }
.br-foot { position: absolute; left: 0; right: 0; bottom: 18px; }
.br-note { position: absolute; left: 0; right: 0; bottom: 118px; text-align: center; font: 22px var(--font-title); text-shadow: 0 2px 0 #000; }
.br-note b { color: var(--yellow); }

/* ---------- Previa ---------- */
.prematch { position: absolute; inset: 0; }
.pm-title { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); font-size: 54px; white-space: nowrap; }
.pm-portrait {
  position: absolute; left: 170px; top: 160px; width: 380px; height: 380px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(#4ade2c, #1f8a15); border: 12px solid #1c5a16; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.pm-portrait svg { width: 100%; height: 100%; display: block; transform: translateY(18px) scale(1.05); }
.pm-bubble {
  position: absolute; left: 620px; top: 190px; width: 540px; padding: 22px 28px; border-radius: 22px;
  background: linear-gradient(#fff, #ececec); color: #111; font: 800 30px/1.3 var(--font-body); border: 3px solid #111;
}
.pm-bubble::before {
  content: ''; position: absolute; left: -30px; top: 40px; border: 16px solid transparent; border-right: 16px solid #111;
}
.pm-vs {
  position: absolute; left: 150px; right: 150px; top: 590px; height: 96px; border-radius: 22px; background: var(--dark);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 50px;
  font: 48px var(--font-title); color: var(--yellow);
}
.pm-vs span:last-child { text-align: right; }
.pm-vs i { font-style: normal; font-size: 40px; }
.pm-comp { position: absolute; left: 0; right: 0; top: 560px; text-align: center; font: 20px var(--font-title); text-shadow: 0 2px 0 #000; }
.pm-go { position: absolute; left: 50%; bottom: 14px; margin: 0; transform: translateX(-50%); }
.pm-go:hover { transform: translateX(-50%) scale(1.04); }

/* ---------- Partido ---------- */
.match { position: absolute; inset: 0; }
.m-sub { position: absolute; left: 22px; top: 150px; font: 18px var(--font-title); text-shadow: 0 2px 0 #000; max-width: 200px; }
.avatar {
  position: absolute; width: 110px; height: 110px; border-radius: 50%; overflow: hidden;
  background: #7d7d7d; border: 7px solid #a97f12; box-shadow: 0 0 0 3px #5b4205, 0 6px 14px rgba(0,0,0,.4);
}
.avatar svg { width: 100%; height: 100%; display: block; transform: translateY(8px) scale(1.12); }
.opp-avatar { left: 36px; top: 26px; }
.you-avatar { left: 36px; top: 560px; background: #f2c200; border-color: #f7d64a; }
.av-name { position: absolute; font: 26px var(--font-title); text-shadow: 0 3px 0 #000; }
.opp-name { left: 160px; top: 60px; max-width: 170px; line-height: 1; }
.you-name { left: 36px; top: 680px; width: 110px; text-align: center; font-size: 34px; }

.opp-hand { position: absolute; left: 0; top: -44px; width: 1280px; height: 200px; }
.opp-hand .card { position: absolute; top: 0; transform: rotate(var(--r)); }

.deck { position: absolute; left: 40px; top: 300px; width: 150px; height: 210px; }
.deck-stack { position: relative; }
.deck-stack .card { position: absolute; }
.deck-stack .d3 { left: 10px; top: 10px; }
.deck-stack .d2 { left: 5px; top: 5px; }
.deck-count { position: absolute; left: 0; top: 200px; width: 140px; text-align: center; font: 22px var(--font-title); text-shadow: 0 2px 0 #000; }
.deck.empty .deck-stack { opacity: 0.2; }

#table, #pens, #fx { position: absolute; inset: 0; pointer-events: none; }
#fx { z-index: 30; }
.flyer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.flyer .card { box-shadow: 0 14px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 3px #fff; }
#table .card, #pens .card { position: absolute; }
#table .card.winner, #pens .card.winner { box-shadow: 0 0 0 5px var(--yellow), 0 0 30px var(--yellow); }
.tsum {
  position: absolute; top: 226px; text-align: center; font: 19px var(--font-title); text-shadow: 0 2px 0 #000; white-space: nowrap;
}
.tsum b { color: var(--yellow); font-size: 24px; }
.tsum.you b { color: #9dff9d; }
.pen-score {
  position: absolute; left: 960px; width: 130px; padding: 6px 0; border-radius: 12px; background: #fff; color: #111; text-align: center;
  border: 3px solid #111; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.pen-score small { display: block; font: 15px var(--font-title); }
.pen-score b { font: 34px/1 var(--font-title); }
.pen-score::before { content: ''; position: absolute; left: -16px; top: 22px; border: 8px solid transparent; border-right-color: #111; }
.match .hand, .match .opp-hand { transition: transform 0.45s ease; }
.match.pens-on .hand { transform: translateY(300px); }
.match.pens-on .opp-hand { transform: translateY(-240px); }
.match.pens-on #table .card { transform: scale(0.85); }

.stand { position: absolute; left: 870px; top: 340px; margin: 0; z-index: 12; width: 200px; }

.prompt {
  position: absolute; left: 240px; right: 240px; top: 492px; text-align: center; font: 23px var(--font-title);
  color: var(--yellow); text-shadow: 0 2px 0 #000, 0 0 8px #000;
}
.avatar.turn { border-color: #ffe600; box-shadow: 0 0 0 3px #fff, 0 0 26px #ffe600; }
.avatar:not(.turn) img, .avatar:not(.turn) svg { filter: brightness(0.7); }

.side { position: absolute; right: 22px; top: 18px; width: 170px; text-align: center; }
.time-lbl { font: 24px var(--font-title); opacity: 0.85; text-shadow: 0 2px 0 #000; }
.time {
  margin: 2px auto 14px; width: 150px; padding: 6px 0; border-radius: 12px; background: linear-gradient(#fffbe0, #ffe486);
  color: #111; font: 36px var(--font-title); box-shadow: 0 4px 0 #a88a1e;
}
.time.low { color: #c00; }
.sq-lbl { font: 21px var(--font-title); text-shadow: 0 2px 0 #000; margin-top: 8px; }
.sq-lbl b { color: var(--yellow); }
.sq {
  width: 88px; height: 122px; margin: 6px auto 4px; border-radius: 10px; border: 3px solid rgba(255,255,255,.4);
}
.sq .card { margin: -3px 0 0 -3px; }
.sq-xi { font: 16px var(--font-title); color: #dfffd8; text-shadow: 0 2px 0 #000; }

.hand { position: absolute; left: 0; top: 572px; width: 1280px; height: 230px; }
.hand .card {
  position: absolute; top: 0; overflow: visible; transform: translateY(var(--y)) rotate(var(--r)); transform-origin: 50% 130%;
  transition: left 0.25s ease, transform 0.16s, box-shadow 0.16s, filter 0.16s;
}
.hand .card.playable { cursor: pointer; }
.hand .card.playable:hover { transform: translateY(calc(var(--y) - 36px)) rotate(var(--r)) scale(1.06); z-index: 9 !important; }
.hand .card.waiting { filter: brightness(0.85); }
.hand .card.blocked { filter: brightness(0.55) grayscale(0.4); }
/* Pistas sobre la carta: trofeo = gana, P = empata (penales), + = sirve de refuerzo. */
.c-hint.win, .c-hint.tie, .c-hint.plus {
  display: grid; place-items: center; position: absolute; left: 50%; top: -30px; width: 30px; height: 26px; transform: translateX(-50%);
  border-radius: 6px; background: #ffe066; border: 2px solid #7a5a00; font: 17px var(--font-title); color: #3a2600;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.c-hint.win::before { content: '🏆'; font-size: 15px; }
.c-hint.tie::before { content: 'P'; }
.c-hint.plus { background: #7dff8a; border-color: #0b6b18; color: #083b10; }
.c-hint.plus::before { content: '+'; font-size: 22px; line-height: 1; }

.ctrls { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 8px; }

.banner {
  position: absolute; left: 0; right: 0; top: 330px; text-align: center; z-index: 40; pointer-events: none;
  opacity: 0; transform: scale(0.6); transition: opacity 0.18s, transform 0.25s cubic-bezier(.2, 1.6, .5, 1);
}
.banner.show { opacity: 1; transform: scale(1); }
.banner .ribbon-title { font-size: 56px; padding: 12px 110px 14px; }
.banner-sub { font: 26px var(--font-title); margin-top: 8px; text-shadow: 0 3px 0 #000; }

.result { width: 1240px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.res-team { text-align: center; }
.res-score { font: 30px var(--font-title); text-shadow: 0 3px 0 #000; margin-bottom: 6px; }
.res-score b { color: var(--yellow); }
.res-score.you b { font-size: 36px; }
.xi-row { display: flex; gap: 5px; justify-content: center; min-height: 112px; }
.xi-empty { font: 22px var(--font-title); opacity: 0.7; align-self: center; }
.res-mid { text-align: center; margin: 6px 0; }
.res-sub { font: 30px var(--font-title); color: var(--yellow); text-shadow: 0 3px 0 #000; margin: 4px 0 6px; }

/* ---------- Campeón ---------- */
.champion { position: absolute; inset: 0; text-align: center; overflow: hidden; }
.ch-trophy { width: 220px; margin: 40px auto 0; animation: bob 2s ease-in-out infinite; filter: drop-shadow(0 12px 18px rgba(0,0,0,.5)); }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-2deg); } }
.ch-comp { font: 34px var(--font-title); text-shadow: 0 3px 0 #000; margin: 10px 0 30px; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall 3.2s linear infinite; }
@keyframes fall { to { transform: translateY(840px) rotate(720deg); } }

/* ---------- Trofeos y reglas ---------- */
.awards { height: 690px; overflow: auto; padding-right: 8px; }
.aw-group { margin-bottom: 14px; }
.aw-cont { font: 22px var(--font-title); color: var(--yellow); margin-bottom: 8px; text-shadow: 0 2px 0 #000; }
.aw-row { display: flex; flex-wrap: wrap; gap: 12px; }
.aw { width: 140px; padding: 10px; border-radius: 14px; background: var(--dark); text-align: center; }
.aw-cup { width: 56px; margin: 0 auto; filter: grayscale(1) brightness(0.45); }
.aw.won .aw-cup { filter: none; }
.aw-name { font: 15px/1.1 var(--font-title); margin-top: 6px; min-height: 34px; }
.aw-n { font: 18px var(--font-title); color: var(--yellow); }

.rules { max-width: 980px; margin: 10px auto 0; display: grid; gap: 12px; }
.rule { display: flex; gap: 18px; align-items: center; background: var(--dark); border-radius: 16px; padding: 14px 22px; }
.rule b {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(#ffc02e, var(--orange-2)); color: var(--ink); font: 26px var(--font-title);
}
.rule p { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.35; }
.rule strong { color: var(--yellow); }
.rule.tip { background: rgba(20, 40, 110, 0.85); }

/* ---------- Panel de planteles ---------- */
.panel { background: rgba(0, 0, 0, 0.55); }
.p-tools { margin-left: auto; display: flex; gap: 10px; }
.tool {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1); color: #fff; font: 800 15px var(--font-body); cursor: pointer; white-space: nowrap;
}
.tool:hover { border-color: var(--yellow); }
.tool.add { background: linear-gradient(#ffc02e, var(--orange-2)); color: var(--ink); border-color: transparent; }
.tool.danger:hover { border-color: #ff6b6b; color: #ffb3b3; }
.p-cols { display: grid; grid-template-columns: 250px 300px 1fr; gap: 14px; height: 680px; }
.p-col { background: var(--dark); border-radius: 16px; padding: 12px; overflow-y: auto; overflow-x: hidden; }
.p-form > input { width: 100%; }
.p-col::-webkit-scrollbar, .p-list::-webkit-scrollbar, .awards::-webkit-scrollbar { width: 8px; }
.p-col::-webkit-scrollbar-thumb, .p-list::-webkit-scrollbar-thumb, .awards::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }
.p-cont { font: 16px var(--font-title); color: var(--yellow); margin: 10px 4px 4px; }
.p-cont:first-child { margin-top: 0; }
.p-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; border: 0; cursor: pointer;
  background: transparent; color: #fff; font: 800 15px var(--font-body); text-align: left;
}
.p-item:hover { background: rgba(255,255,255,.08); }
.p-item.on { background: rgba(255, 200, 40, 0.22); box-shadow: inset 3px 0 0 var(--yellow); }
.p-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item small { font-weight: 900; opacity: 0.75; }
.p-item small.zero { color: #ff9a8a; opacity: 1; }
.dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 3px solid; }
.x { border: 0; background: transparent; color: #ff9a8a; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 6px; opacity: 0.6; }
.x:hover { opacity: 1; background: rgba(255, 80, 80, 0.2); }
.x.big { font-size: 18px; padding: 4px 8px; }
.p-colhead { display: flex; align-items: center; gap: 10px; font: 20px var(--font-title); color: var(--yellow); margin-bottom: 10px; }
.p-colhead > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-search, .p-form input:not([type=color]), .p-form select, .ed-form input:not([type=color]):not([type=checkbox]), .ed-form select {
  background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2); border-radius: 9px; color: #fff;
  font: 700 15px var(--font-body); padding: 7px 10px; outline: none; min-width: 0;
}
.p-search { width: 160px; }
select option { color: #111; }
.p-search:focus, .p-form input:focus, .ed-form input:focus, .ed-form select:focus { border-color: var(--yellow); }
.p-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.15); display: grid; gap: 8px; }
.p-formtitle { font: 14px var(--font-title); color: #cfe9c9; }
.p-row { display: flex; gap: 8px; align-items: center; }
.p-row select { flex: 1; width: 0; }
.p-row label { font-weight: 800; font-size: 14px; }
input[type=color] { width: 38px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.players { display: flex; flex-direction: column; }
.p-list { flex: 1; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.p-player { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.p-player:hover { background: rgba(255,255,255,.11); }
.pp-face { width: 46px; height: 46px; flex: none; }
.pp-face svg { width: 100%; height: 100%; }
.pp-rat { width: 44px; font: 26px var(--font-title); color: var(--yellow); text-align: center; }
.pp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pp-main b { font: 19px var(--font-title); font-weight: 400; }
.pp-main small { font-weight: 800; opacity: 0.75; font-size: 13px; }
.badge { font: 900 12px var(--font-body); color: #3a2600; background: #ffd24a; padding: 3px 8px; border-radius: 999px; }
.p-empty { padding: 30px; text-align: center; font-weight: 800; opacity: 0.8; }

.editor { display: flex; gap: 36px; align-items: center; background: #0f2a10; border-radius: 24px; padding: 28px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.ed-preview { width: 210px; display: grid; place-items: center; }
.ed-form { width: 620px; display: grid; gap: 12px; }
.ed-title { font: 30px var(--font-title); color: var(--yellow); }
.ed-form label { display: grid; gap: 4px; font-weight: 900; font-size: 13px; color: #cfe9c9; flex: 1; }
.ed-form label.chk { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #fff; align-self: end; padding-bottom: 8px; }
.ed-row { display: flex; gap: 10px; }
.ed-err { color: #ff9a8a; font-weight: 800; min-height: 18px; }
.ed-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Retratos pixel-art fuera de las cartas ---------- */
.avatar img, .pm-portrait img, .pp-img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.avatar img { transform: translateY(8px) scale(1.12); }
.pm-portrait img { transform: translateY(18px) scale(1.05); }
.pm-vs.one { grid-template-columns: 1fr; text-align: center; font-size: 34px; }
.sq .card.back { margin: -3px 0 0 -3px; }
.photo-row { align-items: center; }
.photo-row small { font-size: 12px; opacity: 0.75; font-weight: 700; }

/* =====================================================================
   Rediseño: logo, menú, selector de competiciones y HUD del partido
   ===================================================================== */

/* Dorso de las cartas con el logo */
.b-inner {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.18), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 7px, rgba(255,255,255,.12) 7px 9px),
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(255,255,255,.12) 7px 9px),
    linear-gradient(#c8102e, #7d0a1a);
}
.b-inner .b-logo { width: 84%; height: auto; margin: 0; font: inherit; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }

/* Menú */
.menu-left { position: absolute; left: 60px; top: 34px; width: 500px; text-align: center; }
.menu-logo { width: 330px; margin: 0 auto; filter: drop-shadow(0 16px 24px rgba(0,0,0,.45)); animation: logoIn 0.7s cubic-bezier(.2,1.4,.4,1); }
.menu-logo svg { width: 100%; height: auto; display: block; }
@keyframes logoIn { from { transform: scale(0.6) rotate(-6deg); opacity: 0; } }
.menu-tag { font: 28px var(--font-title); color: var(--yellow); text-shadow: 0 3px 0 #000; margin-top: 4px; }
.menu-stats { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.menu-stats span { background: rgba(0,0,0,.45); border-radius: 999px; padding: 5px 14px; font-weight: 800; font-size: 15px; }
.menu-stats b { color: var(--yellow); font-family: var(--font-title); font-weight: 400; font-size: 18px; }
.menu-fan { position: absolute; left: 310px; top: 560px; }
.menu-fan .fan-card { zoom: 0.72; }
.menu-right { position: absolute; right: 60px; top: 60px; width: 540px; }
.profile { background: var(--dark); border-radius: 18px; padding: 14px 20px; margin-bottom: 18px; border: 2px solid rgba(255,255,255,.1); }
.profile-name { font: 30px var(--font-title); color: var(--yellow); }
.profile-row { display: flex; gap: 22px; font-weight: 800; font-size: 16px; opacity: 0.9; }
.profile-row b { font-family: var(--font-title); font-weight: 400; font-size: 20px; color: #fff; }
.mbtn {
  display: flex; align-items: center; gap: 18px; width: 100%; height: 92px; margin-bottom: 14px; padding: 0 24px; cursor: pointer;
  border-radius: 18px; border: 3px solid rgba(255,255,255,.14); background: var(--dark); color: #fff; text-align: left;
  box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.mbtn:hover { transform: translateY(-3px); border-color: var(--yellow); }
.mbtn:active { transform: translateY(1px); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.mbtn i { font-style: normal; font-size: 40px; width: 50px; text-align: center; }
.mbtn span { font: 30px/1.05 var(--font-title); display: flex; flex-direction: column; }
.mbtn small { font: 800 15px var(--font-body); opacity: 0.75; margin-top: 3px; }
.mbtn.primary { background: linear-gradient(#ffc02e, var(--orange-2)); color: var(--ink); border-color: #ffe08a; }
.mbtn.primary small { opacity: 0.85; }
.mbtn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mbtn.small { height: 72px; }
.mbtn.small span { font-size: 24px; }
.mbtn.small i { font-size: 30px; width: 36px; }

/* Selector de competiciones */
.comp-search {
  margin-left: auto; width: 360px; padding: 10px 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45); color: #fff; font: 800 16px var(--font-body); outline: none;
}
.comp-search:focus { border-color: var(--yellow); }
.comp-grid { max-height: 610px; overflow-y: auto; padding: 4px 6px 10px 2px; }
.comp-grid::-webkit-scrollbar { width: 8px; }
.comp-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }
.comp-tile { height: 178px; display: flex; flex-direction: column; }
.comp-tile.nations { background: linear-gradient(160deg, rgba(120, 20, 60, 0.92), var(--dark)); }
.tile-crests { display: flex; gap: 6px; margin: 2px 0 auto; }
.tile-crest { width: 38px; height: 38px; }
.tile-crest svg { width: 100%; height: 100%; display: block; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; opacity: 0.9; }
.stars { color: #ffd23f; font-size: 16px; letter-spacing: 1px; }
.stars i { font-style: normal; color: rgba(255,255,255,.2); }
.empty-note { grid-column: 1 / -1; text-align: center; font: 22px var(--font-title); padding: 40px; opacity: 0.8; }

/* HUD del partido */
.duel-count { font: 17px var(--font-title); color: var(--yellow); text-shadow: 0 2px 0 #000; margin: -6px 0 6px; }
.prompt { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: 760px; padding: 6px 20px; border-radius: 999px; }
.prompt:not(:empty) { background: rgba(0, 0, 0, 0.55); }
.hand .card::before {
  content: attr(data-key); position: absolute; left: 8px; bottom: 44px; z-index: 3; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.72); color: #fff; font: 14px/22px var(--font-title); text-align: center;
}
.dlg-help { margin-top: 14px; font-weight: 800; font-size: 15px; opacity: 0.85; }
.dlg-help b { color: var(--yellow); }

/* Botones de música y sonido */
.corner-btns { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 8px; }
.icon-btn.off { filter: grayscale(1) brightness(0.8); opacity: 0.7; }

/* Revelación final */
.result.reveal .xi-row { min-height: 112px; }
.rv-slot { width: 78px; height: 112px; }
.xi-empty-slot { width: 78px; height: 112px; border-radius: 8px; border: 2px dashed rgba(255,255,255,.3); }
.card.flip-in { animation: flipIn 0.35s ease-out; }
@keyframes flipIn { from { transform: rotateY(90deg) scale(1.1); } }
.pop-in { animation: popIn 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } }
.res-score b { display: inline-block; min-width: 60px; }
.avatar.human { background: #7dd3fc; border-color: #38bdf8; }

/* Traspasos */
.editor.transfer .ed-form { width: 520px; }
.tr-from { font-weight: 800; opacity: 0.9; }
.tr-from b { color: var(--yellow); }
#tSearch, #tClub { width: 100%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); border-radius: 10px; color: #fff; font: 700 15px var(--font-body); padding: 8px 10px; outline: none; }
#tClub optgroup { color: #ffe066; background: #0f2a10; }
#tClub option { color: #fff; background: #0f2a10; }
.tr-card { width: 210px; margin: 6px auto 12px; display: grid; place-items: center; }

/* Cuenta (Google / Apple) */
.menu-right { top: 36px; }
.mbtn { height: 82px; margin-bottom: 12px; }
.profile-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.profile-pic { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 3px solid var(--yellow); flex: none; }
.profile-pic.ph { display: grid; place-items: center; background: rgba(255,255,255,.1); font-size: 24px; }
.profile-id { flex: 1; min-width: 0; }
.profile-id small { display: block; font-weight: 700; opacity: 0.75; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; cursor: pointer;
  font: 800 15px var(--font-body); border: 0; box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.login-btn.google { background: #fff; color: #1f1f1f; }
.login-btn.google b { font: 900 18px Arial, sans-serif; color: #4285F4; }
.login-btn.apple { background: #000; color: #fff; border: 1px solid #444; }
.login-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mbtn.online-btn { background: linear-gradient(135deg, rgba(20, 60, 140, 0.95), var(--dark)); }

/* Multijugador */
.on-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 18px; margin-top: 10px; }
.on-card { background: var(--dark); border-radius: 18px; padding: 18px; border: 2px solid rgba(255,255,255,.1); }
.on-title { font: 22px var(--font-title); color: var(--yellow); margin-bottom: 10px; }
.on-input {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.4);
  color: #fff; font: 24px var(--font-title); outline: none; text-align: center; margin-bottom: 10px;
}
.on-input:focus { border-color: var(--yellow); }
.on-input.code { font-size: 44px; letter-spacing: 12px; text-transform: uppercase; }
.on-note { font-weight: 700; font-size: 14px; opacity: 0.8; margin-top: 8px; }
.on-msg { margin-top: 18px; text-align: center; font: 22px var(--font-title); color: #ffb3a0; min-height: 30px; }
.on-card .mbtn { height: 84px; }
.on-card .ribbon.small { width: 100%; }
.lobby { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin-top: 10px; }
.lobby-code, .lobby-info { background: var(--dark); border-radius: 18px; padding: 22px; text-align: center; }
.code-big { font: 110px/1 var(--font-title); letter-spacing: 16px; color: var(--yellow); text-shadow: 0 6px 0 #000; margin: 10px 0 16px; }
.lobby-comp { font: 30px var(--font-title); margin-bottom: 18px; }
.lobby-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; max-height: 300px; overflow-y: auto; }
.lobby-p { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border-radius: 10px; padding: 8px 12px; text-align: left; }
.lobby-p b { font: 18px var(--font-title); font-weight: 400; flex: 1; }
.lobby-p small { font-weight: 800; color: var(--yellow); }
.lobby-p.me { box-shadow: inset 0 0 0 2px var(--yellow); }
.lobby .ribbon[disabled] { filter: grayscale(1) brightness(0.7); cursor: not-allowed; }
.br-box.human { background: #bfe6ff; }
.rv-slot { position: relative; }
.rv-plus {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%); font: 26px var(--font-title); color: #9dff9d;
  text-shadow: 0 2px 0 #000; pointer-events: none; animation: plusUp 0.9s ease-out forwards;
}
@keyframes plusUp { from { opacity: 0; transform: translate(-50%, 20px) scale(0.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } to { opacity: 0; transform: translate(-50%, -34px); } }
.res-score b.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 50% { transform: scale(1.35); color: #fff; } }

/* ---------- Celulares ---------- */
html, body { touch-action: manipulation; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#viewport { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#rotate {
  display: none; position: fixed; inset: 0; z-index: 9999; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, #1f6b1c, #0a3a10); color: #fff; text-align: center; padding: 24px;
}
.rot-phone { width: 140px; height: 140px; animation: rotPhone 2.2s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
@keyframes rotPhone { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.rot-title { font: 34px var(--font-title); color: var(--yellow); text-shadow: 0 3px 0 #000; }
.rot-sub { font: 800 17px var(--font-body); opacity: 0.9; }
@media (orientation: portrait) and (max-width: 900px) {
  html.touch #rotate, html:not(.touch) #rotate { display: flex; }
}
/* En pantallas táctiles no hay hover: las cartas jugables se marcan con un brillo suave. */
html.touch .hand .card.playable { box-shadow: 0 0 0 2px rgba(255, 230, 0, 0.55), 0 5px 12px rgba(0,0,0,.45); }
html.touch .hand .card.playable:active { transform: translateY(calc(var(--y) - 30px)) rotate(var(--r)) scale(1.05); }

/* ---------- Ancho completo ---------- */
/* Las partes armadas sobre 1280 de ancho quedan centradas; el resto se apoya en los bordes reales. */
.match .opp-hand, .match .hand { left: calc(50% - 640px); }
#table, #pens, #fx { left: calc(50% - 640px); right: auto; width: 1280px; }
.stand { left: calc(50% + 230px); }
.bracket, .prematch, .champion { left: calc(50% - 640px); right: auto; width: 1280px; }
.comp-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.menu-fan { left: calc(60px + 250px); }

/* Ranking */
.mbtn-row.three { grid-template-columns: 1fr 1fr 1fr; }
.mbtn-row.three .mbtn { padding: 0 12px; gap: 8px; }
.mbtn-row.three .mbtn span { font-size: 20px; }
.rank-box { max-width: 900px; margin: 0 auto; max-height: 590px; overflow-y: auto; background: var(--dark); border-radius: 18px; padding: 12px 18px; }
table.rank { width: 100%; border-collapse: collapse; font-weight: 800; }
table.rank th { text-align: left; font: 16px var(--font-title); color: var(--yellow); padding: 8px; font-weight: 400; }
table.rank td { padding: 9px 8px; border-top: 1px solid rgba(255,255,255,.08); font-size: 17px; }
table.rank td b { font: 22px var(--font-title); font-weight: 400; color: var(--yellow); }
table.rank tr.me td { background: rgba(255, 230, 0, .12); }

/* Chat rápido */
.chat-menu {
  position: absolute; right: 18px; bottom: 76px; z-index: 45; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--dark); border: 2px solid rgba(255,255,255,.2); border-radius: 14px; padding: 10px; width: 380px;
}
.chat-menu button { background: rgba(255,255,255,.1); border: 0; border-radius: 10px; color: #fff; font: 800 15px var(--font-body); padding: 9px 8px; cursor: pointer; }
.chat-menu button:hover { background: rgba(255,230,0,.25); }
.chat-bubble {
  position: absolute; z-index: 44; max-width: 260px; padding: 10px 14px; border-radius: 16px; background: #fff; color: #111;
  font: 800 18px var(--font-body); border: 3px solid #111; box-shadow: 0 6px 16px rgba(0,0,0,.4); animation: popIn 0.3s cubic-bezier(.2,1.6,.4,1);
}
.chat-bubble.w1 { left: 160px; top: 96px; }
.chat-bubble.w0 { left: 160px; top: 600px; }
/* Invitaciones */
.invite-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.login-btn.wa { background: #25D366; color: #06371c; text-decoration: none; padding: 0 16px; }
.after-online .rank-note { font-weight: 800; margin: 10px 0 16px; opacity: 0.9; }
.install-btn {
  position: absolute; left: 18px; bottom: 16px; padding: 10px 16px; border-radius: 12px; border: 2px solid #ffe08a; cursor: pointer;
  background: linear-gradient(#ffc02e, var(--orange-2)); color: var(--ink); font: 18px var(--font-title); box-shadow: 0 3px 0 rgba(0,0,0,.35);
}

/* Menú centrado en pantallas anchas: logo y botones en una franja de 1280 en el medio. */
.menu-left { left: calc(50% - 640px + 60px); }
.menu-right { right: calc(50% - 640px + 60px); }
.menu-fan { left: calc(50% - 640px + 310px); }

/* Fotos de cuenta */
.avatar.photo img.acct-photo { width: 100%; height: 100%; object-fit: cover; transform: none; image-rendering: auto; }
.lobby-pic { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--yellow); }
.pm-portrait img.mgr-face, .avatar img.mgr-face { image-rendering: pixelated; }


/* Países */
.flag { width: 26px; height: 18px; object-fit: cover; border-radius: 3px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.flag.none { width: auto; height: auto; box-shadow: none; font-size: 16px; }
.flag-btn { background: none; border: 0; cursor: pointer; padding: 0 0 0 8px; vertical-align: middle; }
.flag-btn:hover .flag { transform: scale(1.15); }
.rk-country { white-space: nowrap; }
.rk-country span { font-size: 14px; opacity: 0.85; margin-left: 4px; }
.tab.small { padding: 7px 14px; font-size: 16px; }
.tab-sep { width: 18px; }
.country-dlg #cSel { width: 100%; margin: 14px 0; background: rgba(255,255,255,.08); color: #fff; border: 2px solid rgba(255,255,255,.2); border-radius: 10px; font: 700 16px var(--font-body); }
.country-dlg #cSel optgroup { color: #ffe066; background: #0f2a10; }
.country-dlg #cSel option { color: #fff; background: #0f2a10; }


/* Botón oficial de Google */
.gsi-wrap { min-height: 42px; display: flex; align-items: center; justify-content: center; }
.gsi-wrap iframe { margin: 0 auto !important; }
.privacy-link { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); color: rgba(255,255,255,.7); font-weight: 800; font-size: 14px; text-decoration: none; }
.privacy-link:hover { color: var(--yellow); }


/* Historial y Elo */
.elo-delta { font: 20px var(--font-title); font-weight: 400; }
.elo-delta.up { color: #5dff7a; }
.elo-delta.down { color: #ff6b6b; }
table.rank.hist td { font-size: 15px; }
table.rank.hist .res-w { color: #5dff7a; }
table.rank.hist .res-l { color: #ff8a8a; }
.hist-kind { opacity: .65; font-size: 12px; margin-left: 4px; }
.login-gate .gsi-wrap { margin: 18px 0 6px; }


/* Idioma */
.lang-btn { padding: 0; display: grid; place-items: center; }
.lang-btn .lang-flag { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.lang-opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.35); color: #fff; font: 800 18px var(--font-body, 'Nunito'), sans-serif; cursor: pointer; }
.lang-opt.on { border-color: var(--yellow); background: rgba(255,230,0,.15); }
.lang-opt .lang-flag { width: 30px; height: 20px; border-radius: 3px; object-fit: cover; }
.quit-result { min-width: 460px; }


/* Reloj de jugada online */
.turn-timer { position: absolute; left: calc(50% - 640px + 1060px); display: none; width: 58px; height: 58px; border-radius: 50%;
  place-items: center; font: 30px var(--font-title); color: #fff; background: rgba(0,0,0,.55); border: 4px solid var(--yellow); z-index: 40; }
.turn-timer.show { display: grid; }
.turn-timer.w0 { top: 610px; }
.turn-timer.w1 { top: 120px; }
.turn-timer.low { border-color: #ff4d4d; color: #ff6b6b; animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.m-toast { position: absolute; left: 50%; top: 200px; transform: translateX(-50%); padding: 10px 20px; border-radius: 999px;
  background: rgba(0,0,0,.8); color: #fff; font-weight: 800; font-size: 18px; opacity: 0; pointer-events: none; z-index: 60; white-space: nowrap; }
.m-toast.show { animation: toastIn 3.2s ease forwards; }
@keyframes toastIn { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.pause-left { margin: 10px 0 4px; font-weight: 800; font-size: 18px; }
.pause-left b { font: 30px var(--font-title); color: var(--yellow); }
.skip-btn { margin-top: 12px; }

/* Fotos en el ranking */
.rk-player { display: flex; align-items: center; gap: 10px; }
.rk-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(255,255,255,.25); }
.rk-pic.ph { display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 16px; }

.elo-rec { font-size: 12px; opacity: .75; font-weight: 800; }
