/* ═════════════ 🎲 dados detallados · barras de arriba y abajo · relieve del mapa ═════════════ */

/* ---------- 🎲 dados ---------- */
#dice-stage { background: radial-gradient(circle at 50% 55%, rgba(20,10,0,.2), rgba(0,0,0,.66)); perspective: 1000px; }
.dice-row { position: relative; gap: 74px; }
.dice-tray { position: absolute; left: 50%; top: 50%; width: 370px; height: 146px; margin: -54px 0 0 -185px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 32%, #3fa452, #22713a 55%, #124a22 100%);
  box-shadow: inset 0 12px 26px rgba(0,0,0,.6), inset 0 -4px 12px rgba(255,255,255,.08),
    0 0 0 10px #7a4a22, 0 0 0 12px #4a2a10, 0 0 0 15px #e3ad3f, 0 0 0 17px #5a3a1e, 0 26px 40px rgba(0,0,0,.6);
  animation: trayIn .3s cubic-bezier(.3,1.4,.5,1); }
.dice-tray::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, rgba(0,0,0,0) 2px 5px); }
.dice-tray::after { content: ''; position: absolute; inset: 14px 40px; border-radius: 50%; border: 2px dashed rgba(255,230,160,.22); }
.tray-hit { position: absolute; left: 50%; top: 55%; width: 120px; height: 40px; margin: -20px 0 0 -60px; border-radius: 50%; border: 3px solid rgba(255,255,255,.55); opacity: 0; }
.dice-tray.bump { animation: trayBump .28s ease-out; }
.dice-tray.bump .tray-hit { animation: trayRing .5s ease-out; }
@keyframes trayIn { from { transform: scale(.6); opacity: 0; } }
@keyframes trayBump { 40% { transform: translateY(3px) scale(1.012, .975); } }
@keyframes trayRing { from { transform: scale(.4); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.die-wrap { z-index: 1; }
.die-shadow { left: 6px; right: 6px; bottom: -34px; height: 22px; background: rgba(0,0,0,.75); filter: blur(7px); opacity: .6; }
.face { border-radius: 18px; padding: 13px; }
.face::before { content: ''; position: absolute; left: 10%; top: 6%; width: 46%; height: 22%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(255,255,255,.55), rgba(255,255,255,0) 70%); transform: rotate(-14deg); }
.d-ivory .face { background: radial-gradient(circle at 30% 25%, #fffef9, #f4e9cf 58%, #ddc89a); border: 1.5px solid #c4ad78;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.55), inset -7px -9px 14px rgba(120,90,40,.28), inset 6px 6px 10px rgba(255,255,255,.7); }
.d-red .face { background: radial-gradient(circle at 30% 25%, #ff7565, #d42a1e 58%, #85120a); border: 1.5px solid #5e0a05;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.16), inset -7px -9px 14px rgba(50,0,0,.4), inset 6px 6px 10px rgba(255,190,180,.35); }
.face .pip::after { width: 16px; height: 16px; background: radial-gradient(circle at 40% 35%, #444, #050505);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.75); }
.d-ivory .f1 .pip::after { width: 22px; height: 22px; background: radial-gradient(circle at 40% 35%, #f0604e, #8e160d); }
.d-red .face .pip::after { background: radial-gradient(circle at 40% 35%, #ffffff, #e4ddd2); box-shadow: inset 0 2px 3px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.25); }
.d-red .f1 .pip::after { width: 22px; height: 22px; background: radial-gradient(circle at 40% 35%, #fff6c8, #e3ad3f); }
.core { position: absolute; inset: 3px; border-radius: 12px; }
.d-ivory .core { background: #d8c393; } .d-red .core { background: #8e140c; }
.core.cx { transform: rotateY(90deg); } .core.cy { transform: rotateX(90deg); }
/* resultado: una ficha con la suma */
.dice-sum { top: calc(50% + 118px); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0; text-shadow: none; }
.dice-sum small { font: 900 17px 'Nunito', sans-serif; color: #fbeccb; letter-spacing: 2px; text-shadow: 0 2px 0 #1b0d02; }
.dice-sum b { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; font: 900 52px/1 'Cinzel', serif; color: #2a1c0e;
  background: radial-gradient(circle at 40% 32%, #fffaf0, #e8d7ae 70%, #cdb37a); border: 4px solid #d9a441;
  box-shadow: 0 0 0 4px #5a3a1e, 0 5px 0 4px #3a210d, 0 14px 26px rgba(0,0,0,.6), 0 0 34px rgba(255,213,107,.65); }
.dice-sum em { font: 900 21px 'Cinzel', serif; font-style: normal; color: #ffd56b; margin-top: 8px; text-shadow: 0 2px 0 #1b0d02, 0 0 14px rgba(255,213,107,.7); white-space: nowrap; }
.dice-sum.hot b { color: #c8372d; }
.dice-sum.seven { font-size: 0; }
.dice-sum.seven b { color: #fff; background: radial-gradient(circle at 40% 32%, #ff7a6a, #c8241a 65%, #7a0e08); border-color: #ffcf4a;
  box-shadow: 0 0 0 4px #3a0505, 0 5px 0 4px #200202, 0 14px 26px rgba(0,0,0,.6), 0 0 44px rgba(255,40,30,.9); }
.dice-sum.seven em { color: #ff5a4a; font-size: 26px; text-shadow: 0 2px 0 #2a0505, 0 0 18px rgba(255,40,30,.9); }

/* ---------- barra de arriba ---------- */
#topbar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0) 40%, rgba(0,0,0,.18)),
    repeating-linear-gradient(176deg, rgba(0,0,0,0) 0 7px, rgba(0,0,0,.07) 7px 9px, rgba(0,0,0,0) 9px 15px, rgba(255,220,160,.04) 15px 16px),
    linear-gradient(#55321a, #2e1909);
  border: 0; border-bottom: 5px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #ffd56b 0 3px, #b8822e 3px 6px, #7a4f18 6px 8px) 5;
  box-shadow: 0 2px 0 #3a210d, 0 8px 18px rgba(0,0,0,.55);
}
.brand-hex { width: 34px; height: 34px; filter: drop-shadow(0 2px 0 #1b0d02) drop-shadow(0 0 6px rgba(255,213,107,.45)); }
.brand-name { color: #ffd56b; letter-spacing: .5px; text-shadow: 0 2px 0 #1b0d02, 0 0 12px rgba(255,213,107,.45); }
.code-pill { background: linear-gradient(#2a1608, #3d2410); border: 1px solid #b8822e; color: #ffe7a8; font-weight: 800; letter-spacing: .4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 rgba(255,220,160,.18); }
.tb-goal { position: relative; overflow: hidden; padding-bottom: 5px;
  background: linear-gradient(#fff0b0, #f2c24f 50%, #d48f1c); border: 2px solid #4a2a10;
  box-shadow: 0 3px 0 #1b0d02, inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,60,0,.35), 0 0 12px rgba(255,213,107,.35); }
.tb-goal::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #3d8a2e var(--pct, 0%), rgba(74,42,16,.3) var(--pct, 0%)); }
.tb-goal .star { filter: drop-shadow(0 1px 0 #7a4f18); }
.roll-mini { padding: 3px 8px 3px 5px; border-radius: 12px; background: rgba(0,0,0,.3); box-shadow: inset 0 2px 5px rgba(0,0,0,.55), 0 1px 0 rgba(255,220,160,.12); }
.mini-die { display: inline-grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 24px; height: 24px; padding: 3px; border-radius: 6px;
  font-size: 12px; place-items: center; animation: miniIn .45s cubic-bezier(.3,1.6,.5,1) both; }
.mini-die i { width: 4.4px; height: 4.4px; border-radius: 50%; }
.md-ivory { background: radial-gradient(circle at 30% 25%, #fffef9, #ecdcb4); color: #2a1c0e; box-shadow: inset 0 -3px 0 #c4ad78, 0 2px 4px rgba(0,0,0,.5); }
.md-ivory i.p { background: #1a1209; box-shadow: inset 0 1px 1px rgba(0,0,0,.7); }
.md-red { background: radial-gradient(circle at 30% 25%, #ff7565, #c8241a); color: #fff; box-shadow: inset 0 -3px 0 #7a0e08, 0 2px 4px rgba(0,0,0,.5); }
.md-red i.p { background: #fff; box-shadow: inset 0 1px 1px rgba(0,0,0,.35); }
.mini-die.off { display: inline-grid; place-items: center; grid-template-columns: 1fr; animation: none; font-weight: 900; color: #fbeccb;
  background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(255,213,107,.4); }
.md-red + .md-ivory { animation-delay: .08s; }
@keyframes miniIn { from { transform: rotate(-200deg) scale(.3); opacity: 0; } }
.roll-mini b { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 3px; border-radius: 50%; margin-left: 3px;
  background: radial-gradient(circle at 40% 32%, #fffaf0, #e2cc96); color: #2a1c0e; font: 900 16px 'Cinzel', serif;
  border: 2px solid #d9a441; box-shadow: 0 2px 0 #1b0d02; }
.roll-mini b.hot { color: #c8372d; }
.roll-mini b.seven { color: #fff; background: radial-gradient(circle at 40% 32%, #ff7a6a, #b81e14); border-color: #ffcf4a; }
.bank { padding: 3px 6px; border-radius: 14px; background: rgba(0,0,0,.22); box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 1px 0 rgba(255,220,160,.1); }
.bk { position: relative; padding: 2px 7px 2px 3px; border-radius: 8px 12px 12px 8px; background: linear-gradient(#3a2210, #24140a);
  border: 1px solid rgba(255,213,107,.28); box-shadow: inset 3px 0 0 var(--rc, #e3ad3f), 0 1px 0 rgba(0,0,0,.6); }
.bk.dev { --rc: #a77ad9; }
.bk b { color: #fff3d6; }
.bk.low { animation: lowPulse 1.6s ease-in-out infinite; }
@keyframes lowPulse { 50% { box-shadow: inset 3px 0 0 var(--rc), 0 0 8px rgba(255,90,70,.7); } }
.tbtn { border-radius: 12px; border: 1.5px solid #b8822e; color: #fff3d6;
  background: linear-gradient(#6a4220, #3e230d 55%, #2c1808);
  box-shadow: 0 3px 0 #140902, inset 0 1px 0 rgba(255,230,180,.28), inset 0 -2px 0 rgba(0,0,0,.25); transition: transform .12s, box-shadow .15s, filter .15s; }
.tbtn:hover { background: linear-gradient(#7d5028, #4a2a10 55%, #321c0a); box-shadow: 0 3px 0 #140902, 0 0 10px rgba(255,213,107,.35), inset 0 1px 0 rgba(255,230,180,.35); transform: translateY(-1px); }
.tbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #140902, inset 0 2px 4px rgba(0,0,0,.4); }
.tbtn.emote-top { background: linear-gradient(#fff0b0, #f2c24f 50%, #d48f1c); color: var(--ink); border-color: #4a2a10; box-shadow: 0 3px 0 #1b0d02, inset 0 1px 0 rgba(255,255,255,.8); }
.leave-btn { background: linear-gradient(#8a3020, #5a1a10 55%, #3a0e08) !important; }

/* ---------- barra de abajo ---------- */
#bottom {
  background:
    linear-gradient(0deg, rgba(0,0,0,.25), rgba(0,0,0,0) 45%, rgba(255,255,255,.05)),
    repeating-linear-gradient(4deg, rgba(0,0,0,0) 0 7px, rgba(0,0,0,.07) 7px 9px, rgba(0,0,0,0) 9px 15px, rgba(255,220,160,.04) 15px 16px),
    linear-gradient(#4a2b12, #241309);
  border: 0; border-top: 5px solid transparent;
  border-image: repeating-linear-gradient(45deg, #ffd56b 0 3px, #b8822e 3px 6px, #7a4f18 6px 8px) 5;
  box-shadow: 0 -2px 0 #3a210d, 0 -8px 18px rgba(0,0,0,.5);
}
/* bandeja de fieltro para las cartas */
#hand { position: relative; padding: 9px 11px 7px; border-radius: 16px;
  background: radial-gradient(ellipse at 50% 30%, #2f6a3a, #1b4424 75%);
  box-shadow: inset 0 4px 10px rgba(0,0,0,.6), 0 0 0 3px #6b4226, 0 0 0 5px #b8822e, 0 3px 0 5px #1b0d02; }
#hand::before { content: ''; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, rgba(0,0,0,0) 2px 5px); }
#devhand { background: radial-gradient(ellipse at 50% 30%, #4a2f6a, #2a1a44 75%); box-shadow: inset 0 3px 8px rgba(0,0,0,.6), 0 0 0 3px #6b4226, 0 0 0 5px #b8822e, 0 3px 0 5px #1b0d02; }
#devhand:has(.dev-empty) { background: none; box-shadow: none; }
.dev-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 150px; height: 74px; padding: 4px 12px;
  border-radius: 12px; border: 2px dashed rgba(255,213,107,.3); color: rgba(251,236,203,.6); font-size: 12px; font-weight: 800; text-align: center; }
.dev-empty span { font-size: 20px; opacity: .55; filter: grayscale(.3); }
.dev-empty small { font-size: 10.5px; font-weight: 700; opacity: .75; }
@media (max-height: 820px) and (min-width: 761px) { .dev-empty { height: 64px; } .dev-empty span { font-size: 16px; } }
/* cartas de recurso con marco, medallón y brillo */
.rcard { border: 2px solid #1e1208; overflow: visible;
  background: linear-gradient(170deg, #fffdf6 0 28%, #f3e6c6 28% 30%, var(--rc) 30%),
    var(--rc);
  box-shadow: 0 4px 0 #120a04, 0 6px 10px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.55), inset 0 0 0 4px rgba(0,0,0,.12); }
.rcard::before { content: ''; position: absolute; left: 50%; top: 46%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.75), rgba(255,255,255,.15) 70%); box-shadow: 0 0 0 2px rgba(255,255,255,.5), inset 0 -3px 6px rgba(0,0,0,.15); }
.rcard .ico { position: relative; }
.rcard .lbl { left: 3px; right: 3px; bottom: 3px; padding: 1px 0; border-radius: 0 0 6px 6px; text-align: center; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.35)); }
.rcard .cnt { background: radial-gradient(circle at 40% 32%, #fff3c4, #e3ad3f 60%, #a8742a); color: #2a1c0e; border: 2px solid #4a2a10;
  box-shadow: 0 2px 0 #1b0d02, inset 0 1px 0 rgba(255,255,255,.7); font-family: 'Cinzel', serif; }
.rcard.zero .cnt { background: #3a2a1a; color: #c9b98f; border-color: #6b4a2a; }
.rcard:not(.zero) { animation: cardIdle 4s ease-in-out infinite; }
.rcard:not(.zero):nth-child(2) { animation-delay: -.8s; } .rcard:not(.zero):nth-child(3) { animation-delay: -1.6s; }
.rcard:not(.zero):nth-child(4) { animation-delay: -2.4s; } .rcard:not(.zero):nth-child(5) { animation-delay: -3.2s; }
@keyframes cardIdle { 50% { translate: 0 -2px; } }
/* tu placa */
#mebox { position: relative; background: linear-gradient(160deg, #fff8e2, #ecd7a4 60%, #d9bb78); border: 2px solid #4a2a10;
  box-shadow: inset 6px 0 0 var(--c), 0 0 0 2px #b8822e, 0 4px 0 2px #120a04, 0 8px 14px rgba(0,0,0,.4); }
#mebox::after { content: ''; position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c4, #b8822e); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.me-bar { display: block; width: 100%; height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(74,42,16,.3); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); overflow: hidden; }
.me-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #6fbf4a, #3d8a2e); transition: width .6s; }
/* botones de acción con relieve */
#actions .btn { border: 2px solid #4a2a10; border-radius: 12px;
  box-shadow: 0 4px 0 #1b0d02, 0 6px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -3px 0 rgba(0,0,0,.15); }
#actions .btn:hover:not(:disabled) { box-shadow: 0 4px 0 #1b0d02, 0 0 14px rgba(255,213,107,.5), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -3px 0 rgba(0,0,0,.15); }
#actions .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #1b0d02, inset 0 2px 4px rgba(0,0,0,.25); }
#actions .btn.build { background: linear-gradient(#fffaf0, #ecdcb4 60%, #d9c08a); }
#actions .btn.build.on { background: linear-gradient(#d6ffbf, #6fbf4a); box-shadow: 0 0 0 3px #ffd56b, 0 0 16px rgba(255,213,107,.8), 0 4px 0 #1b0d02; }
#actions .btn.red { background: linear-gradient(#ff8a7a, #d23a2e 55%, #9a1c12); }
.roll-btn { position: relative; overflow: hidden; background: linear-gradient(#fff3c4, #f2c24f 45%, #d48f1c) !important; }
.roll-btn::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.65) 45%, rgba(255,255,255,0) 55%); background-size: 250% 100%; animation: shineLoop 2.6s ease-in-out infinite; }
@keyframes shineLoop { 0%, 40% { background-position: 130% 0; } 100% { background-position: -70% 0; } }
.rb-dice { display: inline-block; animation: rbShake 1.6s ease-in-out infinite; }
@keyframes rbShake { 0%, 60%, 100% { transform: none; } 66% { transform: rotate(-22deg) scale(1.15); } 74% { transform: rotate(18deg) scale(1.15); } 82% { transform: rotate(-10deg); } 90% { transform: rotate(6deg); } }


/* ---------- celular y pantallas chicas ---------- */
@media (max-width: 760px) {
  .dice-tray { width: 380px; height: 150px; margin: -55px 0 0 -190px; }
  .dice-sum { top: calc(50% + 84px); }
  .dice-sum b { width: 74px; height: 74px; font-size: 42px; }
  .dice-sum em { font-size: 17px; } .dice-sum.seven em { font-size: 20px; }
  .dice-sum small { font-size: 14px; }
  .mini-die { width: 21px; height: 21px; padding: 2.5px; } .mini-die i { width: 3.8px; height: 3.8px; }
  .roll-mini { padding: 2px 6px 2px 4px; } .roll-mini b { min-width: 24px; height: 24px; font-size: 14px; }
  .brand-hex { width: 28px; height: 28px; }
  #hand { padding: 7px 7px 5px; box-shadow: inset 0 3px 8px rgba(0,0,0,.6), 0 0 0 2px #6b4226, 0 0 0 4px #b8822e, 0 2px 0 4px #1b0d02; }
  #devhand { box-shadow: none; background: none; }
  .rcard::before { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  #topbar, #bottom { border-image-width: 4px; }
  .bank { padding: 2px 4px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .rcard::before { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
  .dice-sum { top: calc(50% + 70px); } .dice-sum b { width: 60px; height: 60px; font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .rcard:not(.zero), .rb-dice, .roll-btn::after, .bk.low, .mini-die { animation: none !important; }
}

/* ---------- 🎲 dados 3D ---------- */
.dice3d-host { position: absolute; inset: 0; pointer-events: none; }
.dice3d-host canvas { width: 100%; height: 100%; display: block; }
#dice-stage.d3 .dice-row { display: none; }
#dice-stage.d3 { background: radial-gradient(circle at 50% 50%, rgba(15,8,2,.35), rgba(0,0,0,.72)); }
#dice-stage.d3 .dice-sum { top: auto; bottom: 7%; z-index: 2; }
@media (max-width: 760px) { #dice-stage.d3 .dice-sum { bottom: 12%; } }
@media (max-height: 520px) and (orientation: landscape) { #dice-stage.d3 .dice-sum { bottom: 3%; } #dice-stage.d3 .dice-sum b { width: 56px; height: 56px; font-size: 32px; } #dice-stage.d3 .dice-sum em { font-size: 15px; } }

/* 🎲 dados simples con el diseño comprado en la tienda (colores que pone fx.js) */
#dice-stage.skinned #die1 .face { background: radial-gradient(circle at 30% 25%, var(--d1a), var(--d1b) 58%, var(--d1c)); border-color: var(--d1c); }
#dice-stage.skinned #die2 .face { background: radial-gradient(circle at 30% 25%, var(--d2a), var(--d2b) 58%, var(--d2c)); border-color: var(--d2c); }
#dice-stage.skinned #die1 .face .pip::after { background: radial-gradient(circle at 40% 35%, var(--p1a), var(--p1b)); }
#dice-stage.skinned #die2 .face .pip::after { background: radial-gradient(circle at 40% 35%, var(--p2a), var(--p2b)); }
#dice-stage.skinned #die1 .f1 .pip::after { background: radial-gradient(circle at 40% 35%, var(--u1a), var(--u1b)); }
#dice-stage.skinned #die2 .f1 .pip::after { background: radial-gradient(circle at 40% 35%, var(--u2a), var(--u2b)); }
