* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #020617;
  color: #e5e7eb;
}

body {
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.28), transparent 34%),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  padding: 12px;
}

.main {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.fullscreen-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.step-panel {
  display: none !important;
  width: 100%;
}

.step-panel.active {
  display: flex !important;
}

.panel {
  width: 100%;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  padding: 18px;
}

.panel--intro {
  justify-content: center;
}

.panel-content {
  width: 100%;
}

.panel-actions {
  margin-top: 20px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px;
}

.panel__header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
}

.identity-strip {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 0.9rem;
  text-align: center;
}

.chip,
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
  font-size: 0.82rem;
  font-weight: 700;
}

.info-box {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
  line-height: 1.5;
}

.info-box--mini {
  font-size: 0.94rem;
}

.info-box--story {
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(59, 130, 246, 0.13)),
    rgba(15, 23, 42, 0.74);
  border-color: rgba(250, 204, 21, 0.35);
}

.intro-main-box {
  font-size: 1.02rem;
}

.how-panel {
  margin-top: 14px;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.how-panel summary {
  cursor: pointer;
  padding: 15px 16px;
  font-weight: 800;
  color: #fde68a;
}

.how-panel__content {
  padding: 0 16px 16px;
  color: #dbeafe;
  line-height: 1.55;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-center {
  justify-content: center;
}

.action-buttons {
  justify-content: center;
}

.btn,
button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: rgba(191, 219, 254, 0.4);
}

.btn--secondary {
  background: linear-gradient(135deg, #334155, #0f172a);
}

.btn--warning {
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.btn--next {
  background: linear-gradient(135deg, #16a34a, #059669);
}

.setup-grid,
.control-grid,
.mini-feedback-grid,
.sudden-grid {
  display: grid;
  gap: 14px;
}

.setup-grid,
.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-feedback-grid,
.sudden-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #cbd5e1;
}

input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.6);
  color: #f8fafc;
  font-size: 1rem;
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.field-inline {
  margin-top: 14px;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.checkbox-wrap input {
  width: 18px;
  height: 18px;
}

.card-display {
  margin-top: 16px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.card-display--empty {
  color: #cbd5e1;
}

.card-hero {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 16px;
  align-items: center;
}

.card-image-wrap {
  width: 100%;
  border-radius: 20px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.card-image {
  display: block;
  width: 100%;
  height: auto;
}

.card-title {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.card-subtitle {
  margin-top: 6px;
  color: #bfdbfe;
  font-weight: 700;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.card-despertar {
  border-color: rgba(34, 197, 94, 0.55);
}

.card-pro {
  border-color: rgba(59, 130, 246, 0.6);
}

.card-leyenda {
  border-color: rgba(250, 204, 21, 0.75);
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.25),
    0 24px 60px rgba(250, 204, 21, 0.12);
}
.dice-visual-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}

.dice-cube {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #1e293b, #020617);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 3rem;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
}

.dice-cube.rolling {
  animation: diceShake 0.75s ease;
}

@keyframes diceShake {
  0% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(14deg) scale(1.05); }
  40% { transform: rotate(-12deg) scale(1.08); }
  60% { transform: rotate(10deg) scale(1.04); }
  80% { transform: rotate(-6deg) scale(1.02); }
  100% { transform: rotate(0deg) scale(1); }
}

.dice-single {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.dice-card {
  min-width: 210px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(96, 165, 250, 0.35);
  text-align: center;
}

.dice-card__label {
  color: #93c5fd;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dice-card__value {
  margin-top: 6px;
  font-size: 1.55rem;
  font-weight: 900;
  color: #fef3c7;
}

.execution-info {
  display: grid;
  gap: 14px;
}

.btn-cromo-toggle {
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-weight: 800;
}

.execution-guide {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(74, 222, 128, 0.28);
}

.execution-guide__title {
  color: #bbf7d0;
  font-weight: 900;
  margin-bottom: 8px;
}

.execution-guide__text {
  color: #f8fafc;
  line-height: 1.45;
  font-weight: 700;
}

#executionLoadBox {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(249, 115, 22, 0.12));
  border-color: rgba(250, 204, 21, 0.4);
  color: #fef3c7;
  font-weight: 900;
}

.mini-feedback-box {
  padding: 16px;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.mini-feedback-box__title {
  font-weight: 900;
  color: #fde68a;
  margin-bottom: 12px;
  text-align: center;
}

.player-feedback,
.sudden-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.player-feedback__name,
.sudden-card__name {
  font-size: 1.05rem;
  font-weight: 900;
  color: #bfdbfe;
  margin-bottom: 12px;
}

.feedback-group {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.feedback-group__title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.choice-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #e5e7eb;
  font-weight: 750;
  line-height: 1.35;
}

.choice-chip input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.choice-chip--bad {
  border-color: rgba(248, 113, 113, 0.32);
}

.sudden-card__question {
  margin-bottom: 12px;
  color: #f8fafc;
  font-weight: 900;
  line-height: 1.42;
}

.sudden-card__options {
  display: grid;
  gap: 9px;
}
.collection-content {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.collection-section h3 {
  margin: 0 0 12px;
  color: #fde68a;
}

.collection-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
}

.collection-card {
  padding: 8px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.collection-thumb-wrap {
  overflow: hidden;
  border-radius: 12px;
  background: #020617;
}

.collection-thumb {
  display: block;
  width: 100%;
  height: auto;
}

.collection-code {
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #bfdbfe;
  text-align: center;
}

.achievement-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.32);
  color: #fef3c7;
  font-size: 0.86rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 90;
  transform: translateX(-50%) translateY(20px);
  max-width: min(92vw, 560px);
  padding: 13px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(8px);
}

.modal-content {
  width: min(94vw, 880px);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, #0f172a, #020617);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.modal-content h2 {
  margin-top: 0;
  color: #f8fafc;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  font-size: 1.7rem;
  font-weight: 900;
  cursor: pointer;
}

.lightbox-content {
  width: min(94vw, 620px);
}

.modal-open {
  overflow: hidden;
}

.mobile-fullscreen {
  min-height: 100vh;
}

@media (max-width: 760px) {
  .app {
    padding: 8px;
  }

  .panel {
    min-height: auto;
    padding: 14px;
    border-radius: 20px;
  }

  .panel__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .setup-grid,
  .control-grid,
  .mini-feedback-grid,
  .sudden-grid {
    grid-template-columns: 1fr;
  }

  .card-hero {
    grid-template-columns: 1fr;
  }

  .card-image-wrap {
    max-width: 340px;
    margin: 0 auto;
  }

  .toolbar,
  .toolbar-center,
  .action-buttons {
    justify-content: center;
  }

  .btn {
    width: 100%;
  }

  .fullscreen-wrapper .btn {
    width: auto;
  }

  .identity-strip {
    border-radius: 16px;
  }

  .modal-content {
    padding: 16px;
  }

  .collection-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  }
}

@media (max-width: 420px) {
  .panel {
    padding: 12px;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .dice-cube {
    width: 76px;
    height: 76px;
    font-size: 2.4rem;
  }

  .choice-chip {
    align-items: flex-start;
  }
}
