/* =========================================================
   JOGO DE REAÇÃO - CSS
   ========================================================= */

:root {
  --rx-line: rgba(255,255,255,.12);
  --rx-white: #f5f5f5;
  --rx-amber: #ffb400;
  --rx-green: #2ecc71;
  --rx-red: #e74c3c;
  --rx-cyan: #00d1ff;
  --rx-blue: #1a4b8c;
  --rx-blue-dark: #0d2a52;
}

/* Container */
.rx-wrap {
  max-width: 560px;
  margin: 0 auto;
}

/* Área do pinheirinho */
.rx-treeArea {
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
}

.rx-tree {
  width: 200px;
  border-radius: 16px;
  position: relative;
  padding: 12px 0 14px;
  background: rgba(8,12,18,.35);
  border: 1px solid var(--rx-line);
  overflow: hidden;
  backdrop-filter: blur(6px);
}

/* Coluna central azul */
.rx-tree::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
  bottom: 12px;
  width: 42px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--rx-blue) 0%, var(--rx-blue-dark) 100%);
  border: 2px solid rgba(100,150,220,.3);
  box-shadow: inset 0 2px 8px rgba(255,255,255,.15), 0 0 20px rgba(26,75,140,.3);
  z-index: 1;
}

/* Texto PRODEME no pinheirinho principal */
.rx-tree::after{
  content:"PRODEME";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);

  writing-mode:vertical-rl;
  text-orientation:upright;

  white-space:nowrap;
  line-height:1;

  font-family:'Barlow Condensed','Orbitron',sans-serif;
  font-weight:800;
  font-size:19px;
  letter-spacing:5px;

  color:rgba(255,255,255,.92);
  text-shadow:0 0 12px rgba(0,209,255,.55);

  z-index:2;
  pointer-events:none;
}

/* Labels Pista A / B */
.rx-labelsTop {
  display: flex;
  justify-content: space-between;
  padding: 0 30px 12px;
  font-size: .72rem;
  letter-spacing: .8px;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  font-weight: 600;
}

/* Linhas de lâmpadas */
.rx-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  padding: 4px 0;
  position: relative;
}

.rx-row.sep {
  padding-top: 10px;
}

.rx-row.pre-stage {
  padding-bottom: 2px;
}

/* Lâmpadas */
.rx-lamp {
  border-radius: 50%;
  background: rgba(40,40,45,.85);
  border: 3px solid rgba(70,75,85,.7);
  box-shadow: 
    inset 0 -8px 12px rgba(0,0,0,.7),
    inset 0 4px 8px rgba(255,255,255,.08),
    0 3px 8px rgba(0,0,0,.5);
  transition: all .08s ease-out;
  position: relative;
  z-index: 3;
}

.rx-lamp.sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.rx-lamp.md {
  width: 38px;
  height: 38px;
  border-width: 4px;
}

.rx-lamp.on {
  border-color: rgba(255,255,255,.3);
  box-shadow: 
    0 0 25px currentColor,
    0 0 50px currentColor,
    0 0 75px rgba(255,255,255,.15),
    inset 0 -6px 10px rgba(0,0,0,.3),
    inset 0 4px 8px rgba(255,255,255,.3);
}

/* Cores das lâmpadas */
.pre, .stg {
  color: var(--rx-white);
  background: radial-gradient(circle at 35% 35%, #fff 0%, #e8e8e8 40%, #c0c0c0 100%);
}

.amb {
  color: var(--rx-amber);
  background: radial-gradient(circle at 35% 35%, #ffe066 0%, #ffb400 40%, #cc8800 100%);
}

.grn {
  color: var(--rx-green);
  background: radial-gradient(circle at 35% 35%, #5dff8a 0%, #2ecc71 40%, #1a9c4a 100%);
}

.red {
  color: var(--rx-red);
  background: radial-gradient(circle at 35% 35%, #ff7b7b 0%, #e74c3c 40%, #b82d1f 100%);
}

.rx-lamp-group {
  display: flex;
  gap: 6px;
  position: relative;
  z-index: 3;
}

/* Caixa de tempo */
.rx-timeBox {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--rx-line);
  background: rgba(0,0,0,.18);
  text-align: center;
}

.rx-timeVal {
  font-weight: 950;
  font-size: 2.15rem;
  letter-spacing: .9px;
  font-variant-numeric: tabular-nums;
}

.rx-timeVal.negative {
  color: var(--rx-red);
}

.rx-timeHint {
  margin-top: 3px;
  font-size: .86rem;
  color: rgba(255,255,255,.70);
}

/* Botões */
.rx-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.rx-btn {
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font-weight: 900 !important;
  letter-spacing: .2px;
  touch-action: manipulation;
}

/* Tabela de ranking */
.rx-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rx-table .rank-pos {
  width: 40px;
  text-align: center;
  font-weight: 700;
}

.rx-table .rank-medal {
  font-size: 1.3rem;
  line-height: 1;
}

.rx-table .rank-name {
  font-weight: 500;
}

/* Contador de tentativas */
.rx-attempts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--rx-line);
  font-size: .82rem;
  color: rgba(255,255,255,.7);
}

.rx-attempts b {
  color: var(--rx-cyan);
  font-weight: 700;
}

.rx-attempts.warning {
  background: rgba(255,180,0,.08);
  border-color: rgba(255,180,0,.3);
}

.rx-attempts.warning b {
  color: var(--rx-amber);
}

/* =========================================================
   CARD PARA STORIES
   ========================================================= */

.story-wrap {
  background: transparent;
  border-radius: 18px;
  padding: 0;
}

.story-card {
  width: 380px;
  max-width: 100%;
  border-radius: 20px;
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15,20,28,.99) 0%, rgba(8,12,18,.99) 100%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 50px rgba(0,0,0,.5);
}

.sc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sc-header img {
  height: 36px;
  width: auto;
}

.sc-header-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--rx-cyan);
  text-shadow: 0 0 20px rgba(0,230,255,.5);
}

.sc-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Pinheirinho mini do card */
.sc-tree-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  background: rgba(0,0,0,.25);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
}

.sc-tree-mini {
  position: relative;
  padding: 6px 0;
}

.sc-tree-mini::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 3px;
  bottom: 3px;
  width: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--rx-blue) 0%, var(--rx-blue-dark) 100%);
  border: 1px solid rgba(100,150,220,.25);
  z-index: 1;
}

/* Texto PRODEME no card (mini) */
.sc-tree-mini::after{
  content:"PRODEME";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);

  writing-mode:vertical-rl;
  text-orientation:upright;

  white-space:nowrap;
  line-height:1;

  font-family:'Barlow Condensed','Orbitron',sans-serif;
  font-weight:700;
  font-size:8px;
  letter-spacing:2px;

  color:rgba(255,255,255,.85);
  text-shadow:0 0 6px rgba(0,209,255,.45);

  z-index:2;
  pointer-events:none;
}

.sc-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 22px;
  align-items: center;
  padding: 1px 0;
  z-index: 2;
}

.sc-row.sep {
  padding-top: 3px;
}

.sc-pair {
  display: flex;
  gap: 2px;
}

.sc-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(40,40,45,.85);
  border: 1px solid rgba(70,75,85,.6);
  box-shadow: 
    inset 0 -2px 4px rgba(0,0,0,.6),
    inset 0 1px 2px rgba(255,255,255,.06);
}

.sc-lamp.sm {
  width: 6px;
  height: 6px;
  border-width: 1px;
}

.sc-lamp.on {
  border-color: rgba(255,255,255,.25);
  box-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    inset 0 -1px 2px rgba(0,0,0,.25);
}

.sc-pre {
  color: var(--rx-white);
  background: radial-gradient(circle at 35% 35%, #fff 0%, #e0e0e0 50%, #a0a0a0 100%);
}

.sc-amb {
  color: var(--rx-amber);
  background: radial-gradient(circle at 35% 35%, #ffe066 0%, #ffb400 50%, #cc8800 100%);
}

.sc-grn {
  color: var(--rx-green);
  background: radial-gradient(circle at 35% 35%, #5dff8a 0%, #2ecc71 50%, #1a9c4a 100%);
}

.sc-red {
  color: var(--rx-red);
  background: radial-gradient(circle at 35% 35%, #ff7b7b 0%, #e74c3c 50%, #b82d1f 100%);
}

/* Info box */
.sc-info-box {
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 14px;
}

.sc-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.sc-kv:last-child {
  border-bottom: none;
}

.sc-kv span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sc-kv b {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  letter-spacing: .3px;
}

/* Tempo no card */
.sc-time {
  border-radius: 12px;
  border: 2px solid rgba(0,209,255,.3);
  background: linear-gradient(180deg, rgba(0,209,255,.08) 0%, rgba(0,209,255,.03) 100%);
  padding: 16px 14px;
  text-align: center;
}

.sc-time.burned {
  border-color: rgba(231,76,60,.3);
  background: linear-gradient(180deg, rgba(231,76,60,.08) 0%, rgba(231,76,60,.03) 100%);
}

.sc-time .val {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--rx-cyan);
  text-shadow: 0 0 25px rgba(0,209,255,.5);
}

.sc-time.burned .val {
  color: var(--rx-red);
  text-shadow: 0 0 25px rgba(231,76,60,.5);
}

.sc-time .unit {
  margin-top: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
}

/* Footer do card */
.sc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sc-footer .tag {
  font-family: 'Orbitron', sans-serif;
  font-size: .7rem;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
}

.sc-footer .url {
  font-family: 'Rajdhani', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  color: var(--rx-cyan);
  letter-spacing: .5px;
}

@media (max-width: 420px) {
  .story-card {
    width: 100%;
    padding: 16px 14px 14px;
  }
}

/* =========================================================
   MODAL DE ÚLTIMA TENTATIVA
   ========================================================= */

.last-attempt-modal .modal-content {
  background: linear-gradient(180deg, rgba(30,35,45,.98) 0%, rgba(15,18,25,.98) 100%);
  border: 2px solid rgba(255,180,0,.4);
  border-radius: 20px;
}

.last-attempt-icon {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: pulse-warning 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: .8; }
}

.last-attempt-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--rx-amber);
  margin-bottom: 8px;
}

.last-attempt-text {
  color: rgba(255,255,255,.8);
  font-size: .95rem;
  line-height: 1.5;
}

.last-attempt-footer {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  margin-top: 12px;
}
