    html { -webkit-text-size-adjust: 100%; }
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    body, html {
      height: 100%;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      margin: 0;
      padding: 0;
      background-color: #f0f0f0;
      display: flex;
      flex-direction: column;
      
    }
    
    #page-container {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }
    /* ===== 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; }

    h1 {
      margin: 25px 0;
      font-size: 36px;
      text-align: center;
    }
    .title-outline{
      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;
      font-size: clamp(42px, 7vw, 72px);
      padding: 10px;
    }
    .description {
      text-align: center;
      padding-bottom: 10px;
    }

    .puzzle-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 30px;
    }
    table {
      border-collapse: collapse;
      margin: 0 auto 30px;
    }
    td {
      width: 25px;
      height: 25px;
      text-align: center;
      border: 1px solid #ccc;
      user-select: none;
      font-weight: bold;
      font-family: monospace;
      cursor: pointer;
    }
    td.selected {
      background-color: grey;
    }
    td.found {
      background-color: lightgreen;
    }
    td:hover {
      background-color: lightgray;
    }
    .clues {
      display: flex;
      justify-content: center;
      margin-bottom: 30px;
    }
    #clue-list {
      list-style: none;
      text-align: center;
      padding: 0;
      margin: 0 auto;
      column-count: 5;
      column-gap: 40px;
      max-width: 1000px;
    }
    #clue-list li {
      padding: 5px 0;
      font-size: 16px;
    }
    #clue-list li.found {
      text-decoration: line-through;
      color: green;
    }

    button {
      margin-top: 10px;
    }
     /* ===== 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; }
@media (max-width: 700px){
  td { width: 22px; height: 22px; font-size: 14px; }
  #clue-list { column-count: 2; column-gap: 16px; max-width: 92vw; }
  h1 { font-size: 28px; }
}
/* Mobile: prevent scroll/zoom while tracing words */
#puzzle-grid, #puzzle-grid td {
  touch-action: none;          /* block panning/zooming inside grid */
  -webkit-user-select: none;
  user-select: none;
}

.puzzle-wrapper {
  overscroll-behavior: contain; /* keep pull-to-refresh/scroll outside grid */
}
/* === Mobile grid + clue list for Word Search === */
:root { --ws-cell: clamp(22px, 6.2vw, 32px); }  /* responsive cell */

h1{ font-size: clamp(28px, 6vw, 36px); }

table{ max-width: 95vw; }

td{
  width: var(--ws-cell);
  height: var(--ws-cell);
  font-size: clamp(14px, 3.6vw, 18px);
}

/* Multi-column clue list that collapses on smaller phones */
#clue-list{ column-count: 2; column-gap: 16px; max-width: 92vw; }
@media (min-width: 900px){ #clue-list{ column-count: 3; } }

/* Keep scroll/zoom outside the grid while tracing words */
#puzzle-grid, #puzzle-grid td{
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.puzzle-wrapper{ overscroll-behavior: contain; }
/* === Word Search HUD & Rewards === */
#hud{
  display:flex; align-items:center; justify-content:center;
  gap:16px; margin:10px 0 16px;
}
#timer{
  font-family: "Shojumaru", system-ui, sans-serif;
  font-size: clamp(22px, 6vw, 32px);
  padding: 6px 14px;
  border: 2px solid #111;
  border-radius: 10px;
  background: #fff;
  min-width: 110px;
  text-align: center;
}
#win-panel, #timeup-panel{
  max-width: 740px;
  margin: 0 auto 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.07);
}
#win-panel h2, #timeup-panel h2{ margin-bottom: 8px; }
#reward-links{ 
  list-style: none; padding: 0; margin: 12px auto 0; 
  display: grid; gap: 10px; 
  grid-template-columns: repeat(1, minmax(0,1fr));
  max-width: 540px;
}
#reward-links a{
  display:block; padding:10px 12px; border:1px solid #e5e5e5; border-radius:10px;
  text-decoration:none; font-weight:600;
}
#reward-links a:hover{ background:#f7f7f7; }

#play-again, #retry{
  margin-top: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid #111;
  background: #111; color:#fff; cursor:pointer;
}
#play-again:hover, #retry:hover{ background:#222; }

/* a11y helper */
.visually-hidden{
  position:absolute !important; width:1px; height:1px; margin:-1px; padding:0; border:0;
  clip:rect(0 0 0 0); overflow:hidden; white-space:nowrap;
}
/* ==== Right-side Timer ==== */
#timer-aside{
  position: fixed;
  right: 2vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

#timer{
  font-family: "Shojumaru", system-ui, sans-serif;
  font-size: clamp(22px, 6vw, 32px);
  padding: 10px 16px;
  border: 2px solid #111;
  border-radius: 12px;
  background: #fff;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

/* Optional: on small screens, tuck timer under the puzzle */
@media (max-width: 950px){
  #timer-aside{
    position: static;
    transform: none;
    margin: 12px auto 0;
  }
}
/* === Category rewards === */
.rewards-grid{
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 560px;
  margin: 12px auto 0;
}
@media (max-width: 560px){
  .rewards-grid{ grid-template-columns: 1fr; }
}

.category-btn{
  display: block;
  text-align: center;
  padding: 12px 14px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
  transition: transform .06s ease, box-shadow .06s ease, background .1s ease;
}
.category-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
  background: #f8f8f8;
}