:root {
  --bg: #0b0b0b;
  --panel: #141414;
  --line: #2a2a2a;
  --text: #f3f4f6;
  --muted: #b3b3b3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: 100%;
  padding: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  padding: 20px 20px 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.stage-section,
.status-section,
.attempts-section {
  width: 100%;
  padding: 20px;
}

.stage-section {
  padding-top: 16px;
}

.stage-timer {
  width: 100%;
  margin-bottom: 12px;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  text-align: center;
}

.hidden {
  visibility: hidden;
}

.stage-screen {
  width: 100%;
  height: 90dvh;
  min-height: 90dvh;
  border: 1px solid #fff;
  display: grid;
  place-items: center;
  transition: background-color 0.15s linear;
}

.stage-screen.black {
  background: #000;
}

.stage-screen.azul {
  background: #0ea5e9;
}

.stage-screen.verde {
  background: #22c55e;
}

.stage-screen.vermelho {
  background: #ef4444;
}

.stage-screen.amarelo {
  background: #eab308;
}

.stage-screen.neutral {
  background: #1e293b;
}

.stage-screen.success {
  background: #059669;
}

.stage-content {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
}

.stage-text {
  order: 2;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
}

.stage-hints {
  order: 1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 600;
  text-align: center;
}

.stage-hints span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 160px;
}

.hint-azul {
  color: #38bdf8;
}

.hint-verde {
  color: #4ade80;
}

.hint-vermelho {
  color: #f87171;
}

.hint-amarelo {
  color: #facc15;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
}

.hint-azul kbd {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.hint-verde kbd {
  background: rgba(34, 197, 94, 0.2);
  border-color: #4ade80;
  color: #86efac;
}

.hint-vermelho kbd {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #fca5a5;
}

.hint-amarelo kbd {
  background: rgba(234, 179, 8, 0.2);
  border-color: #facc15;
  color: #fde047;
}

.status-section,
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.status-row,
.summary-row {
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.status-row span,
.summary-row span,
.attempts-header p,
.attempt-empty,
.attempt-row {
  color: var(--muted);
}

.status-row strong,
.summary-row strong {
  color: var(--text);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.attempts-header {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.attempts-list {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
}

.attempt-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.attempt-row:last-child {
  border-bottom: 0;
}

.attempt-empty {
  padding: 16px;
}

@media (max-width: 700px) {
  h1,
  .stage-section,
  .status-section,
  .attempts-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stage-content {
    padding: 18px;
    gap: 16px;
  }

  .stage-hints {
    gap: 14px;
  }

  .stage-hints span {
    min-width: 130px;
  }

  .status-row,
  .summary-row {
    padding: 14px;
  }
}
