/* Pantalla de juego: estructura, jugadores, mano y tablero */
/* ───────── juego: estructura ───────── */
#game { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh; }
#topbar {
  display: flex; align-items: center; gap: 18px; padding: 8px 16px; color: #fbeccb;
  background: linear-gradient(#3d2410, #2a170a); border-bottom: 3px solid #8a5d2b; box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 2;
}
.brand { font-family: 'Cinzel', serif; font-weight: 900; font-size: 22px; color: var(--gold2); }
.code-pill { font-family: 'Nunito'; font-size: 12px; background: rgba(255,255,255,.12); color: #fbeccb; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.goal { font-weight: 800; }
.roll-mini { display: flex; align-items: center; gap: 4px; font-weight: 900; min-width: 90px; }
.roll-mini .seven { color: #ff7a6a; }
.mini-die { display: inline-grid; place-items: center; width: 24px; height: 24px; background: #fffaf0; color: #2a1c0e; border-radius: 5px; font-weight: 900; box-shadow: inset 0 -2px 0 #c9b98f; }
.bank { margin-left: auto; display: flex; gap: 10px; font-weight: 800; font-size: 14px; }
.bank span { display: flex; align-items: center; gap: 2px; }
#main { display: grid; grid-template-columns: 1fr 310px; min-height: 0; }
#board-wrap { position: relative; min-height: 0; min-width: 0; }
#board { width: 100%; height: 100%; display: block; }
#phase-msg {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; text-align: center;
  background: rgba(20,12,4,.78); color: #fbeccb; padding: 8px 18px; border-radius: 30px; font-weight: 800; font-size: 15px;
  border: 2px solid rgba(227,173,63,.4); max-width: 90%; pointer-events: none; transition: all .3s;
}
#phase-msg small { opacity: .7; font-weight: 600; }
#phase-msg.mine { background: linear-gradient(#ffe08a, #e3a531); color: var(--ink); border-color: #5a3a1e; animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(-50%) scale(1.04); } }
#side { display: flex; flex-direction: column; min-height: 0; background: rgba(10,20,30,.35); border-left: 2px solid rgba(255,255,255,.08); }
#players { padding: 10px; display: grid; gap: 8px; overflow: auto; flex: none; max-height: 58%; }
#log { flex: 1; overflow: auto; padding: 8px 12px; font-size: 13px; color: #dfe8ef; min-height: 60px; }
.lg { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.lg.turn { color: var(--gold2); font-weight: 800; margin-top: 4px; }
.lg.roll { color: #bfe3ff; }
.lg.bad { color: #ff9b8e; font-weight: 700; }
.lg.big, .lg.win { color: var(--gold2); font-weight: 800; }
.lg.chat { color: #fff; }
#chat { padding: 8px; }
#chat input { font-size: 13px; padding: 7px 10px; background: rgba(255,255,255,.9); }

/* jugadores */
.pl {
  background: linear-gradient(160deg, #f8eccd, #e7d2a2); border-radius: 12px; padding: 8px 10px;
  border: 2px solid #8a5d2b; box-shadow: inset 5px 0 0 var(--c); transition: transform .25s, box-shadow .25s;
}
.pl.active { box-shadow: inset 5px 0 0 var(--c), 0 0 0 3px var(--gold2), 0 0 22px rgba(255,213,107,.6); transform: scale(1.02); }
.pl.me .pl-name { text-decoration: underline var(--c) 3px; text-underline-offset: 3px; }
.pl-top { display: flex; align-items: center; gap: 8px; }
.pl-house { width: 26px; flex: none; }
.pl-name { font-weight: 900; flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-name em { font-weight: 600; font-size: 11px; opacity: .6; }
.pl-vp { font-family: 'Cinzel', serif; font-weight: 900; font-size: 22px; }
.pl-vp small { font-size: 13px; }
.pl-stats { display: flex; gap: 10px; font-size: 13px; font-weight: 800; opacity: .85; margin-top: 2px; }
.pl-awards { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pl-awards span { font-size: 11px; font-weight: 800; background: #2a1c0e; color: var(--gold2); padding: 1px 7px; border-radius: 8px; }
.pl-wait { font-size: 12px; font-weight: 800; color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.off { filter: grayscale(1); }

/* mano */
#bottom {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px; flex-wrap: wrap;
  background: linear-gradient(#3d2410, #24140a); border-top: 3px solid #8a5d2b; box-shadow: 0 -4px 14px rgba(0,0,0,.4); z-index: 2;
}
#hand { display: flex; gap: 8px; }
.rcard {
  width: 66px; height: 88px; border-radius: 9px; position: relative; display: grid; place-items: center;
  background: linear-gradient(170deg, #fffaf0 0 30%, var(--rc) 30%); border: 2px solid #2a1c0e;
  box-shadow: 0 4px 0 #120a04, inset 0 0 0 2px rgba(255,255,255,.5); transition: transform .2s, opacity .2s;
}
.rcard .ico { margin-top: -12px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.rcard .cnt {
  position: absolute; top: -9px; right: -9px; min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center;
  background: #2a1c0e; color: var(--gold2); font-weight: 900; font-size: 15px; border: 2px solid var(--gold); padding: 0 4px;
}
.rcard .lbl { position: absolute; bottom: 3px; font-size: 10.5px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.rcard.zero { opacity: .45; filter: saturate(.4); }
.rcard:hover { transform: translateY(-4px); }
.res-wood { --rc: var(--r-wood); } .res-brick { --rc: var(--r-brick); } .res-sheep { --rc: var(--r-sheep); }
.res-wheat { --rc: var(--r-wheat); } .res-ore { --rc: var(--r-ore); }
.pulse { animation: pulseA .5s ease-out; }
@keyframes pulseA { 40% { transform: scale(1.15); filter: brightness(1.3); } }

#devhand { display: flex; gap: 6px; align-items: center; }
.dev-empty { color: rgba(251,236,203,.45); font-size: 12px; font-weight: 700; }
.dcard {
  width: 62px; height: 84px; border-radius: 9px; border: 2px solid #2a1c0e; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(170deg, #f3e3ff, #9b7bc4); cursor: default; position: relative; padding: 4px; box-shadow: 0 4px 0 #120a04; color: var(--ink);
}
.dcard.dev-vp { background: linear-gradient(170deg, #fff4c4, #e3ad3f); }
.dcard.dev-knight { background: linear-gradient(170deg, #e8eef8, #8395b5); }
.dcard .de { font-size: 26px; }
.dcard .dn { font-size: 9.5px; font-weight: 900; text-align: center; line-height: 1.1; }
.dcard .dx { position: absolute; top: -8px; right: -8px; background: #2a1c0e; color: var(--gold2); border-radius: 10px; padding: 0 6px; font-weight: 900; font-size: 12px; }
.dcard.play { cursor: pointer; animation: btnGlow 1.6s infinite; }
.dcard.play:hover { transform: translateY(-5px) rotate(-2deg); }
#actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.build { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; }
.btn.build.on { background: linear-gradient(#bff0a8, #6fbf4a); box-shadow: 0 3px 0 #5a3a1e, 0 0 0 3px #fff; }
.cost { display: flex; gap: 1px; }
.ico { display: inline-block; vertical-align: middle; }

/* ───────── tablero SVG ───────── */
.water .waves { animation: waves 4s ease-in-out infinite; animation-delay: var(--d); }
@keyframes waves { 50% { transform: translateX(6px); opacity: .5; } }
.dock { stroke: #6b4421; stroke-width: 5; stroke-dasharray: 3 3; stroke-linecap: butt; }
.port-disc { fill: #f6ead0; stroke: #6b4421; stroke-width: 2.5; }
.port-disc.any { fill: #dff0fa; }
.port-txt { text-anchor: middle; font: 900 11px 'Nunito', sans-serif; fill: #2a1c0e; }
.hex { transition: filter .3s; }

.token { transform-box: fill-box; transform-origin: center; }
.token.down .front { display: none; }
.token.up .back { display: none; }
.token .num { text-anchor: middle; font: 900 19px 'Cinzel', serif; fill: #2a1c0e; }
.token .num.hot { fill: #c0262d; }
.token.flipping { animation: flip .8s ease-in-out both; }
.token.flipping .front { animation: showHalf .8s step-end both; animation-delay: inherit; }
.token.flipping .back { animation: hideHalf .8s step-end both; animation-delay: inherit; }
@keyframes flip {
  0% { transform: scale(1, 1); }
  45% { transform: scale(0, 1.35); }
  55% { transform: scale(0, 1.35); }
  80% { transform: scale(1.25, 1.25); }
  100% { transform: scale(1, 1); }
}
@keyframes showHalf { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes hideHalf { 0% { opacity: 1; } 50% { opacity: 0; } }
.token.down .back { animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { 50% { filter: brightness(1.25); } }
.token.bounce { animation: tokBounce .8s ease-out; }
@keyframes tokBounce { 30% { transform: scale(1.45) translateY(-6px); } 60% { transform: scale(.95); } }
.token-wrap.robbed .token { opacity: .45; }
.ring-burst { fill: none; stroke: #ffd56b; stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: burst .9s ease-out forwards; }
@keyframes burst { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; stroke-width: 1; } }

.hexglow { fill: rgba(255,226,120,.25); stroke: #ffd56b; stroke-width: 7; animation: hexGlow 1.6s ease-out forwards; }
.hexglow.blocked { fill: rgba(200,40,40,.3); stroke: #ff5a4a; }
.blockx { stroke: #ff5a4a; stroke-width: 7; stroke-linecap: round; animation: hexGlow 1.6s ease-out forwards; }
@keyframes hexGlow { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

.road.new { animation: roadGrow .5s cubic-bezier(.3,1.5,.5,1) both; transform-box: fill-box; transform-origin: center; }
@keyframes roadGrow { from { transform: scale(.05); opacity: 0; } }
.bld.new { animation: drop .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes drop { 0% { transform: translateY(-60px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }

#robber { transition: transform .9s cubic-bezier(.5,-0.3,.4,1.4); }
.robber-bob { animation: bob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.robber-bob.angry { animation: angry .25s ease-in-out 5; }
@keyframes angry { 25% { transform: rotate(-12deg) scale(1.15); } 75% { transform: rotate(12deg) scale(1.15); } }
.eye { animation: eye 3s infinite; }
@keyframes eye { 0%, 92%, 100% { opacity: 1; } 95% { opacity: 0; } }

.spot { fill: rgba(255,255,255,.55); stroke: #fff; stroke-width: 2.5; cursor: pointer; animation: spot 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.spot.city { fill: rgba(255,213,107,.3); stroke: var(--gold2); stroke-width: 3; }
.spot:hover { fill: var(--gold2); animation: none; transform: scale(1.3); }
@keyframes spot { 50% { transform: scale(1.25); opacity: .7; } }
.espot { stroke: rgba(255,255,255,.75); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 6 6; cursor: pointer; animation: ants 1s linear infinite; }
.espot:hover { stroke: var(--gold2); stroke-dasharray: none; stroke-width: 12; }
@keyframes ants { to { stroke-dashoffset: -24; } }
.hspot { fill: rgba(255,255,255,0); stroke: rgba(255,90,74,.0); stroke-width: 4; cursor: pointer; transition: all .15s; }
.hspot:hover { fill: rgba(255,90,74,.25); stroke: #ff5a4a; }
