
:root{font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:#152a27;background:#f5f3eb}*{box-sizing:border-box}body{margin:0}header{background:#123c34;color:white;padding:16px max(16px,calc((100vw - 1000px)/2));display:flex;justify-content:space-between;align-items:center;gap:12px}header strong{font-size:15px;letter-spacing:.03em}.issue{font-size:12px;color:#c9dfd7}main{max-width:980px;margin:auto;padding:22px 14px 65px}.panel{background:white;border:1px solid #e4e4db;border-radius:18px;padding:clamp(16px,4vw,34px);box-shadow:0 8px 24px #1830290c}section.page{display:none}section.page.active{display:block}h1{font-family:Georgia,serif;font-size:clamp(37px,7vw,69px);line-height:1.02;margin:15px 0}h2{font-family:Georgia,serif;font-size:clamp(28px,5vw,42px);margin:0 0 10px}h3{margin:14px 0 6px}.sub{color:#67746b}.eyebrow{font-weight:800;color:#86632b;letter-spacing:.13em;text-transform:uppercase;font-size:12px}.lead{font-size:18px;line-height:1.6;max-width:680px}.tag{display:inline-block;background:#e8eee4;padding:8px 12px;border-radius:99px;font-size:13px;margin:4px 4px 4px 0}.actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:25px}button{border:0;border-radius:11px;cursor:pointer;padding:12px 16px;font-weight:750;background:#e9eee9;color:#123c34;font-size:15px}button.primary{background:#136a52;color:white}button:focus-visible,.cell:focus-visible{outline:3px solid #f2ad40;outline-offset:2px}.bar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:10px 0 18px}.progress{font-size:13px;font-weight:bold;color:#56665c}.gridwrap{width:100%;overflow-x:auto;overscroll-behavior-inline:contain;padding:7px 0 16px}.crossword{--cell:30px;display:grid;grid-template-columns:repeat(var(--w),var(--cell));grid-template-rows:repeat(var(--h),var(--cell));width:max-content;background:#fff;touch-action:pan-x pan-y}.cell{width:var(--cell);height:var(--cell);border:1px solid #a7afa7;background:#fff;text-align:center;font-size:18px;font-weight:800;color:#133b32;border-radius:0;padding:0;text-transform:uppercase;caret-color:#16664f}.cell.selected{background:#d7e8dd}.cell.focused{background:#f9d994}.cell.wrong{background:#fbe1dc}.cell.correct{background:#d3f0d4}.cell::selection{background:#d2a34e}.blank{width:var(--cell);height:var(--cell)}.tile{position:relative}.num{position:absolute;z-index:1;font-size:9px;left:2px;top:0;pointer-events:none;color:#59635c;font-weight:bold}.cluelists{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:18px}.clue{padding:10px 9px;text-align:left;width:100%;background:transparent;border-bottom:1px solid #edf0e9;border-radius:0;font-size:13px;line-height:1.4;font-weight:500;color:#233a35}.clue.active{background:#e5f0e7;border-radius:8px}.clue b{margin-right:5px}.hint{color:#67746b;font-size:13px}.quiz{border:1px solid #e1e7de;padding:15px;border-radius:12px;margin:15px 0}.quiz label{display:block;padding:10px;margin:5px 0;border-radius:8px;background:#f7f8f4;cursor:pointer}.quiz label:has(input:checked){background:#d6ecdf}.result{font-size:clamp(42px,7vw,75px);font-family:Georgia,serif;color:#136a52;font-weight:700}.solution-grid{font-family:monospace;white-space:pre;overflow-x:auto;background:#f1f5ed;padding:12px;border-radius:10px;font-size:11px}.footer{font-size:12px;text-align:center;color:#738079;padding:25px}.credit{border-left:4px solid #c69d61;padding:13px;background:#faf8ef;margin:20px 0}@media(max-width:550px){.cluelists{grid-template-columns:1fr;gap:8px}.crossword{--cell:29px}.panel{padding:15px}.bar{align-items:flex-start;flex-direction:column}.actions button{flex:1}}@media print{header,.actions,.quiz,.footer{display:none!important}section.page{display:block!important;break-after:page}}
.wordwrap{width:100%;overflow-x:auto;padding:5px 0 16px}.wordgrid{display:grid;grid-template-columns:repeat(var(--wordsize),minmax(0,1fr));width:min(100%,560px);min-width:280px;gap:2px;touch-action:pan-y}.wordcell{aspect-ratio:1;padding:0;border-radius:3px;background:#e7efe8;color:#183e34;font-size:clamp(11px,2.5vw,19px);font-weight:800;user-select:none;-webkit-user-select:none;touch-action:none}.wordcell.startword{background:#f5c568}.wordcell.found{background:#9cddad}.wordlist{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.worditem{padding:7px 9px;border:1px solid #cad7cc;border-radius:8px;font-size:12px;font-weight:750}.worditem.done{background:#c1e9c8;text-decoration:line-through}@media(max-width:430px){.wordgrid{gap:1px}.wordcell{font-size:11px}}

.steps{display:flex;gap:5px;overflow-x:auto;padding:10px 12px;background:#e8eee4;position:sticky;top:0;z-index:5}.steps button{flex:1;min-width:54px;padding:12px 5px;font-size:12px;white-space:nowrap}.steps button[aria-current="step"]{background:#123c34;color:white}#notice{max-width:980px;margin:auto;padding:12px;color:#694900}#notice:empty{display:none}.ad{border:1px dashed #c8c5b8;padding:15px;text-align:center;color:#657067;font-size:12px;margin:22px 0;min-height:65px}.gridwrap{overflow:visible}.crossword{width:100%;grid-template-columns:repeat(var(--w),minmax(0,1fr));grid-template-rows:none;gap:0}.tile,.blank{width:100%;height:auto;aspect-ratio:1}.cell{width:100%;height:100%;min-width:0;font-size:clamp(10px,2.8vw,21px)}.tile{min-width:0}.num{font-size:clamp(6px,1.4vw,10px);line-height:1}.wordgrid{min-width:0}.wordwrap{overflow:visible}.wordcell{min-height:0}.wordcell.preview{background:#f5c568}.quiz fieldset{border:0;padding:0;margin:0}.quiz legend{font-weight:700;line-height:1.5}input:not(.cell):not([type=radio]),textarea,select{font:inherit;padding:13px;border:1px solid #8e9d92;border-radius:9px;max-width:100%;width:100%;margin:8px 0 14px}button,a{touch-action:manipulation}button{min-height:44px}a{color:#136a52}.cell{min-height:0}body{overflow-wrap:break-word}main{min-width:0}.admin textarea{font-family:monospace;min-height:55vh;font-size:16px}.admin label{display:block;font-weight:700}#leaderboard{padding-left:26px;line-height:1.8}.footer{line-height:1.6}.wordgrid .wordcell{min-height:0}.wordcell:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid #a05a00;outline-offset:1px}@media(max-width:380px){main{padding:14px 8px 45px}.panel{padding:12px}.steps button{font-size:10px}.cell{font-size:11px}}@media(min-width:650px){.crossword{max-width:760px}.steps{justify-content:center}.steps button{max-width:180px}}

@media(max-width:650px){.cell{font-size:16px}}

.footer{color:#526159}details{border:1px solid #d8dfd6;border-radius:10px;padding:12px;margin:12px 0}summary{cursor:pointer;font-weight:700;padding:10px 0;min-height:44px}#gameFields>button{margin:8px 0 20px}

input[type=checkbox]{width:auto!important;min-height:24px;margin-right:10px!important}button:disabled{opacity:.6;cursor:default}#entryInput{font-size:20px;letter-spacing:.12em;text-transform:uppercase}

/* The clue and board share one in-flow workspace: no overlay above the keyboard. */
.crossword-workspace{display:flex;flex-direction:column;gap:8px;max-width:760px;margin:16px auto 0;overflow-anchor:none;min-width:0}
.active-clue{box-sizing:border-box;background:#edf4ef;border:1px solid #9db7a5;border-left:4px solid #136a52;border-radius:10px;padding:10px 12px;color:#152a27}
.clue-meta{display:block;font-size:13px;font-weight:750;line-height:1.35;color:#345a47}
.clue-text{font-size:16px;line-height:1.4;font-weight:600;margin:4px 0 0}
.crossword-workspace .gridwrap{padding:0;margin:0;overflow:visible}
.crossword-workspace .crossword{width:min(100%,var(--crossword-grid-limit,760px));margin:0 auto}
.word-entry label{display:block;font-size:14px;font-weight:700;line-height:1.35}
.word-entry #entryInput{margin:4px 0 0;min-height:44px;padding:8px 12px;font-size:20px;line-height:1.2}
.cell.focused{background:#f9d994;box-shadow:inset 0 0 0 2px #123c34}
#page1 .cluelists{gap:12px;margin-top:12px}#page1 .cluelists details{margin:0;min-width:0}#page1 .cluelists summary{font-size:15px;line-height:1.4}
.crossword-intro{line-height:1.5;font-size:14px;max-width:760px}
.clue-measure{position:absolute;visibility:hidden;pointer-events:none;min-height:0!important}
@media(max-width:550px){.crossword-workspace{margin-top:12px}.clue-text{font-size:16px}#page1 .bar{flex-direction:row;align-items:center;gap:8px;margin-top:16px}#page1 .bar button{font-size:13px;padding:10px}#page1 .progress{font-size:12px}}
/* Fixed grid tracks prevent input minimum heights from stretching the board when the keyboard opens. */
.crossword-workspace .crossword{aspect-ratio:var(--w)/var(--h);grid-template-rows:repeat(var(--h),minmax(0,1fr));min-height:0}
.crossword-workspace .tile,.crossword-workspace .blank{height:100%;min-height:0;aspect-ratio:auto}
.crossword-workspace .cell{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;line-height:1;min-height:0}

/* Collegamenti informativi */
.privacy-footer{
 max-width:960px;margin:28px auto 0;padding:20px 16px;
 border-top:1px solid #d8dfd6;text-align:center;
 color:#526159;line-height:1.7
}
.privacy-footer nav{margin:8px 0}
.privacy-footer a,.privacy-document a{overflow-wrap:anywhere}
.privacy-document{max-width:800px;margin:24px auto}
.privacy-document h2{margin-top:26px;font-size:1.2rem}
.privacy-document p,.privacy-document li{line-height:1.65}


/* Questo è Mondragone · Editorial Emerald · theme-only overlay.
   Does not change game logic, grid dimensions, or administrative controls. */
:root{
  --md-ink:#18372f;--md-deep:#103c31;--md-green:#176750;--md-muted:#62766a;
  --md-cream:#f7f5ed;--md-paper:#fffefa;--md-gold:#b78d4a;
  --md-line:#dce5dc;--md-focus:#d59531;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--md-ink);background:var(--md-cream);
}
body{
  background:radial-gradient(ellipse at 86% 0%,rgba(206,220,199,.34),transparent 34%),
             linear-gradient(180deg,#f8f7f1 0%,#f4f2e9 100%);
  color:var(--md-ink);-webkit-font-smoothing:antialiased;
}
header{
  min-height:84px;background:linear-gradient(120deg,#0b382e 0%,#15503f 82%,#1a5a47 100%);
  border-bottom:3px solid #c3a266;box-shadow:0 5px 20px rgba(11,48,37,.12);
}
header strong{letter-spacing:.105em;font-size:clamp(12px,2vw,16px);font-weight:850}
header .issue{color:#e0d4b5;font-size:11px;letter-spacing:.08em;line-height:1.6}
header a{color:#f6efd8!important;text-underline-offset:4px}
main{max-width:1060px;padding-top:clamp(18px,3vw,34px)}
.panel{
  background:var(--md-paper);border:1px solid #e2e6dc;border-radius:22px;
  box-shadow:0 14px 44px rgba(28,56,39,.065),0 2px 8px rgba(28,56,39,.035);
}
h1,h2{color:#133b31;letter-spacing:-.035em;text-wrap:balance}
h1{font-weight:700;line-height:1.07}h1 em{font-style:italic;color:var(--md-green)}
h2{line-height:1.14}h3{color:#214638}
.eyebrow{color:#98723a;letter-spacing:.15em;font-weight:850}
.lead{color:#40584c;font-size:clamp(16px,2.8vw,19px);line-height:1.72}
.sub{color:var(--md-muted);line-height:1.58}
#page0{
  position:relative;overflow:hidden;
  background:radial-gradient(circle at 100% 2%,rgba(208,227,206,.50),transparent 37%),var(--md-paper);
}
#page0::before{
  content:"EDIZIONE DOMENICALE";display:block;width:max-content;max-width:100%;
  border-bottom:1px solid #ccb286;margin-bottom:22px;padding-bottom:8px;
  color:#9b7b47;font-size:10px;font-weight:800;letter-spacing:.22em;
}
#page0 h1{max-width:850px;margin:14px 0 24px}#page0 .lead{max-width:650px}
.tag{
  padding:9px 13px;margin:5px 6px 5px 0;background:#eef3eb;border:1px solid #dce8db;
  color:#285b47;font-weight:700;font-size:12px;
}
.steps{
  background:rgba(247,248,242,.97);border-bottom:1px solid #dce5dc;
  box-shadow:0 4px 14px rgba(21,65,47,.05);gap:8px;scrollbar-width:thin;
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
}
.steps button{
  min-height:47px;border:1px solid transparent;border-radius:10px;
  background:transparent;color:#526b5c;font-weight:750;
}
.steps button[aria-current="step"]{
  background:#145541;color:white;box-shadow:0 3px 9px rgba(20,85,65,.2);
}
button{
  border-radius:11px;
  transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;
}
button.primary{background:#14624d;color:#fff;box-shadow:0 4px 10px rgba(20,98,77,.15)}
button.primary:hover{background:#0e4a39}
button:not(.primary):not(.cell):not(.wordcell):hover{background:#dbe9df}
button:focus-visible,a:focus-visible,input:focus-visible,
.cell:focus-visible,.wordcell:focus-visible{outline:3px solid var(--md-focus);outline-offset:2px}
a{color:#17654f;text-underline-offset:3px}
.bar{padding:10px 0}.progress{color:#506e5b}
.credit{
  background:#faf6e9;border-left:3px solid #bd985c;border-radius:0 10px 10px 0;
  color:#506050;line-height:1.6;
}
.ad{border:1px dashed #d8d1bf;background:#faf9f4;border-radius:12px;color:#7c8177}
.crossword-workspace{
  background:#f9fbf7;border:1px solid #e2e9e0;border-radius:17px;
  padding:clamp(7px,1.8vw,18px);
}
.active-clue{
  background:#eaf3ed;border:1px solid #b9d1c0;border-left:4px solid #176750;
  border-radius:11px;box-shadow:0 2px 6px rgba(33,88,60,.035);
}
.clue-meta{color:#31684e;font-size:12px;letter-spacing:.045em;text-transform:uppercase}
.clue-text{color:#143c30;font-size:clamp(15px,2.6vw,17px);line-height:1.48}
.crossword-workspace .crossword{background:transparent}
.cell{border-color:#a9b9ad;background:#fffefa;color:#173d30}
.cell.selected{background:#dcecdf}
.cell.focused{background:#f7daa0;box-shadow:inset 0 0 0 2px #1a5e48}
.cell.correct{background:#d7eedd}.cell.wrong{background:#f6ded9}
.word-entry label{color:#42614f}
.word-entry #entryInput{border-color:#a6bcad;background:#fff;box-shadow:0 2px 6px rgba(25,61,42,.035)}
.cluelists details,details{border-color:var(--md-line);background:#fffefa;border-radius:12px}
.clue.active{background:#e6f2e8;color:#0e513c}
.quiz{
  background:#fffefa;border-color:#dfe7de;border-radius:15px;
  padding:clamp(14px,3vw,22px);
}
.quiz legend{color:#194233;font-size:clamp(15px,2vw,18px)}
.quiz label{
  padding:13px 12px;border:1px solid #e4e9e1;border-radius:10px;
  background:#f8faf6;line-height:1.4;min-height:46px;
}
.quiz label:has(input:checked){
  background:#e4f1e8;border-color:#79ad90;box-shadow:inset 3px 0 0 #35805c;
}
.wordcell{
  border:1px solid rgba(58,104,78,.1);border-radius:4px;
  background:#e5eee6;color:#174a38;
}
.wordcell.found{background:#abd8b2}
.wordcell.startword,.wordcell.preview{background:#f5d28f}
.worditem{background:#fffefa;border-color:#d6e3d6;border-radius:9px}
.worditem.done{background:#dcefe0}.result{color:#13654c}
#leaderboard{background:#fbfcf8;border-radius:12px;padding-top:10px;padding-bottom:10px}
.footer,.privacy-footer{color:#5c7164;border-top:1px solid #e0e8df;line-height:1.7}
.privacy-document{background:var(--md-paper)}
.privacy-document h2{border-top:1px solid #e6ebe2;padding-top:18px}
@media(min-width:850px){
  #page0{padding:clamp(35px,5vw,65px)}
  #page0 .actions .primary{padding-inline:25px}
}
@media(max-width:550px){
  header{min-height:74px;padding:12px 16px;gap:8px}
  header .issue{font-size:10px}
  main{padding:16px 10px 48px}
  .panel{border-radius:16px;padding:clamp(14px,3.8vw,20px)}
  .steps{gap:4px;padding:7px 8px}
  .steps button{padding:9px 5px;min-height:44px;font-size:11px}
  #page0::before{margin-bottom:14px}
  #page0 h1{font-size:clamp(35px,9.2vw,52px);margin:10px 0 20px}
  .tag{padding:8px 10px}
  .crossword-workspace{padding:6px;border-radius:12px}
  .active-clue{padding:9px 10px}
  .clue-text{font-size:15px}
  .quiz label{padding:12px 10px}
  .wordcell{border-radius:2px}
  .actions button{min-height:46px}
}
@media(prefers-reduced-motion:reduce){button{transition:none}*,*::before,*::after{scroll-behavior:auto!important}}
@media print{body{background:white}.panel{box-shadow:none}.steps{position:static}}



/* MOBILE CROSSWORD FIX V2 */
@media (max-width:650px) {

  #page1 .crossword-workspace {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }

  #page1 .gridwrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    padding: 5px 0 13px;
  }

  #page1 .crossword-workspace .crossword {
    --cell: 40px;
    display: grid;
    width: max-content !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: auto !important;
    grid-template-columns: repeat(var(--w), 40px) !important;
    grid-template-rows: repeat(var(--h), 40px) !important;
    margin: 0;
  }

  #page1 .crossword-workspace .tile,
  #page1 .crossword-workspace .blank {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    aspect-ratio: 1;
  }

  #page1 .crossword-workspace .cell {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    font-size: 20px;
    line-height: 1;
    padding: 9px 1px 1px;
    border-radius: 0;
  }

  #page1 .crossword-workspace .num {
    position: absolute;
    z-index: 2;
    top: 2px;
    left: 3px;
    font-family: system-ui, sans-serif;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    color: #3d5c4c;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
  }
}

/* Meaning game follows the same Editorial Emerald controls. */
#page5>.eyebrow{color:#755522}
.steps button[data-page="5"]{min-width:88px}

.steps button{flex:0 0 auto;min-width:72px}
