/* MyClassicGame Tetris — Modern Retro Arcade Theme
   Drop-in replacement for css/style.css
   Phase 1: CSS-only redesign, no HTML/JS changes required.
*/

:root {
  --bg-page: #070b14;
  --bg-radial-1: #15243a;
  --bg-radial-2: #0b1020;
  --bg-panel: rgba(14, 20, 34, 0.96);
  --bg-card: rgba(18, 27, 45, 0.92);
  --bg-board: #07111f;
  --bg-cell: #0d1828;
  --text-primary: #f8fafc;
  --text-secondary: #a9b4c7;
  --accent-cyan: #39d9ff;
  --accent-purple: #c56cff;
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-cyan: rgba(57, 217, 255, 0.7);
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-panel: 0 18px 55px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 8px 22px rgba(0, 0, 0, 0.35);
  --glow-cyan: 0 0 20px rgba(57, 217, 255, 0.3);
  --glow-purple: 0 0 24px rgba(197, 108, 255, 0.3);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 10px;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 50% 0%, rgba(57, 217, 255, 0.16), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(197, 108, 255, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg-radial-1), var(--bg-page) 55%, var(--bg-radial-2));
}

#particles-js {
  flex: 1;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.35;
}

#container {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 18px;
  margin: 24px auto;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

#container::before {
  content: "TETRIS";
  position: absolute;
  left: 50
  top: 100px;
  transform: translateX(-50%);
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(57, 217, 255, 0.75), 0 0 24px rgba(197, 108, 255, 0.55);
}

#matriz {
  width: auto;
  height: auto;
  display: inline-block;
  margin: 0 auto;
  background: var(--bg-board);
  border: 2px solid var(--border-cyan);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.45), var(--glow-cyan);
  padding: 8px;
}

#info {
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  vertical-align: top;
  min-width: 136px;
}

#info .box,
#pontuacaoBox,
#proximasPecasBox {
  margin: 0;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

#pontuacaoBox {
  border: 1px solid rgba(57, 217, 255, 0.35);
}

#info .box .titulo {
  margin-bottom: 8px;
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#pontuacaoBox .titulo {
  font-size: 0;
}

#pontuacaoBox .titulo::after {
  content: "SCORE";
  font-size: 13px;
}

#pontuacao {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.github-button,
.github-button iframe,
#info .box:has(.github-button) {
  display: none !important;
}

#proximasPecasBox {
  min-height: 192px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

#proximasPecasBox::before {
  content: "NEXT";
  display: block;
  margin-bottom: 8px;
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.bloco {
  color: var(--text-primary);
  background: var(--bg-cell);
  width: 30px;
  height: 30px;
  display: inline-block;
  vertical-align: top;
  line-height: 25px;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.035);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.22);
}

.bloco.ativo {
  background-color: var(--accent-cyan);
  border-color: rgba(255,255,255,0.26);
  box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(57,217,255,0.28);
}

#proximasPecasBox .linha,
#proximasPecasBox .bloco {
  height: 15px;
}

#proximasPecasBox .bloco {
  width: 15px;
  border-radius: 3px;
}

#proximasPecasBox .bloco.ativo {
  background-color: var(--accent-purple);
  box-shadow: inset 0 0 8px rgba(255,255,255,0.22), 0 0 12px rgba(197,108,255,0.4);
}

.ativo.cor-0 { background-color: #ff5d6c; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(255,93,108,0.35); }
.ativo.cor-1 { background-color: #ffc857; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(255,200,87,0.34); }
.ativo.cor-2 { background-color: #39d9ff; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(57,217,255,0.35); }
.ativo.cor-3 { background-color: #7ee06b; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(126,224,107,0.35); }
.ativo.cor-4 { background-color: #5f8cff; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(95,140,255,0.35); }
.ativo.cor-5 { background-color: #c56cff; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(197,108,255,0.35); }
.ativo.cor-6 { background-color: #c9f31d; box-shadow: inset 0 0 10px rgba(255,255,255,0.22), 0 0 12px rgba(201,243,29,0.32); }

#joystick {
  display: flex;
  border-top: 1px solid var(--border-soft);
  margin-top: 14px;
  padding-top: 14px;
}

#direcional { flex: 1; }

#direcional table {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

#direcional a,
#botoes #action {
  display: block;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #25344f, #111827);
  border: 1px solid rgba(57,217,255,0.4);
  box-shadow: var(--glow-cyan);
}

#direcional a {
  width: 28px;
  height: 28px;
}

#botoes {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

#botoes #action {
  width: 56px;
  height: 56px;
  background: linear-gradient(180deg, #5d2f88, #251437);
  border-color: rgba(197,108,255,0.55);
  box-shadow: var(--glow-purple);
}

@media (max-width: 720px) {
  body {
    align-items: flex-start;
    padding: 86px 12px 24px;
  }

  #container {
    width: min(100%, 430px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin: 0 auto;
  }

  #container::before {
    top: -58px;
    font-size: 40px;
  }

  #info {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #pontuacaoBox {
    min-height: 76px;
  }

  #proximasPecasBox {
    grid-column: 1 / -1;
    min-height: 96px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 18px;
  }

  #proximasPecasBox::before {
    margin: 0 8px 0 0;
  }
}

@media (max-width: 420px) {
  body {
    padding-left: 8px;
    padding-right: 8px;
  }

  #container {
    padding: 10px;
  }

  #matriz {
    padding: 6px;
  }

  .bloco {
    width: 26px;
    height: 26px;
    line-height: 22px;
  }

  #proximasPecasBox .linha,
  #proximasPecasBox .bloco {
    height: 13px;
  }

  #proximasPecasBox .bloco {
    width: 13px;
  }

  #pontuacao {
    font-size: 24px;
  }
}
