:root {
  --bg1: #1a237e;
  --bg2: #0d47a1;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-muted: #b0b0c8;
  --primary: #ffa726;
  --primary-dark: #fb8c00;
  --guess: #2196f3;
  --guess-dark: #007bff;
  --perform: #43a047;
  --perform-dark: #28a745;
  --fingerspelling: #ffd700;
  --fingerspelling-dark: #ffa500;
  --success: #28a745;
  --error: #dc3545;
  --radius: 16px;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em 0;
}

p {
  line-height: 1.6;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 40, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.3rem;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle-label span {
  width: 26px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  gap: 6px;
}

.site-nav a {
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  background: var(--surface);
  text-decoration: none;
}

.site-nav a.active {
  background: var(--primary);
  color: #1a1a2e;
}

@media (max-width: 720px) {
  .nav-toggle-label {
    display: flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    order: 3;
    padding-top: 10px;
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  .site-nav a {
    padding: 12px 14px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 24px 20px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------- Generic layout helpers ---------- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
}

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title p {
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-guess {
  background: linear-gradient(135deg, var(--guess), var(--guess-dark));
}

.btn-perform {
  background: linear-gradient(135deg, var(--perform), var(--perform-dark));
}

.btn-fingerspelling {
  background: linear-gradient(135deg, var(--fingerspelling), var(--fingerspelling-dark));
  color: #241a00;
}

.btn-outline {
  background: transparent;
  border-color: var(--surface-border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface);
}

.btn-block {
  width: 100%;
}

/* ---------- Hero (Home) ---------- */

.hero {
  text-align: center;
  padding: 70px 20px 50px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.hero .tagline {
  font-size: 1.2rem;
  max-width: 640px;
  margin: 0 auto 30px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat .label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Cards / feature grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  margin: 0;
}

/* ---------- Game mode cards ---------- */

.mode-grid {
  display: grid;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 22px;
  flex-wrap: wrap;
}

.mode-card.mode-guess {
  border-color: var(--guess);
}

.mode-card.mode-perform {
  border-color: var(--perform);
}

.mode-card.mode-fingerspelling {
  border-color: var(--fingerspelling);
}

.mode-card .mode-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
}

.mode-card .mode-info {
  flex: 1;
  min-width: 180px;
}

.mode-card h3 {
  margin-bottom: 4px;
}

.mode-card p {
  margin: 0;
}

/* ---------- Gameplay ---------- */

.game-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

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

.game-score {
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.video-stage {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid var(--surface-border);
}

.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  padding: 18px 12px;
  border-radius: 14px;
  border: 2px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.choice-btn:disabled {
  cursor: default;
}

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

.choice-btn.incorrect {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.feedback-banner {
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.feedback-banner.correct {
  background: rgba(40, 167, 69, 0.25);
  border: 1px solid var(--success);
}

.feedback-banner.incorrect {
  background: rgba(220, 53, 69, 0.25);
  border: 1px solid var(--error);
}

.perform-word {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  margin-bottom: 20px;
}

.perform-word .word {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--perform);
}

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

.game-over {
  text-align: center;
  padding: 40px 20px;
}

.game-over .final-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 10px 0 20px;
}

/* ---------- Fingerspelling ---------- */

.fingerspell-input {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fingerspell-input input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.1rem;
}

.fingerspell-input input[type="text"]:focus {
  outline: none;
  border-color: var(--fingerspelling);
}

.fingerspell-stage {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.fingerspell-stage img {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.fingerspell-word {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.fingerspell-word .active-letter {
  color: var(--fingerspelling);
}

.speed-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.speed-selector button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.speed-selector button.active {
  border-color: var(--fingerspelling);
  background: rgba(255, 215, 0, 0.18);
}

/* ---------- FAQ (Support) ---------- */

.faq-item {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.faq-item p {
  margin: 0;
}

/* ---------- Prose (Privacy) ---------- */

.prose h2 {
  margin-top: 1.6em;
}

.prose ul {
  color: var(--text-muted);
  line-height: 1.7;
}

.prose strong {
  color: var(--text);
}

.updated-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

/* ---------- Blazor framework defaults below ---------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9yb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jYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}