/* ============================================================
   CUCARACHA — mock de interfaz (HTML + CSS, sin dependencias)
   ============================================================ */

:root{
  --wood-dark:#1b0f06;
  --wood-mid:#2a180b;
  --walnut:#4b2a12;
  --walnut-lt:#6b3d1a;
  --oak:#c99553;
  --oak-lt:#e8bd7d;
  --orange:#e08b1e;
  --orange-hi:#ffc262;
  --gold:#f0b64a;
  --gold-dim:#c8912f;
  --cream:#f3e7d2;
  --text:#e9dcc4;
  --text-dim:#a89272;
  --green:#4ade5a;
  --green-deep:#1d6b26;
  --red:#ef5b4c;
  --panel-1:#241608;
  --panel-2:#150c04;
  --line:rgba(240,182,74,.22);
  --radius:14px;
  --shadow-panel:0 10px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,150,.06);
}

*{box-sizing:border-box;margin:0;padding:0}

html,body{height:100%}

body{
  font-family:"Segoe UI",Roboto,-apple-system,"Helvetica Neue",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(120,70,25,.35), transparent 60%),
    repeating-linear-gradient(96deg,
      rgba(0,0,0,.22) 0 3px,
      rgba(255,255,255,.02) 3px 7px,
      rgba(0,0,0,.10) 7px 13px),
    linear-gradient(160deg,#241505,#140b04 55%,#0d0703);
  background-attachment:fixed;
  padding:18px;
  min-height:100%;
}

/* ---------------- layout ---------------- */

.app{
  display:grid;
  grid-template-columns:320px minmax(420px,1fr) 340px;
  gap:18px;
  max-width:1600px;
  margin:0 auto;
  align-items:start;
}

.col{display:flex;flex-direction:column;gap:16px}

/* ---------------- paneles ---------------- */

.panel{
  background:linear-gradient(165deg,var(--panel-1),var(--panel-2));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-panel);
  padding:14px 16px 16px;
}

.panel-head{
  display:flex;
  align-items:center;
  gap:9px;
  padding-bottom:11px;
  margin-bottom:11px;
  border-bottom:1px solid rgba(240,182,74,.16);
}
.panel-head.center{justify-content:center;border-bottom-color:transparent;padding-bottom:2px;margin-bottom:12px}

.panel-head h2{
  flex:1;
  font-size:.82rem;
  font-weight:700;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:var(--gold);
}
.panel-head.center h2{flex:0;text-align:center}

.panel-icon{font-size:1rem;line-height:1;filter:saturate(1.2)}

.chip-info{
  width:22px;height:22px;border-radius:50%;
  background:linear-gradient(180deg,#3a2510,#1c1006);
  border:1px solid var(--gold-dim);
  color:var(--gold);
  font:italic 700 .78rem/1 Georgia,serif;
  cursor:pointer;
}
.chip-info.sm{width:17px;height:17px;font-size:.66rem;display:inline-flex;align-items:center;justify-content:center;vertical-align:-3px}

/* ---------------- logo ---------------- */

.logo-plate{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:14px 16px 16px;
  border-radius:var(--radius);
  background:linear-gradient(165deg,#2b1a09,#100903);
  border:1px solid rgba(240,182,74,.35);
  box-shadow:var(--shadow-panel), inset 0 0 30px rgba(240,182,74,.07);
}
.logo-bug{width:38px;height:44px;margin-bottom:-4px}

.logo-title{
  font-family:Georgia,"Times New Roman",serif;
  font-size:2.05rem;
  letter-spacing:.09em;
  font-weight:700;
  background:linear-gradient(180deg,#ffe9a8 8%,#f0b64a 42%,#a86c14 78%,#f7d489 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  text-shadow:0 2px 3px rgba(0,0,0,.6);
}
.logo-flourish{color:var(--gold-dim);font-size:.7rem;letter-spacing:.4em;margin-top:2px}

/* ---------------- lista de datos ---------------- */

.stat-list{display:flex;flex-direction:column}
.stat-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  padding:8px 2px;
  font-size:.92rem;
  border-bottom:1px dashed rgba(240,182,74,.10);
}
.stat-row:last-child{border-bottom:0}
.stat-row dt{color:var(--text)}
.stat-row dd{font-weight:600;color:var(--cream)}

.val-gold{color:var(--gold)!important}
.val-green{color:var(--green)!important}
.val-red{color:var(--red)}

/* ---------------- jugadores ---------------- */

.player-list{list-style:none;display:flex;flex-direction:column}

.player{
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px 8px;
  border-radius:10px;
  border:1px solid transparent;
  border-bottom:1px solid rgba(240,182,74,.10);
}
.player:last-child{border-bottom-color:transparent}

.player.is-active{
  background:linear-gradient(180deg,rgba(224,139,30,.18),rgba(224,139,30,.05));
  border-color:rgba(240,182,74,.5);
  box-shadow:inset 0 0 18px rgba(240,182,74,.10);
}

.player-rank{
  flex:none;
  width:24px;height:24px;border-radius:50%;
  display:grid;place-items:center;
  font-size:.74rem;font-weight:700;
  color:#2a1a06;
  background:radial-gradient(circle at 35% 28%,#ffe6a6,#c9902f);
  border:1px solid #8a5f18;
}

.avatar{
  flex:none;
  width:38px;height:38px;border-radius:50%;
  display:grid;place-items:center;
  font-weight:700;font-size:1rem;color:#fff;
  border:2px solid rgba(240,182,74,.45);
  box-shadow:0 3px 8px rgba(0,0,0,.5);
}
.avatar-lg{width:46px;height:46px;font-size:1.2rem}
.av-1{background:linear-gradient(150deg,#a2506b,#5c2338)}
.av-2{background:linear-gradient(150deg,#4c7fa8,#22405c)}
.av-3{background:linear-gradient(150deg,#c98a3a,#7a4614)}
.av-4{background:linear-gradient(150deg,#5c8a63,#2b4a30)}

.player-id{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.player-id strong{font-size:.96rem;color:var(--cream)}
.player-id em{font-style:normal;font-size:.8rem;color:var(--text-dim)}
.player-money{font-size:.86rem;font-weight:600;color:var(--text)}

.dot-online{
  display:inline-block;width:7px;height:7px;border-radius:50%;
  background:var(--green);
  box-shadow:0 0 7px rgba(74,222,90,.8);
  vertical-align:1px;margin-left:3px;
}

.kebab{
  flex:none;background:none;border:0;color:var(--text-dim);
  font-size:1.15rem;line-height:1;cursor:pointer;padding:4px 6px;border-radius:6px;
}
.kebab:hover{color:var(--gold);background:rgba(240,182,74,.10)}

/* ---------------- barra de turno ---------------- */

.turn-bar{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 18px;
  border-radius:var(--radius);
  background:linear-gradient(165deg,var(--panel-1),var(--panel-2));
  border:1px solid rgba(240,182,74,.35);
  box-shadow:var(--shadow-panel);
}
.turn-text{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px}
.turn-label{
  font-size:.74rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--gold);font-weight:700;
}
.turn-name{font-size:1.25rem;font-weight:600;color:var(--cream)}
.turn-name em{font-style:normal;color:var(--text-dim);font-size:1.05rem}

/* ---------------- tablero ---------------- */

.board-frame{
  padding:14px;
  border-radius:22px;
  background:
    linear-gradient(180deg,var(--walnut-lt),var(--walnut) 45%,#341b0a);
  box-shadow:
    0 24px 46px rgba(0,0,0,.65),
    inset 0 2px 0 rgba(255,205,140,.22),
    inset 0 -3px 6px rgba(0,0,0,.5);
}

.board-inner{
  padding:11px;
  border-radius:16px;
  background:linear-gradient(180deg,var(--orange-hi),var(--orange) 40%,#a75b0d);
  box-shadow:
    inset 0 2px 0 rgba(255,225,170,.55),
    inset 0 -3px 5px rgba(0,0,0,.35),
    0 3px 10px rgba(0,0,0,.4);
}

.board-wood{
  position:relative;
  border-radius:10px;
  overflow:hidden;
  padding:16px 10px;
  background:
    repeating-linear-gradient(92deg,
      rgba(120,72,28,.16) 0 2px,
      rgba(255,214,150,.05) 2px 6px,
      rgba(100,58,20,.10) 6px 11px,
      rgba(255,225,170,.03) 11px 17px),
    radial-gradient(140% 80% at 50% 0%, #e3b57a, transparent 70%),
    linear-gradient(180deg,#d7a468,#b87f42 55%,#9c672f);
  box-shadow:
    inset 0 0 40px rgba(90,50,15,.5),
    inset 0 2px 3px rgba(0,0,0,.35);
}

/* junta central de las dos tablas de madera */
.board-seam{
  position:absolute;
  top:0;bottom:0;left:50%;width:3px;
  transform:translateX(-50%);
  background:linear-gradient(90deg,
    rgba(0,0,0,0), rgba(80,44,14,.45) 35%, rgba(255,220,170,.18) 55%, rgba(0,0,0,0));
  pointer-events:none;
}

.bug{
  position:relative;
  display:block;
  width:100%;
  height:auto;
  max-height:78vh;
  margin:0 auto;
}

/* ---------------- posiciones (24 slots) ---------------- */

.slot{cursor:pointer}

.slot .chip{
  fill:url(#gSlot);
  stroke:#54463a;
  stroke-width:2.5;
  transition:fill .35s ease, stroke .25s ease, stroke-width .25s ease;
}

.slot .num{
  text-anchor:middle;
  font-family:"Segoe UI",Arial,sans-serif;
  font-size:22px;
  font-weight:700;
  fill:#1a1208;
  pointer-events:none;
  transition:fill .35s ease;
}
.slot-tail .num{font-size:25px}

.slot:hover .chip{stroke:var(--gold);stroke-width:3.5}

/* disponible */
.slot.is-available .chip{
  stroke:#ffdf5e;
  stroke-width:3.5;
  filter:drop-shadow(0 0 6px rgba(255,223,94,.9));
  animation:pulse-avail 1.6s ease-in-out infinite;
}
@keyframes pulse-avail{
  0%,100%{filter:drop-shadow(0 0 4px rgba(255,223,94,.55))}
  50%    {filter:drop-shadow(0 0 11px rgba(255,223,94,1))}
}

/* seleccionada */
.slot.is-selected .chip{
  stroke:#ffc93c;
  stroke-width:4.5;
  filter:drop-shadow(0 0 10px rgba(255,201,60,.95));
}

/* ocupada / completada */
.slot.is-filled .chip{
  fill:url(#gSlotOn);
  stroke:#12551a;
  animation:pop-in .45s cubic-bezier(.2,1.5,.4,1);
  transform-box:fill-box;
  transform-origin:center;
}
.slot.is-filled .num{fill:#0d3d10}
@keyframes pop-in{
  0%  {transform:scale(.4);opacity:.2}
  70% {transform:scale(1.16)}
  100%{transform:scale(1);opacity:1}
}

/* ---------------- leyenda ---------------- */

.legend{
  display:flex;flex-wrap:wrap;justify-content:center;gap:18px;
  font-size:.8rem;color:var(--text-dim);
}
.legend-item{display:flex;align-items:center;gap:7px}
.lg{width:14px;height:14px;border-radius:50%;display:inline-block;border:2px solid #54463a;background:#ddd6c6}
.lg-avail{border-color:#ffdf5e;box-shadow:0 0 7px rgba(255,223,94,.8)}
.lg-sel{border-color:#ffc93c;box-shadow:0 0 9px rgba(255,201,60,.9)}
.lg-fill{background:#49c93f;border-color:#12551a}

/* ---------------- barra superior derecha ---------------- */

.topbar{display:flex;justify-content:flex-end;gap:10px}

.icon-btn{
  width:52px;height:52px;
  border-radius:12px;
  display:grid;place-items:center;
  color:var(--cream);
  background:linear-gradient(165deg,#2b1a09,#120a04);
  border:1px solid rgba(240,182,74,.30);
  box-shadow:var(--shadow-panel);
  cursor:pointer;
}
.icon-btn svg{width:24px;height:24px;fill:currentColor}
.icon-btn:hover{color:var(--gold);border-color:var(--gold)}

/* ---------------- dados ---------------- */

.dice-tray{display:flex;justify-content:space-between;gap:8px;padding:4px 0 2px}

.die{
  --pip:#1a1208;
  width:54px;height:54px;
  flex:none;
  border-radius:12px;
  background:linear-gradient(155deg,#fffdf6,#ddd6c6 70%,#b9b0a0);
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -3px 5px rgba(120,110,95,.5),
    0 4px 9px rgba(0,0,0,.5);
  display:grid;
  grid-template:repeat(3,1fr)/repeat(3,1fr);
  padding:8px;
}
.die i{
  width:9px;height:9px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#4a4038,var(--pip));
  align-self:center;justify-self:center;
  box-shadow:inset 0 1px 1px rgba(0,0,0,.6);
}
.die-mini{width:34px;height:34px;border-radius:8px;padding:5px}
.die-mini i{width:6px;height:6px}
.die-mini.dark{
  background:linear-gradient(155deg,#f4f1e8,#cfc7b6);
}

/* caras — posiciones en la cuadrícula 3×3 */
.f1 i:nth-child(1){grid-area:2/2}

.f2 i:nth-child(1){grid-area:1/1}
.f2 i:nth-child(2){grid-area:3/3}

.f3 i:nth-child(1){grid-area:1/1}
.f3 i:nth-child(2){grid-area:2/2}
.f3 i:nth-child(3){grid-area:3/3}

.f4 i:nth-child(1){grid-area:1/1}
.f4 i:nth-child(2){grid-area:1/3}
.f4 i:nth-child(3){grid-area:3/1}
.f4 i:nth-child(4){grid-area:3/3}

.f5 i:nth-child(1){grid-area:1/1}
.f5 i:nth-child(2){grid-area:1/3}
.f5 i:nth-child(3){grid-area:2/2}
.f5 i:nth-child(4){grid-area:3/1}
.f5 i:nth-child(5){grid-area:3/3}

.f6 i:nth-child(1){grid-area:1/1}
.f6 i:nth-child(2){grid-area:1/3}
.f6 i:nth-child(3){grid-area:2/1}
.f6 i:nth-child(4){grid-area:2/3}
.f6 i:nth-child(5){grid-area:3/1}
.f6 i:nth-child(6){grid-area:3/3}

.dice-caption{
  text-align:center;
  margin-top:12px;
  font-size:1rem;
  color:var(--cream);
}

.hint{
  margin-top:12px;
  padding:9px 11px;
  border-radius:9px;
  font-size:.82rem;
  color:var(--text);
  background:rgba(240,182,74,.07);
  border:1px solid rgba(240,182,74,.16);
}
.hint b{color:var(--gold)}

/* ---------------- botón lanzar ---------------- */

.roll-box{display:flex;align-items:stretch;gap:8px}

.nav-arrow{
  width:34px;
  border-radius:10px;
  background:linear-gradient(180deg,#2b1a09,#150c04);
  border:1px solid rgba(240,182,74,.22);
  color:var(--gold);
  font-size:1.4rem;line-height:1;
  cursor:pointer;
}
.nav-arrow:hover{background:rgba(240,182,74,.14)}

.btn-roll{
  flex:1;
  display:flex;align-items:center;justify-content:center;gap:12px;
  padding:20px 10px;
  border-radius:12px;
  cursor:pointer;
  color:#eafbe6;
  font-size:1.5rem;font-weight:700;letter-spacing:.06em;
  background:linear-gradient(180deg,#3f9a3a,#1f6a22 55%,#134a17);
  border:1px solid #6fd063;
  box-shadow:
    inset 0 2px 0 rgba(190,255,180,.45),
    inset 0 -4px 8px rgba(0,0,0,.35),
    0 6px 16px rgba(0,0,0,.5);
  text-shadow:0 2px 3px rgba(0,0,0,.5);
  transition:transform .12s ease, filter .12s ease;
}
.btn-roll:hover{filter:brightness(1.1)}
.btn-roll:active{transform:translateY(2px)}

.roll-sub{
  text-align:center;
  margin-top:10px;
  font-size:.86rem;
  color:var(--text-dim);
}

/* ---------------- historial de lanzamientos ---------------- */

.roll-log{list-style:none;display:flex;flex-direction:column;gap:8px}
.roll-log li{
  display:flex;align-items:center;gap:11px;
  padding:9px 11px;
  border-radius:10px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(240,182,74,.12);
}
.roll-n{
  flex:none;width:26px;height:26px;border-radius:50%;
  display:grid;place-items:center;
  font-size:.78rem;font-weight:700;color:#2a1a06;
  background:radial-gradient(circle at 35% 28%,#ffe6a6,#c9902f);
}
.roll-vals{flex:1;font-size:1rem;letter-spacing:.06em;color:var(--cream)}
.roll-hits{display:flex;gap:5px}
.hit{
  width:23px;height:23px;border-radius:50%;
  display:grid;place-items:center;
  font-style:normal;font-size:.76rem;font-weight:700;
  color:#eafbe6;
  background:radial-gradient(circle at 35% 28%,#5fd35a,#1c6b22);
  border:1px solid #6fd063;
}
.roll-hits.none{color:var(--text-dim);font-size:1rem}

/* ---------------- último evento ---------------- */

.event-text{font-size:.95rem;line-height:1.5;color:var(--cream)}
.event-time{margin-top:7px;font-size:.78rem;color:var(--text-dim)}

/* ---------------- responsive ---------------- */

@media (max-width:1240px){
  .app{grid-template-columns:1fr 1fr}
  .col-center{grid-column:1 / -1;order:-1}
}

@media (max-width:820px){
  body{padding:12px}
  .app{grid-template-columns:1fr;gap:14px}
  .col-center{order:0}
  .bug{max-height:none}
  .logo-title{font-size:1.7rem}
  .turn-name{font-size:1.05rem}
  .die{width:46px;height:46px;padding:7px}
  .die i{width:8px;height:8px}
  .btn-roll{font-size:1.25rem;padding:16px 8px}
}

@media (max-width:420px){
  .die{width:38px;height:38px;padding:6px}
  .die i{width:6px;height:6px}
  .board-frame{padding:9px;border-radius:16px}
  .board-inner{padding:7px}
}

@media (prefers-reduced-motion:reduce){
  .slot .chip,.slot .num{transition:none}
  .slot.is-available .chip,.slot.is-filled .chip{animation:none}
}
