.mode-page{max-width:760px;margin:auto;padding:20px}.mode-tabs{display:flex;gap:8px;background:#eae9e1;padding:5px;border-radius:14px}.mode-tabs a{flex:1;text-align:center;padding:12px 4px;text-decoration:none;color:inherit;border-radius:10px}.mode-tabs a[aria-current]{background:#fff;box-shadow:0 2px 6px #0001;font-weight:700}.mode-switcher{display:none}.mode-intro{margin:24px 0}.mode-intro h1{font-size:30px;margin:0 0 6px}.mode-intro p{color:#6b7065;margin:0}.mode-card{margin-top:14px}.mode-card-heading{padding-bottom:16px}.mode-objective{background:#eaf0df;padding:10px 20px;font-size:14px;line-height:1.45;border-top:1px solid #e0e5cc;border-bottom:1px solid #e0e5cc}.objective-heading{display:flex;align-items:center;gap:10px;font-size:12px}.objective-heading>span{color:#667450}.objective-heading button{margin-left:auto;border:0;background:transparent;padding:0 4px;font-size:12px;text-decoration:underline;min-height:36px}#objectiveList{list-style:none;padding:0;margin:4px 0}#objectiveList li{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.45;margin:3px 0}#objectiveList li>span:nth-child(2){flex:1}#objectiveList small{font-variant-numeric:tabular-nums;color:#687761}#objectiveList .condition-met{color:#245747}.mode-editor{padding-top:12px}.mode-editor .editor-heading strong{color:var(--green)}.mode-draft-container{margin:12px 0 0;border-bottom:1px solid #cdd5c6}#modeMessage{font-size:11px;color:var(--muted);min-height:20px;margin:4px 0 0}.mode-rack-section{padding-top:16px}.mode-rack-section .rack-heading>span:last-child{font-weight:400;letter-spacing:0;color:var(--muted)}.mode-letter-rack{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-width:360px;margin:auto}.mode-letter-rack button{height:62px;min-width:0;border:1px solid #d9ddcc;border-bottom:3px solid #c8cfb7;border-radius:8px;background:#f1f2e6;position:relative;display:flex;align-items:center;justify-content:center;font:600 29px var(--serif)}.mode-letter-rack button:hover:not(:disabled){transform:translateY(-2px);background:var(--lime);box-shadow:0 5px 7px #31422410}.mode-letter-rack button:disabled{opacity:.25;border-style:dashed;background:transparent}.mode-letter-rack small{font:600 9px var(--sans);position:absolute;right:6px;bottom:5px;color:#858b76}.mode-controls{display:flex;gap:10px;flex-wrap:wrap}.mode-controls button{flex:1}.mode-saved{padding-top:20px}.mode-saved .section-heading{margin-bottom:10px}.mode-words:not(.exploration-list){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.mode-word-slot{position:relative;border:1px dashed #d4d9ca;border-radius:9px;min-height:65px;display:flex;align-items:stretch;padding:0;gap:0;overflow:hidden}.mode-word-slot .slotSelect{min-height:65px;padding:14px 10px}.mode-word-slot .slotSelect:disabled{opacity:1;cursor:default}.mode-word-slot.filled{border-style:solid}.mode-word-slot .slotCircle{display:inline-flex;align-items:center;justify-content:center}.mode-word-slot .slotWordLabel{flex:1}.mode-word-slot .slotDelete{top:2px;right:3px}.mode-word{display:flex;align-items:center;gap:12px;min-height:48px;border-bottom:1px solid #eceee6}.mode-word strong{flex:1}.mode-word button{border:0;background:none;font-size:22px}.mode-words.exploration-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px}.mode-bottom{padding:14px 0}.mode-bottom>button{width:100%;margin-bottom:10px;border:1px solid #d7dbce;border-radius:10px;background:#fff;padding:12px;font-weight:650;min-height:46px}.mode-page .primary{background:var(--green);color:white!important;border-color:var(--green)!important}.mode-secondary-actions button{border:1px solid #d7dbce;border-radius:10px;background:#fff;padding:10px;font-weight:600;min-height:44px}.mode-bottom p{font-size:13px}.mode-rules{padding:12px 0;font-size:13px;line-height:1.6}.last-result{display:flex;align-items:center;gap:8px;margin:10px 0;padding:7px 10px;background:#e9efdc;border-radius:10px;font-size:12px}.last-result[hidden]{display:none}.last-result span{flex:1}.last-result button{background:none;border:0;min-width:36px;font-size:22px}.last-result[data-outcome="failure"]{background:#f6e9df;color:#844d2e}.last-result[data-outcome="skipped"]{background:#eae9e1}.challenge-settings{margin:12px 0;border:1px solid var(--line);border-radius:12px;background:var(--paper);overflow:hidden}.challenge-settings summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;cursor:pointer;font-size:12px;list-style:none}.challenge-settings summary::-webkit-details-marker{display:none}.challenge-settings summary:after{content:'⌄';font-size:16px;color:var(--muted)}.challenge-settings[open] summary:after{content:'⌃'}.challenge-settings summary strong{font-weight:600;color:#667450;text-align:right}.challenge-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 14px 10px}.challenge-choice{display:flex;flex-direction:column;gap:6px;font-size:11px;color:var(--muted)}.challenge-choice select{width:100%;padding:10px;border:1px solid #d7dbce;background:white;border-radius:8px;color:var(--ink)}.challenge-settings p{font-size:10px;color:#7b8176;margin:0;padding:0 14px 12px}.joker-letter{color:#83572f;border-bottom:2px dotted #b68247}.mode-daily-link{font-size:13px;color:inherit}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #8ba267;outline-offset:3px}
#jokerDialog{border:0;border-radius:18px;max-width:460px;width:calc(100% - 20px);padding:20px 14px;max-height:calc(100dvh - 24px);overflow:auto;background:#fffefa;color:#243c33}#jokerDialog::backdrop{background:#0006}#jokerDialog form{margin:0}.joker-heading{display:flex;align-items:flex-start;gap:8px}.joker-heading>div{flex:1}.joker-heading h2{font:22px Georgia,serif;line-height:1.2;margin:7px 0 0}.joker-heading button{border:0;background:none;min-width:44px;min-height:44px;font-size:28px}#jokerDialog p{font-size:12px;margin:10px 0 16px;line-height:1.5;color:#7b8176}#jokerLetters{display:block;margin:0}.joker-key-row{display:flex;justify-content:center;gap:4px;margin-bottom:7px}#jokerLetters button{flex:0 1 calc((100% - 36px)/10);min-width:0;min-height:46px;padding:0;font-size:15px;font-weight:650;box-shadow:0 2px 0 #d0d4c9;border:1px solid #ddd;background:#f6f5ef;border-radius:6px}.joker-cancel{display:block;border:0;background:transparent;margin:12px auto 0;padding:6px 18px;min-height:44px;color:#7b8176}

@media(max-width:720px){
  .modes-page .site-header{height:56px;padding:0 14px}.modes-page .brand{font-size:19px}.modes-page .brand-icon{width:28px;height:33px;font-size:25px;margin-right:7px}.mode-daily-link{font-size:11px}.mode-page{padding:8px 14px}.mode-tabs{display:none}.mode-switcher{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 8px;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);font-size:11px;color:var(--muted)}.mode-switcher select{border:0;background:transparent;color:var(--ink);font-weight:700;text-align:right;min-height:32px;padding:0 24px 0 8px}.mode-intro{display:none}.mode-card{margin-top:6px;border-radius:14px}.mode-card-heading{display:none}.mode-objective{padding:7px 12px}.objective-heading{gap:6px}.objective-heading button{min-height:32px}#objectiveList{margin:2px 0}#objectiveList li{font-size:12px;margin:1px 0}.mode-editor{padding:10px 18px 0}.mode-draft-container{margin-top:6px}#modeMessage{min-height:22px;margin:3px 0 0;line-height:1.35}.mode-rack-section{padding:7px 18px 12px}.mode-rack-section .rack-heading{margin-bottom:6px}.mode-rack-section .rack-heading>span:last-child{display:none}.mode-letter-rack{gap:5px}.mode-letter-rack button{height:49px;border-radius:6px;font-size:25px}.mode-letter-rack small{right:3px;bottom:3px;font-size:8px}.mode-rack-section .action-row{margin-top:10px}.mode-rack-section .actionTile{height:44px}.mode-saved{padding:11px 18px}.mode-saved .section-heading{margin-bottom:7px}.mode-saved .section-heading h2{font-size:22px}.mode-word-slot{min-height:52px;padding:0;gap:0}.mode-word-slot .slotSelect{min-height:52px;padding:8px 6px;gap:5px}.mode-word-slot .slotCircle{width:21px;height:21px}.mode-word-slot .slotWordLabel{font-size:9px}.mode-word-slot .slotScore{font-size:8px}.mode-words.exploration-list{grid-template-columns:1fr}.mode-word{min-height:42px}.challenge-settings{margin:8px 0}.challenge-settings summary{padding:9px 11px}.challenge-settings-grid{padding:0 11px 9px}.challenge-settings p{padding:0 11px 10px}.mode-bottom{padding-top:6px}.mode-bottom>button{margin-bottom:8px}.mode-secondary-actions{gap:6px}.mode-secondary-actions button{font-size:11px;padding:8px 5px}.mode-rules{padding-top:8px}.page-footer{margin-top:14px}.last-result{margin:6px 0;padding:5px 9px}
}
@media(max-width:390px){.mode-words:not(.exploration-list){gap:6px}.mode-word-slot .slotSelect{padding-inline:5px}.mode-word-slot .slotDelete{font-size:15px}.challenge-settings summary strong{font-size:11px}.mode-secondary-actions{display:grid;grid-template-columns:1fr 1fr}.mode-secondary-actions #modeShare{grid-column:1/-1}}
@media(max-width:360px){.modes-page .brand-icon{display:none}#jokerDialog{padding:16px 10px}.joker-heading h2{font-size:20px}#jokerLetters button{font-size:13px}.joker-key-row{gap:3px}.objective-heading{gap:5px}#objectiveList li{font-size:11px}.mode-page{padding-inline:10px}.mode-editor,.mode-rack-section,.mode-saved{padding-left:12px;padding-right:12px}.mode-letter-rack{gap:4px}.mode-letter-rack button{height:46px}}
@media(max-height:580px) and (max-width:720px){.modes-page .site-header{height:48px}.mode-switcher{padding-block:4px;margin-bottom:5px}.mode-objective{padding-block:5px}.mode-editor{padding-top:6px}.mode-rack-section{padding-top:4px;padding-bottom:8px}.mode-letter-rack button{height:45px}.mode-saved{padding-block:8px}.mode-word-slot{min-height:46px}.last-result{margin:4px 0}}

/* Adaptive Défis: compact power-up presentation, no configuration panel. */
.objective-powers{display:flex;flex-wrap:wrap;gap:6px;margin:7px 0 2px}.objective-powers[hidden]{display:none}.power-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 9px;border-radius:999px;background:#fff;border:1px solid #d8dfc7;font-size:11px;font-weight:650;color:#516144}.joker-power{background:#f7f0df;border-color:#e5d6b4;color:#725b2b}.mode-letter-rack button.bonus-letter-tile,.mode-letter-rack button.double-letter-tile{border-color:#aabf7b;box-shadow:0 0 0 2px #dfe8c6 inset}.mode-letter-rack button.bonus-letter-tile{background:#eef4d9}.mode-letter-rack button.double-letter-tile{background:#e7f0df}.tile-power{position:absolute;left:4px;top:4px;min-width:21px;padding:2px 4px;border-radius:999px;background:#334d3f;color:#fff;font:700 8px var(--sans);letter-spacing:0}.boosted-score{font-weight:800;color:var(--green)}

@media(max-width:720px){.objective-powers{gap:4px;margin-top:5px}.power-chip{font-size:10px;min-height:25px;padding:3px 7px}.tile-power{left:3px;top:3px;font-size:7px}.mode-objective{border-radius:0}}

@media(max-width:420px){}

/* Objectives stay readable above the rack, including on narrow screens. */
.objective-heading { flex-wrap: wrap; }
.objective-heading strong { font-size: 11px; letter-spacing: 1px; }
#objectiveCount { font-size: 11px; font-variant-numeric: tabular-nums; }
.objective-heading button { min-height: 44px; padding-inline: 8px; }
.objective-instruction { margin: 0 0 8px; color: #526344; font-size: 12px; }
#objectiveList { display: grid; gap: 5px; margin: 0; }
#objectiveList li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; margin: 0; padding: 8px; border: 1px solid #dce3ce; border-radius: 8px; background: #ffffffb0; }
#objectiveList li > span:first-child { text-align: center; font-size: 16px; }
#objectiveList small { white-space: nowrap; font-size: 11px; color: #536249; }
#objectiveList .condition-met { background: #e1ebd2; border-color: #a8bd8d; }
.mode-objective.all-met #objectiveCount { color: var(--green); font-weight: 700; }
.objective-powers { align-items: center; margin-top: 8px; }
.powers-label { color: #667450; font-size: 10px; }
@media (max-width: 390px) {
    #objectiveList li { grid-template-columns: 18px minmax(0, 1fr); gap: 2px 6px; padding: 6px 8px; font-size: 12px; }
    #objectiveList small { grid-column: 2; }
}

/* Finish belongs to the board; extra actions come after the playing surface. */
.mode-finish { padding: 0 28px 20px; background: #fbfbf5; }
.mode-finish p { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.mode-finish button { width: 100%; min-height: 46px; padding: 12px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 650; }
.mode-finish:not(.is-ready) p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Small phones: one uninterrupted board, from objectives to finish. */
@media (max-width: 720px) {
    .modes-page .site-header { height: 48px; padding: 0 12px; gap: 8px; }
    .modes-page .mode-daily-link { display: none; }
    .modes-page .mode-switcher { display: flex; flex: 0 0 auto; margin: 0; padding: 0; border: 0; background: transparent; }
    .mode-switcher > span { display: none; }
    .mode-switcher select { min-height: 44px; padding: 0 18px 0 6px; font-size: 12px; }
    .mode-page { padding: 4px 10px 16px; }
    .mode-card { margin-top: 0; border-radius: 12px; }
    .mode-objective { padding: 0 10px 7px; }
    .objective-heading { flex-wrap: nowrap; gap: 6px; min-height: 40px; }
    .objective-heading strong { font-size: 10px; letter-spacing: .7px; }
    .objective-heading button { min-height: 44px; padding: 0 2px 0 8px; font-size: 11px; }
    #objectiveCount { font-size: 10px; }
    .objective-instruction { display: none; }
    #objectiveList { gap: 3px; }
    #objectiveList li { grid-template-columns: 15px minmax(0, 1fr) auto; gap: 5px; padding: 4px 6px; border-radius: 5px; font-size: 12px; line-height: 1.25; }
    #objectiveList li > span:first-child { font-size: 13px; }
    #objectiveList small { grid-column: auto; font-size: 10px; }
    .progress-unit { display: none; }
    .objective-powers { gap: 4px; margin: 5px 0 0; }
    .powers-label { display: none; }
    .power-chip { padding: 2px 6px; min-height: 21px; font-size: 10px; font-weight: 600; }
    .mode-editor { padding: 7px 12px 0; }
    .mode-editor .editor-heading { margin-bottom: 0; font-size: 10px; line-height: 14px; }
    .mode-draft-container { margin-top: 0; }
    #modeDraft { min-height: 44px; }
    #modeMessage { min-height: 14px; margin: 2px 0 0; font-size: 10px; line-height: 1.3; }
    .mode-rack-section { padding: 5px 12px 8px; }
    .mode-rack-section .rack-heading { display: none; }
    .mode-letter-rack { gap: 4px; max-width: 360px; }
    .mode-letter-rack button { height: 46px; font-size: 25px; }
    .mode-rack-section .action-row { margin-top: 7px; gap: 7px; }
    .mode-rack-section .actionTile { height: 44px; font-size: 11px; }
    .mode-controls .delTile { flex: 0 0 84px; }
    .mode-saved { padding: 7px 12px; }
    .mode-saved .section-heading { display: none; }
    .mode-words:not(.exploration-list) { gap: 5px; }
    .mode-word-slot { min-height: 44px; padding: 0; gap: 0; }
    .mode-word-slot .slotSelect { min-height: 44px; padding: 5px; gap: 4px; }
    .mode-word-slot.filled .slotCircle { display: none; }
    .mode-word-slot .slotWordLabel { font-size: 11px; padding-right: 8px; }
    .mode-word-slot .slotScore { font-size: 9px; margin-top: 3px; }
    .mode-word-slot .slotDelete { width: 24px; height: 24px; padding: 0; top: 0; right: 0; }
    .mode-finish { padding: 0 12px 9px; }
    .mode-finish p { font-size: 11px; line-height: 1.25; margin-bottom: 5px; }
    .mode-finish button { min-height: 44px; padding: 9px; font-size: 13px; }
    .mode-bottom { padding: 12px 0 0; }
    .mode-bottom #lastResult { margin: 0 0 8px; }
    .mode-bottom #modeBest:empty { display: none; }
    .modes-page .page-footer { flex-direction: row; }
}
@media (max-width: 720px) and (max-height: 600px) {
    .modes-page .site-header { height: 44px; }
    .mode-page { padding-top: 2px; }
    .mode-editor { padding-top: 5px; }
    #modeDraft { min-height: 40px; }
    .mode-letter-rack button { height: 44px; }
    .mode-rack-section { padding-top: 3px; padding-bottom: 6px; }
    .mode-rack-section .action-row { margin-top: 5px; }
    .mode-saved { padding-block: 5px; }
}
@media (max-width: 720px) and (max-height: 600px) {
    #objectiveList li { padding-block: 2px; }
    .mode-objective { padding-bottom: 5px; }
    .objective-powers { margin-top: 3px; }
    .power-chip { min-height: 19px; padding-block: 1px; }
    #modeMessage[data-kind="hint"], #modeMessage[data-kind="success"] {
        position: absolute; width: 1px; height: 1px; min-height: 0;
        overflow: hidden; clip-path: inset(50%); margin: 0;
    }
    .mode-rack-section { padding-bottom: 4px; }
    .mode-rack-section .action-row { margin-top: 4px; }
    .mode-saved { padding-block: 4px; }
}
