:root {
  --bg: #f4efe6;
  --paper: #fffdf8;
  --ink: #171414;
  --muted: #685e52;
  --line: #d9d1c5;
  --accent: #d25126;
  --accent-soft: #ffe7dc;
  --ok: #1f7a4d;
  --danger: #b3261e;
  --shadow: 0 18px 50px rgba(38, 24, 13, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #fff8eb 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #f7e2d2 0%, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 16px 52px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

p {
  line-height: 1.45;
  margin: 8px 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8bfaf;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button {
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary {
  background: #45403b;
}

.row {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.status {
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 12px;
  font-weight: 600;
}

.status.ok {
  background: #e3f5ea;
  color: var(--ok);
}

.status.err {
  background: #fde8e7;
  color: var(--danger);
}

.secret-word {
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  letter-spacing: 0.3em;
  font-weight: 700;
  margin: 20px 0;
  text-align: center;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.question-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: #fffcf6;
}

.qr {
  max-width: 190px;
  border: 1px solid #d7ccbc;
  border-radius: 8px;
  background: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #8a3416;
  font-weight: 700;
  font-size: 0.82rem;
}

a {
  color: #b53d1b;
}

.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(16, 10, 6, 0.84);
  backdrop-filter: blur(3px);
}

.reveal-overlay.hidden {
  display: none;
}

.reveal-card {
  width: min(680px, 100%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, #fff2e8 0%, transparent 54%),
    #fffdf8;
  border: 1px solid #e8d5c2;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.28);
  text-align: center;
  padding: 24px 16px 28px;
}

.reveal-title {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: #84401f;
  margin-bottom: 6px;
}

.reveal-letter {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(5.8rem, 32vw, 14rem);
  line-height: 1;
  color: #bf431b;
  text-shadow: 0 5px 0 #f2ccb9;
}

.reveal-meta,
.reveal-hint {
  margin: 8px auto;
  max-width: 480px;
}

.reveal-hint {
  font-weight: 700;
}

.reveal-btn {
  display: inline-block;
  text-decoration: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 10px 14px;
}

.reveal-btn:hover {
  opacity: 0.92;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 1px solid #efe5d8;
  padding: 9px 10px;
  text-align: left;
}

.leaderboard-table th {
  background: #f7ecdf;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.lang-switcher {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 80;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid #cbb9a4;
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(2px);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #5f5346;
  background: transparent;
  cursor: pointer;
}

.lang-btn.active {
  color: #fff;
  background: #a74a24;
}

@media (max-width: 700px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  main {
    padding: 20px 12px 36px;
  }
}
