:root{
  --bg0:#060a14; --bg1:#0a1230;
  --glass: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);

  --alejo:#40e0a0;
  --sofia:#ff66c4;
  --mercedes:#58a6ff;
  --lionel:#ffcc33;

  --neutralFill: rgba(255,255,255,.07);
  --neutralStroke: rgba(255,255,255,.18);

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --shadow2: 0 12px 30px rgba(0,0,0,.35);
  --r: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(88,166,255,.22), transparent 60%),
    radial-gradient(1100px 600px at 80% 20%, rgba(255,102,196,.18), transparent 60%),
    radial-gradient(900px 500px at 55% 85%, rgba(64,224,160,.12), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  overflow-x:hidden;
}

.app{
  max-width:1320px;
  margin:0 auto;
  padding:14px 14px calc(14px + env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns:360px 1fr;
  gap:14px;
  min-height:100%;
}
@media (max-width: 980px){
  .app{grid-template-columns:1fr;}
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border:1px solid var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card2{
  background: rgba(0,0,0,.14);
  border:1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow2);
}

.panel{padding:14px}
.mapWrap{padding:14px; position:relative; overflow:hidden}

.head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.head h1{margin:0; font-size:18px}
.pill{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.toast{margin-top:6px; min-height:18px; font-size:13px; color:rgba(255,255,255,.88)}
.hint{color:var(--muted); font-size:13px; line-height:1.35; margin-top:10px}
.label{color:var(--muted); font-size:12px}

.room{padding:12px; margin-top:12px}
.roomRow{display:flex; gap:10px; align-items:center; justify-content:space-between; margin-top:10px}
.roomCode{font-weight:1000; font-size:18px; letter-spacing:1px}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline:none;
}
.input::placeholder{color: rgba(255,255,255,.45)}

.turnBox{margin-top:12px; padding:12px; border:1px solid var(--stroke); border-radius:16px; background: rgba(0,0,0,.14); box-shadow: var(--shadow2)}
.turnTop{display:flex; align-items:center; justify-content:space-between; gap:10px}
.turnSub{margin-top:8px; font-size:13px; color:var(--muted); line-height:1.35}
.who{display:flex; align-items:center; gap:10px; font-weight:1000}
.dot{width:12px; height:12px; border-radius:6px; outline:2px solid rgba(255,255,255,.2); outline-offset:3px; background: var(--neutralFill)}

.players{margin-top:12px; display:grid; gap:10px}
.player{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px; border-radius:16px; border:1px solid var(--stroke); background: rgba(0,0,0,.10)}
.player .left{display:flex; align-items:center; gap:10px}
.player .name{font-weight:1000; font-size:14px}

.actions{margin-top:12px; display:grid; gap:10px}

.btn{
  cursor:pointer;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight:1000;
  border-radius:14px;
  padding:10px 12px;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active{transform: scale(.99)}
.btn.primary{background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.26)}
.btn.danger{background: rgba(255,80,80,.12); border-color: rgba(255,80,80,.28)}
.btn.small{padding:8px 10px; font-size:13px; border-radius:12px}
.btn:disabled{opacity:.5; cursor:not-allowed}

.dice{padding:12px; margin-top:12px}
.diceTop{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.diceRow{display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap}
.diceNum{font-size:26px; font-weight:1000}

.mapHeader{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px}
.mapHeader h2{margin:0; font-size:16px}
.mapHeader p{margin:4px 0 0 0; color:var(--muted); font-size:13px; line-height:1.35}

.legend{display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; font-size:12px; color:var(--muted)}
.legend span{border:1px solid var(--stroke); background: rgba(0,0,0,.12); border-radius:999px; padding:6px 10px; display:flex; gap:8px; align-items:center}

.svgBox{
  border:1px solid var(--stroke);
  background:
    radial-gradient(900px 500px at 35% 25%, rgba(88,166,255,.18), rgba(0,0,0,0) 55%),
    radial-gradient(900px 520px at 70% 55%, rgba(64,224,160,.12), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.18));
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--shadow2);
  position:relative;
}
svg{width:100%; height:auto; display:block}

.country{
  fill: var(--neutralFill);
  stroke: var(--neutralStroke);
  stroke-width: 2;
  cursor:pointer;
  transition: filter .14s ease, fill .14s ease, stroke .14s ease;
}
.country:hover{filter: brightness(1.12)}

.countryLabel{
  fill: rgba(255,255,255,.86);
  font-weight: 900;
  font-size: 14px;
  pointer-events:none;
}
.abbr{
  fill: rgba(255,255,255,.7);
  font-weight: 900;
  font-size: 12px;
  pointer-events:none;
}

.overlay{
  position:absolute; inset:0;
  display:none;
  align-items:center; justify-content:center;
  padding:18px;
  background: radial-gradient(800px 500px at 50% 35%, rgba(255,255,255,.12), rgba(0,0,0,.70));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index:20;
}
.overlay.show{display:flex;}
.overlayCard{
  width:min(520px,100%);
  border-radius:20px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(10,18,48,.55);
  box-shadow: var(--shadow);
  padding:16px;
  text-align:center;
}
.overlayCard h3{margin:0; font-size:22px; letter-spacing:.6px}
.overlayCard p{margin:10px 0 14px; color:var(--muted); font-size:14px; line-height:1.35}
.bigWho{display:flex; align-items:center; justify-content:center; gap:12px; margin:10px 0 14px; font-weight:1000; font-size:18px}
.bigDot{width:14px; height:14px; border-radius:7px; outline:3px solid rgba(255,255,255,.18); outline-offset:4px}
.tiny{font-size:12px}
.muted{color:var(--muted)}
