    :root {
      --bg: #111827;
      --panel: #1f2937;
      --panel-2: #243041;
      --text: #f3f4f6;
      --muted: #9ca3af;
      --accent: #f59e0b;
      --accent-2: #fb7185;
      --good: #22c55e;
      --bad: #ef4444;
      --border: rgba(255,255,255,0.08);
      --shadow: 0 12px 30px rgba(0,0,0,0.35);
      --radius: 18px;
      --card-shadow: 0 16px 34px rgba(0,0,0,0.28);
      --type-rock: #ef4444;
      --type-paper: #3b82f6;
      --type-scissors: #22c55e;
      --type-special: #a855f7;
	  --video-opacity: 0.22;
	  --video-blur: 1px;
	  --video-overlay: rgba(11,16,32,0.55);
    }

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

    body {
      font-family: Arial, Helvetica, sans-serif;
      background:
        radial-gradient(circle at top, rgba(245,158,11,0.08), transparent 30%),
        linear-gradient(180deg, #0b1020 0%, var(--bg) 100%);
      color: var(--text);
      min-height: 100vh;
    }
	
	.video-bg-wrap {
	  position: fixed;
	  inset: 0;
	  z-index: -2;
	  overflow: hidden;
	  pointer-events: none;
	}

	.video-bg {
	  width: 100%;
	  height: 100%;
	  object-fit: cover;
	  opacity: var(--video-opacity);
	  filter: blur(var(--video-blur));
	  transform: scale(1.06);
	}

	.video-bg-overlay {
	  position: absolute;
	  inset: 0;
	  background: var(--video-overlay);
	  z-index: -1;
	}

    .container {
      width: min(1220px, calc(100% - 32px));
      margin: 0 auto;
    }

    span small {
      color: #aaa !important;
      font-size: 10px;
    }

    .site-header {
      padding: 28px 0 18px;
      border-bottom: 1px solid var(--border);
      backdrop-filter: blur(8px);
	  background-color: #0000005e
    }

    .site-header .container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .brand h1 {
      font-size: 1.9rem;
      margin-bottom: 6px;
    }

    .brand p {
      color: var(--muted);
      font-size: 0.96rem;
    }

    #head-fortune {
      position: relative;
      display: inline-block;
      color: var(--accent);
      text-shadow:
        0 0 8px rgba(255, 153, 34, 0.42),
        0 0 18px rgba(255, 196, 64, 0.24);
      animation: headFortuneGlow 3.4s ease-in-out infinite;
    }

    #head-fortune::after {
      content: "";
      position: absolute;
      inset: -2px -8px;
      background: linear-gradient(115deg, transparent 18%, rgba(255, 229, 167, 0.44) 48%, transparent 76%);
      transform: translateX(-120%);
      pointer-events: none;
      mix-blend-mode: screen;
      animation: headFortuneSweep 3.8s ease-in-out infinite;
    }

    @keyframes headFortuneGlow {
      0%, 100% {
        text-shadow:
          0 0 8px rgba(255, 158, 45, 0.36),
          0 0 18px rgba(255, 196, 64, 0.2);
        filter: brightness(1);
      }
      50% {
        text-shadow:
          0 0 12px rgba(255, 146, 32, 0.62),
          0 0 28px rgba(255, 186, 48, 0.4),
          0 0 44px rgba(255, 224, 146, 0.24);
        filter: brightness(1.08);
      }
    }

    @keyframes headFortuneSweep {
      0%, 18% {
        opacity: 0;
        transform: translateX(-120%);
      }
      28% {
        opacity: 0.9;
      }
      54% {
        opacity: 0.36;
        transform: translateX(120%);
      }
      100% {
        opacity: 0;
        transform: translateX(120%);
      }
    }

    .chip {
      display: inline-block;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: rgba(255,255,255,0.04);
      color: var(--muted);
      font-size: 0.9rem;
    }

    .layout {
      display: grid;
      grid-template-columns: 1.45fr 0.95fr;
      gap: 24px;
      padding: 28px 0 40px;
    }

    .panel {
      background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 20px;
	  backdrop-filter: blur(8px);
    }

    .arena-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .arena-tabs {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border-radius: 999px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
    }

    .arena-tab {
      border: 0;
      border-radius: 999px;
      padding: 10px 16px;
      background: transparent;
      color: rgba(255,255,255,0.72);
      font-size: 0.92rem;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }

    .arena-tab.is-active {
      background: linear-gradient(180deg, rgba(245,158,11,0.94), rgba(217,119,6,0.94));
      color: #111827;
      box-shadow: 0 10px 22px rgba(245,158,11,0.2);
    }

    .arena-tab-pane {
      display: none;
    }

    .arena-tab-pane.is-active {
      display: block;
      animation: tabPaneFade 0.24s ease;
    }

    .leaderboard-pane {
      min-height: 520px;
    }

    .leaderboard-pane-head {
      margin-bottom: 14px;
    }

    .leaderboard-tab-list {
      display: grid;
      gap: 8px;
    }

    .section-title {
      position: relative;
      display: inline-block;
      animation: titleDance 3s ease-in-out infinite;
      transform-origin: center;
    }

    .section-title::before,
    .section-title::after {
      content: attr(data-text);
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: -1;
    }

    .section-title::before {
      opacity: 0.25;
      filter: blur(2px);
      transform: translate(-4px, 3px);
      animation: titleTrail1 3s ease-in-out infinite;
    }

    .section-title::after {
      opacity: 0.15;
      filter: blur(4px);
      transform: translate(4px, -3px);
      animation: titleTrail2 3s ease-in-out infinite;
    }
	
	.dice-rules {
  display: grid;
  gap: 8px;
}

.rule-line {
  display: inline-block;
  width: fit-content;
  transform-origin: left center;
  margin-left: 5px;
}

.rule-1 {
  animation: ruleDance1 2.2s ease-in-out infinite;
}

.rule-2 {
  animation: ruleDance2 3.1s ease-in-out infinite;
}

.rule-3 {
  animation: ruleDance3 1.8s ease-in-out infinite;
}

.rule-4 {
  animation: ruleDance4 2.7s ease-in-out infinite;
}

.rule-5 {
  animation: ruleDance5 3.6s ease-in-out infinite;
}

.rule-6 {
  animation: ruleDance6 3.4s ease-in-out infinite;
}

.rule-7 {
  animation: ruleDance7 3.05s ease-in-out infinite;
}

.rule-8 {
  animation: ruleDance8 3.25s ease-in-out infinite;
}

.rule-9 {
  animation: ruleDance9 2.95s ease-in-out infinite;
}

.rule-10 {
  animation: ruleDance10 2s ease-in-out infinite;
}

.rule-box {
    padding: 9px;
    background: rgb(255 215 0 / 15%);
    border-radius: 6px;
    border: 1px solid #fbbf24;
}

@keyframes ruleDance1 {
  0%   { transform: translateX(0) translateY(0) rotate(-0.4deg); }
  50%  { transform: translateX(4px) translateY(-1px) rotate(0.5deg); }
  100% { transform: translateX(0) translateY(0) rotate(-0.4deg); }
}

@keyframes ruleDance2 {
  0%   { transform: translateX(0) translateY(0) rotate(0.3deg); }
  50%  { transform: translateX(-3px) translateY(-1px) rotate(-0.5deg); }
  100% { transform: translateX(0) translateY(0) rotate(0.3deg); }
}

@keyframes ruleDance3 {
  0%   { transform: translateX(0) translateY(0) rotate(-0.2deg); }
  50%  { transform: translateX(2px) translateY(-2px) rotate(0.4deg); }
  100% { transform: translateX(0) translateY(0) rotate(-0.2deg); }
}

@keyframes ruleDance4 {
  0%   { transform: translateX(0) translateY(0) rotate(0deg); }
  50%  { transform: translateX(-4px) translateY(-1px) rotate(0.3deg); }
  100% { transform: translateX(0) translateY(0) rotate(0deg); }
}

@keyframes ruleDance5 {
  0%   { transform: translateX(0) translateY(0) rotate(0.2deg); }
  50%  { transform: translateX(5px) translateY(-1px) rotate(-0.4deg); }
  100% { transform: translateX(0) translateY(0) rotate(0.2deg); }
}

@keyframes ruleDance6 {
  0%   { transform: translateX(0) translateY(0) rotate(-0.3deg); }
  50%  { transform: translateX(-2px) translateY(-3px) rotate(0.4deg); }
  100% { transform: translateX(0) translateY(0) rotate(-0.3deg); }
}

@keyframes ruleDance7 {
  0%   { transform: translateX(0) translateY(0) rotate(0.3deg); }
  50%  { transform: translateX(3px) translateY(-2px) rotate(-0.6deg); }
  100% { transform: translateX(0) translateY(0) rotate(0.3deg); }
}

@keyframes ruleDance8 {
  0%   { transform: translateX(0) translateY(0) rotate(-0.2deg); }
  50%  { transform: translateX(-5px) translateY(-1px) rotate(0.5deg); }
  100% { transform: translateX(0) translateY(0) rotate(-0.2deg); }
}

@keyframes ruleDance9 {
  0%   { transform: translateX(0) translateY(0) rotate(0.1deg); }
  50%  { transform: translateX(2px) translateY(-3px) rotate(-0.4deg); }
  100% { transform: translateX(0) translateY(0) rotate(0.1deg); }
}

@keyframes ruleDance10 {
  0%   { transform: translateX(0) translateY(0) rotate(-0.2deg); }
  50%  { transform: translateX(-3px) translateY(-1px) rotate(0.3deg); }
  100% { transform: translateX(0) translateY(0) rotate(-0.2deg); }
}


@keyframes titleDance {
  0% { transform: rotate(-1deg) translateY(0px); }
  50% { transform: rotate(1deg) translateY(-3px); }
  100% { transform: rotate(-1deg) translateY(0px); }
}

@keyframes titleTrail1 {
  0% { transform: translate(-6px, 1px) rotate(-1deg); }
  50% { transform: translate(-2px, 3px) rotate(0.4deg); }
  100% { transform: translate(-6px, 1px) rotate(-1deg); }
}

@keyframes titleTrail2 {
  0% { transform: translate(6px, -1px) rotate(1deg); }
  50% { transform: translate(2px, -3px) rotate(-0.4deg); }
  100% { transform: translate(6px, -1px) rotate(1deg); }
}

    * {
      scrollbar-width: thin;
      scrollbar-color: #f59e0b #111827;
    }

    ::-webkit-scrollbar {
      width: 10px;
    }

    ::-webkit-scrollbar-track {
      background: #111827;
      border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, #f59e0b, #d97706);
      border-radius: 10px;
      border: 2px solid #111827;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, #fbbf24, #f59e0b);
    }

    .panel h2, .panel h3 { margin-bottom: 14px; }

    .collapsible-panel {
      transition: max-height 420ms ease, opacity 320ms ease, margin 420ms ease, padding 420ms ease, transform 420ms ease;
      max-height: 800px;
      opacity: 1;
      transform: translateY(0);
      overflow-y: auto;
      overflow-x: hidden;
	 
    }

    .collapsible-panel.is-collapsed {
      max-height: 0;
      opacity: 0;
      margin-top: 0;
      margin-bottom: 0;
      padding-top: 0;
      padding-bottom: 0;
      border-width: 0;
      transform: translateY(-10px);
      pointer-events: none;
    }

    .arena {
      display: grid;
      gap: 18px;
    }

    .setup-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }

    .hint {
      color: var(--muted);
      font-size: 0.92rem;
      margin-top: 6px;
      line-height: 1.55;
    }

    .selector-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
      gap: 14px;
    }

    .mini-card {
      border: 2px solid var(--border);
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
      box-shadow: var(--card-shadow);
      position: relative;
      animation: miniCardPop 1.2s ease-in-out infinite;
      transform-origin: center bottom;
    }

    .mini-card:hover {
      transform: translateY(-3px);
      border-color: rgba(245,158,11,0.8);
    }

    .mini-card.selected {
      border-color: rgba(245,158,11,0.7);
      box-shadow: 0 0 0 2px rgba(245,158,11,0.2), var(--card-shadow);
    }

    .mini-card.gold::after {
      content: 'GOLD';
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 0.72rem;
      font-weight: bold;
      color: #111827;
      background: linear-gradient(180deg, #fde68a, #f59e0b);
      padding: 4px 8px;
      padding: 4px 8px;
      border-radius: 999px;
      z-index: 2;
    }

    .mini-thumb {
      background: linear-gradient(180deg, rgba(251,113,133,0.17), rgba(255,255,255,0.03));
      display: grid;
      place-items: center;
      overflow: hidden;
      border-bottom: 1px solid var(--border);
      min-height: 260px;
    }

    .mini-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .mini-thumb .placeholder {
      color: var(--muted);
      font-size: 0.9rem;
      text-align: center;
      padding: 12px;
      line-height: 1.4;
    }

    .mini-body {
      padding: 12px;
      display: grid;
      gap: 8px;
      position: absolute;
      bottom: 0;
      background: rgb(31 41 55 / 90%);
      width: 100%;
      min-height: 130px;
    }

    .mini-top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: start;
    }

    .mini-top strong {
      font-size: 1rem;
    }
	
	.type-0 .fa-gem {
		font-size: 1.04rem;
		transform: translateY(1px);
	}
	
	.type-2 .fa-scissors {
		font-size: 0.9rem;
		transform: translateY(1px);

	}
	
	.type-1 .fa-toilet-paper {
		transform: translateY(1px);
	}
	
	.tag.type-0 .fa-gem {
		font-size: 1.12rem;
    transform: translate(0px, 2px);
}

    .tag {
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(245,158,11,0.12);
      border: 1px solid rgba(245,158,11,0.22);
      color: #fcd34d;
      font-size: 0.74rem;
      font-size: 0.84rem;
      text-transform: uppercase;
      width: 28px;
      height: 28px;
	  display: flex;
	  align-items: center;   /* vertical */
		justify-content: center; /* horizontal */
    }


    .mini-stats {
      display: grid;
      gap: 4px;
      color: #e5e7eb;
      font-size: 0.9rem;
    }
	
	.enemy-fade-out,
	.vs-fade-out {
	  opacity: 0 !important;
	  transform: scale(0.85);
	  transition: opacity 0.7s ease, transform 0.7s ease;
	  pointer-events: none;
	}

    .card-row {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 18px;
      align-items: center;
      position: relative;
    }

    .card-row.death-sequence {
      overflow: hidden;
      isolation: isolate;
    }

    .card-row.death-sequence > :not(.death-overlay) {
      transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        filter 0.55s ease;
    }

    .card-row.death-content-fade > :not(.death-overlay) {
      opacity: 0;
      transform: scale(0.965);
      filter: blur(7px);
      pointer-events: none;
    }

    .death-overlay {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      background: rgba(0, 0, 0, 0);
      opacity: 0;
      pointer-events: none;
      z-index: 5;
      transition:
        opacity 0.45s ease,
        background 0.8s ease;
    }

    .card-row.death-blackout .death-overlay {
      opacity: 1;
      background:
        radial-gradient(circle at 50% 42%, rgba(24, 6, 6, 0.38), rgba(0, 0, 0, 0.95) 62%),
        rgba(0, 0, 0, 0.96);
    }

    .death-overlay-text {
      font-family: "Cinzel", "Times New Roman", serif;
      font-size: clamp(2rem, 4vw, 3.4rem);
      font-weight: 700;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: rgba(186, 35, 35, 0.92);
      text-align: center;
      opacity: 0;
      transform: scale(1.06);
      text-shadow:
        0 0 18px rgba(122, 10, 10, 0.35),
        0 2px 14px rgba(0, 0, 0, 0.85);
      transition:
        opacity 0.55s ease,
        transform 0.75s ease;
    }

    .card-row.death-message-visible .death-overlay-text {
      opacity: 1;
      transform: scale(1);
    }

    .vs {
      font-size: 1.8rem;
      font-weight: bold;
      color: var(--accent);
      text-align: center;
      transition: opacity 0.25s ease;
    }

    .vs.hidden-vs {
      opacity: 0;
    }

    .character-card {
      background: linear-gradient(180deg, var(--panel), var(--panel-2));
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      min-height: 360px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: visible; /
	  transition: transform 0.2s ease;
    }

    .character-card::before {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at top right, rgba(251,113,133,0.16), transparent 28%);
      pointer-events: none;
    }

    .character-card.empty-slot {
      opacity: 0.75;
      border-style: dashed;
    }

    .victory-placeholder-card {
      opacity: 0;
      padding: 0;
      overflow: hidden;
      border: 1px solid rgba(255,255,255,0.14);
      background:
        radial-gradient(circle at 50% -10%, rgba(255, 252, 233, 0.46), transparent 24%),
        radial-gradient(circle at top left, rgba(255, 224, 130, 0.28), transparent 34%),
        linear-gradient(160deg, rgba(214,132,24,0.96) 0%, rgba(219,128,93,0.92) 42%, rgba(207,94,141,0.94) 100%);
      box-shadow:
        0 26px 48px rgba(13, 5, 31, 0.38),
        0 0 28px rgba(255, 225, 145, 0.28),
        0 0 58px rgba(255, 244, 214, 0.16),
        inset 0 1px 0 rgba(255,255,255,0.16);
    }

    .victory-placeholder-hidden {
      display: none !important;
    }

    .victory-placeholder-fade-in {
      animation: victoryPlaceholderFadeIn 0.55s ease forwards;
    }

    .victory-card-shell {
      position: relative;
      display: grid;
      gap: 12px;
      min-height: 100%;
      padding: 18px 18px 18px;
      animation: victoryCardFloat 8.5s ease-in-out infinite;
      animation-delay: -2.2s;
    }

    .victory-card-shell::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 30%);
      pointer-events: none;
    }

    .victory-card-shell::after {
      content: "";
      position: absolute;
      inset: -10% -6%;
      background:
        radial-gradient(circle at 50% 12%, rgba(255, 249, 224, 0.34), transparent 23%),
        radial-gradient(circle at 50% 50%, rgba(255, 230, 168, 0.16), transparent 36%);
      filter: blur(8px);
      opacity: 0.62;
      pointer-events: none;
      z-index: 0;
      animation: victoryHaloPulse 6.4s ease-in-out infinite;
    }

    .victory-particles {
      position: absolute;
      inset: -12px;
      overflow: visible;
      pointer-events: none;
      z-index: 0;
    }

    .victory-particle {
      position: absolute;
      bottom: 12px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 35%, rgba(255,255,255,0.98), rgba(255,240,181,0.86) 42%, rgba(255,220,124,0.08) 76%);
      box-shadow:
        0 0 7px rgba(255, 245, 197, 0.72);
      opacity: 0;
      animation: victoryParticleRise 5.4s linear infinite;
    }

    .victory-particle:nth-child(1) { left: 14%; animation-delay: -0.3s; transform: scale(0.82); }
    .victory-particle:nth-child(2) { left: 34%; animation-delay: -1.8s; width: 6px; height: 6px; }
    .victory-particle:nth-child(3) { left: 58%; animation-delay: -3.4s; width: 9px; height: 9px; }
    .victory-particle:nth-child(4) { left: 78%; animation-delay: -2.4s; width: 6px; height: 6px; }

    .victory-card-top,
    .victory-card-heading,
    .victory-score-box,
    .victory-media-frame,
    .victory-message,
    .victory-actions {
      position: relative;
      z-index: 1;
    }

    .victory-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .victory-card-heading {
      position: relative;
      z-index: 1;
    }

    .victory-kicker {
      margin: 0;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.72);
    }

    .victory-title {
      margin: 2px 0 0;
      font-size: clamp(1.12rem, 2.4vw, 1.55rem);
      line-height: 1;
      color: #fff7ed;
      text-shadow: 0 4px 18px rgba(72, 18, 28, 0.22);
    }

    .victory-top-score {
      display: inline-flex;
      align-items: baseline;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(89, 17, 37, 0.18);
      border: 1px solid rgba(255,255,255,0.14);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
      white-space: nowrap;
    }

    .victory-top-score-label {
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.8);
    }

    .victory-top-score-value {
      font-size: clamp(0.95rem, 2.2vw, 1.15rem);
      font-weight: 800;
      line-height: 1;
      color: #fff;
    }

    .victory-media-frame {
      min-height: 138px;
      border-radius: 18px;
      padding: 10px;
      border: 1px solid rgba(255,255,255,0.18);
      background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    }

    .victory-media-slot {
      display: grid;
      place-items: center;
      gap: 8px;
      min-height: 116px;
      height: 100%;
      border-radius: 14px;
      border: 1px dashed rgba(255,255,255,0.18);
      background:
        radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 68%),
        rgba(72, 12, 30, 0.16);
      text-align: center;
      padding: 12px;
      color: rgba(255,255,255,0.85);
    }

    .victory-media-slot p {
      margin: 0;
      font-size: 0.82rem;
      line-height: 1.28;
    }

    .victory-media-video {
      width: 100%;
      height: 100%;
      min-height: 116px;
      object-fit: cover;
      border-radius: 12px;
      display: block;
      background: rgba(0,0,0,0.18);
    }

    .victory-media-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 9px;
      border-radius: 999px;
      background: rgba(255,255,255,0.12);
      font-size: 0.64rem;
      font-weight: 700;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      color: #fff7ed;
    }

    .victory-message {
      margin: 0;
      font-size: 0.9rem;
      line-height: 1.32;
      color: rgba(255,255,255,0.96);
      text-wrap: balance;
    }

    .victory-actions {
      display: grid;
      gap: 8px;
      margin-top: auto;
    }

    .victory-shop-link {
      width: fit-content;
      margin: 6px 0 8px;
      color: #fff8e8;
      font-size: 0.92rem;
      font-weight: 700;
      text-decoration: none;
      border-bottom: 1px solid rgba(255,255,255,0.55);
      transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    }

    .victory-shop-link:hover {
      opacity: 0.92;
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.9);
    }

    .victory-bonus-btn {
      width: 100%;
      justify-content: center;
      padding: 10px 14px;
      border-radius: 12px;
      border: 2px solid rgba(120, 43, 0, 0.4);
      font-size: 0.9rem;
      font-weight: 700;
      box-shadow: 0 16px 26px rgba(73, 16, 35, 0.25);
    }

    @keyframes victoryCardFloat {
      0% {
        transform: translateY(0) rotate(-0.45deg) scale(1);
      }
      50% {
        transform: translateY(-10px) rotate(0.42deg) scale(1.012);
      }
      100% {
        transform: translateY(0) rotate(-0.45deg) scale(1);
      }
    }

    @keyframes victoryHaloPulse {
      0% {
        opacity: 0.56;
        transform: scale(0.98);
      }
      50% {
        opacity: 0.96;
        transform: scale(1.03);
      }
      100% {
        opacity: 0.56;
        transform: scale(0.98);
      }
    }

    @keyframes victoryParticleRise {
      0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0.7) rotate(0deg);
      }
      12% {
        opacity: 1;
      }
      55% {
        opacity: 0.9;
      }
      100% {
        opacity: 0;
        transform: translateY(-150px) translateX(12px) scale(1.08) rotate(90deg);
      }
    }

    @media (max-width: 980px) {
      .victory-card-shell::after {
        filter: blur(5px);
        opacity: 0.48;
      }

      .victory-particles {
        display: none;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .victory-card-shell,
      .victory-card-shell::after {
        animation: none !important;
      }

      .victory-particles {
        display: none !important;
      }
    }

    .character-card.enemy-reveal {
      animation: enemyRevealPop 0.45s ease;
    }

    .character-card.clash-left {
      transform: translateX(100px) scale(0.75, 0.95) !important;
    }

    .character-card.clash-right {
       transform: translateX(-100px) scale(0.75,0.95) !important;
    }

    @keyframes enemyRevealPop {
      0% { transform: scale(0.92); opacity: 0.4; }
      100% { transform: scale(1); opacity: 1; }
    }

    @keyframes victoryPlaceholderFadeIn {
      0% {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes clashLeft {
      0% { transform: translateX(0); }
      35% { transform: translateX(18px) scale(1.02); }
      100% { transform: translateX(0); }
    }

    @keyframes clashRight {
      0% { transform: translateX(0); }
      35% { transform: translateX(-18px) scale(1.02); }
      100% { transform: translateX(0); }
    }
	
	

    .card-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 12px;
	  
    }

    .card-top h3 {
      margin: 0;
      font-size: 1.25rem;
	  white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    }

    .type-badge {
		padding: 6px 6px;
		border-radius: 999px;
		background: rgba(245, 158, 11, 0.12);
		border: 1px solid rgba(245, 158, 11, 0.25);
		color: #fcd34d;
		font-size: 0.85rem;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		font-family: monospace;
		width: 32px;
		height: 32px;
		display: flex;
		align-items: center;   /* vertical */
		justify-content: center; /* horizontal */
}

    .portrait {
      border: 1px dashed rgba(255,255,255,0.12);
      border-radius: 16px;
      min-height: 170px;
      display: grid;
      place-items: center;
      color: var(--muted);
      margin-bottom: 14px;
      background: rgba(255,255,255,0.02);
      text-align: center;
      padding: 14px;
      overflow: hidden;
    }

    .portrait img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 12px;
      display: block;
    }
	
	.character-card {
      animation: cardSway 3s ease-in-out infinite;

	}

    @keyframes cardSway {
      0%   { transform: translateY(0px) rotate(-0.5deg) scale(1); }
	  50% { transform: translateY(-10px) rotate(0.5deg) scale(1.01); }
	  100%   { transform: translateY(0px) rotate(-0.5deg) scale(1); }
    }
	
	#player-card {
	  animation: cardSway  3.6s ease-in-out infinite;
	  animation-delay: 0s;
	}

	#enemy-card {
	  animation: cardSway  3.6s ease-in-out infinite;
	  animation-delay: -1.8s; /* 👈 clave */
	}
	
	.no-float {
	  animation: none !important;
	}

	.character-card.victory-placeholder-card {
	  animation: none;
	}

	.character-card.victory-placeholder-card.victory-placeholder-fade-in {
	  animation: victoryPlaceholderFadeIn 0.55s ease forwards;
	}

    .stats { display: grid; gap: 10px; }
    .stat { display: grid; gap: 6px; }

    .stat-line {
      display: flex;
      justify-content: space-between;
      font-size: 0.92rem;
      color: #e5e7eb;
    }

    .bar {
      width: 100%;
      height: 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.08);
      overflow: hidden;
    }

    .fill {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      transition: width 220ms ease;
    }

    .fill.hp { background: linear-gradient(90deg, #ef4444, #f87171); }
    .fill.bp { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 4px;
      align-items: center;
    }

    button {
      border: 0;
      border-radius: 12px;
      padding: 12px 16px;
      font-size: 0.96rem;
      font-weight: bold;
      cursor: pointer;
      transition: transform 0.12s ease, opacity 0.2s ease;
    }

    button:hover { transform: translateY(-1px); }
    button:active { transform: translateY(1px); }
    button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

    .primary {
	  background: linear-gradient(180deg, var(--accent), #d97706);
	  color: #111827;
	}

	/* Animación */
	.primary.ready {
	  animation: pulseGlow 1s ease-in-out infinite;
	}

	@keyframes pulseGlow {
	  0% {
		transform: scale(1);
		filter: brightness(1);
		box-shadow: 0 0 0px rgba(255, 180, 0, 0);
	  }

	  50% {
		transform: scale(1.05);
		filter: brightness(1.3);
		box-shadow: 0 0 20px rgba(255, 180, 0, 0.8);
	  }

	  100% {
		transform: scale(1);
		filter: brightness(1);
		box-shadow: 0 0 0px rgba(255, 180, 0, 0);
	  }
	}
	
	

    .secondary {
      background: #334155;
      color: var(--text);
      border: 1px solid var(--border);
    }

    .danger {
      background: #7f1d1d;
      color: #fee2e2;
    }

    .dice-wrap {
      display: flex;
      align-items: stretch;
      gap: 12px;
      margin-top: 10px;
      flex-wrap: nowrap;
    }

    .dice-box {
      width: 76px;
      height: 76px;
      border-radius: 18px;
      background: linear-gradient(180deg, #fff, #d1d5db);
      color: #111827;
      display: grid;
      place-items: center;
      font-size: 2rem;
      font-weight: bold;
      box-shadow: inset 0 2px 8px rgba(255,255,255,0.5), 0 10px 22px rgba(0,0,0,0.25);
      border: 2px solid rgba(255,255,255,0.65);
    }

    .dice-box.rolling {
      animation: shake 0.12s linear infinite;
    }

    .dice-result-card {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      padding: 12px 14px;
      border-radius: 14px;
      background: rgba(255,255,255,0.045);
      border: 1px solid rgba(255,255,255,0.08);
    }

    #dice-result-text {
      display: block;
      line-height: 1.3;
    }

    .dice-result-card .hint {
      margin-top: 8px;
      margin-bottom: 0;
    }

    @keyframes shake {
      0% { transform: translate(0, 0) rotate(0deg); }
      25% { transform: translate(2px, -1px) rotate(2deg); }
      50% { transform: translate(-2px, 1px) rotate(-2deg); }
      75% { transform: translate(1px, 2px) rotate(1deg); }
      100% { transform: translate(0, 0) rotate(0deg); }
    }

    .log {
      display: grid;
      gap: 10px;
      max-height: 322px;
      overflow: auto;
      padding-right: 6px;
	  margin-bottom: 12px;

    }

    .log-item {
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      color: #e5e7eb;
      line-height: 1.45;
      font-size: 0.95rem;
    }

    .log-item.new {
      animation: logFade 1.2s ease forwards, logPop 0.2s ease;
    }

    @keyframes logFade {
      0% {
        background: rgba(34,197,94,0.25);
        border-color: rgba(34,197,94,0.6);
      }
      60% {
        background: rgba(34,197,94,0.25);
        border-color: rgba(34,197,94,0.6);
      }
      100% {
        background: rgba(255,255,255,0.03);
        border-color: var(--border);
      }
    }

    @keyframes logPop {
      0% { transform: scale(0.96); }
      100% { transform: scale(1); }
    }

    .footer-note {
      margin-top: 16px;
      color: var(--muted);
      font-size: 0.9rem;
	  font-family: monospace, monospace;
	  font-weight: bold;
	  max-height: 344px;
    overflow-y: scroll;
    overflow-x: hidden;
	}

    .mini-card:nth-child(1)  { animation-delay: 0s; }
    .mini-card:nth-child(2)  { animation-delay: 0.1s; }
    .mini-card:nth-child(3)  { animation-delay: 0.2s; }
    .mini-card:nth-child(4)  { animation-delay: 0.3s; }
    .mini-card:nth-child(5)  { animation-delay: 0.4s; }
    .mini-card:nth-child(6)  { animation-delay: 0.5s; }
    .mini-card:nth-child(7)  { animation-delay: 0.6s; }
    .mini-card:nth-child(8)  { animation-delay: 0.7s; }
    .mini-card:nth-child(9)  { animation-delay: 0.8s; }
    .mini-card:nth-child(10) { animation-delay: 0.9s; }
    .mini-card:nth-child(11) { animation-delay: 1.0s; }
    .mini-card:nth-child(12) { animation-delay: 1.1s; }
    .mini-card:nth-child(13) { animation-delay: 1.2s; }
    .mini-card:nth-child(14) { animation-delay: 1.3s; }
    .mini-card:nth-child(15) { animation-delay: 1.4s; }
    .mini-card:nth-child(16) { animation-delay: 1.5s; }
    .mini-card:nth-child(17) { animation-delay: 1.6s; }
    .mini-card:nth-child(18) { animation-delay: 1.7s; }
    .mini-card:nth-child(19) { animation-delay: 1.8s; }
    .mini-card:nth-child(20) { animation-delay: 1.9s; }

    @keyframes miniCardPop {
      0%   { transform: translateY(0) rotate(0deg); }
      10%  { transform: translateY(-2px) rotate(-0.2deg); }
      20%  { transform: translateY(0) rotate(0deg); }
      90%  { transform: translateY(0) rotate(0deg); }
      100% { transform: translateY(1px) rotate(0deg); }
    }

    .type-0 {
      background: rgba(239,68,68,0.45);
      border: 1px solid rgba(239,68,68,0.35);
      color: #fca5a5;
    }

    .type-1 {
      background: rgba(59,130,246,0.45);
      border: 1px solid rgba(59,130,246,0.35);
      color: #93c5fd;
    }

    .type-2 {
      background: rgba(34,197,94,0.45);
      border: 1px solid rgba(34,197,94,0.35);
      color: #86efac;
    }

    .type-3 {
      background: rgba(168,85,247,0.45);
      border: 1px solid rgba(168,85,247,0.35);
      color: #d8b4fe;
    }

    .battle-overlay {
      position: fixed;
      inset: 0;
      background: rgba(5, 8, 18, 0.72);
      backdrop-filter: blur(4px);
      z-index: 9999;
      display: grid;
      place-items: center;
    }

    .battle-overlay.hidden {
      display: none !important;
    }

    .battle-overlay-inner {
      text-align: center;
      animation: overlayPop 0.35s ease;
    }
	
	.rule-highlight {
	  animation: ruleFlash 0.9s ease-in-out 2;
	}

	@keyframes ruleFlash {
	  0%   { background: rgba(255,255,255,0); }
	  30%  { background: rgba(255, 215, 0, 0.35); }
	  60%  { background: rgba(255,255,255,0); }
	  100% { background: rgba(255, 215, 0, 0.25); }
	}

    .battle-vs-text {
      font-size: clamp(4rem, 12vw, 8rem);
      font-weight: 900;
      color: #fff;
      text-shadow:
        0 0 12px rgba(245,158,11,0.6),
        0 0 40px rgba(245,158,11,0.35);
      letter-spacing: 0.08em;
    }

    .battle-subtext {
      margin-top: 8px;
      font-size: 1rem;
      color: #fcd34d;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .battle-overlay-panel {
      margin-top: 18px;
      min-width: min(360px, calc(100vw - 64px));
      padding: 18px;
      border-radius: 18px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(10, 13, 26, 0.64);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    }

    .battle-overlay-panel.hidden {
      display: none !important;
    }

    .battle-overlay-score {
      margin: 0 0 12px;
      font-size: 1rem;
      color: #fff8cf;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .battle-overlay-input {
      width: 100%;
      height: 46px;
      padding: 0 14px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.14);
      background: rgba(255,255,255,0.08);
      color: #fff;
      font-size: 0.96rem;
      outline: none;
    }

    .battle-overlay-input::placeholder {
      color: rgba(255,255,255,0.48);
    }

    .battle-overlay-input:focus {
      border-color: rgba(252, 211, 77, 0.8);
      box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
    }

    .battle-overlay-submit {
      width: 100%;
      margin-top: 12px;
    }
	
	.character-card.enemy-defeated {
	  animation: enemyFadeOut 0.8s ease forwards;
	}

	@keyframes enemyFadeOut {
	  0% {
		opacity: 1;
		transform: scale(1);
	  }
	  100% {
		opacity: 0;
		transform: scale(0.96);
	  }
	}

    @keyframes overlayPop {
      0% { transform: scale(0.9); opacity: 0; }
      100% { transform: scale(1); opacity: 1; }
    }
	
	.terminal-title {
	  position: relative;
	  display: inline-block;
	  font-family: "Courier New", monospace;
	  font-weight: bold;
	  letter-spacing: 0.08em;
	  text-transform: uppercase;
	  color: #f3f4f6;
	  animation: crtFlicker 0.8s infinite ease-in-out;
	  text-shadow:
		0 0 4px rgba(255,255,255,0.25),
		0 0 10px rgba(34,197,94,0.18),
		0 0 16px rgba(59,130,246,0.12);
		margin-top: 4px;
		margin-bottom: 0 !important;
}
	}

	.terminal-title::before,
	.terminal-title::after {
	  content: attr(data-text);
	  position: absolute;
	  inset: 0;
	  pointer-events: none;
	}

	.terminal-title::before {
	  color: rgba(59,130,246,0.75);
	  transform: translate(-1px, 0);
	  mix-blend-mode: screen;
	  animation: glitchLeft 1.5s infinite ease-in-out;
	}

	.terminal-title::after {
	  color: rgba(239,68,68,0.75);
	  transform: translate(1px, 0);
	  mix-blend-mode: screen;
	  animation: glitchRight 1.1s infinite ease-in-out;
	}

	@keyframes glitchLeft {
	  0%, 85%, 100% {
		transform: translate(0, 0);
		opacity: 0.35;
	  }
	  86% {
		transform: translate(-4px, 1px);
		opacity: 0.7;
	  }
	  88% {
		transform: translate(4px, -1px);
		opacity: 0.45;
	  }
	  90% {
		transform: translate(-1px, 0);
		opacity: 0.6;
	  }
	}

	@keyframes glitchRight {
	  0%, 80%, 100% {
		transform: translate(0, 0);
		opacity: 0.25;
	  }
	  81% {
		transform: translate(2px, 0);
		opacity: 0.65;
	  }
	  84% {
		transform: translate(-2px, 1px);
		opacity: 0.4;
	  }
	  87% {
		transform: translate(1px, -1px);
		opacity: 0.55;
	  }
	}

	@keyframes crtFlicker {
	  0%, 18%, 22%, 62%, 64%, 100% {
		opacity: 1;
		transform: translateY(0);
	  }
	  20% {
		opacity: 0.88;
		transform: translateY(-1px);
	  }
	  63% {
		opacity: 0.92;
		transform: translateY(1px);
	  }
	}
	
	#lucky-stars-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.lucky-star {
 position: absolute;
  top: -30px;
  opacity: 0;
  user-select: none;
  will-change: transform, opacity;
  animation: luckyFall linear forwards;
  text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

@keyframes luckyFall {
  0% {
    transform: translateY(-20px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) translateX(12px) rotate(180deg);
    opacity: 0;
  }
}

	.enemy-hit {
	animation: enemyHitFlash 0.5s ease-in-out 2;
	}

	@keyframes enemyHitFlash {
	0%   { transform: translateX(0) scale(1); filter: brightness(1); }
	25%  { transform: translateX(-6px) scale(1.02); filter: brightness(1.4); }
	50%  { transform: translateX(6px) scale(0.98); filter: brightness(0.8); }
	100% { transform: translateX(0) scale(1); filter: brightness(1); }
	}
	
	#roll-btn.lucky-roll {
	  animation: luckyFlash 0.35s linear infinite;
	  position: relative;
	  z-index: 1;
	}

	@keyframes luckyFlash {
	  0%   { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
	  25%  { background: #ffd93d; box-shadow: 0 0 12px #ffd93d; }
	  50%  { background: #4dff88; box-shadow: 0 0 12px #4dff88; }
	  75%  { background: #4da6ff; box-shadow: 0 0 12px #4da6ff; }
	  100% { background: #ff4dff; box-shadow: 0 0 12px #ff4dff; }
	}
	
	.video-bg.lucky-mode {
	  animation: luckyRainbow 1.2s linear infinite;
	  filter: hue-rotate(0deg) saturate(1.6) brightness(1.1);
	}

	@keyframes luckyRainbow {
	  0%   { filter: hue-rotate(0deg)   saturate(1.6) brightness(1.1); }
	  25%  { filter: hue-rotate(90deg)  saturate(1.8) brightness(1.2); }
	  50%  { filter: hue-rotate(180deg) saturate(2)   brightness(1.3); }
	  75%  { filter: hue-rotate(270deg) saturate(1.8) brightness(1.2); }
	  100% { filter: hue-rotate(360deg) saturate(1.6) brightness(1.1); }
	}
	
	.log-item {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.05); /* default */
  transition: all 0.2s ease;
}

	/* 🟢 victoria */
	.log-win {
	  background: rgba(77, 255, 136, 0.15);
	  border-left: 3px solid #4dff88;
	}

	/* 🔴 derrota */
	.log-lose {
	  background: rgba(255, 77, 77, 0.15);
	  border-left: 3px solid #ff4d4d;
	}
	
	.log-attack {
	  background: #f50b6050;
	  border: 1px solid rgb(255 28 114 / 52%);
	}

	/* 🟠 daño */
	.log-damage {
	  background: rgba(255, 136, 77, 0.15);
	  border-left: 3px solid #ff884d;
	}

	/* 🔵 gain */
	.log-gain {
	  background: rgba(77, 166, 255, 0.15);
	  border-left: 3px solid #4da6ff;
	}

	/* 🟡 lucky (modo especial) */
	.log-lucky {
	  background: rgba(255, 215, 0, 0.18);
	  border-left: 3px solid gold;
	  box-shadow: 0 0 8px rgba(255,215,0,0.5);
	}

	/* ⚪ empate */
	.log-draw {
	  background: rgba(200,200,200,0.3);
	  border-left: 3px solid #ccc;
	}
	
	.log-sys {
	  background: rgb(200 24 255 / 15%);
	border-left: 3px solid #c728f1;
	}
	
	.log-drugs {
	  animation: luckyFlash 0.35s linear infinite !important;
	  position: relative;
	  z-index: 1;
	  border-left: 3px solid gold;
	}
	
	.log-item.new {
	  animation: logPop 0.3s ease;
	}

	@keyframes logPop {
	  0% { transform: translateY(-10px); opacity: 0; }
	  100% { transform: translateY(0); opacity: 1; }
	}


    @media (max-width: 980px) {
      .layout { grid-template-columns: 1fr; }
      .card-row { grid-template-columns: 1fr; }
      .vs { order: -1; }
    }
	
	.character-card {
	  position: relative;
	  overflow: hidden;
	}

	/* overlay base */
	.card-react-overlay {
	  position: absolute;
	  inset: 0;
	  pointer-events: none;
	  opacity: 0;
	  mix-blend-mode: screen;
	}

	/* animación */
	.card-react-active .card-react-overlay {
	  animation: reactFlash 0.8s ease;
	}

	@keyframes reactFlash {
	  0%   { opacity: 0; }
	  30%  { opacity: 0.6; }
	  100% { opacity: 0; }
	}

	/* movimiento tipo "pop" */
	.card-react-active {
	  animation: reactPop 0.8s ease;
	}

	@keyframes reactPop {
	  0%   { transform: translateY(0px); }
	  30%  { transform: translateY(-12px) scale(1.02); }
	  100% { transform: translateY(0px); }
	}

	/* colores */
	.react-damage { background: rgba(255, 80, 80, 0.6); }
	.react-heal   { background: rgba(255, 215, 0, 0.5); }
	.react-buff   { background: rgba(80, 150, 255, 0.5); }
	.react-lucky  { background: rgba(80, 255, 120, 0.5); }
	.react-flash  { background: rgba(255, 255, 255, 0.75); }
	
	.disabled-gold {
	  opacity: 0.55;
	  filter: grayscale(0.2);
	  cursor: not-allowed;
	  position: relative;
	}

	.disabled-gold::after {
	  content: 'LOCKED';
	  position: absolute;
	  top: 8px;
	  right: 8px;
	  font-size: 11px;
	  font-weight: 700;
	  padding: 4px 6px;
	  border-radius: 999px;
	  background: rgba(0,0,0,0.75);
	  color: #ffd700;
	  pointer-events: none;
	}
	
	/*radio*/
	
	.radio-chip {
	  display: inline-flex;
	  flex-direction: column;
	  align-items: stretch;
	  gap: 10px;
	  min-width: 320px;
	  max-width: 520px;
	  padding: 12px 14px;
	  border-radius: 18px;
	  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
	}

	.radio-top-row {
	  display: flex;
	  align-items: center;
	  gap: 12px;
	  min-width: 0;
	}

	.radio-controls {
	  display: inline-flex;
	  align-items: center;
	  gap: 8px;
	  flex: 0 0 auto;
	}

	.radio-btn {
	  border: 0;
	  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
	  color: var(--text);
	  border-radius: 10px;
	  padding: 7px 10px;
	  cursor: pointer;
	  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
	}

	.radio-btn:hover {
	  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.12));
	}

	.radio-track {
	  white-space: nowrap;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  max-width: 260px;
	  font-size: 14px;
	  color: rgba(255,255,255,0.86);
	  flex: 1 1 auto;
	  min-width: 0;
	}

	.radio-volume-row {
	  display: flex;
	  align-items: center;
	  gap: 12px;
	  padding: 8px 10px;
	  border-radius: 14px;
	  background: linear-gradient(180deg, rgba(8, 11, 28, 0.34), rgba(255,255,255,0.03));
	  border: 1px solid rgba(255,255,255,0.08);
	}

	.radio-volume-label {
	  font-size: 0.74rem;
	  font-weight: 700;
	  letter-spacing: 0.12em;
	  text-transform: uppercase;
	  color: rgba(255,255,255,0.64);
	  flex: 0 0 auto;
	}

	.radio-volume {
	  width: 100%;
	  flex: 1 1 auto;
	  appearance: none;
	  background: transparent;
	  cursor: pointer;
	}

	.radio-volume::-webkit-slider-runnable-track {
	  height: 8px;
	  border-radius: 999px;
	  background: linear-gradient(90deg, rgba(245,158,11,0.92), rgba(251,191,36,0.92));
	  box-shadow:
		inset 0 1px 2px rgba(0,0,0,0.28),
		0 0 0 1px rgba(255,255,255,0.06);
	}

	.radio-volume::-webkit-slider-thumb {
	  appearance: none;
	  width: 18px;
	  height: 18px;
	  border-radius: 50%;
	  margin-top: -5px;
	  border: 2px solid rgba(255,255,255,0.86);
	  background: radial-gradient(circle at 35% 35%, #fff8df, #f59e0b 72%);
	  box-shadow:
		0 4px 12px rgba(0,0,0,0.32),
		0 0 14px rgba(251,191,36,0.38);
	}

	.radio-volume::-moz-range-track {
	  height: 8px;
	  border-radius: 999px;
	  background: linear-gradient(90deg, rgba(245,158,11,0.92), rgba(251,191,36,0.92));
	  box-shadow:
		inset 0 1px 2px rgba(0,0,0,0.28),
		0 0 0 1px rgba(255,255,255,0.06);
	}

.radio-volume::-moz-range-thumb {
	  width: 18px;
	  height: 18px;
	  border: 2px solid rgba(255,255,255,0.86);
	  border-radius: 50%;
	  background: radial-gradient(circle at 35% 35%, #fff8df, #f59e0b 72%);
	  box-shadow:
		0 4px 12px rgba(0,0,0,0.32),
		0 0 14px rgba(251,191,36,0.38);
	}
	
	/* end radio */

	.site-footer {
	  margin-top: 28px;
	  padding: 0 0 34px;
	}

	.site-footer-inner {
	  display: grid;
	  gap: 16px;
	  justify-items: center;
	}

	.site-footer-links {
	  display: flex;
	  justify-content: center;
	  align-items: center;
	  gap: 22px;
	  flex-wrap: wrap;
	}

	.site-footer-links a {
	  color: rgba(255,255,255,0.82);
	  text-decoration: none;
	  font-size: 0.94rem;
	  transition: color 0.18s ease, transform 0.18s ease;
	}

	.site-footer-links a:hover {
	  color: var(--accent);
	  transform: translateY(-1px);
	}

	.site-footer-rule {
	  width: min(100%, 820px);
	  margin: 0;
	  border: 0;
	  border-top: 1px solid rgba(255,255,255,0.12);
	}

	.site-footer-copy {
	  margin: 0;
	  text-align: center;
	  color: rgba(255,255,255,0.56);
	  font-size: 0.88rem;
	}
	
	.portrait {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 3;

  background: linear-gradient(
    100deg,
    transparent 42%,
    rgba(255,255,255,0.95) 50%,
    transparent 58%
  );

  opacity: 0;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  animation: portraitScan 5s ease-in-out infinite;
}

#player-card .portrait::before {
  animation-delay: 0s;
}

#enemy-card .portrait::before {
  animation-delay: 2s; /* mitad del ciclo */
}

.portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-action-layout {
  display: block;
}

.main-action-layout::after {
  content: "";
  display: block;
  clear: both;
}

.main-action-left {
  min-width: 0;
}

.main-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.main-action-head h3 {
  margin: 0;
}

.match-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.74);
  font-family: monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.main-action-right {
  float: right;
  width: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 10px 16px;
}

.score-panel {
  width: auto;
  min-width: 0;
  display: block;
}

.score-boxes-row {
  display: flex;
  gap: 8px;
}

.score-box {
  text-align: left;
  padding: 10px 14px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  gap: 10px;
}

.score-box-main {
  min-width: 72px;
}

.score-box-mini {
  min-width: 74px;
  align-content: center;
  justify-items: end;
  padding: 8px 9px 9px;
  gap: 4px;
}

.score-box-ranking {
  min-width: 220px;
}

.score-ranking-hidden {
  display: none !important;
}

.score-box-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.score-label {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

#score-value {
  font-size: 22px;
  line-height: 1;
}

.score-meta-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.66);
  text-align: right;
}

.score-meta-value {
  font-size: 14px;
  line-height: 1.1;
  text-align: right;
}

.score-ranking {
  display: grid;
  gap: 7px;
}

.score-ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-ranking-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}

.score-ranking-list {
  display: grid;
  gap: 6px;
}

.score-ranking-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
}

.score-ranking-pos {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.score-ranking-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.score-ranking-score {
  font-size: 13px;
  color: #fcd34d;
}

.score-ranking-empty {
  padding: 8px 0 2px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.score-pop {
  animation: scorePop 0.2s ease;
}

@keyframes scorePop {
  0% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes tabPaneFade {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-slot {
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

hr {
	margin: 6px 0;
	border: 1px solid #ffffff05
}

@keyframes bobFloat {
  0% {
    transform: translateY(0px) rotate(-0.5deg);
  }
  25% {
    transform: translateY(-2px) rotate(1deg);
  }
  50% {
    transform: translateY(-4px) rotate(0deg);
  }
  75% {
    transform: translateY(-2px) rotate(-1deg);
  }
  100% {
    transform: translateY(0px) rotate(-0.5deg);
  }
}

.bob-uncanny {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  border: 2px solid rgba(255,255,255,0.15);
}

.bob-pop {
  animation: bobPop 0.22s ease;
}

.score-box {
	animation: bobFloat 3s linear infinite;
	animation-delay: -0.5s;
}

.score-bump {
  animation: scoreBump 0.16s ease-out;
    animation-delay: 1s;
}

@keyframes scoreBump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bobPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes portraitScan {
  0% {
    transform: translate(-120%, -120%) rotate(12deg);
    opacity: 0;
  }
  20% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
  80% {
    opacity: 0.3;
  }
  100% {
    transform: translate(120%, 120%) rotate(12deg);
    opacity: 0;
  }
  
}

.score-box {
  position: relative;
  text-align: center;
}

/* POP */
.score-pop {
  animation: scorePop 0.25s ease;
}

@keyframes scorePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* +10 flotante */
.floating-score {
  position: absolute;
  right: 0;
  top: 0;
  color: #4cff7a;
  font-weight: bold;
  pointer-events: none;
  animation: floatUp 0.8s ease forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0px); }
  100% { opacity: 0; transform: translateY(-30px); }
}

.body-hit {
  animation: bodyHit 0.18s ease-out;
  transform-origin: center;
}

@keyframes bodyHit {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.975);
  }
  100% {
    transform: scale(1);
  }
}


.bob-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

/* flotación base */
@keyframes bobFloat {
  0%   { transform: translateY(0px) rotate(-0.6deg); }
  25%  { transform: translateY(-3px) rotate(0.8deg); }
  50%  { transform: translateY(-6px) rotate(0deg); }
  75%  { transform: translateY(-2px) rotate(-0.8deg); }
  100% { transform: translateY(0px) rotate(-0.6deg); }
}

/* hype/shake activado */
.bob-img.bob-shaking {
  animation:
    bobFloat 3s ease-in-out infinite,
    bobShake var(--bob-shake-speed, 0.18s) steps(1) infinite;
}

@keyframes bobShake {
  0%   { transform: scale(1.08) translate(var(--sx1, 0px), var(--sy1, 0px)) rotate(var(--sr1, 0deg)); }
  20%  { transform: scale(1.08) translate(var(--sx2, 0px), var(--sy2, 0px)) rotate(var(--sr2, 0deg)); }
  40%  { transform: scale(1.08) translate(var(--sx3, 0px), var(--sy3, 0px)) rotate(var(--sr3, 0deg)); }
  60%  { transform: scale(1.08) translate(var(--sx4, 0px), var(--sy4, 0px)) rotate(var(--sr4, 0deg)); }
  80%  { transform: scale(1.08) translate(var(--sx5, 0px), var(--sy5, 0px)) rotate(var(--sr5, 0deg)); }
  100% { transform: scale(1.08) translate(var(--sx6, 0px), var(--sy6, 0px)) rotate(var(--sr6, 0deg)); }
}

#center-view {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-left: auto;
	padding: 10px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255,255,255,0.1);
	background: rgba(255,255,255,0.04);
	color: rgba(255,255,255,0.82);
	font-family: monospace;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
	white-space: nowrap;
	transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

#center-view:hover {
	transform: translateY(-1px);
	background: rgba(255,255,255,0.07);
	border-color: rgba(255,255,255,0.18);
}

#center-view:before {
    content: '\f31e';
    font-family: 'Font Awesome 6 Free';
    font-weight: bold;
    font-size: 0.95rem;
    margin-right: 0;
    vertical-align: middle;
}

.side-panel {
  position: sticky;
  top: 20px;
  align-self: start;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;

  height: calc(100vh - 40px);
  min-height: 500px;
  max-height: calc(100vh - 40px);
      margin-bottom: 25px;
}

.side-panel .log,
.side-panel .footer-note,
.side-panel .dice-rules {
  min-height: 0;
}

.side-panel .log {
  overflow-y: auto;
  padding-right: 6px;
}

.side-panel .footer-note {
  overflow: hidden;
  margin-top: 0;
}

.side-panel .dice-rules {
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

.sweat-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 4;
}

.sweat-drop {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  animation: sweatFall linear forwards;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.4));
}

.rule-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.rule-col {
  display: flex;
  flex-direction: column;
}

.rule-col .win {
  color: var(--accent);
}

.rule-col .lose {
  color: var(--bad);
}

.rainbow-text {
  display: inline-block;
  font-weight: bold;

  background: linear-gradient(
    90deg,
    #ff4d4d,
    #ffd24d,
    #4dff88,
    #4dd2ff,
    #b84dff,
    #ff4d4d
  );
  background-size: 300% 100%;
  background-position: 0% 0%;

  background-clip: text;
  -webkit-background-clip: text;

  color: transparent;
  -webkit-text-fill-color: transparent;

  animation: rainbowMove 1.2s linear infinite;
}

@keyframes rainbowMove {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 300% 0%;
  }
}

@keyframes sweatFall {
  0% {
    transform: translateY(-8px) translateX(0) rotate(8deg) scale(0.9);
    opacity: 0;
  }
  15% {
    opacity: 0.95;
  }
  100% {
    transform: translateY(42px) translateX(6px) rotate(18deg) scale(1);
    opacity: 0;
  }
}

.attack-ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
}

.attack-ghost img {
  position: absolute;
  width: 128px;
  height: 128px;
  object-fit: contain;
  opacity: 0;
  filter: blur(0px);
  will-change: transform, opacity, filter;
  z-index:100
}

.attack-ghost.player img {
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(0.6);
  animation: attackFlyRight 0.65s ease-out forwards;
}

.attack-ghost.enemy img {
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(0.6);
  animation: attackFlyLeft 0.65s ease-out forwards;
}

@keyframes attackFlyRight {
  0% {
    transform: translate(-50%, -50%) translateX(0) scale(0.6);
    opacity: 0;
    filter: blur(0px);
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) translateX(140px) scale(1.25);
    opacity: 0.95;
    filter: blur(1px);
  }
  100% {
    transform: translate(-50%, -50%) translateX(190px) scale(2);
    opacity: 0;
    filter: blur(14px);
  }
}

@keyframes attackFlyLeft {
  0% {
    transform: translate(-50%, -50%) translateX(0) scale(0.6);
    opacity: 0;
    filter: blur(0px);
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) translateX(-140px) scale(1.25);
    opacity: 0.95;
    filter: blur(1px);
  }
  100% {
    transform: translate(-50%, -50%) translateX(-190px) scale(2);
    opacity: 0;
    filter: blur(14px);
  }
}

.powerup-slots {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-left: 38px;
}

.power-slot {
  width: 38px;
  height: 38px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
}

.power-slot img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  opacity: 0.85;
}

/* cuando está activo */
.power-slot.active {
  border-color: gold;
  box-shadow: 0 0 10px gold;
  transform: scale(1.1);
  animation: powerFloat 2.2s ease-in-out infinite,
             powerGlow 2.2s ease-in-out infinite;
}

.power-slot:nth-child(1) {
  animation-delay: 0s, 0s;
}

.power-slot:nth-child(2) {
  animation-delay: 0.3s, 0.3s;
}

.power-slot:nth-child(3) {
  animation-delay: 0.6s, 0.6s;
}

.power-slot:nth-child(4) {
  animation-delay: 0.9s, 0.9s;
}

@keyframes powerFloat {
  0% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.05);
  }
  100% {
    transform: translateY(0px) scale(1);
  }
}

@keyframes powerGlow {
  0% {
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.8);
  }
  100% {
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.2);
  }
}

.dice-powerup-img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  margin: auto;
  pointer-events: none;
}

.player-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-powerups {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
}

.player-powerup {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgb(204 229 14);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.18);
  animation: playerPowerupFloat 2s ease-in-out infinite;
}

.player-powerup img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
}

.player-powerup:nth-child(1) { animation-delay: 0s; }
.player-powerup:nth-child(2) { animation-delay: 0.2s; }
.player-powerup:nth-child(3) { animation-delay: 0.4s; }
.player-powerup:nth-child(4) { animation-delay: 0.6s; }
.player-powerup:nth-child(5) { animation-delay: 0.8s; }

@keyframes playerPowerupFloat {
  0%   { transform: translateY(0px) scale(1); }
  50%  { transform: translateY(-3px) scale(1.05); }
  100% { transform: translateY(0px) scale(1); }
}

#victory-placeholder-card {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

#victory-placeholder-card .card-top h3 {
    color: #ffffff;
    text-shadow: 0 1px 0px white, 0 1px 3px #0000009c;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
}
