* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: #050506;
  color: #c8c4bc;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.st-app {
  min-height: 100vh;
  padding: 24px 20px 100px;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.st-title {
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  margin: 0 0 10px;
  color: #e8e4dc;
  letter-spacing: 0.04em;
}

.st-sub {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 8px;
  opacity: 0.92;
  max-width: 42ch;
}

.st-sub strong {
  color: #d8a0a0;
  font-weight: 600;
}

.st-round {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6a6a70;
  margin: 20px 0 12px;
}

.st-hint {
  font-size: 0.88rem;
  min-height: 1.4em;
  color: #8a8a8c;
  margin: 10px 0 16px;
}

.st-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 56px;
  margin-bottom: 6px;
}

.st-cell {
  width: 44px;
  height: 52px;
  border: 2px solid #3a3a42;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #e0dcc8;
  background: #12121a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.st-cell.st-cell--empty {
  color: transparent;
}

.st-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Focus trap: one-pixel visible focus for keyboard users */
.st-input {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0.02;
  pointer-events: auto;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 1px;
  caret-color: transparent;
}

.st-input:focus {
  opacity: 0.05;
  outline: 1px solid #4448;
}

.st-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.st-btn {
  margin: 0;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d4d0c8;
  background: #1c1c24;
  border: 1px solid #3a3a45;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.st-btn:hover,
.st-btn:focus-visible {
  border-color: #5a5a68;
  color: #f0ede8;
  outline: none;
}

.st-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.st-btn-hear {
  background: #2a1a1a;
  border-color: #5a2a2a;
}

.st-btn-hear:hover:not(:disabled),
.st-btn-hear:focus-visible:not(:disabled) {
  border-color: #8a3a3a;
  color: #ffb0a0;
}

.st-btn-link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.st-exit {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 28px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: #5a5a60;
  background: rgba(8, 8, 10, 0.85);
  border: 1px solid #2a2a32;
  border-radius: 4px;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.st-exit:hover,
.st-exit:focus-visible {
  color: #999;
  border-color: #444;
  outline: none;
}

/* ── Death overlay ── */
.st-death {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #050304;
  animation: st-death-bg 0.4s ease-out forwards;
}

.st-death[hidden] {
  display: none;
}

@keyframes st-death-bg {
  from {
    background: #300008;
  }
  to {
    background: #080205;
  }
}

.st-death-canvas {
  max-width: min(100%, 520px);
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  margin-bottom: 8px;
  filter: contrast(1.1);
}

.st-death-line1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #8a0a0a;
  text-shadow: 0 0 20px #400010, 0 0 40px #200010;
  margin: 0 0 6px;
  animation: st-shake 0.1s ease-in-out infinite;
}

.st-death-line2 {
  font-size: 0.95rem;
  text-align: center;
  color: #6a4a4a;
  max-width: 32ch;
  line-height: 1.4;
  margin: 0 0 24px;
}

.st-beast {
  color: #a01818;
  font-weight: 700;
}

@keyframes st-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(2px, -1px);
  }
  75% {
    transform: translate(-2px, 1px);
  }
}

.st-death-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.st-death .st-btn {
  min-width: 120px;
}

body.st-locked {
  overflow: hidden;
}
