    html { -webkit-text-size-adjust: 100%; }
    /* Base / layout reset */
    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0; /* remove 16px margin so header touches top and footer reaches bottom */
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      background: #fff;
      color: #000;
    }

    /* Page container fills viewport; footer is pushed down by main content */
    #page-container {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      width: 100%;
    }
    main#content {
      flex: 1; /* grow to push footer to the bottom when content is short */
      width: 100%;
    }

    /* ===== Header / Nav (shared) ===== */
    header.site-header{
      background:#111;
      color:#fff;
    }
    .site-header .nav{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:16px;
      max-width:1200px;
      margin:0 auto;
      padding:12px 16px;
    }
    .brand{
      display:flex;
      align-items:center;
      gap:10px;
      text-decoration:none;
      color:#fff;
    }
    .brand-mark{
      font-family:"Shojumaru", system-ui;
      font-size:28px;
      letter-spacing:.5px;
      white-space:nowrap;
    }
    .primary-nav{
      display:flex;
      align-items:center;
      gap:20px;
      list-style:none;
      margin:0;
      padding:0;
    }
    .primary-nav a{
      color:#fff;
      text-decoration:none;
      padding:8px 10px;
      border-radius:6px;
    }
    .primary-nav a:hover{ background:#222; }

    /* Dropdown */
    .has-submenu{ position:relative; }
    .submenu{
      display:none;
      position:absolute;
      top:100%;
      left:0;
      background:#1b1b1b;
      list-style:none;
      padding:8px 0;
      margin:6px 0 0;
      min-width:200px;
      border:1px solid #2c2c2c;
      border-radius:8px;
      z-index:50;
    }
    .submenu a{ display:block; padding:8px 12px; }
    .has-submenu:hover .submenu{ display:block; }

    /* === Mobile-friendly crossword sizing & readability === */

    /* Responsive cell size: never too small on phones */
    :root {
      /* Each cell between 32–44px depending on viewport width */
      --cell: clamp(32px, 8.5vw, 44px);
    }
    /* Title */
    .title {
      text-align: center;
      font-family: Shojumaru, system-ui;
      font-size: clamp(42px, 7vw, 72px);
      color: white;
      text-shadow:
        -5px -5px 0 #000,  5px -5px 0 #000,
        -5px  5px 0 #000,  5px  5px 0 #000,
         0px -5px 0 #000,  0px  5px 0 #000,
        -5px  0px 0 #000,  5px  0px 0 #000;
      margin: 16px 0;
    }
    .description {
      text-align: center;
    }

    /* Stats bar */
    .stats {
      display: flex;
      justify-content: center;
      gap: 24px;
      margin-bottom: 12px;
      font-weight: 600;
      flex-wrap: wrap;
      padding: 0 16px;
    }
    .stat {
      padding: 8px 12px;
      border: 1px solid #ddd;
      border-radius: 8px;
      background: #fafafa;
    }
    .done { background: #e8ffe8; border-color: #97d597; }
    .timeout { background: #fff2f2; border-color: #ffb3b3; }

    /* Center the crossword + hints together */
    .layout {
      display: flex;
      gap: 24px;
      align-items: flex-start;
      justify-content: center;     /* center horizontally */
      margin: 0 auto;
      max-width: 1400px;
      width: 100%;
      padding: 0 16px 25px;
    }

    table { border-collapse: collapse; }
   /* Table cells */
    td {
      width: var(--cell);
      height: var(--cell);
      border: 1px solid #000;
      position: relative;
      text-align: center;
      /* Make the letter itself scale nicely */
      font-size: clamp(12px, 3.4vw, 26px);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      background: #fff;
    }

    .black { background-color: #000; }

    /* Small corner number, always readable */
    .number {
      position: absolute;
      top: 2px;
      left: 2px;
      font-size: clamp(10px, 2.6vw, 14px);
      line-height: 1;
      opacity: 0.9;
      z-index: 1;
      pointer-events: none;
    }

    /* The single-letter input inside each cell */
    .input {
      width: 100%;
      height: 100%;
      border: none;
      background: transparent;
      text-align: center;

      /* CRITICAL: keep ≥16px to stop iOS auto-zoom and improve legibility */
      font-size: inherit;            /* inherits td font-size (which is ≥18px) */
      line-height: 1;
      text-transform: uppercase;
      caret-color: #111;

      /* Improve tap feel */
      -webkit-user-select: none;
      user-select: none;
    }
    /* High-contrast focus ring on the active square */
    td:has(.input:focus) {
      outline: 2px solid #0a84ff;           /* iOS blue */
      outline-offset: 0;
      box-shadow: inset 0 0 0 2px #fff;     /* keep border readable on dark boards */
    }

    /* When letters are revealed */
    .revealed input { color: #d00; font-weight: 700; }

    /* Let the grid scroll within its box on small screens */
    .grid-scroll {
      max-width: 100%;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-x pan-y;
      margin: 0 auto;
    }

    /* Right-side hints panel (two fixed columns: Across / Down) */
    .hints {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px 24px;
      min-width: 420px;
      max-width: 760px;
      align-items: start;
    }
    .hint-section {
      display: flex;
      flex-direction: column;
      border: 8px solid black;
    }
    .hint-title {
      font-weight: 700; margin-bottom: 8px; text-align: center;
      font-size: 24px; font-family: "Comic Sans MS", sans-serif;
    }

    /* Single vertical list per section with its own scrollbar */
    .hint-col {
      border-left: 3px solid #eee;
      padding-left: 12px;
      overflow-y: auto;        /* scroll inside the column */
    }

    .clue {
      margin: 6px 0;
      line-height: 1.3;
      display: flex;
      align-items: center;
      gap: 6px;
      padding-right: 8px;
    }
    .clue-num { font-weight: 700; min-width: 2.5ch; text-align: right; }
    .hint-text { font-size: 0.95rem; flex: 1 1 auto; }
    .clue button {
      flex: 0 0 auto;
      padding: 4px 8px; border: 1px solid #333; background: #fafafa;
      cursor: pointer; border-radius: 6px; font-size: 12px;
    }
    .clue button:hover { background: #f0f0f0; }

    /* Controls: button centered 20px below the crossword */
    .controls {
      margin-top: 20px;
      display: flex;
      justify-content: center;
    }
    .controls button {
      padding: 8px 12px; border: 1px solid #333; background: #fafafa;
      cursor: pointer; border-radius: 6px;
    }
    .controls button:hover { background: #f0f0f0; }

    /* Footer spans full width and sits at bottom */
    /* ===== Footer (2 columns) ===== */
.site-footer{ background:#111; color:#fff; padding:32px 16px 12px; }
.site-footer a{ color:#fff; text-decoration:none; }
.site-footer a:hover{ text-decoration:underline; }

.footer-inner.two-col{
  max-width:1200px; margin:0 auto;
  display:grid; grid-template-columns: 1.2fr 1fr;
  gap: 32px 28px; align-items:start;
}

/* Left column */
.footer-left{
  display:flex; flex-direction:column; align-items:center; text-align:center;
}
.footer-logo{
  font-family:"Shojumaru", system-ui, sans-serif;
  font-size:32px; line-height:1; margin:0;
}
.footer-tag{ margin-top:20px; opacity:.9; line-height:1.35; max-width:560px; }

/* 25px space BEFORE links list/socials block */
.links-block{ margin-top:25px; width:100%; }

/* Links list (inline + centered) */
.about-col ul{
  list-style:none; margin:0; padding:0;
  display:flex; gap:14px 18px; flex-wrap:wrap; justify-content:center;
}
.about-col li{ display:inline-flex; }
.about-col a{ padding:4px 0; opacity:.95; }

/* Socials under links, tighter gap than before */
.socials{
  list-style:none; margin:14px 0 0; padding:0;
  display:flex; justify-content:center; align-items:center; gap:12px; flex-wrap:wrap;
}
.socials li{ display:inline-flex; }
.socials a{ display:inline-flex; padding:6px; }

/* Right column (contact) */
.contact-col{ text-align:center; max-width:420px; justify-self:center; width:100%; }
.contact-col h4{ margin:0 0 10px; font-size:18px; }
#footer-contact{ display:flex; flex-direction:column; gap:10px; }
#footer-contact input, #footer-contact textarea{
  width:100%; padding:10px 12px; border-radius:8px; border:1px solid #2a2a2a;
  background:#1b1b1b; color:#fff; resize:vertical;
}
#footer-contact button{
  padding:10px 12px; border-radius:8px; border:1px solid #2a2a2a;
  background:#fff; color:#111; font-weight:600; cursor:pointer;
}
#footer-contact button:hover{ background:#e9e9e9; }
.fineprint{ font-size:.9rem; opacity:.8; }

/* Bottom bar */
.footer-bottom{
  max-width:1200px; margin:22px auto 0;
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  border-top:1px solid #222; padding-top:12px;
}
.footer-bottom p{ margin:0 auto; text-align:center; flex:1; }
.back-to-top{ white-space:nowrap; }

.sr-only{
  position:absolute; width:1px; height:1px; margin:-1px; border:0; padding:0;
  clip:rect(0 0 0 0); overflow:hidden;
}

/* Responsive */
@media (max-width: 900px){
  .footer-inner.two-col{ grid-template-columns:1fr; }
  .contact-col{ justify-self:center; }
  .footer-bottom{ flex-direction:column; gap:10px; }
}
/* keep existing rules; add this */
.has-submenu.open .submenu { display: block; }
/* Hints remain stacked on phones */
@media (max-width: 800px){
  .layout { flex-direction: column; align-items: center; }
  .hints { min-width: 0; width: 100%; grid-template-columns: 1fr; }
}

/* Keep type legible even on very narrow phones */
@media (max-width: 420px){
  /* We DO NOT drop below 18px letters anymore */
  td { font-size: clamp(18px, 4.2vw, 24px); }
}
/* Force null cells (blocks) to render black */
#crossword td.black { 
  background-color: #000 !important;
}
/* === Mobile readability overrides for Crossword === */
:root { --cell: clamp(32px, 8.5vw, 44px); }  /* responsive cell size */

td{
  font-size: clamp(18px, 3.4vw, 26px);       /* big, readable letters */
  background:#fff;
}

.number{ font-size: clamp(10px, 2.6vw, 14px); }

.input{ font-size: inherit; }                 /* keeps ≥16px on phones */

.grid-scroll{
  max-width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  touch-action: pan-x pan-y;
  margin:0 auto;
}

@media (max-width: 700px){
  .layout{ flex-direction: column; align-items: center; }
  .hints{ min-width:0; max-width:100%; grid-template-columns: 1fr; }
}