/* PuzzleSolver — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

:root,[data-theme="light"]{
  --font-display:'Outfit','Georgia',serif;
  --font-body:'Inter','Helvetica Neue',sans-serif;
  --color-bg:#f7f6f2;--color-surface:#f9f8f5;--color-surface-2:#fbfbf9;
  --color-surface-offset:#f0ede8;--color-divider:#dcd9d5;--color-border:#d4d1ca;
  --color-text:#28251d;--color-text-muted:#6b6a65;--color-text-faint:#b0afa9;
  --color-primary:#01696f;--color-primary-hover:#0c4e54;--color-primary-light:#d4e8e6;
  --color-success:#437a22;--color-error:#c53030;--color-warning:#b45309;
  --radius-sm:.375rem;--radius-md:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-full:9999px;
  --shadow-sm:0 1px 3px rgba(40,37,29,.07);--shadow-md:0 4px 14px rgba(40,37,29,.10);--shadow-lg:0 12px 36px rgba(40,37,29,.14);
  --transition:180ms cubic-bezier(.16,1,.3,1);
  --space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;
  --space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--space-10:2.5rem;--space-12:3rem;--space-16:4rem;
  --content-default:960px;--content-wide:1200px;
}
[data-theme="dark"]{
  --color-bg:#171614;--color-surface:#1c1b19;--color-surface-2:#201f1d;
  --color-surface-offset:#252422;--color-divider:#2e2d2b;--color-border:#3a3936;
  --color-text:#cdccca;--color-text-muted:#7a7977;--color-text-faint:#525150;
  --color-primary:#4f98a3;--color-primary-hover:#3a8490;--color-primary-light:#1a3538;
  --color-success:#6daa45;--color-error:#fc8181;--color-warning:#f6ad55;
  --shadow-sm:0 1px 3px rgba(0,0,0,.25);--shadow-md:0 4px 14px rgba(0,0,0,.4);--shadow-lg:0 12px 36px rgba(0,0,0,.55);
}
@media(prefers-color-scheme:dark){:root:not([data-theme]){
  --color-bg:#171614;--color-surface:#1c1b19;--color-surface-2:#201f1d;
  --color-surface-offset:#252422;--color-divider:#2e2d2b;--color-border:#3a3936;
  --color-text:#cdccca;--color-text-muted:#7a7977;--color-text-faint:#525150;
  --color-primary:#4f98a3;--color-primary-hover:#3a8490;--color-primary-light:#1a3538;
  --shadow-sm:0 1px 3px rgba(0,0,0,.25);--shadow-md:0 4px 14px rgba(0,0,0,.4);--shadow-lg:0 12px 36px rgba(0,0,0,.55);
}}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-font-smoothing:antialiased}
body{min-height:100dvh;font-family:var(--font-body);font-size:clamp(1rem,.95rem + .25vw,1.125rem);color:var(--color-text);background:var(--color-bg);line-height:1.65}
img,svg{display:block;max-width:100%;height:auto}
a{color:var(--color-primary);text-decoration:none;transition:color var(--transition)}
a:hover{color:var(--color-primary-hover)}
button{cursor:pointer;font:inherit;border:none;background:none}
input,select,textarea{font:inherit;color:inherit}
h1,h2,h3,h4{font-family:var(--font-display);line-height:1.15}
::selection{background:rgba(1,105,111,.18);color:var(--color-text)}
:focus-visible{outline:2px solid var(--color-primary);outline-offset:3px;border-radius:var(--radius-sm)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

.skip-link{position:absolute;top:-100%;left:0;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:0 0 var(--radius-md) 0;z-index:999}
.skip-link:focus{top:0}
.container{max-width:var(--content-default);margin-inline:auto;padding-inline:var(--space-4)}
.container-wide{max-width:var(--content-wide);margin-inline:auto;padding-inline:var(--space-4)}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:var(--radius-md);font-size:.875rem;font-weight:600;transition:all var(--transition);cursor:pointer;border:none;text-decoration:none;white-space:nowrap}
.btn-primary{background:var(--color-primary);color:#fff}
.btn-primary:hover{background:var(--color-primary-hover);color:#fff;transform:translateY(-1px);box-shadow:var(--shadow-md)}
.btn-outline{border:1.5px solid var(--color-border);color:var(--color-text);background:transparent}
.btn-outline:hover{border-color:var(--color-primary);color:var(--color-primary)}
.btn-ghost{color:var(--color-text-muted)}
.btn-ghost:hover{color:var(--color-primary);background:var(--color-surface-offset)}
.btn-danger{background:var(--color-error);color:#fff}
.btn-danger:hover{opacity:.9}
.btn-sm{padding:.375rem .875rem;font-size:.8rem}

/* Badges */
.badge{display:inline-flex;align-items:center;padding:.2em .6em;border-radius:var(--radius-full);font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--color-primary-light);color:var(--color-primary)}
.badge-secondary{background:var(--color-surface-offset);color:var(--color-text-muted)}
.badge-success{background:#d4e8cc;color:var(--color-success)}
.badge-draft{background:#fef3c7;color:#92400e}

/* Alerts */
.alert{padding:var(--space-3) var(--space-4);border-radius:var(--radius-lg);margin-bottom:var(--space-4);font-size:.875rem;border-left:3px solid currentColor}
.alert-success{background:#f0fdf4;color:#166534;border-color:var(--color-success)}
.alert-error{background:#fef2f2;color:#991b1b;border-color:var(--color-error)}
.alert-warning{background:#fffbeb;color:#92400e;border-color:var(--color-warning)}
[data-theme="dark"] .alert-success{background:#14290f;color:#86efac}
[data-theme="dark"] .alert-error{background:#2d0f0f;color:#fca5a5}

/* Header */
.site-header{position:sticky;top:0;z-index:100;background:rgba(249,248,245,.92);backdrop-filter:blur(12px);border-bottom:1px solid var(--color-divider);transition:background var(--transition)}
[data-theme="dark"] .site-header{background:rgba(28,27,25,.92)}
.header-inner{max-width:var(--content-wide);margin-inline:auto;padding:0 var(--space-4);height:64px;display:flex;align-items:center;gap:var(--space-4)}
.site-logo{display:flex;align-items:center;gap:.625rem;text-decoration:none;flex-shrink:0}
.logo-text{font-family:var(--font-display);font-weight:800;font-size:1.15rem;color:var(--color-text)}
.logo-img{height:40px;width:auto}

/* Header Search — FIXED to match HTML classes */
.header-search-wrap{flex:1;max-width:400px;position:relative}
.header-search-box{display:flex;align-items:center;border:1.5px solid var(--color-border);border-radius:var(--radius-full);background:var(--color-surface);overflow:hidden;transition:border-color var(--transition),box-shadow var(--transition)}
.header-search-box:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(1,105,111,.12)}
.hs-icon{flex-shrink:0;margin-left:.85rem;color:var(--color-text-faint);pointer-events:none;display:flex;align-items:center}
.header-search-box input{flex:1;padding:.52rem .6rem;background:none;border:none;outline:none;font-size:.875rem;color:var(--color-text);font-family:var(--font-body)}
.header-search-box input::placeholder{color:var(--color-text-faint)}
.hs-btn{flex-shrink:0;padding:.42rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:0 var(--radius-full) var(--radius-full) 0;font-size:.82rem;font-weight:700;cursor:pointer;transition:background var(--transition);white-space:nowrap;font-family:var(--font-body)}
.hs-btn:hover{background:var(--color-primary-hover)}

/* Search dropdown (shared between header and pages) */
.search-dropdown{position:absolute;top:calc(100% + .5rem);left:0;right:0;background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);z-index:200;display:none;overflow:hidden;max-height:320px;overflow-y:auto}
.search-dropdown.open{display:block}
.sd-item{display:flex;align-items:center;justify-content:space-between;padding:.6rem 1rem;cursor:pointer;gap:1rem;transition:background var(--transition)}
.sd-item:hover,.sd-item.active{background:var(--color-surface-offset)}
.sd-question{font-size:.8rem;color:var(--color-text-muted);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sd-answer{font-family:var(--font-display);font-weight:800;color:var(--color-primary);font-size:.875rem;white-space:nowrap}
.sd-letters{font-size:.7rem;color:var(--color-text-faint);white-space:nowrap}
.site-nav{display:flex;align-items:center;gap:.25rem;margin-left:auto}
.site-nav a{padding:.4rem .7rem;border-radius:var(--radius-md);font-size:.875rem;font-weight:500;color:var(--color-text-muted);transition:all var(--transition)}
.site-nav a:hover{color:var(--color-text);background:var(--color-surface-offset)}
.nav-dropdown{position:relative}
.nav-dropdown-btn{display:flex;align-items:center;gap:.3rem;padding:.4rem .7rem;border-radius:var(--radius-md);font-size:.875rem;font-weight:500;color:var(--color-text-muted);cursor:pointer;transition:all var(--transition)}
.nav-dropdown-btn:hover{color:var(--color-text);background:var(--color-surface-offset)}
.nav-dropdown-menu{position:absolute;top:calc(100% + .5rem);left:0;min-width:210px;background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);z-index:200;display:none;padding:.375rem;max-height:340px;overflow-y:auto}
.nav-dropdown:hover .nav-dropdown-menu{display:block}
.nav-dropdown-menu a{display:flex;justify-content:space-between;align-items:center;padding:.45rem .75rem;border-radius:var(--radius-md);font-size:.8rem;color:var(--color-text-muted);transition:all var(--transition)}
.nav-dropdown-menu a:hover{background:var(--color-surface-offset);color:var(--color-text)}
.nav-dropdown-menu a span{color:var(--color-text-faint);font-size:.72rem}
.header-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.theme-toggle{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--radius-md);color:var(--color-text-muted);border:1.5px solid var(--color-border);transition:all var(--transition)}
.theme-toggle:hover{color:var(--color-primary);border-color:var(--color-primary)}
[data-theme="dark"] .icon-moon,[data-theme="light"] .icon-sun{display:block}
[data-theme="dark"] .icon-sun,[data-theme="light"] .icon-moon{display:none}
.mobile-nav-toggle{display:none;flex-direction:column;gap:5px;width:36px;height:36px;align-items:center;justify-content:center;border-radius:var(--radius-md);color:var(--color-text-muted)}
.mobile-nav-toggle span{display:block;width:20px;height:2px;background:currentColor;border-radius:2px;transition:all .3s}
.mobile-nav{display:none;flex-direction:column;gap:.2rem;padding:var(--space-3) var(--space-4);border-top:1px solid var(--color-divider);max-height:60vh;overflow-y:auto}
.mobile-nav.open{display:flex}
.mobile-nav a{padding:.5rem .75rem;border-radius:var(--radius-md);font-size:.875rem;color:var(--color-text-muted)}
.mobile-nav a:hover{background:var(--color-surface-offset);color:var(--color-text)}

/* Hero */
.hero{position:relative;overflow:hidden;background:
  radial-gradient(circle at top left, rgba(1,105,111,.10), transparent 34%),
  radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 28%),
  linear-gradient(180deg,var(--color-surface) 0%,var(--color-bg) 72%);
  padding:clamp(2.5rem,7vw,5rem) 0 clamp(2.2rem,5vw,3.75rem);
  border-bottom:1px solid var(--color-divider)}
.hero::before{content:"";position:absolute;inset:auto auto -80px -60px;width:240px;height:240px;background:rgba(1,105,111,.05);filter:blur(10px);border-radius:50%;pointer-events:none}
.hero::after{content:"";position:absolute;inset:30px -70px auto auto;width:220px;height:220px;background:rgba(14,165,233,.05);filter:blur(12px);border-radius:50%;pointer-events:none}
.hero-inner{max-width:760px;margin-inline:auto;padding:clamp(1.1rem,3vw,1.5rem);text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;background:color-mix(in srgb, var(--color-surface) 88%, transparent);border:1px solid var(--color-border);border-radius:calc(var(--radius-xl) + 6px);box-shadow:var(--shadow-sm);backdrop-filter:blur(6px)}
.hero-badge{display:inline-block;padding:.34em .95em;background:var(--color-primary-light);color:var(--color-primary);border-radius:var(--radius-full);font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:var(--space-4)}
.hero-title{display:block;width:100%;max-width:11.5ch;margin:0 auto var(--space-4);text-align:center;font-family:var(--font-display);font-size:clamp(1.9rem,4.4vw,3.35rem);font-weight:800;line-height:1.02;letter-spacing:-.03em;color:var(--color-text);text-wrap:balance}
.hero-accent{color:var(--color-primary)}
.hero-sub{font-size:clamp(.92rem,1.8vw,1.02rem);color:var(--color-text-muted);margin-bottom:var(--space-6);max-width:52ch;margin-inline:auto}
.hero-search{width:100%;max-width:560px;margin:0 auto var(--space-5)}
.hero-search-row,.hero-search-wrap{position:relative;display:flex;gap:.55rem;align-items:center}
.hero-search-input{flex:1;padding:.82rem 1rem;border:1.5px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-surface-2);font-size:.98rem;transition:border-color var(--transition), box-shadow var(--transition)}
.hero-search-input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 4px rgba(1,105,111,.10)}
.hero-search-btn{padding:.82rem 1.35rem;background:var(--color-primary);color:#fff;border-radius:var(--radius-lg);font-family:var(--font-display);font-weight:700;font-size:.92rem;transition:all var(--transition);flex-shrink:0;border:none;cursor:pointer}
.hero-search-btn:hover{background:var(--color-primary-hover);transform:translateY(-1px)}
.hero-tags{display:flex;flex-wrap:wrap;gap:.55rem;justify-content:center}
.hero-tag{padding:.36em .8em;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-full);font-size:.76rem;color:var(--color-text-muted);transition:all var(--transition)}
.hero-tag:hover{background:var(--color-primary-light);color:var(--color-primary);border-color:transparent}

/* Stats bar */
.stats-bar{background:var(--color-surface);border-bottom:1px solid var(--color-divider)}
.stats-bar-inner{max-width:var(--content-wide);margin-inline:auto;padding:var(--space-4);display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-4)}
.stat-item{font-size:.875rem;color:var(--color-text-muted)}
.stat-item strong{color:var(--color-text);font-weight:700}
.stat-divider{width:1px;height:20px;background:var(--color-divider)}

/* Sections */
.section{padding:clamp(2rem,5vw,3.5rem) 0}
.section-alt{background:var(--color-surface)}
.section-header{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:var(--space-6);gap:var(--space-4);flex-wrap:wrap}
.section-title{font-family:var(--font-display);font-size:clamp(1.4rem,3vw,1.9rem);font-weight:800}
.section-sub{color:var(--color-text-muted);font-size:.875rem;margin-top:.25rem}
.section-link{font-size:.875rem;font-weight:600;color:var(--color-primary);white-space:nowrap}

/* Length grid */
.length-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:var(--space-3)}
.length-card{display:flex;flex-direction:column;align-items:center;padding:var(--space-4) var(--space-3);background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);text-decoration:none;transition:all var(--transition);gap:2px;color:inherit}
.length-card:hover{border-color:var(--color-primary);background:var(--color-primary-light);transform:translateY(-2px);box-shadow:var(--shadow-md)}
.length-num{font-family:var(--font-display);font-size:1.9rem;font-weight:900;color:var(--color-primary);line-height:1}
.length-label{font-size:.68rem;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.04em}
.length-count{font-size:.7rem;color:var(--color-text-faint)}

/* Puzzle grid */
.puzzle-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--space-4)}
.puzzle-card{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-5);background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);text-decoration:none;color:inherit;transition:all var(--transition)}
.puzzle-card:hover{border-color:var(--color-primary);box-shadow:var(--shadow-md);transform:translateY(-2px)}
.puzzle-card-meta{display:flex;gap:.375rem;flex-wrap:wrap}
.puzzle-card-q{font-size:.875rem;font-weight:500;color:var(--color-text-muted);line-height:1.5;flex:1}
.puzzle-card-answer{font-family:var(--font-display);font-size:1.3rem;font-weight:900;color:var(--color-primary);letter-spacing:.04em}
.puzzle-card-footer{display:flex;justify-content:space-between;align-items:center;font-size:.75rem;color:var(--color-text-faint);margin-top:auto;padding-top:var(--space-2);border-top:1px solid var(--color-divider)}
.puzzle-card-arrow{color:var(--color-primary);transition:transform var(--transition)}
.puzzle-card:hover .puzzle-card-arrow{transform:translateX(4px)}

/* Puzzle list */
.puzzle-list{display:flex;flex-direction:column;gap:.375rem}
.puzzle-list-item{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4);background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);gap:var(--space-4);text-decoration:none;color:inherit;transition:all var(--transition)}
.puzzle-list-item:hover{border-color:var(--color-primary);background:var(--color-surface-2)}
.pli-left{flex:1;min-width:0}
.pli-clue{font-size:.9rem;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pli-meta{display:flex;gap:.375rem;margin-top:.25rem}
.pli-answer{font-family:var(--font-display);font-weight:900;font-size:1.1rem;color:var(--color-primary);white-space:nowrap;letter-spacing:.04em}

/* AZ grid */
.az-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:var(--space-2)}
.az-card{display:flex;align-items:center;justify-content:center;height:46px;background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-md);font-family:var(--font-display);font-size:1.05rem;font-weight:800;color:var(--color-text-muted);transition:all var(--transition);text-decoration:none}
.az-card:hover,.az-card-active{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}

/* Puzzle detail page */
.puzzle-layout,.words-layout,.search-layout{display:grid;grid-template-columns:1fr 300px;gap:var(--space-8);padding-block:var(--space-6) var(--space-12)}
.breadcrumb{display:flex;align-items:center;gap:.5rem;font-size:.8rem;color:var(--color-text-muted);margin-bottom:var(--space-5)}
.breadcrumb a{color:var(--color-text-muted)}
.breadcrumb a:hover{color:var(--color-primary)}
.puzzle-answer-card{background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-xl);padding:var(--space-8);box-shadow:var(--shadow-sm)}
.puzzle-clue-label{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-faint);margin-bottom:var(--space-3)}
.puzzle-clue{font-family:var(--font-display);font-size:clamp(1.4rem,3vw,2rem);font-weight:900;margin-bottom:var(--space-6)}
.puzzle-answer-section{padding:var(--space-6);background:var(--color-bg);border-radius:var(--radius-lg);margin-bottom:var(--space-5)}
.answer-label{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-faint);margin-bottom:var(--space-4)}
.letter-boxes{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:var(--space-4)}
.letter-box{display:flex;align-items:center;justify-content:center;width:clamp(38px,7vw,52px);height:clamp(38px,7vw,52px);background:var(--color-surface-2);border:2.5px solid var(--color-primary);border-radius:var(--radius-md);font-family:var(--font-display);font-size:clamp(1rem,2.5vw,1.4rem);font-weight:900;color:var(--color-primary);box-shadow:var(--shadow-sm);animation:popIn .4s cubic-bezier(.34,1.56,.64,1) both}
.letter-box:nth-child(1){animation-delay:.04s}.letter-box:nth-child(2){animation-delay:.08s}
.letter-box:nth-child(3){animation-delay:.12s}.letter-box:nth-child(4){animation-delay:.16s}
.letter-box:nth-child(5){animation-delay:.2s}.letter-box:nth-child(6){animation-delay:.24s}
.letter-box:nth-child(7){animation-delay:.28s}.letter-box:nth-child(8){animation-delay:.32s}
.letter-box:nth-child(n+9){animation-delay:.36s}
.letter-space{background:transparent;border-color:transparent;width:20px}
@keyframes popIn{from{opacity:0;transform:scale(.4) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}
.answer-meta{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.answer-text-plain{font-family:var(--font-display);font-size:1rem;font-weight:900;color:var(--color-primary);letter-spacing:.1em}
.puzzle-explanation{margin-top:var(--space-5);padding:var(--space-5);background:var(--color-surface-offset);border-radius:var(--radius-lg)}
.exp-title{font-size:.875rem;font-weight:700;margin-bottom:var(--space-2)}
.related-section{margin-top:var(--space-8)}
.related-title{font-family:var(--font-display);font-size:1.2rem;font-weight:800;margin-bottom:var(--space-4)}
.related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:var(--space-3)}
.related-card{padding:var(--space-3) var(--space-4);background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);transition:all var(--transition);text-decoration:none;color:inherit;display:block}
.related-card:hover{border-color:var(--color-primary);transform:translateY(-1px)}
.related-answer{font-family:var(--font-display);font-weight:900;font-size:1rem;color:var(--color-primary);letter-spacing:.04em}
.related-clue{font-size:.75rem;color:var(--color-text-muted);margin-top:.2rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.browse-more{display:flex;gap:var(--space-3);margin-top:var(--space-8);flex-wrap:wrap}

/* Sidebar */
.puzzle-sidebar{display:flex;flex-direction:column;gap:var(--space-4)}
.widget{background:var(--color-surface);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);overflow:hidden}
.widget-title{font-family:var(--font-display);font-size:.875rem;font-weight:800;padding:var(--space-3) var(--space-4);border-bottom:1px solid var(--color-divider)}
.widget-body{padding:var(--space-4)}
.widget-list{list-style:none;display:flex;flex-direction:column;gap:.2rem}
.widget-list li a{display:flex;justify-content:space-between;align-items:center;padding:.35rem .5rem;font-size:.83rem;color:var(--color-text-muted);border-radius:var(--radius-md);transition:all var(--transition)}
.widget-list li a:hover{background:var(--color-surface-offset);color:var(--color-primary)}

/* Search page */
.words-header,.search-hero{margin-bottom:var(--space-6)}
.words-title,.search-title{font-family:var(--font-display);font-size:clamp(1.5rem,3vw,2.2rem);font-weight:900;margin-bottom:var(--space-2)}
.search-title em{color:var(--color-primary);font-style:normal}
.search-results-meta{color:var(--color-text-muted);font-size:.875rem;margin-bottom:var(--space-4)}
.search-form-big{margin-top:var(--space-5)}
.search-big-wrap{display:flex;gap:.5rem}
.search-big-input{flex:1;padding:.75rem 1rem;border:2px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-surface);font-size:1rem;transition:border-color var(--transition)}
.search-big-input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(1,105,111,.12)}
.search-big-btn{padding:.75rem 1.25rem;background:var(--color-primary);color:#fff;border-radius:var(--radius-lg);font-weight:700;display:flex;align-items:center;gap:.5rem;border:none;cursor:pointer;transition:all var(--transition);font-family:var(--font-display)}
.search-big-btn:hover{background:var(--color-primary-hover)}

/* Pagination */
.pagination{margin-top:var(--space-8)}
.pagination ul{display:flex;flex-wrap:wrap;gap:.375rem;list-style:none;justify-content:center}
.pagination li a,.pagination li span{display:flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 .5rem;border-radius:var(--radius-md);font-size:.875rem;font-weight:500;border:1.5px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);transition:all var(--transition);text-decoration:none}
.pagination li a:hover{border-color:var(--color-primary);color:var(--color-primary)}
.pagination li.active a{background:var(--color-primary);border-color:var(--color-primary);color:#fff}

/* Empty state */
.empty-state{text-align:center;padding:var(--space-16) var(--space-8)}
.empty-icon{font-size:3rem;margin-bottom:var(--space-4)}
.empty-state h2{font-family:var(--font-display);font-size:1.5rem;font-weight:800;margin-bottom:var(--space-2)}
.empty-state p{color:var(--color-text-muted);max-width:36ch;margin-inline:auto}

/* Footer */
.site-footer{border-top:1px solid var(--color-divider);background:var(--color-surface)}
.footer-widgets{max-width:var(--content-wide);margin-inline:auto;padding:var(--space-10) var(--space-4) var(--space-8);display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:var(--space-8)}
.footer-brand{display:flex;align-items:center;gap:.5rem;font-family:var(--font-display);font-weight:800;font-size:1rem;color:var(--color-text);margin-bottom:var(--space-3)}
.footer-desc{font-size:.83rem;color:var(--color-text-muted);line-height:1.6}
.footer-col-title{font-family:var(--font-display);font-size:.875rem;font-weight:800;margin-bottom:var(--space-4);color:var(--color-text)}
.footer-links-list{list-style:none;display:flex;flex-direction:column;gap:.25rem}
.footer-links-list li a{display:flex;justify-content:space-between;align-items:center;font-size:.83rem;color:var(--color-text-muted);padding:.2rem .3rem;border-radius:var(--radius-sm);transition:color var(--transition)}
.footer-links-list li a:hover{color:var(--color-primary)}
.footer-links-list li a span{color:var(--color-text-faint);font-size:.72rem}
.footer-az{display:flex;flex-wrap:wrap;gap:.3rem}
.footer-az a{display:flex;align-items:center;justify-content:center;width:28px;height:28px;font-size:.75rem;font-weight:700;color:var(--color-text-muted);border-radius:var(--radius-sm);background:var(--color-surface-offset);transition:all var(--transition)}
.footer-az a:hover{background:var(--color-primary);color:#fff}
.footer-bottom{border-top:1px solid var(--color-divider);padding:var(--space-4) 0}
.footer-inner{max-width:var(--content-wide);margin-inline:auto;padding-inline:var(--space-4);display:flex;align-items:center;justify-content:center}
.footer-copy{font-size:.78rem;color:var(--color-text-faint)}

/* Sidebar badge (admin) */
.sidebar-badge{display:inline-flex;align-items:center;justify-content:center;background:var(--color-error,#a12c7b);color:#fff;font-size:.68rem;font-weight:700;min-width:18px;height:18px;border-radius:9999px;padding:0 5px;line-height:1}

/* Responsive */
@media(max-width:960px){.puzzle-layout,.words-layout,.search-layout{grid-template-columns:1fr}.puzzle-sidebar{display:none}}
@media(max-width:768px){.header-search-wrap{display:none}.site-nav{display:none}.mobile-nav-toggle{display:flex}.stat-divider{display:none}.footer-widgets{grid-template-columns:1fr 1fr}.search-big-wrap{flex-direction:column}}
@media(max-width:480px){.puzzle-grid{grid-template-columns:1fr}.footer-widgets{grid-template-columns:1fr}.length-grid{grid-template-columns:repeat(auto-fill,minmax(75px,1fr))}}
/* ─── Mobile Nav — hidden on desktop, shown only on mobile ─── */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) 0;
}
.mobile-nav a {
  padding: var(--space-3) var(--space-6);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: var(--color-surface-offset); }
.mobile-nav.is-open { display: flex; }

/* Desktop nav — hidden on mobile */
@media (max-width: 768px) {
  .header-nav { display: none !important; }
  .mobile-nav-btn { display: flex !important; }
}
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
  .mobile-nav-btn { display: none !important; }
}

/* AdSense containers */
.ad-zone {
  width: 100%;
  overflow: hidden;
  text-align: center;
  margin: var(--space-8) 0;
  min-height: 90px;
}
.ad-zone:empty { display: none; }

.entry-content{ line-height:1.85; }
.entry-content p{ margin:0 0 1rem; }
.entry-content h2,.entry-content h3{ margin:1.5rem 0 .75rem; }

@media (max-width: 640px){.hero-inner{padding:1rem}.hero-title{font-size:clamp(1.7rem,8vw,2.4rem);max-width:12ch}.hero-search-row,.hero-search-wrap{flex-direction:column}.hero-search-btn{width:100%}}
/* ===== Final homepage polish ===== */

:root{
    --ui-bg: #f6fbfc;
    --ui-card: #ffffff;
    --ui-line: #dbe7ea;
    --ui-line-strong: #c6d7dc;
    --ui-text: #1f2937;
    --ui-muted: #5f6f7a;
    --ui-accent: #0b7680;
    --ui-accent-soft: #e8f7f8;
    --ui-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
    --ui-radius: 26px;
}

body{
    background:
        radial-gradient(circle at top left, rgba(11,118,128,.08), transparent 32%),
        linear-gradient(180deg, #f8fcfd 0%, #f4f8fa 100%);
}

/* outer spacing */
.hero,
.hero-section{
    padding-top: 42px !important;
    padding-bottom: 28px !important;
}

/* main visual frame */
.hero-card,
.hero-shell,
.hero-box{
    max-width: 1180px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,252,253,.98));
    border: 1px solid var(--ui-line);
    border-radius: 30px;
    box-shadow: var(--ui-shadow);
    padding: 34px 28px 26px;
    position: relative;
    overflow: hidden;
}

.hero-card::before,
.hero-shell::before,
.hero-box::before{
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at left top, rgba(11,118,128,.08), transparent 28%),
        radial-gradient(circle at right bottom, rgba(11,118,128,.05), transparent 24%);
    pointer-events: none;
}

/* make content sit above effect */
.hero-inner,
.hero-content{
    position: relative;
    z-index: 1;
}

/* badge */
.hero-badge{
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 16px !important;
    border-radius: 999px;
    background: var(--ui-accent-soft);
    border: 1px solid #cce8ea;
    color: var(--ui-accent);
    font-size: 13px !important;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 auto 18px auto !important;
    box-shadow: 0 6px 18px rgba(11,118,128,.08);
}

/* title */
.hero-title{
    max-width: 9.5ch !important;
    margin: 0 auto 16px auto !important;
    text-align: center !important;
    font-size: clamp(2.4rem, 4.7vw, 4.45rem) !important;
    line-height: .98 !important;
    letter-spacing: -0.045em !important;
    font-weight: 800 !important;
    color: #201a17;
    text-wrap: balance;
}

.hero-title .hero-accent{
    color: var(--ui-accent) !important;
}

/* subtitle */
.hero-sub,
.hero-desc{
    max-width: 760px;
    margin: 0 auto 24px auto !important;
    text-align: center !important;
    font-size: clamp(1rem, 1.45vw, 1.18rem) !important;
    line-height: 1.8 !important;
    color: var(--ui-muted) !important;
}

/* search block */
.hero-search{
    max-width: 760px !important;
    margin: 0 auto 18px auto !important;
    padding: 10px !important;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--ui-line-strong);
    border-radius: 24px !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.hero-search form,
.hero-search .search-form{
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-search input,
.hero-search .search-input{
    min-height: 60px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.03rem !important;
    color: var(--ui-text) !important;
    padding: 0 16px !important;
}

.hero-search input::placeholder{
    color: #8a98a3;
}

.hero-search button,
.hero-search .search-btn{
    min-width: 156px;
    min-height: 58px;
    border: 0 !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #0d838d 0%, #0a6f79 100%) !important;
    color: #fff !important;
    font-size: 1.06rem !important;
    font-weight: 800 !important;
    box-shadow: 0 10px 22px rgba(11,118,128,.22);
}

/* tags below search */
.hero-tags{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px !important;
}

.hero-tags a,
.hero-tags .tag{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ui-line);
    color: #42525d;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
}

/* header polish */
.site-header,
.header{
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,.82) !important;
    border-bottom: 1px solid rgba(210,223,228,.85);
}

.nav a{
    font-weight: 700;
}

/* mobile */
@media (max-width: 768px){
    .hero-card,
    .hero-shell,
    .hero-box{
        border-radius: 22px;
        padding: 24px 16px 18px;
    }

    .hero-title{
        max-width: 11ch !important;
        font-size: clamp(2rem, 9vw, 3rem) !important;
        line-height: 1.02 !important;
    }

    .hero-sub,
    .hero-desc{
        font-size: .98rem !important;
        line-height: 1.7 !important;
        margin-bottom: 18px !important;
    }

    .hero-search{
        padding: 8px !important;
        border-radius: 20px !important;
    }

    .hero-search form,
    .hero-search .search-form{
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .hero-search button,
    .hero-search .search-btn{
        width: 100%;
        min-width: 100%;
        min-height: 52px;
        border-radius: 16px !important;
    }
}

/* ===== Final homepage polish - clean ===== */
:root{
  --ui-bg:#f6fbfc;
  --ui-line:#dbe7ea;
  --ui-line-strong:#cddbe0;
  --ui-text:#1f2937;
  --ui-muted:#60707b;
  --ui-accent:#0b7680;
  --ui-accent-soft:#e8f6f7;
  --ui-shadow:0 18px 50px rgba(15,23,42,.06);
}

/* light mode polish */
body{
  background:
    radial-gradient(circle at top left, rgba(11,118,128,.07), transparent 30%),
    linear-gradient(180deg, #f8fcfd 0%, #f3f8fa 100%);
}

.site-header{
  background:rgba(255,255,255,.82) !important;
  backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(210,223,228,.85) !important;
}

.hero{
  position:relative;
  overflow:hidden;
  padding:42px 0 34px !important;
  background:
    radial-gradient(circle at top left, rgba(11,118,128,.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14,165,233,.05), transparent 24%),
    linear-gradient(180deg, #f6fbfc 0%, #f3f8fa 100%) !important;
  border-bottom:1px solid #e3ecef !important;
}

.hero::before{
  content:"";
  position:absolute;
  inset:24px auto auto 50%;
  transform:translateX(-50%);
  width:min(1180px, calc(100% - 32px));
  height:100%;
  max-height:640px;
  border-radius:30px;
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,252,253,.98));
  border:1px solid var(--ui-line);
  box-shadow:var(--ui-shadow);
  z-index:0;
}

.hero::after{
  content:"";
  position:absolute;
  inset:24px auto auto 50%;
  transform:translateX(-50%);
  width:min(1180px, calc(100% - 32px));
  height:100%;
  max-height:640px;
  border-radius:30px;
  background:
    radial-gradient(circle at left top, rgba(11,118,128,.07), transparent 28%),
    radial-gradient(circle at right bottom, rgba(11,118,128,.04), transparent 24%);
  pointer-events:none;
  z-index:0;
}

.hero-inner{
  position:relative;
  z-index:1;
  max-width:860px !important;
  margin:0 auto !important;
  padding:34px 28px 24px !important;
  text-align:center !important;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
}

.hero-badge{
  display:inline-flex !important;
  align-items:center;
  gap:8px;
  padding:8px 14px !important;
  margin:0 auto 18px auto !important;
  border-radius:999px;
  background:var(--ui-accent-soft) !important;
  border:1px solid #cfe7ea !important;
  color:var(--ui-accent) !important;
  font-size:12px !important;
  font-weight:800;
  letter-spacing:.08em;
  box-shadow:0 6px 18px rgba(11,118,128,.06);
}

.hero-title{
  display:block !important;
  width:100% !important;
  max-width:11.2ch !important;
  margin:0 auto 14px auto !important;
  text-align:center !important;
  font-family:var(--font-display);
  font-size:clamp(1.35rem, 2.2vw, 2.25rem) !important;
  line-height:1.12 !important;
  letter-spacing:-.02em !important;
  font-weight:800 !important;
  color:#201a17 !important;
  text-wrap:balance;
}

.hero-accent,
.hero-title .hero-accent{
  color:var(--ui-accent) !important;
}

.hero-sub{
  max-width:700px;
  margin:0 auto 22px auto !important;
  text-align:center !important;
  font-size:clamp(.98rem, 1.35vw, 1.08rem) !important;
  line-height:1.75 !important;
  color:var(--ui-muted) !important;
}

.hero-search{
  width:100%;
  max-width:700px !important;
  margin:0 auto 14px auto !important;
}

.hero-search-row,
.hero-search-wrap{
  display:flex !important;
  align-items:center;
  gap:10px;
  padding:10px !important;
  background:rgba(255,255,255,.94) !important;
  border:1px solid var(--ui-line-strong) !important;
  border-radius:22px !important;
  box-shadow:0 12px 30px rgba(15,23,42,.05);
}

.hero-search-input{
  flex:1;
  min-height:56px;
  padding:0 16px !important;
  border:none !important;
  background:transparent !important;
  box-shadow:none !important;
  font-size:1rem !important;
  color:var(--ui-text) !important;
}

.hero-search-input::placeholder{
  color:#8b99a3 !important;
}

.hero-search-btn{
  min-width:140px;
  min-height:54px;
  padding:0 20px !important;
  border:none !important;
  border-radius:16px !important;
  background:linear-gradient(180deg, #0d838d 0%, #0a6f79 100%) !important;
  color:#fff !important;
  font-family:var(--font-display);
  font-size:1rem !important;
  font-weight:700 !important;
  box-shadow:0 10px 22px rgba(11,118,128,.20);
}

.hero-search-btn:hover{transform:translateY(-1px)}

.hero-tags{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin-top:8px !important;
}

.hero-tag{
  padding:.46rem .9rem !important;
  background:#fff !important;
  border:1px solid var(--ui-line) !important;
  border-radius:999px !important;
  color:#465762 !important;
  font-size:.86rem !important;
  font-weight:700;
}

/* Homepage card refinements */
.puzzle-card{
  min-height:190px;
  padding:1rem 1rem .9rem;
  gap:.7rem;
  justify-content:space-between;
}

.puzzle-card-meta{margin-bottom:.2rem}

.puzzle-card-title{
  margin:.2rem 0 0 0;
  font-family:var(--font-display);
  font-size:1.02rem;
  font-weight:800;
  line-height:1.5;
  color:var(--color-primary);
  letter-spacing:-.01em;
  text-wrap:pretty;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.puzzle-card:hover .puzzle-card-title{color:var(--color-primary-hover)}

.puzzle-card-q,
.puzzle-card-answer,
.puzzle-card-views{display:none !important}

.puzzle-card-footer{
  margin-top:auto;
  padding-top:.65rem;
  border-top:1px solid var(--color-divider);
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:.78rem;
  color:var(--color-text-faint);
}

.puzzle-card-length{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.28rem .62rem;
  border-radius:999px;
  background:var(--color-primary-light);
  color:var(--color-primary);
  font-size:.72rem;
  font-weight:800;
  line-height:1;
  letter-spacing:.03em;
}

/* Search help */
.search-help{
  max-width:760px;
  margin:12px auto 0;
  text-align:center;
  font-size:.88rem;
  line-height:1.65;
  color:var(--color-text-muted);
}

.search-help a{
  color:var(--color-primary);
  font-weight:700;
  text-decoration:none;
}

.search-help a:hover{color:var(--color-primary-hover)}

.search-help strong{
  display:inline-block;
  padding:.12rem .45rem;
  border-radius:999px;
  background:var(--color-primary-light);
  color:var(--color-primary);
  font-size:.78rem;
  font-weight:800;
  line-height:1.2;
}

/* Dark mode fixes */
[data-theme="dark"] body{
  background:
    radial-gradient(circle at top left, rgba(79,152,163,.10), transparent 30%),
    linear-gradient(180deg, #171614 0%, #1b1a18 100%) !important;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ui-text:#ece7df;
    --ui-muted:#a9acae;
  }
  :root:not([data-theme="light"]) body{
    background:
      radial-gradient(circle at top left, rgba(79,152,163,.10), transparent 30%),
      linear-gradient(180deg, #171614 0%, #1b1a18 100%) !important;
  }
}

[data-theme="dark"] .site-header{
  background:rgba(23,22,20,.84) !important;
  border-bottom:1px solid rgba(58,57,54,.9) !important;
}

[data-theme="dark"] .hero{
  background:
    radial-gradient(circle at top left, rgba(79,152,163,.10), transparent 28%),
    radial-gradient(circle at top right, rgba(79,152,163,.06), transparent 24%),
    linear-gradient(180deg, #1b1a18 0%, #171614 100%) !important;
  border-bottom:1px solid #2f2d2a !important;
}

[data-theme="dark"] .hero::before{
  background:linear-gradient(180deg, rgba(31,30,28,.96), rgba(24,23,21,.98)) !important;
  border:1px solid #34322f !important;
  box-shadow:0 18px 50px rgba(0,0,0,.35) !important;
}

[data-theme="dark"] .hero::after{
  background:
    radial-gradient(circle at left top, rgba(79,152,163,.10), transparent 28%),
    radial-gradient(circle at right bottom, rgba(79,152,163,.05), transparent 24%) !important;
}

[data-theme="dark"] .hero-badge{
  background:rgba(79,152,163,.14) !important;
  border-color:rgba(79,152,163,.24) !important;
  color:#7fc1cb !important;
  box-shadow:none !important;
}

[data-theme="dark"] .hero-title{color:#ece7df !important}

[data-theme="dark"] .hero-accent,
[data-theme="dark"] .hero-title .hero-accent{color:#69b3be !important}

[data-theme="dark"] .hero-sub{color:#a9acae !important}

[data-theme="dark"] .hero-search-row,
[data-theme="dark"] .hero-search-wrap{
  background:rgba(30,29,27,.96) !important;
  border:1px solid #3a3936 !important;
  box-shadow:0 12px 30px rgba(0,0,0,.26) !important;
}

[data-theme="dark"] .hero-search-input{color:#ece7df !important}
[data-theme="dark"] .hero-search-input::placeholder{color:#8d918f !important}

[data-theme="dark"] .hero-search-btn{
  background:linear-gradient(180deg, #3f8d98 0%, #346f78 100%) !important;
  box-shadow:0 10px 22px rgba(0,0,0,.24) !important;
}

[data-theme="dark"] .hero-tag{
  background:#242321 !important;
  border-color:#3a3936 !important;
  color:#c8cbc9 !important;
}

[data-theme="dark"] .stats-bar{
  background:#161513 !important;
  border-bottom:1px solid #2f2d2a !important;
}

[data-theme="dark"] .stat-item,
[data-theme="dark"] .stat-item strong{color:#d7d3cd !important}

[data-theme="dark"] .stat-divider{background:#363430 !important}

[data-theme="dark"] .search-help{color:#a9acae}
[data-theme="dark"] .search-help strong{
  background:rgba(79,152,163,.14);
  color:#7fc1cb;
}

@media (max-width: 768px){
  .hero{
    padding:28px 0 24px !important;
  }

  .hero::before,
  .hero::after{
    width:calc(100% - 20px);
    top:12px;
    border-radius:22px;
  }

  .hero-inner{
    max-width:100% !important;
    padding:22px 14px 16px !important;
  }

  .hero-title{
    max-width:12ch !important;
    font-size:clamp(1.25rem, 5.8vw, 1.7rem) !important;
    line-height:1.14 !important;
  }

  .hero-sub{
    font-size:.96rem !important;
    margin-bottom:16px !important;
  }

  .hero-search-row,
  .hero-search-wrap{
    flex-direction:column;
    align-items:stretch;
    padding:8px !important;
    border-radius:18px !important;
  }

  .hero-search-btn{
    width:100%;
    min-width:100%;
    min-height:50px;
    border-radius:14px !important;
  }
}
/* ===== Final fixes: theme toggle + search help ===== */

.theme-toggle{
  color: var(--color-text-muted);
}

.theme-toggle svg,
.theme-toggle i{
  color: currentColor !important;
  stroke: currentColor !important;
  fill: none !important;
}

[data-theme="dark"] .theme-toggle{
  color: #dce3e4 !important;
  border-color: #4a4946 !important;
  background: #242321 !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}

[data-theme="dark"] .theme-toggle:hover{
  color: #8cc3cb !important;
  border-color: #5a7f86 !important;
  background: #2a2927 !important;
}

[data-theme="dark"] .theme-toggle svg,
[data-theme="dark"] .theme-toggle i{
  color: currentColor !important;
  stroke: currentColor !important;
}

/* search page helper text */
.search-hero .search-help{
  display: block !important;
  max-width: 760px !important;
  margin: 12px auto 0 !important;
  text-align: center !important;
  font-size: .88rem !important;
  line-height: 1.7 !important;
  color: var(--color-text-muted) !important;
}

.search-hero .search-help a{
  color: var(--color-primary) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.search-hero .search-help a:hover{
  color: var(--color-primary-hover) !important;
  text-decoration: underline !important;
}

.search-hero .search-help strong{
  display: inline-block !important;
  padding: .12rem .46rem !important;
  border-radius: 999px !important;
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

[data-theme="dark"] .search-hero .search-help{
  color: #aeb3b1 !important;
}

[data-theme="dark"] .search-hero .search-help strong{
  background: rgba(79,152,163,.16) !important;
  color: #89c2cb !important;
}
.theme-toggle{
  color: var(--color-text-muted) !important;
}

.theme-toggle svg,
.theme-toggle i,
.theme-toggle svg *{
  color: currentColor !important;
  stroke: currentColor !important;
  fill: none !important;
}

[data-theme="dark"] .theme-toggle{
  color: #e8ecec !important;
  border-color: #55524d !important;
  background: #272522 !important;
}

[data-theme="dark"] .theme-toggle:hover{
  color: #8dc5cd !important;
  border-color: #6b9198 !important;
  background: #2d2a27 !important;
}
/* ===== Force visible theme toggle icon ===== */
.theme-toggle{
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  border: 1.5px solid var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  overflow: hidden !important;
}

/* اخف أي أيقونة داخلية قديمة */
.theme-toggle svg,
.theme-toggle i,
.theme-toggle .icon-sun,
.theme-toggle .icon-moon{
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
}

/* رمز افتراضي واضح */
.theme-toggle::before{
  content: "☀";
  font-size: 20px !important;
  line-height: 1 !important;
  color: #1f2937 !important;
  display: block !important;
}

/* في الوضع الداكن نظهر القمر */
[data-theme="dark"] .theme-toggle{
  background: #272522 !important;
  border-color: #57534e !important;
}

[data-theme="dark"] .theme-toggle::before{
  content: "☾";
  color: #f3f4f6 !important;
}

/* في الوضع الفاتح */
[data-theme="light"] .theme-toggle::before{
  content: "☀";
  color: #1f2937 !important;
}

/* fallback إذا لم يكن data-theme موجود */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .theme-toggle{
    background: #272522 !important;
    border-color: #57534e !important;
  }

  :root:not([data-theme="light"]) .theme-toggle::before{
    content: "☾";
    color: #f3f4f6 !important;
  }
}
.hero-lengths,
.length-grid,
.hero-tags {
  display: none !important;
}

/* 2026 refresh */
.section-tight{padding-block:1.1rem}
.widget{box-shadow:var(--shadow-sm);height:100%}
.widget-body{padding:var(--space-4)}
.widget-text{color:var(--color-text-muted);line-height:1.8}
.widget-empty{color:var(--color-text-faint);font-size:.875rem}
.widget-chip{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:.22rem .5rem;border-radius:999px;background:var(--color-primary-light);color:var(--color-primary);font-size:.72rem;font-weight:800}
.widget-list li a{gap:.75rem}
.widget-list li a span:first-child{min-width:0;display:flex;flex-direction:column;gap:.1rem}
.widget-list li a small{display:block;color:var(--color-text-faint);font-size:.72rem;font-weight:500}
.footer-layout-1{grid-template-columns:1fr}
.footer-layout-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.footer-layout-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.footer-mini-links{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:1rem}
.footer-mini-links a{padding:.28rem .65rem;border:1px solid var(--color-border);border-radius:999px;color:var(--color-text-muted);font-size:.78rem}
.footer-stat-stack{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
.footer-stat-stack div{padding:.8rem;border:1px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-surface)}
.footer-stat-stack strong{display:block;font-family:var(--font-display);font-size:1.15rem;color:var(--color-text)}
.footer-stat-stack span{display:block;font-size:.75rem;color:var(--color-text-faint);margin-top:.2rem}
.hero-search-input,.hero-search-btn,.puzzle-card,.length-card,.az-card,.widget,.footer-stat-stack div{transition:all .22s ease}
@media (max-width: 900px){
  .puzzle-layout,.words-layout,.search-layout{grid-template-columns:1fr}
  .puzzle-sidebar{order:2}
}
@media (max-width: 768px){
  .footer-layout-2,.footer-layout-3{grid-template-columns:1fr}
  .hero-inner{padding:1rem}
  .hero-search-row{flex-direction:column}
  .hero-search-btn{width:100%}
  .footer-stat-stack{grid-template-columns:1fr 1fr}
}
@media (max-width: 480px){
  .footer-stat-stack{grid-template-columns:1fr}
  .hero-title{max-width:100%}
}

/* Multi-answer puzzle + recent widget enhancements */
.answer-variants-box{margin-top:1rem;padding:1rem;border:1px solid var(--color-border);border-radius:18px;background:var(--color-surface-offset)}
.answer-variants-title{margin:0 0 .8rem;font-size:1rem;font-weight:800}
.answer-variants-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem}
.answer-variant-item{padding:.85rem .9rem;border-radius:14px;background:var(--color-surface);border:1px solid var(--color-border)}
.answer-variant-word{font-weight:800;letter-spacing:.04em;word-break:break-word}
.answer-variant-meta{margin-top:.3rem;font-size:.82rem;color:var(--color-text-muted)}
.widget-recent-cards{display:grid;gap:.7rem}
.widget-recent-card{display:block;padding:.85rem .95rem;border:1px solid var(--color-border);border-radius:16px;background:var(--color-surface);text-decoration:none;color:inherit;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.widget-recent-card:hover{transform:translateY(-2px);border-color:var(--color-primary);box-shadow:0 10px 25px rgba(0,0,0,.08)}
.widget-recent-clue{font-weight:700;line-height:1.45}
.widget-recent-meta{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:.5rem}
.widget-answer-preview{font-size:.84rem;color:var(--color-text-muted);font-weight:700;letter-spacing:.04em}
.form-hint{margin-top:.35rem;font-size:.78rem;color:var(--color-text-muted)}
@media (max-width: 640px){
  .answer-variants-grid{grid-template-columns:1fr}
}

/* 2026 answer table, voting, suggestion form */
.answer-table-box,.community-answer-box,.suggest-answer-box{margin-top:1rem;padding:1rem 1.1rem;border:1px solid var(--color-border);border-radius:20px;background:var(--color-surface-offset)}
.answer-table-wrap{overflow:auto}
.answer-table{width:100%;border-collapse:collapse;min-width:420px}
.answer-table th,.answer-table td{padding:.85rem .9rem;border-bottom:1px solid var(--color-border);text-align:left}
.answer-table thead th{font-size:.8rem;letter-spacing:.03em;text-transform:uppercase;color:var(--color-text-muted);background:rgba(0,0,0,.02)}
.answer-table tbody tr:last-child td{border-bottom:none}
.answer-tag-primary,.answer-tag-ok{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:999px;font-size:.72rem;font-weight:800;margin-inline-start:.45rem}
.answer-tag-primary{background:var(--color-primary-light);color:var(--color-primary)}
.answer-tag-ok{background:rgba(34,197,94,.12);color:#15803d}
.community-answer-list{display:grid;gap:.75rem}
.community-answer-item{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9rem 1rem;border:1px solid var(--color-border);border-radius:16px;background:var(--color-surface)}
.community-answer-word{font-weight:800;font-size:1rem;letter-spacing:.02em}
.community-answer-sub{font-size:.8rem;color:var(--color-text-muted);margin-top:.15rem}
.community-answer-votes{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.vote-form{margin:0}
.vote-btn{display:inline-flex;align-items:center;gap:.45rem;padding:.58rem .8rem;border-radius:12px;border:1px solid var(--color-border);background:var(--color-surface-offset);color:var(--color-text);font-weight:800;cursor:pointer}
.vote-btn-muted{opacity:.9}
.vote-btn:hover{border-color:var(--color-primary);transform:translateY(-1px)}
.suggest-answer-head p{margin:.2rem 0 0;color:var(--color-text-muted)}
.suggest-answer-form{margin-top:1rem}
.suggest-answer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:.85rem;margin-bottom:1rem}
.suggest-answer-form label{display:block;margin-bottom:.35rem;font-size:.8rem;font-weight:700;color:var(--color-text-muted)}
.suggest-answer-form input{width:100%;padding:.78rem .9rem;border:1px solid var(--color-border);border-radius:14px;background:var(--color-surface);color:var(--color-text);outline:none}
.suggest-answer-form input:focus{border-color:var(--color-primary);box-shadow:0 0 0 4px rgba(1,105,111,.1)}
.mini-alert{margin-top:.85rem;padding:.8rem .95rem;border-radius:14px;font-size:.92rem}
.mini-alert-success{background:rgba(34,197,94,.12);color:#166534}
.mini-alert-error{background:rgba(239,68,68,.12);color:#991b1b}
.widget-recent-meta{justify-content:flex-start}
.widget-recent-card .widget-chip{background:transparent;border:1px solid var(--color-border);color:var(--color-text-muted)}
@media (max-width: 820px){
  .suggest-answer-grid{grid-template-columns:1fr}
  .community-answer-item{flex-direction:column;align-items:flex-start}
}
@media (max-width: 640px){
  .answer-table{min-width:0}
  .answer-table th:nth-child(2),.answer-table td:nth-child(2){width:110px}
}
.suggest-answer-actions{
  display:flex;
  justify-content:flex-start;
  margin-top:1rem;
}

.btn-suggest-small{
  min-height:36px;
  padding:.45rem .8rem;
  border-radius:10px;
  font-size:.82rem;
  font-weight:700;
}

.suggest-answer-panel{
  margin-top:.75rem;
}

.suggest-answer-grid-single{
  display:grid;
  grid-template-columns:1fr;
  gap:.75rem;
  margin-bottom:.9rem;
}

.suggest-answer-form{
  max-width:420px;
}

.suggest-answer-form label{
  display:block;
  margin-bottom:.35rem;
  font-size:.84rem;
  font-weight:700;
  color:var(--color-text-muted);
}

.suggest-answer-form input{
  width:100%;
  min-height:44px;
  padding:.75rem .9rem;
  border:1px solid var(--color-border);
  border-radius:12px;
  background:var(--color-surface);
  color:var(--color-text);
}

.suggest-answer-form input:focus{
  outline:none;
  border-color:var(--color-primary);
  box-shadow:0 0 0 4px rgba(1,105,111,.08);
}