:root {
  --bg: #edf8ef;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #f8fff9;
  --line: #b9d9bf;
  --text: #12351d;
  --muted: #4f6d56;
  --accent: #28a745;
  --accent-soft: #d5f2da;
  --success: #20a43a;
  --success-soft: #d5f2da;
  --warning: #d7a928;
  --warning-soft: #fff3c7;
  --danger: #87968b;
  --danger-soft: #edf3ee;
  --shadow: 0 18px 45px rgba(21, 87, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(237, 248, 239, 0.9) 35%, rgba(207, 235, 212, 0.92));
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-card,
.game-panel,
.info-card {
  background: var(--panel);
  border: 1px solid rgba(88, 117, 94, 0.16);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card {
  padding: 32px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.subtitle {
  color: var(--muted);
  margin-bottom: 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.7);
}

.auth-form button,
#submitGuess,
#closeReveal {
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #35c653, #159b32);
  color: #ffffff;
  font-weight: 700;
  padding: 14px 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-form button:hover,
#submitGuess:hover,
#closeReveal:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 134, 48, 0.22);
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-wrap h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.logout-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.45);
}

.language-toggle,
.reset-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.8fr);
  gap: 24px;
}

.game-panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.length-pill {
  border-radius: 999px;
  background: var(--accent-soft);
  color: #2d4035;
  font-weight: 700;
  padding: 10px 16px;
}

.board {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.row {
  display: grid;
  grid-template-columns: repeat(var(--letters), minmax(0, 1fr));
  gap: 10px;
}

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  text-transform: uppercase;
  transition: all 0.18s ease;
}

.cell-letter {
  display: block;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  line-height: 1;
  pointer-events: none;
}

.cell.filled {
  border-color: rgba(57, 72, 86, 0.25);
  background: rgba(255, 255, 255, 0.96);
}

.cell.correct {
  background: var(--success);
  border-color: var(--success);
  color: white;
  -webkit-text-fill-color: white;
}

.cell.present {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
  -webkit-text-fill-color: white;
}

.cell.absent {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  -webkit-text-fill-color: white;
}

.status-row {
  min-height: 28px;
  margin-bottom: 16px;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.controls input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  outline: none;
  font-size: 1rem;
}

#submitGuess {
  min-width: 120px;
}

.reset-button {
  border: none;
  border-radius: 14px;
  background: #e1f5e4;
  color: #17652a;
}

.reset-button:hover,
.language-toggle:hover {
  border-color: var(--accent);
  background: #d4f2d9;
}

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

.keyboard {
  display: grid;
  gap: 8px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.key {
  flex: 1 1 0;
  max-width: 52px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  min-width: 0;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text);
}

.key.correct {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.key.present {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.key.absent {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.info-panel {
  display: flex;
  flex-direction: column;
}

.info-card {
  padding: 22px 20px;
  height: fit-content;
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.reveal-modal {
  border: none;
  padding: 0;
  background: transparent;
  width: min(92vw, 760px);
}

.reveal-modal::backdrop {
  background: rgba(19, 17, 18, 0.7);
}

.reveal-card {
  background: var(--panel-strong);
  border-radius: 28px;
  padding: 26px 22px 18px;
  box-shadow: var(--shadow);
}

#revealName {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  letter-spacing: 0.18em;
  text-align: center;
}

.reveal-copy {
  text-align: center;
  color: var(--muted);
  margin-bottom: 18px;
}

.video-wrap {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  background: #140f0f;
}

#revealVideo {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #140f0f;
}

#closeReveal {
  width: 100%;
}

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

@media (max-width: 760px) {
  .page-shell {
    padding-top: 22px;
  }

  .topbar,
  .panel-header,
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-panel,
  .info-card,
  .auth-card {
    padding: 18px 16px;
  }

  .row {
    gap: 6px;
  }

  .cell {
    border-radius: 10px;
    font-size: clamp(1.25rem, 8vw, 1.8rem);
    line-height: 1;
  }

  .keyboard {
    width: 100%;
  }

  .keyboard-row {
    gap: 5px;
  }

  .key {
    padding: 10px 5px;
  }
}
