/* Nostalgia Game — حبر الليل · وفق 08 */

/* Local IBM Plex — do not rely on OS/system fonts */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
/* Latin glyphs inside Arabic UI (e.g. ScorePoint) */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/nostalgia/ibm-plex-sans-arabic-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.nostalgia-shell {
  --bg: #12141c;
  --surface: #1c2030;
  --text: #f3eee4;
  --muted: #b8b0a4;
  --gold: #c4a574;
  --gold-press: #a88955;
  --option-border: #606a8c;
  --focus: #e0c089;
  --wa: #0f8244;
  --x-bg: #3d4668;
  --x-border: #8a93b5;
  --error-text: #e8b4b4;
  --error-bg: rgba(180, 70, 70, 0.12);
  --error-border: #8a4040;
  --selected-bg: rgba(196, 165, 116, 0.24);
  --radius: 14px;
  --max: 600px;
  --font-ar: "IBM Plex Sans Arabic", sans-serif;
  --font-en: "IBM Plex Sans", sans-serif;
  --touch: 48px;
  --confirm-ms: 200ms;
}

.nostalgia-shell,
.nostalgia-shell *,
.nostalgia-shell *::before,
.nostalgia-shell *::after {
  box-sizing: border-box;
}

.nostalgia-page {
  padding: 24px 0 48px;
}

.nostalgia-after-game {
  max-width: 1000px;
}

.nostalgia-seo-article {
  margin-top: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  line-height: 1.9;
}

.nostalgia-seo-article h2 {
  margin: 0 0 16px;
  font-size: 1.55rem;
}

.nostalgia-seo-article h3 {
  margin: 24px 0 8px;
  color: #c4a574;
  font-size: 1.15rem;
}

.nostalgia-seo-article p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.82);
}

.nostalgia-shell {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, var(--text));
  font-family: var(--font-ar);
  line-height: 1.55;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

body[data-lang="en"] .nostalgia-shell {
  font-family: var(--font-en);
}

.nostalgia-shell button,
.nostalgia-shell input {
  font: inherit;
}

.nostalgia-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 32px 24px;
  min-height: 0;
}

.nostalgia-shell .screen[hidden] {
  display: none !important;
}

.nostalgia-shell .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  margin-bottom: 0;
}

.nostalgia-shell .topbar--play {
  justify-content: center;
  min-height: 40px;
  margin-bottom: 20px;
}

.nostalgia-shell .progress {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nostalgia-shell .hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 16px;
  text-align: center;
}

.nostalgia-shell .hero {
  display: block;
  min-height: auto;
  text-align: center;
  padding: 28px 8px 8px;
}

.nostalgia-shell .game-title {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 5.5vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.nostalgia-shell .tagline {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 1.05rem;
}

.nostalgia-shell .intro {
  margin: 0 0 28px;
  color: var(--text);
  font-size: 1rem;
}

.nostalgia-shell .reassure {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.nostalgia-shell .card {
  background: var(--surface);
  border: 1px solid rgba(96, 106, 140, 0.45);
  border-radius: var(--radius);
  padding: 22px 18px;
}

.nostalgia-shell .question-text {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
}

.nostalgia-shell .options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nostalgia-shell .option-btn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: var(--touch);
  padding: 14px 14px;
  text-align: start;
  border: 2px solid var(--option-border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.nostalgia-shell .option-btn:hover:not(:disabled) {
  border-color: var(--gold);
}

.nostalgia-shell .option-btn.is-selected {
  border-color: var(--gold);
  background: var(--selected-bg);
}

.nostalgia-shell .option-btn:disabled {
  cursor: default;
}

.nostalgia-shell .option-label {
  flex: 1;
}

.nostalgia-shell .check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
}

.nostalgia-shell .option-btn.is-selected .check {
  opacity: 1;
  border-color: var(--gold);
}

.nostalgia-shell .back-btn {
  margin-top: 16px;
  min-height: var(--touch);
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nostalgia-shell .compute {
  text-align: center;
  padding: 64px 16px;
  color: var(--muted);
  font-size: 1.1rem;
}

.nostalgia-shell .result-lead,
.nostalgia-shell .shared-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nostalgia-shell .world-mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  position: relative;
  color: var(--gold);
}

.nostalgia-shell .world-mark span,
.nostalgia-shell .world-mark i {
  position: absolute;
  box-sizing: border-box;
  border-color: currentColor;
  background: transparent;
}

/* temporary geometric marks — not final SVG */
.nostalgia-shell .mark-cassette .a,
.nostalgia-shell .mark-cassette .b {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  top: 13px;
}
.nostalgia-shell .mark-cassette .a { left: 4px; }
.nostalgia-shell .mark-cassette .b { right: 4px; }
.nostalgia-shell .mark-cassette .c {
  height: 2px;
  width: 12px;
  background: currentColor;
  top: 19px;
  left: 14px;
}

.nostalgia-shell .mark-radio .a,
.nostalgia-shell .mark-radio .b,
.nostalgia-shell .mark-radio .c {
  border: 2px solid currentColor;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
  left: 50%;
  transform: translateX(-50%);
}
.nostalgia-shell .mark-radio .a { width: 28px; height: 28px; top: 6px; }
.nostalgia-shell .mark-radio .b { width: 18px; height: 18px; top: 11px; }
.nostalgia-shell .mark-radio .c {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  border: 0;
  top: 17px;
  transform: translateX(-50%);
}

.nostalgia-shell .mark-film .a {
  width: 30px;
  height: 10px;
  border: 2px solid currentColor;
  top: 15px;
  left: 5px;
  border-radius: 2px;
}
.nostalgia-shell .mark-film .b,
.nostalgia-shell .mark-film .c,
.nostalgia-shell .mark-film .d {
  width: 3px;
  height: 3px;
  background: currentColor;
  top: 18px;
}
.nostalgia-shell .mark-film .b { left: 8px; }
.nostalgia-shell .mark-film .c { left: 14px; }
.nostalgia-shell .mark-film .d { left: 20px; }

.nostalgia-shell .mark-letters .a {
  width: 28px;
  height: 18px;
  border: 2px solid currentColor;
  top: 11px;
  left: 6px;
}
.nostalgia-shell .mark-letters .b {
  width: 20px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(180deg) skewX(28deg);
  top: 11px;
  left: 10px;
}

.nostalgia-shell .mark-neighbors .a,
.nostalgia-shell .mark-neighbors .b {
  width: 12px;
  height: 22px;
  border: 2px solid currentColor;
  top: 9px;
  border-radius: 2px 2px 0 0;
}
.nostalgia-shell .mark-neighbors .a { left: 6px; }
.nostalgia-shell .mark-neighbors .b { right: 6px; }

.nostalgia-shell .mark-landline .a {
  width: 22px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 4px 4px;
  top: 8px;
  left: 9px;
}
.nostalgia-shell .mark-landline .b {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 0 0 6px 6px;
  top: 16px;
  left: 13px;
}

.nostalgia-shell .mark-screen .a {
  width: 28px;
  height: 18px;
  border: 2px solid currentColor;
  top: 6px;
  left: 6px;
  border-radius: 2px;
}
.nostalgia-shell .mark-screen .b {
  width: 16px;
  height: 3px;
  background: currentColor;
  top: 28px;
  left: 12px;
}
.nostalgia-shell .mark-screen .c {
  width: 22px;
  height: 2px;
  background: currentColor;
  top: 33px;
  left: 9px;
}

.nostalgia-shell .mark-vhs .a {
  width: 30px;
  height: 18px;
  border: 2px solid currentColor;
  background: transparent;
  top: 11px;
  left: 5px;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 85% 100%, 0 100%);
}
.nostalgia-shell .mark-vhs .b {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  top: 16px;
  left: 16px;
}

.nostalgia-shell .preview-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border: 1px solid var(--option-border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nostalgia-shell .preview-badge[hidden] {
  display: none !important;
}

.nostalgia-shell .mark-net .a {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  top: 16px;
  left: 16px;
}
.nostalgia-shell .mark-net .b,
.nostalgia-shell .mark-net .c,
.nostalgia-shell .mark-net .d {
  width: 16px;
  height: 2px;
  background: currentColor;
  top: 19px;
  left: 12px;
  transform-origin: left center;
}
.nostalgia-shell .mark-net .b { transform: rotate(-40deg); }
.nostalgia-shell .mark-net .c { transform: rotate(40deg); left: 12px; }
.nostalgia-shell .mark-net .d { width: 12px; transform: rotate(90deg); left: 14px; top: 14px; }

.nostalgia-shell .result-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: clamp(1.35rem, 4.5vw, 1.65rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1.35;
}

.nostalgia-shell .result-desc {
  margin: 0 0 18px;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.6;
}

.nostalgia-shell .share-prompt {
  margin: 0 0 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.nostalgia-shell .actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nostalgia-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--touch);
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.nostalgia-shell .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.nostalgia-shell .btn-primary {
  background: var(--gold);
  color: #1a1520;
  border-color: var(--gold);
}

.nostalgia-shell .btn-primary:hover:not(:disabled) {
  background: var(--gold-press);
  border-color: var(--gold-press);
}

.nostalgia-shell .btn-wa {
  background: var(--wa);
  color: #fff;
  border-color: var(--wa);
}

.nostalgia-shell .btn-x {
  background: var(--x-bg);
  color: var(--text);
  border-color: var(--x-border);
}

.nostalgia-shell .btn-secondary {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.nostalgia-shell .btn-quiet {
  background: transparent;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.nostalgia-shell .signature {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.nostalgia-shell .error-box {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
}

.nostalgia-shell .error-box p {
  margin: 0 0 18px;
  color: var(--error-text);
}

.nostalgia-shell .modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.nostalgia-shell .modal[hidden] {
  display: none !important;
}

.nostalgia-shell .modal-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--option-border);
  border-radius: var(--radius);
  padding: 18px;
}

.nostalgia-shell .modal-card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--gold);
}

.nostalgia-shell .modal-card pre {
  margin: 0 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
}

.nostalgia-shell .dev-dock {
  position: fixed;
  inset-inline-end: 8px;
  bottom: 8px;
  z-index: 30;
  max-width: min(96vw, 320px);
  background: rgba(28, 32, 48, 0.96);
  border: 1px solid var(--option-border);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
  color: var(--muted);
}

.nostalgia-shell .dev-dock[hidden] {
  display: none !important;
}

.nostalgia-shell .dev-dock summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 600;
}

.nostalgia-shell .dev-dock .dev-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.nostalgia-shell .dev-dock a,
.nostalgia-shell .dev-dock button {
  font-size: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--option-border);
  border-radius: 6px;
  padding: 4px 6px;
  text-decoration: none;
  cursor: pointer;
}

.nostalgia-shell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.nostalgia-shell :focus {
  outline: none;
}

.nostalgia-shell :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Programmatic focus for screen readers — no visible ring on question title only */
.nostalgia-shell #questionText:focus,
.nostalgia-shell #questionText:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .nostalgia-shell,
  .nostalgia-shell *,
  .nostalgia-shell *::before,
  .nostalgia-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 320px) {
  .nostalgia-shell {
    padding: 14px 10px 32px;
  }

  .nostalgia-shell .option-btn {
    padding: 12px 10px;
  }
}

@media (max-width: 600px) {
  .nostalgia-seo-article {
    padding: 20px 16px;
    border-radius: 14px;
  }
}
