/* Doublets web — laid out over the daily frame art (assets/frame-daily.webp, 941 × 1672).
   Like the app, the frame stretches to the screen; every element is placed in
   percentages of that frame so it lines up on any phone or window. */
:root{
  --font: Sylfaen, "Gentium Book Plus", Georgia, "Times New Roman", serif;
  --cell-bg:#28231e; --cell-line:#b4a078; --wrong:#3c3732; --exists:#b59f3b; --correct:#538d4e;
  --key:#818384; --key-text:#fff; --enter:#2ecc71; --back:#e74c3c;
  --gold:#e8c35a; --ink:#1b140d; --parchment:#efe3c8;
  --frame-ratio:0.5628;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:#120d08}
body{font-family:var(--font);color:#fff;overflow:hidden;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;
  background:#120d08 url(assets/poster.webp) center/cover no-repeat fixed}
body::before{content:"";position:fixed;inset:0;background:rgba(10,7,4,.78);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

#stage{position:relative;height:100dvh;width:min(100vw,calc(100dvh * var(--frame-ratio)));margin:0 auto;
  background:url(assets/frame-daily.webp) center/100% 100% no-repeat;box-shadow:0 0 60px rgba(0,0,0,.8);overflow:hidden}

/* Invisible hotspots over the painted title plate (How to play) and "Word of the Day" (statistics) */
.hotspot{position:absolute}
#title{left:24%;top:2%;width:52%;height:13%}
#mode{left:0;top:6%;width:22%;height:12%}

/* Board: the black panel of the frame, above the keyboard */
#board{position:absolute;left:20.6%;right:20.6%;top:18%;bottom:23%;display:flex;align-items:center;justify-content:center}
#grid{display:grid;gap:var(--gap,6px);grid-template-columns:repeat(var(--cols,4),var(--cell,40px));grid-auto-rows:var(--cell,40px)}
.cell{position:relative;border-radius:calc(var(--cell) * .14);background:var(--cell-bg);border:1px solid var(--cell-line);display:flex;align-items:center;justify-content:center;
  font-size:calc(var(--cell) * .56);line-height:1;color:#fff;text-transform:uppercase;transform-style:preserve-3d}
.cell.fixed{background:#24201b}
.cell.ghost{color:rgba(255,255,255,.22)}
.cell.filled{animation:pop .09s ease-out}
.cell.wrong{background:var(--wrong);border-color:var(--wrong)}
.cell.exists{background:var(--exists);border-color:var(--exists)}
.cell.correct{background:var(--correct);border-color:var(--correct)}
.cell.flip{animation:flip .46s ease-in-out both}
.row-shake{animation:shake .4s ease}
@keyframes pop{50%{transform:scale(1.08)}}
@keyframes flip{0%{transform:rotateX(0)}50%{transform:rotateX(90deg)}100%{transform:rotateX(0)}}
@keyframes shake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
@keyframes win-bounce{40%{transform:translateY(-18%)}}
.cell.bounce{animation:win-bounce .5s ease both}

#toast{position:absolute;top:2%;left:50%;transform:translateX(-50%);max-width:96%;padding:.45em .9em;border-radius:6px;background:rgba(239,227,200,.96);color:var(--ink);
  font-size:calc(var(--sw) * .036);font-weight:700;text-align:center;box-shadow:0 4px 14px rgba(0,0,0,.5);pointer-events:none;z-index:5}

/* On-screen keyboard, as in the app */
#keyboard{position:absolute;left:2%;right:2%;top:78.4%;bottom:1.2%;display:flex;flex-direction:column;gap:1.3%}
.krow{flex:1;display:flex;gap:1%;justify-content:center}
.key{-webkit-appearance:none;appearance:none;flex:0 0 9%;border-radius:3px;background:var(--key);color:var(--key-text);font-size:calc(var(--sw) * .058);display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 0 rgba(0,0,0,.35);touch-action:manipulation}
.key:active{filter:brightness(1.25)}
.key.wide{flex:0 0 14%;font-size:calc(var(--sw) * .033)}
/* Letter keys always stay plain grey; only ENTER and BACK are coloured. */
.key.enter{background:var(--enter)}.key.back{background:var(--back)}

/* Overlays */
.overlay{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(8,6,4,.72);animation:fade .18s ease}
.overlay[hidden]{display:none}
@keyframes fade{from{opacity:0}}
.faq-sheet{position:relative;height:100dvh;aspect-ratio:1080/1919;max-width:100vw}
.faq-art{width:100%;height:100%;object-fit:contain}
.faq-close{position:absolute;left:1%;top:.5%;width:16%;height:9%;border-radius:50%}
.overlay.dark{background:#141414}
/* Close: a small gold ring in the top-right corner */
.close-x{position:fixed;right:max(14px,env(safe-area-inset-right));top:max(14px,env(safe-area-inset-top));width:40px;height:40px;padding:0;border-radius:50%;border:1.5px solid #b4a078;background:rgba(20,20,20,.85);color:#e8c35a;
  display:grid;place-items:center;z-index:2;transition:background .15s,transform .12s}
.close-x svg{width:18px;height:18px;display:block}
.close-x:hover{background:#2a2219}.close-x:active{transform:scale(.94)}

/* End screen: congratulations, steps, statistics, share, the app */
.end-body{width:min(92vw,440px);max-height:100dvh;overflow:auto;padding:64px 0 24px;text-align:center;font-size:19px;line-height:1.45}
.end-body h2{color:var(--gold);font-weight:700;font-size:34px;line-height:1.1;margin-bottom:6px;text-shadow:0 2px 6px rgba(0,0,0,.6)}
.end-text{font-size:21px;margin-bottom:4px}
.end-path{font-size:15px;color:#cfc3a8;letter-spacing:.03em}
.end-path:empty,.end-text:empty{display:none}
.end-body h3{color:#b4a078;font-weight:400;font-size:20px;margin:18px 0 6px}
#stats-list{display:grid;gap:1px}
#stats-list div{display:flex;justify-content:center;gap:.4em}
#stats-list dt::after{content:":"}
#dist{list-style:none;display:grid;gap:3px}
#dist li{display:grid;grid-template-columns:7.5em 1fr;align-items:center;gap:8px;font-size:16px;text-align:right}
#dist .bar{height:18px;min-width:22px;border-radius:3px;background:#3c3732;color:#fff;font-size:13px;line-height:18px;text-align:right;padding-right:5px}
#dist li.today .bar{background:var(--correct)}
.end-actions{display:flex;justify-content:center;margin-top:14px}
.end-actions .pill{min-width:180px;font-size:19px}
#daily-status{margin-top:12px;color:#cfc3a8;font-size:16px}
.app-promo{margin-top:20px;padding-top:16px;border-top:1px solid #3a3026;color:#cfc3a8;font-size:16px}
.app-promo .pill{margin-top:10px}
.pill{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:8px 20px;border-radius:23px;border:1px solid #b4a078;color:#efe3c8;text-decoration:none;font-size:17px;background:#2a2219}
.pill.gold{background:linear-gradient(#f2d98c,#c9a24e);color:#2a1d08;border-color:#8a6d2a;font-weight:700}
.pill[hidden]{display:none}
.pill:active{transform:scale(.97)}
#confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:30}
.noscript{position:fixed;inset:auto 0 40% 0;text-align:center;font-size:20px}
@media (prefers-reduced-motion:reduce){.cell.flip,.cell.bounce,.row-shake,.cell.filled{animation:none}}

/* ===== Design button (top left, beside the title plate) and its menu ===== */
#style-btn{position:absolute;left:2.2%;top:1.6%;width:calc(var(--sw) * .095);height:calc(var(--sw) * .095);min-width:34px;min-height:34px;border-radius:50%;padding:0;
  display:grid;place-items:center;background:rgba(27,20,13,.82);border:1.5px solid #b4a078;color:#e8c35a;z-index:6;box-shadow:0 2px 6px rgba(0,0,0,.5)}
#style-btn svg{width:60%;height:60%;display:block}
#style-btn:active{transform:scale(.94)}
#style-menu{position:absolute;left:2.2%;top:calc(1.6% + max(34px, var(--sw) * .095) + 6px);z-index:7;min-width:190px;padding:6px;border-radius:10px;
  background:#1d1813;border:1px solid #b4a078;box-shadow:0 10px 30px rgba(0,0,0,.55);display:grid;gap:4px}
#style-menu[hidden]{display:none}
#style-menu button{display:grid;gap:1px;text-align:left;padding:8px 10px 8px 30px;border-radius:7px;color:#efe3c8;position:relative;font-size:16px}
#style-menu button small{font-size:12px;opacity:.7}
#style-menu button:hover{background:#2a2219}
#style-menu button[aria-checked="true"]::before{content:"";position:absolute;left:11px;top:50%;width:9px;height:9px;margin-top:-5px;border-radius:50%;background:#e8c35a}

/* ===== Minimalist design: a plain, Wordle-style screen (light or dark with the device) ===== */
#min-header{display:none}
:root{--m-bg:#ffffff;--m-text:#1a1a1b;--m-muted:#787c7e;--m-line:#d3d6da;--m-tile:#d3d6da;--m-tile-filled:#878a8c;--m-fixed:#f2f3f4;
  --m-key:#d3d6da;--m-key-text:#1a1a1b;--m-correct:#6aaa64;--m-exists:#c9b458;--m-wrong:#787c7e}
@media (prefers-color-scheme:dark){:root{--m-bg:#121213;--m-text:#f8f8f8;--m-muted:#818384;--m-line:#3a3a3c;--m-tile:#3a3a3c;--m-tile-filled:#565758;--m-fixed:#1e1e1f;
  --m-key:#818384;--m-key-text:#ffffff;--m-correct:#538d4e;--m-exists:#b59f3b;--m-wrong:#3a3a3c}}
html.theme-min,html.theme-min body{background:var(--m-bg)}
html.theme-min body{color:var(--m-text);font-family:"Helvetica Neue",Arial,system-ui,sans-serif}
html.theme-min body::before{display:none}
html.theme-min #stage{width:min(100vw,500px);background:none;box-shadow:none;display:flex;flex-direction:column}
html.theme-min #title,html.theme-min #mode{display:none}
html.theme-min #min-header{display:flex;flex:none;height:54px;align-items:center;justify-content:center;border-bottom:1px solid var(--m-line);position:relative;padding-top:env(safe-area-inset-top);box-sizing:content-box}
html.theme-min #min-header h1{font:700 30px/1 Georgia,"Times New Roman",serif;letter-spacing:.01em;color:var(--m-text)}
html.theme-min .mh-tools{position:absolute;right:10px;bottom:9px;display:flex;gap:4px}
.icon-btn{width:36px;height:36px;display:grid;place-items:center;border-radius:6px;color:inherit}
.icon-btn svg{width:24px;height:24px}
.icon-btn:active{background:var(--m-line)}
html.theme-min #style-btn{position:absolute;left:10px;top:calc(env(safe-area-inset-top) + 9px);width:36px;height:36px;min-width:0;min-height:0;background:none;border:1px solid var(--m-line);color:var(--m-text);box-shadow:none}
html.theme-min #style-menu{left:10px;top:calc(env(safe-area-inset-top) + 50px);background:var(--m-bg);border-color:var(--m-line);color:var(--m-text)}
html.theme-min #style-menu button{color:var(--m-text)}
html.theme-min #style-menu button:hover{background:var(--m-fixed)}
html.theme-min #style-menu button[aria-checked="true"]::before{background:var(--m-correct)}
html.theme-min #board{position:relative;inset:auto;flex:1;min-height:0;margin:10px 0}
html.theme-min .cell{border-radius:0;border:2px solid var(--m-tile);background:transparent;color:var(--m-text);font-family:"Helvetica Neue",Arial,sans-serif;font-weight:700;font-size:calc(var(--cell) * .5)}
html.theme-min .cell.filled{border-color:var(--m-tile-filled)}
html.theme-min .cell.fixed{background:var(--m-fixed);border-color:var(--m-tile-filled)}
html.theme-min .cell.ghost{color:var(--m-tile)}
html.theme-min .cell.correct{background:var(--m-correct);border-color:var(--m-correct);color:#fff}
html.theme-min .cell.exists{background:var(--m-exists);border-color:var(--m-exists);color:#fff}
html.theme-min .cell.wrong{background:var(--m-wrong);border-color:var(--m-wrong);color:#fff}
html.theme-min #toast{background:var(--m-text);color:var(--m-bg);font-family:"Helvetica Neue",Arial,sans-serif;font-size:15px;border-radius:4px}
html.theme-min #keyboard{position:relative;inset:auto;flex:none;height:min(198px,27dvh);margin:0 8px calc(8px + env(safe-area-inset-bottom));gap:8px}
html.theme-min .krow{gap:6px}
html.theme-min .key{flex:1 1 0;max-width:46px;border-radius:4px;background:var(--m-key);color:var(--m-key-text);box-shadow:none;font:700 clamp(14px,4.4vw,20px)/1 "Helvetica Neue",Arial,sans-serif}
html.theme-min .key.wide{flex:1.5 1 0;max-width:70px;font-size:12px}
html.theme-min .key.enter{background:var(--enter);color:#fff}html.theme-min .key.back{background:var(--back);color:#fff}
/* Minimalist end screen and overlays */
html.theme-min .overlay.dark{background:var(--m-bg);color:var(--m-text)}
html.theme-min .end-body{font-family:"Helvetica Neue",Arial,sans-serif}
html.theme-min .end-body h2{color:var(--m-text);text-shadow:none;font-family:Georgia,serif}
html.theme-min .end-body h3{color:var(--m-muted)}
html.theme-min .end-path,html.theme-min #daily-status,html.theme-min .app-promo{color:var(--m-muted)}
html.theme-min .app-promo{border-top-color:var(--m-line)}
html.theme-min #dist .bar{background:var(--m-wrong);color:#fff}
html.theme-min #dist li.today .bar{background:var(--m-correct)}
html.theme-min .pill{background:transparent;color:var(--m-text);border-color:var(--m-line)}
html.theme-min .pill.gold{background:var(--m-correct);color:#fff;border-color:var(--m-correct)}
html.theme-min .close-x{background:var(--m-bg);border-color:var(--m-line);color:var(--m-text)}

/* ===== Classic: How to play button, top right of the frame (mirrors the design button) ===== */
#classic-help{position:absolute;right:2.2%;top:1.6%;width:calc(var(--sw) * .095);height:calc(var(--sw) * .095);min-width:34px;min-height:34px;border-radius:50%;padding:0;
  display:grid;place-items:center;background:rgba(27,20,13,.82);border:1.5px solid #b4a078;color:#e8c35a;z-index:6;box-shadow:0 2px 6px rgba(0,0,0,.5)}
#classic-help svg{width:62%;height:62%;display:block}
#classic-help:active{transform:scale(.94)}
html.theme-min #classic-help{display:none}

/* ===== Minimalist How to play ===== */
#faq-min{background:rgba(0,0,0,.45)}
.faq-min-sheet{position:relative;width:min(100vw,500px);max-height:100dvh;overflow:auto;padding:22px 22px calc(26px + env(safe-area-inset-bottom));
  background:var(--m-bg);color:var(--m-text);font-family:"Helvetica Neue",Arial,sans-serif;font-size:16px;line-height:1.45;box-shadow:0 10px 40px rgba(0,0,0,.35)}
@media (min-width:520px){.faq-min-sheet{border-radius:10px}}
.faq-min-sheet .close-x{position:absolute;right:14px;top:14px;background:var(--m-bg);border-color:var(--m-line);color:var(--m-text)}
.faq-min-sheet h2{font:700 28px/1.15 Georgia,"Times New Roman",serif;margin:4px 48px 6px 0}
.faq-min-sheet .lead{font-size:19px;margin-bottom:10px}
.faq-min-sheet ul{padding-left:20px;margin-bottom:6px}
.faq-min-sheet li{margin:4px 0}
.faq-min-sheet h3{font-size:15px;font-weight:700;margin:16px 0 8px;text-transform:uppercase;letter-spacing:.06em;color:var(--m-muted)}
.faq-min-sheet .example{display:grid;gap:5px;justify-content:start}
.faq-min-sheet .ex-row{display:flex;gap:5px}
.faq-min-sheet .t{display:inline-grid;place-items:center;width:38px;height:38px;border:2px solid var(--m-tile);font-weight:700;font-size:20px;color:var(--m-text);flex:none}
.faq-min-sheet .t.fixed{background:var(--m-fixed);border-color:var(--m-tile-filled)}
.faq-min-sheet .t.correct{background:var(--m-correct);border-color:var(--m-correct);color:#fff}
.faq-min-sheet .t.exists{background:var(--m-exists);border-color:var(--m-exists);color:#fff}
.faq-min-sheet .t.wrong{background:var(--m-wrong);border-color:var(--m-wrong);color:#fff}
.faq-min-sheet .ex-caption{margin-top:8px;color:var(--m-muted);font-size:14px}
.faq-min-sheet ul.colours{list-style:none;padding:0;margin-top:14px;display:grid;gap:8px}
.faq-min-sheet ul.colours li{display:flex;align-items:center;gap:10px}
.faq-min-sheet ul.colours .t{width:32px;height:32px;font-size:17px}
.faq-min-sheet .note{margin-top:16px;padding-top:12px;border-top:1px solid var(--m-line);color:var(--m-muted);font-size:14px}
