:root {
  --bg-color: #050505;      
  --text-color: #dcdcdc;     
  --border-color: #333333;  
  --tile-bg: #121212;      


  --color-correct: #8a1c1c;  
  --color-present: #b8860b;  
  --color-absent: #2a2a2a;   
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Crimson Text', serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 0;
}

/* --- CABEÇALHO --- */
header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
  padding-bottom: 15px;
  width: 100%;
  max-width: 600px;
}

h1.mephisto-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 4px;
  font-size: 3rem;

  background: linear-gradient(to bottom, #e0e0e0 30%, #8a1c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #8a1c1c;

  filter: drop-shadow(0 0 15px rgba(138, 28, 28, 0.3));
  margin-bottom: 5px;
  text-transform: uppercase;
}

header p {
  font-style: italic;
  color: #888;
  font-size: 1rem;
  letter-spacing: 1px;
}

/* --- TABULEIRO --- */
#board-container {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 30px;
}

#board {
display: grid;
grid-template-rows: repeat(6, 1fr);
grid-gap: 5px;
}

.row {
  display: grid;
  grid-template-columns: repeat(6, 1fr); 
  grid-gap: 5px;
}

.tile {
  width: 52px;
  height: 52px;
  border: 2px solid var(--border-color);
  background-color: var(--tile-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
  color: #fff;
  user-select: none;
  transition: transform 0.1s;
}

.tile.active {
  border-color: #dcdcdc;
  box-shadow: 0 0 10px rgba(138, 28, 28, 0.5);
  transform: scale(1.05);
  z-index: 10;
}

.current-row .tile { cursor: pointer; }

.tile.correct { background-color: var(--color-correct); border-color: var(--color-correct); }
.tile.present { background-color: var(--color-present); border-color: var(--color-present); }
.tile.absent { background-color: var(--color-absent); border-color: var(--color-absent); color: #555; }

.tile[data-status="filled"] {
  border-color: #666;
  animation: pulse 0.1s ease-in-out;
}

/* --- TECLADO --- */
#keyboard-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 6px;
max-width: 550px;
padding: 0 10px;
}

.key {
  background-color: #2c2c2c;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  height: 50px;
  min-width: 40px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  text-transform: uppercase;
  user-select: none;
  transition: background-color 0.2s;
}

.key:hover { background-color: #444; }
.key.wide { flex: 1.5; font-size: 0.9rem; }
.key.correct { background-color: var(--color-correct); }
.key.present { background-color: var(--color-present); }
.key.absent { background-color: var(--color-absent); color: #555; }

/* --- MENSAGENS E ANIMAÇÕES --- */
#message-container {
height: 30px;
margin-bottom: 15px;
color: #dcdcdc;
font-family: 'Cinzel', serif;
font-weight: bold;
text-align: center;
text-shadow: 0 0 5px rgba(138, 28, 28, 0.8);
font-size: 1.1rem;
}

.shake { animation: shake 0.5s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* --- MODAL DE VITÓRIA --- */
.hidden { display: none !important; }

#victory-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.95);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
animation: fadeIn 1s ease;
}

.modal-content {
  background-color: #0a0a0a;
  border: 2px solid var(--color-correct);
  padding: 30px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 0 30px rgba(138, 28, 28, 0.3);
  border-radius: 4px;
}

.victory-title {
  font-family: 'Cinzel', serif;
  color: var(--color-correct);
  font-size: 2rem;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(138, 28, 28, 0.6);
}

.stats-container {
  display: flex;
  justify-content: space-around;
  margin-bottom: 25px;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  padding: 15px 0;
}

.stat-box { display: flex; flex-direction: column; }

.stat-box span:first-child {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: #dcdcdc;
  font-weight: bold;
}

.stat-label { font-size: 0.8rem; color: #666; margin-top: 5px; }

.prophecy {
  font-family: 'Crimson Text', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #a8a8a8;
  line-height: 1.5;
  margin-bottom: 25px;
}

#close-btn {
background-color: transparent;
border: 1px solid var(--border-color);
color: #888;
padding: 10px 20px;
font-family: 'Cinzel', serif;
cursor: pointer;
transition: all 0.3s;
text-transform: uppercase;
font-size: 0.9rem;
}

#close-btn:hover {
border-color: var(--color-correct);
color: var(--color-correct);
box-shadow: 0 0 10px rgba(138, 28, 28, 0.2);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Mobible --- */
@media (max-width: 600px) {
  h1.mephisto-title { font-size: 2.2rem; }
  .tile { width: 45px; height: 45px; font-size: 1.8rem; }
  .key { height: 45px; min-width: 30px; font-size: 0.9rem; }
  #board-container { margin-bottom: 15px; }
}

/* --- RODAPÉ DA PÁGINA PRINCIPAL --- */
footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    padding-bottom: 10px;
    width: 100%;
    font-family: 'Crimson Text', serif;
    letter-spacing: 0.5px;
}

.footer-link {
    color: #888;
    text-decoration: none;
    border-bottom: 1px dotted #555;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--color-correct); 
    border-bottom-color: var(--color-correct);
}

.licenses-container {
    max-width: 700px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-header-img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border: 3px solid var(--color-correct);
    box-shadow: 0 0 25px rgba(138, 28, 28, 0.5);
    margin-bottom: 25px;
}

.mephisto-title.smaller {
    font-size: 2.2rem;
    margin-bottom: 30px;
}

.licenses-text-box {
    background-color: #0a0a0a;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 4px;
    text-align: left;
    width: 100%;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    margin-bottom: 40px;
}

.licenses-text-box p {
    margin-bottom: 20px;
    line-height: 1.7;
    color: #c0c0c0;
    font-size: 1.05rem;
}

.licenses-text-box a {
    color: var(--color-correct);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-correct);
    font-weight: bold;
    transition: opacity 0.2s;
}

.licenses-text-box a:hover {
    opacity: 0.8;
}

.disclaimer {
    font-style: italic;
    color: #888 !important;
    margin-top: 30px;
    font-size: 0.9rem !important;
}

.back-btn-container a#close-btn {
    text-decoration: none;
    display: inline-block;
}
