  :root {
    color-scheme: dark;
    --ink: #0b1314;
    --paper: #f0f2e6;
    --mint: #b8f0cf;
    --gold: #edcf92;
    --text: "Instrument Sans", system-ui, sans-serif;
    --title: "Instrument Serif", Georgia, serif;
  }
  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }
  body { margin: 0; min-width: 0; background: var(--ink); color: var(--paper); font: 1rem/1.5 var(--text); }
  .entry { display: grid; grid-template-rows: auto auto 1fr; width: min(100%, 1660px); min-height: 100svh; margin: auto; padding: 0 clamp(16px, 3vw, 52px) clamp(16px, 3vw, 48px); }
  .masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
  .wordmark .fold { color: #a6f4ce; }
  .wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: .84rem; font-weight: 750; letter-spacing: .24em; }
  /* Same canonical diamond as the second door, now at the original 25px masthead size. */
  .wordmark-diamond { display: block; width: 25px; height: 25px; flex: none; color: var(--mint); }
  .languages { display: flex; }
  .languages button { min-width: 44px; min-height: 44px; padding: 4px; border: 0; background: transparent; color: #a5b7b1; font: 700 .76rem var(--text); letter-spacing: .1em; cursor: pointer; }
  .languages button[aria-pressed="true"] { color: var(--mint); text-decoration: underline; text-underline-offset: 5px; }
  .languages button:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
  h1 { margin: 0 0 clamp(14px, 2.2vh, 28px); text-align: center; font: 400 clamp(2rem, 4.1vw, 4rem)/1.02 var(--title); letter-spacing: -.045em; }
  .entry-intro { align-self: center; margin-bottom: clamp(14px, 2.2vh, 28px); }
  .entry-intro h1 { margin-bottom: 8px; }
  .entry-subtitle { max-width: 68ch; margin: 0 auto; padding: 0 5px; text-align: center; color: var(--paper); opacity: .8; font-size: clamp(.82rem, 1.2vw, .98rem); line-height: 1.45; }
  .doors { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #688479; }
  .portal {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: minmax(175px, 1fr) auto;
    align-items: end;
    justify-items: center;
    min-height: 520px;
    overflow: hidden;
    padding: clamp(25px, 4vh, 58px) clamp(14px, 3vw, 48px);
    text-align: center;
    text-decoration: none;
    color: var(--paper);
  }
  .library {
    --light: var(--mint);
    --line: #7cb69a;
    --line-faint: #7cb69a4a;
    background: radial-gradient(ellipse at 50% 25%, #2e594b, transparent 63%), linear-gradient(148deg, #1a362f, #11231f 72%);
  }
  .game {
    --light: var(--gold);
    --line: #7f7459;
    --line-faint: #81765843;
    border-inline-start: 1px solid #688479;
    background: radial-gradient(ellipse at 50% 25%, #262b28, transparent 63%), linear-gradient(148deg, #151d1e, #0e1516 72%);
  }
  .portal::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 11px;
    border: 1px solid var(--line-faint);
    pointer-events: none;
  }
  .portal::after {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 47px, var(--line-faint) 47px 48px),
                repeating-linear-gradient(0deg, transparent 0 47px, var(--line-faint) 47px 48px);
    opacity: .21;
    mask-image: linear-gradient(#0008, #000, transparent 92%);
    pointer-events: none;
  }
  .portal:focus-visible { z-index: 1; outline: 3px solid var(--gold); outline-offset: -5px; }
  .architecture {
    position: relative;
    display: grid;
    place-items: center;
    width: min(73%, 305px);
    align-self: center;
    aspect-ratio: 1 / 1.06;
    margin-bottom: 14px;
    color: var(--line);
  }
  .architecture::before, .architecture::after, .stone, .leaf {
    position: absolute;
    content: "";
    border: 1px solid currentColor;
  }
  .architecture::before { inset: 4% 7%; opacity: .37; }
  .architecture::after { inset: 9% 12%; opacity: .55; }
  .stone { inset: 15% 18%; opacity: .79; }
  .leaf {
    display: grid;
    place-items: center;
    inset: 21% 24%;
    background: linear-gradient(115deg, #ffffff09, #070e1288);
    box-shadow: inset 0 0 30px #070f1366;
  }
  .leaf::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid var(--line-faint);
    background: linear-gradient(90deg, transparent calc(50% - .5px), var(--line-faint) 50%, transparent calc(50% + .5px));
  }
  .library .leaf { box-shadow: 0 0 34px #b8f0cf22, inset 0 0 32px #152c23; }
  .library .leaf::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 9%;
    width: 82%;
    height: 2px;
    background: var(--mint);
    box-shadow: 0 0 12px 2px #b8f0cf55;
  }
  .symbol { position: relative; z-index: 1; display: block; width: 44%; aspect-ratio: 1; color: var(--light); }
  /* El símbolo de la puerta abierta ahora es un teclado; los marcos originales permanecen iguales. */
  .keyboard { width: 57%; aspect-ratio: auto; filter: drop-shadow(0 0 9px #b8f0cf35); }
  /* Toda la superficie abre Jugar. Biblioteca es un enlace secundario independiente. */
  .play-link { text-decoration: none; }
  .play-link::before { content: ""; position: absolute; inset: 0; z-index: 1; cursor: pointer; }
  .play-link:focus-visible { outline: none; }
  .play-link:focus-visible::before { outline: 3px solid var(--gold); outline-offset: -5px; }
  .door-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  /* Keep the two door layouts aligned; only the left door has a secondary library link. */
  .game .door-actions::after { content: ""; display: block; height: 44px; width: 1px; flex: 0 0 44px; pointer-events: none; }
  .library-shortcut { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 5px 14px; color: #d7eadf; font: 600 .86rem/1.25 var(--text); text-decoration: underline; text-underline-offset: 4px; }
  .library-shortcut:hover { color: var(--mint); }
  .library-shortcut:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  /* Second door: authentic MAZEFOLD diamond at the original maze icon size. */
  .diamond { width: 38%; }
  .diamond-outline { opacity: .70; }
  .diamond-inner { opacity: .76; }
  .portal h2 { margin: 0; font: 400 clamp(2.25rem, 5.35vw, 5rem)/.96 var(--title); letter-spacing: -.055em; }
  .portal p { min-height: 3em; margin: 13px auto 17px; max-width: 27ch; color: #cfddd4; font-size: clamp(.94rem, 1.24vw, 1.1rem); }
  .game p { color: #c7c8bd; }
  .action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 44px;
    padding: 7px 15px;
    border: 1px solid var(--line);
    color: var(--light);
    font: 700 .77rem/1.25 var(--text);
    letter-spacing: .08em;
  }
  .arrow { position: relative; width: 13px; height: 1px; background: currentColor; }
  .arrow::after { content: ""; position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
  .seal {
    z-index: 3;
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #799185;
    background: var(--ink);
    color: var(--gold);
    font-size: 1.32rem;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
  }
  .seal span { transform: rotate(-45deg); }
  @media (hover: hover) {
    .library .leaf, .library .action { transition: background-color 160ms ease, box-shadow 160ms ease; }
    .library:hover .leaf { background-color: #527f68; box-shadow: 0 0 55px #b8f0cf48, inset 0 0 32px #152c23; }
    .library:hover .action { background-color: var(--mint); color: #10271d; }
    .game .leaf, .game .action { transition: background-color 160ms ease, box-shadow 160ms ease; }
    .game:hover .leaf { background-color: #72664a; box-shadow: 0 0 55px #edcf9248, inset 0 0 32px #2d271a; }
    .game:hover .action { background-color: var(--gold); color: #1c1a14; }
  }
  @media (max-width: 680px) {
    .entry { padding: 0 12px 12px; }
    .masthead { min-height: 57px; }
    .doors { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
    .portal { grid-template-rows: minmax(115px, 1fr) auto; min-height: 320px; padding: 22px 16px; }
    .game { border-inline-start: 0; border-block-start: 1px solid #688479; }
    .architecture { width: min(44%, 151px); margin-bottom: 0; }
    .seal { width: 26px; height: 26px; font-size: 1rem; }
    .portal p { margin: 8px auto 12px; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
