@import url('./assets/fonts.css');
:root{font-family:'Avenir Next','Trebuchet MS',system-ui,sans-serif;color:#193d3b;background:#f8f3e8;font-synthesis:none;color-scheme:light;--ink:#193d3b;--accent:#e6b35d;--deep:#123f3e;--soft:#e4ebe4;--line:#d9d8c6;--paper:#fff9ed}
*{box-sizing:border-box}body{margin:0;min-height:100svh}body[data-game="tori-drop"]{--ink:#442a58;--accent:#f1a181;--deep:#352047;--soft:#ede4f0;--line:#d9ccde;--paper:#fff6f1;background:#fbf4ed;color:var(--ink)}body[data-game="toghu-tiles"]{--ink:#233146;--accent:#e9b84f;--deep:#182538;--soft:#e6e7e7;--line:#d1d2d1;--paper:#fff8e7;background:#f5f1e6;color:var(--ink)}[hidden]{display:none!important}button,input,select{font:inherit}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;border:0}a{color:inherit;text-decoration:none}button:disabled{opacity:.48;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible{outline:3px solid #c56836;outline-offset:4px}button,input,select{min-height:44px}input,select{width:100%;border:1px solid var(--line);background:var(--paper);padding:12px;border-radius:10px;color:var(--ink)}label{display:block;font-weight:750;margin:12px 0 8px}button{transition:transform .15s,background .15s}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:13px;padding:14px 24px;font-weight:850;font-size:16px;min-height:48px}.primary{background:var(--accent);color:var(--deep);box-shadow:0 4px 0 #0003;border:1px solid #fff6}.primary:hover{transform:translateY(-2px)}.primary:active{transform:translateY(1px)}.secondary{background:var(--paper);border:1px solid var(--line);color:var(--ink)}.secondary:hover{background:var(--soft)}.quiet{background:none;padding:9px 8px;font-size:13px;font-weight:750}.round{width:40px;min-height:40px;flex-shrink:0;border-radius:50%;background:var(--soft);border:1px solid var(--line);font-size:20px;display:inline-grid;place-items:center}.site-header{height:68px;display:flex;align-items:center;justify-content:space-between;gap:16px;max-width:1220px;margin:auto;padding:0 24px}.site-header>a{display:flex;gap:10px;align-items:center;font-size:17px}.header-actions{display:flex;align-items:center;gap:10px}.screen{animation:arrive .3s ease-out}.home{max-width:1240px;padding:0 24px;margin:auto}.hero{position:relative;isolation:isolate;overflow:hidden;border-radius:24px;min-height:min(720px,calc(100svh - 136px));background:var(--deep)}.hero>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:-3}.hero-shade{position:absolute;inset:0;background:linear-gradient(90deg,#061c20df 0%,#061c2078 35%,transparent 68%),linear-gradient(0deg,#051c204d,transparent 40%);z-index:-2}body[data-game="tori-drop"] .hero-shade{background:linear-gradient(90deg,#251033e8,#25103370 38%,transparent 70%),linear-gradient(0deg,#25103355,transparent 38%)}.hero-content{width:51%;min-width:400px;padding:48px;min-height:inherit;display:flex;flex-direction:column;align-items:flex-start;color:#fff9eb}.eyebrow{font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:2px;margin:0 0 16px}.hero .eyebrow{color:var(--accent)}.wordmark{font-family:'Arial Rounded MT Bold','Avenir Next',system-ui,sans-serif;font-size:clamp(76px,7.9vw,120px);letter-spacing:-5px;font-weight:950;line-height:.88;margin:12px 0 24px;color:var(--accent);text-shadow:0 3px 0 #fff3,0 6px 0 #0005;transform:rotate(-2deg)}body[data-game="sabi"] .wordmark{font-size:clamp(100px,11vw,156px);letter-spacing:-8px}body[data-game="toghu-tiles"] .wordmark{letter-spacing:-3px;font-size:clamp(66px,7.5vw,110px)}.tagline{font-size:clamp(19px,2vw,27px);line-height:1.25;font-weight:750;margin:14px 0 25px}.home-actions{margin-top:auto;width:100%;max-width:365px;padding-top:28px}#play-now{width:100%;min-height:84px;flex-direction:column;gap:3px}#play-now span{font-size:27px}#play-now small{font-size:12px}.secondary-actions{display:flex;gap:10px;margin-top:13px}.secondary-actions>*{flex:1;padding:13px 9px;font-size:14px}.hero-link{background:none;color:#fff9eb;text-decoration:underline;padding:15px 0 0;text-underline-offset:4px}.place{position:absolute;right:24px;bottom:24px;padding:10px 17px;border-radius:30px;background:#0f2824db;color:#fff4d9;font-size:11px;font-weight:800}.under-hero{display:flex;justify-content:space-between;align-items:center;gap:20px;font-size:12px;color:#6d766c;padding:14px 5px}.site-footer{max-width:1192px;margin:8px auto 0;padding:20px 24px 24px;display:flex;justify-content:space-between;font-size:10px;color:#777e72}.site-footer a:last-child{text-decoration:underline;text-underline-offset:3px}.centered{max-width:520px;margin:70px auto;min-height:440px;text-align:center;padding:20px 24px}.centered h1{font-size:38px;line-height:1.1;letter-spacing:-1.6px}.centered p{line-height:1.7;font-size:15px}.centered .primary{margin:16px 0}.muted{font-size:12px;color:#77736d;line-height:1.65}.search-animation{display:flex;gap:12px;justify-content:center;margin:35px}.search-animation i{width:16px;height:16px;border-radius:6px;background:var(--accent);animation:bounce 1.2s infinite}.search-animation i:nth-child(2){animation-delay:.15s}.search-animation i:nth-child(3){animation-delay:.3s}.divider{display:flex;gap:15px;align-items:center;justify-content:center;margin:30px 0;font-size:11px;text-transform:uppercase;letter-spacing:1px}.divider:before,.divider:after{content:'';height:1px;background:var(--line);flex:1}.join-row{display:flex;gap:12px}.join-row input{font-size:23px;text-transform:uppercase;letter-spacing:4px;text-align:center;min-width:0}.play{max-width:1040px;margin:auto;padding:0 24px}.play-heading{height:54px;display:flex;align-items:center;justify-content:space-between}.play-heading h1{margin:0;font-size:25px;font-weight:900;letter-spacing:-1px;color:var(--ink)}.game-layout{display:grid;grid-template-columns:minmax(0,520px) 230px;gap:44px;justify-content:center;align-items:start}.game-main{min-width:0}.scorebar{display:flex;align-items:center;justify-content:space-between;min-height:68px;padding:6px 10px 12px;gap:15px}.scorebar>div{display:flex;flex-direction:column;gap:4px}.scorebar>div:last-child{text-align:right}.scorebar span{font-size:10px;letter-spacing:.6px}.scorebar strong{font-size:28px;font-weight:850;line-height:1.1}.scorebar #round-center{text-align:center}.scorebar #mode-label{font-size:9px;font-weight:850;letter-spacing:1.2px}.scorebar #round-clock{font-size:23px}#round-clock.urgent{color:#b34736}.board-stage{position:relative;display:flex;align-items:center;justify-content:center;margin:auto;max-width:100%;border-radius:18px}canvas{display:block;width:auto!important;height:auto!important;max-width:100%;max-height:min(520px,calc(100svh - 330px));border-radius:16px;touch-action:none;user-select:none;outline-offset:1px!important}.board-cover{position:absolute;inset:0;background:#fff9ede8;backdrop-filter:blur(6px);border-radius:18px;display:flex;flex-direction:column;gap:20px;align-items:center;justify-content:center;z-index:3}.board-cover h2{font-size:24px;margin:0}.game-controls{margin:8px auto 0;max-width:480px}.word-preview{min-height:34px;font-size:24px;font-weight:850;letter-spacing:3px;text-align:center;overflow-wrap:anywhere}.word-actions{display:flex;justify-content:center;gap:9px}.word-actions button,.game-controls>button,.game-controls .secondary{border-radius:10px;padding:8px 14px;background:var(--soft);font-size:12px;font-weight:800;min-height:39px}.word-actions button:first-child{background:var(--accent)}.word-found{font-size:10px;color:#77736d;text-align:center;line-height:1.5;margin:7px 0;max-height:38px;overflow:auto}.game-tip{font-size:11px;text-align:center;line-height:1.5;margin:8px 0 4px}.board-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 5px;font-size:10px}.board-footer>span:first-child{border:1px solid var(--line);padding:10px 12px;border-radius:24px;white-space:nowrap}.board-footer b{font-size:18px}.board-footer #round-note{text-align:center;max-width:190px;color:#6d746c;font-size:10px;line-height:1.5}.game-aside{padding-top:20px}.game-aside>img{width:100%;height:180px;object-fit:cover;object-position:75% center;border-radius:70px 70px 12px 12px;margin-bottom:24px}.game-aside .eyebrow{font-size:9px;letter-spacing:1.1px;margin-bottom:12px}.game-aside h2{font-size:28px;line-height:1.13;letter-spacing:-1px;margin:0 0 20px}.game-aside ol{padding:0;list-style:none;counter-reset:steps}.game-aside li{font-size:12px;line-height:1.7;border-top:1px solid var(--line);padding:13px 0 13px 27px;position:relative;counter-increment:steps}.game-aside li:before{content:'0' counter(steps);position:absolute;left:0;top:13px;font-size:10px;font-weight:850;color:#ba803a}.result-panel{text-align:center;background:var(--paper);border:1px solid var(--line);border-radius:18px;margin:15px 0;padding:25px}.result-panel h2{font-size:32px;margin:7px 0}.result-panel p{line-height:1.6;font-size:13px}.result-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:20px}.result-actions>*{flex:1;white-space:nowrap}.result-panel .eyebrow{font-size:9px}.feedback{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:13px 20px;background:var(--deep);color:#fff8e8;border-radius:14px;max-width:calc(100vw - 30px);font-size:12px;line-height:1.5;z-index:20;box-shadow:0 5px 24px #0002}dialog{max-width:450px;width:calc(100vw - 32px);border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);padding:30px;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#071a2766;backdrop-filter:blur(3px)}dialog h2{font-size:27px;line-height:1.15;margin:12px 0 20px}dialog p,dialog li{font-size:13px;line-height:1.7}dialog ol{padding-left:20px}.dialog-close{position:absolute;right:10px;top:8px;background:none;font-size:25px;min-width:38px}dialog form>.primary{margin-top:20px;width:100%}#safety-dialog select{margin-bottom:10px}.skip{position:fixed;top:-100px;left:20px;z-index:30;padding:12px;background:var(--paper)}.skip:focus{top:10px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes bounce{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-9px);opacity:1}}
@media(min-width:1000px) and (max-height:780px){.site-header{height:56px}.play-heading{height:44px}.scorebar{min-height:60px}canvas{max-height:calc(100svh - 300px)}.game-aside>img{height:145px;margin-bottom:18px}.game-aside h2{font-size:24px}.game-aside li{padding-top:10px;padding-bottom:10px}.game-aside li:before{top:10px}}
@media(max-width:760px){.site-header{height:60px;padding:0 17px}.site-header>a{font-size:14px}.header-actions{gap:7px}.header-actions .quiet{font-size:11px}.round{width:36px;min-height:36px;font-size:18px}.home{padding:0 12px}.hero{min-height:660px;max-height:none;border-radius:20px}.hero>img{object-position:72% center}.hero-shade{background:linear-gradient(0deg,#0a272a 0%,#0a272ac9 25%,#0a272a00 68%),linear-gradient(90deg,#0a272a66,transparent)}body[data-game="tori-drop"] .hero-shade{background:linear-gradient(0deg,#241330 0%,#241330c9 26%,#24133000 70%)}.hero-content{width:100%;min-width:0;padding:25px;min-height:660px;justify-content:flex-start}.hero .eyebrow{font-size:8px;max-width:210px}.wordmark{font-size:78px;letter-spacing:-4px;margin:8px 0 15px}body[data-game="sabi"] .wordmark{font-size:110px;letter-spacing:-6px}body[data-game="toghu-tiles"] .wordmark{font-size:70px}.tagline{font-size:21px;margin-top:auto;margin-bottom:5px;text-shadow:0 2px 8px #0008}.home-actions{padding-top:18px;margin-top:0;max-width:none}.place{right:18px;bottom:204px;font-size:8px;padding:8px 12px}.under-hero{font-size:10px;align-items:start;gap:12px}.under-hero>span{max-width:230px;line-height:1.7}.under-hero button{font-size:10px;padding:0;white-space:nowrap;min-height:30px}.site-footer{font-size:9px;padding:12px 18px 24px}.play{padding:0 12px}.play-heading{height:45px}.play-heading h1{font-size:24px}.game-layout{display:block}.game-aside{display:none}.game-main{max-width:500px;margin:auto}.scorebar{min-height:62px;padding:5px 5px 10px}.scorebar strong{font-size:25px}.scorebar span{font-size:9px}canvas{max-height:min(510px,calc(100svh - 330px))}.game-controls{margin-top:6px}.word-preview{font-size:22px;min-height:28px}.word-actions button{min-height:38px;padding:7px 12px}.word-found{max-height:28px;font-size:9px}.game-tip{font-size:10px;margin:5px 0}.board-footer{padding:9px 2px;gap:8px;font-size:9px}.board-footer #round-note{font-size:9px}.board-footer>span:first-child{padding:8px 10px}.board-footer b{font-size:16px}.centered{margin:35px auto;min-height:450px}.centered h1{font-size:32px}.result-panel{padding:18px}.result-panel h2{font-size:28px}.result-actions .primary,.result-actions .secondary{font-size:13px;padding:12px 14px}.header-actions #account-button{font-size:15px}}
@media(max-height:500px) and (orientation:landscape){.site-header{height:38px;max-width:100%;padding:0 18px}.site-header .round{width:29px;min-height:29px}.play-heading{height:34px;max-width:720px;margin:auto}.play-heading h1{font-size:20px}.play{padding:0 15px}.game-layout{display:block}.game-main{max-width:720px;display:grid;grid-template-columns:minmax(160px,1fr) 225px;gap:0 25px;align-items:start}.scorebar{grid-column:2;grid-row:1;min-height:57px;padding:8px 0}.scorebar strong{font-size:21px}.board-stage{grid-column:1;grid-row:1/5;width:100%;height:calc(100svh - 80px)}canvas{max-height:calc(100svh - 84px);max-width:100%;border-radius:10px}.game-controls{grid-column:2;grid-row:2;width:100%;margin:0}.board-footer{grid-column:2;grid-row:3;flex-wrap:wrap;margin-top:6px}.board-footer #round-note{order:3;max-width:100%;flex:1 0 100%}.word-actions{gap:5px}.word-actions button{font-size:10px;min-height:34px;padding:7px 8px}.game-tip{font-size:10px}.word-found{max-height:30px}.game-aside,.site-footer{display:none}.result-panel{grid-column:2;grid-row:2/5;z-index:4;margin:0;padding:15px}.result-panel h2{font-size:23px}.result-actions{gap:6px}.result-actions>*{font-size:11px!important;padding:10px!important}.result-panel .muted{font-size:10px}.hero{min-height:440px}.hero-content{min-height:440px;width:55%;padding:25px}.hero>img{object-position:right center}.hero-shade{background:linear-gradient(90deg,#0a272af5,#0a272a88 40%,transparent 75%)}.hero .wordmark{font-size:70px}.hero .tagline{margin-top:10px}.home-actions{max-width:300px;padding-top:15px}.hero .place{bottom:20px}.under-hero{display:none}.centered{margin:10px auto;min-height:0}.search-animation{margin:20px}.centered h1{font-size:27px}.centered p{font-size:12px}}
.word-preview strong{display:block}.word-preview span{display:block;font-size:11px;letter-spacing:0;font-weight:500;margin-top:3px}.word-preview{margin-bottom:7px}.toghu-controls{font-size:12px}
@media(max-width:760px){.word-preview strong{font-size:19px}.word-preview span{font-size:10px;margin-top:1px}}
@media(max-height:500px) and (orientation:landscape){.word-preview strong{font-size:17px}.word-preview span{font-size:9px}}
@media(min-width:1000px) and (max-height:780px){body[data-screen="play"] canvas{max-height:calc(100svh - 365px)}body[data-game="toghu-tiles"][data-screen="play"] canvas{max-height:calc(100svh - 335px)}.word-preview{min-height:0;margin-bottom:5px}.word-preview strong{font-size:18px;letter-spacing:1px}.word-preview span{font-size:10px;margin-top:0}.word-actions button{min-height:36px;padding:6px 12px}body[data-screen="play"] .game-tip,body[data-screen="play"] .tori-note{display:none}.board-footer{padding-top:8px;padding-bottom:8px}}
@media(max-width:760px) and (min-height:501px){body[data-game="sabi"] canvas,body[data-game="tori-drop"] canvas{max-height:calc(100svh - 380px)}}
@media(max-height:500px) and (orientation:landscape){.board-stage{margin:0;align-self:start;align-items:flex-start}.word-found,.game-tip{display:none}.word-preview{min-height:0;margin-bottom:5px}.board-footer{padding-top:5px;padding-bottom:5px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.casual-invite-mount{display:flex;justify-content:center;margin:14px 0 8px}.casual-invite-mount:empty{display:none}.casual-invite-mount.ngi-active + #copy-invite{display:none}.casual-invite-mount .ngi-trigger{font:inherit;font-weight:800;font-size:14px;padding:12px 22px;border-radius:12px;background:var(--deep,#174d37);color:#fff7e8;min-width:180px}

/* Keep the current solo goal next to the board. */
.solo-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 0 5px 9px;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--deep);
  background: var(--paper);
  color: var(--ink);
}
.solo-progress-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.solo-progress-label { font-size: 10px; font-weight: 700; color: var(--deep); }
.solo-progress-title { font-size: 15px; font-weight: 750; line-height: 1.25; }
.solo-progress-count { font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.solo-progress progress { width: 100%; height: 4px; accent-color: var(--deep); }

#pause-button {
  width: auto; padding-inline: 12px; font-size: 12px; border-radius: 14px;
}
.board-cover { gap: 8px; }
.board-cover h2 { margin-bottom: 7px; }
.board-cover button { min-width: min(170px, 75%); }
@media (max-height: 500px) and (orientation: landscape) {
  .game-main:has(#solo-progress:not([hidden])) .solo-progress {
    grid-column: 2; grid-row: 2; margin: 0; padding: 4px 8px;
  }
  .game-main:has(#solo-progress:not([hidden])) .game-controls { grid-column: 2; grid-row: 3; }
  .game-main:has(#solo-progress:not([hidden])) .board-footer { grid-column: 2; grid-row: 4; }
  .game-main:has(#solo-progress:not([hidden])) #sabi-learning-feedback { grid-column: 2; grid-row: 5; }
  .game-main:has(#solo-progress:not([hidden])) #result-panel { grid-column: 1 / -1; grid-row: 6; }
}

/* Solo clues and stack warnings must also be readable on short screens. */
body[data-game="tori-drop"][data-screen="play"] .game-main:has(#solo-progress:not([hidden])) .tori-note {
  display: block;
}

/* Polish, 7 November 2026: the result is a card over the board, shown after the last move's reaction. */
.board-stage > .result-panel.result-cover { position: absolute; left: 5%; right: 5%; top: 50%; transform: translateY(-50%); margin: 0; z-index: 4; max-height: calc(100% - 12px); overflow: auto; padding: 18px 16px; box-shadow: 0 18px 50px #2a1d1240; text-wrap: balance; }
.board-stage:has(> .result-cover:not([hidden]))::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: 18px; background: #fff9ed8c; backdrop-filter: blur(2px); }
.result-cover h2 { text-wrap: balance; }
.result-cover h2:focus { outline: none; }
.result-cover .result-actions { margin-top: 14px; }
/* Touch never leaves a keyboard focus ring on the board. */
canvas:focus:not(:focus-visible) { outline: none; }
/* Tori Drop's solo target. */
.tori-target { flex-basis: 100%; margin: 3px 0 0; font-size: 11px; font-weight: 700; line-height: 1.3; color: var(--deep); }
@media (max-height: 500px) and (orientation: landscape) {
  .board-stage > .result-panel.result-cover { padding: 10px 12px; }
  .result-cover h2 { font-size: 20px; margin: 3px 0; }
  .result-cover p { margin: 3px 0; }
  .result-cover .result-actions { margin-top: 6px; }
}
/* Tori Drop on phones: a slightly smaller stack keeps Pause and the footer on screen while playing. */
@media (max-width: 760px) and (orientation: portrait) {
  body[data-game="tori-drop"][data-screen="play"] canvas { max-height: max(300px, calc(100svh - 472px)); }
}
.fx-choice{margin:14px 0 10px;padding-top:12px;border-top:1px solid var(--line)}
.fx-choice h3{margin:0 0 8px;font-size:14px}
.fx-choice [role=group]{display:flex;gap:6px}
.fx-choice button{flex:1;min-height:40px;border-radius:12px;border:1px solid var(--line);background:var(--paper);color:var(--ink);font:inherit;font-weight:800;cursor:pointer}
.fx-choice button[aria-pressed=true]{background:var(--deep,#173a36);color:#fff8e6;border-color:var(--deep,#173a36)}
.fx-choice .small{font-size:12px;line-height:1.5;margin:8px 0 0;opacity:.8}
