/* All visual rules are scoped to the title. Native gameplay CSS is unchanged. */
#title-screen {
  --home-ink:#241e25; --home-coral:#ff6866; --home-paper:#fff8f0;
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; align-items:stretch;
  justify-content:stretch; gap:0; padding:14px clamp(24px,3.5vw,60px) 12px;
  background:var(--home-paper); color:var(--home-ink); text-align:left;
  position:relative; isolation:isolate; overflow-x:hidden; min-height:0; height:100%;
  font-family:var(--ui); overscroll-behavior:contain;
}
#title-screen button,#title-screen summary { -webkit-tap-highlight-color:transparent; }
#title-screen .title-header { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:52px; border-bottom:1px solid #241e2533; padding-bottom:12px; z-index:5; }
#title-screen .title-brand { font-size:27px; font-weight:900; letter-spacing:-.04em; line-height:1; }
#title-screen .title-tools { display:flex; align-items:center; gap:12px; }
#title-screen details { position:relative; }
#title-screen summary { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:12px; min-height:44px; }
#title-screen summary::-webkit-details-marker { display:none; }
#title-screen svg { width:24px; height:24px; stroke:currentColor; stroke-width:2.2; fill:none; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
#title-screen .title-language > summary { border:2px solid var(--home-ink); border-radius:999px; padding:5px 18px; font-size:15px; font-weight:800; }
#title-screen .title-language > summary svg { width:14px; height:14px; }
#title-screen .title-icon { display:grid; place-items:center; min-width:44px; min-height:44px; padding:8px; border:0; background:transparent; border-radius:12px; }
#title-screen .title-icon svg { width:26px; height:26px; }
#title-screen .title-menu { position:absolute; z-index:8; top:calc(100% + 10px); right:0; min-width:220px; max-width:calc(100vw - 36px); max-height:min(420px,calc(var(--game-viewport-height) - 90px)); overflow:auto; overscroll-behavior:contain; padding:12px; background:var(--home-paper); border:2px solid var(--home-ink); border-radius:16px; box-shadow:0 5px 0 #241e2526; }
#title-screen details[open] .title-menu { animation:title-menu-in 140ms ease-out both; }
#title-screen #lang-chips .chips { display:grid; gap:4px; }
#title-screen #lang-chips .chip { min-height:44px; border:0; border-radius:8px; background:transparent; box-shadow:none; text-align:left; padding:8px 14px; font-size:15px; }
#title-screen #lang-chips .chip[aria-pressed="true"] { background:#ffd7d0; }
#title-screen .title-menu h2 { font-size:16px; margin:0 4px 10px; }
#title-screen #title-preferences { display:grid; gap:8px; }
#title-screen #title-preferences .toggle { width:100%; min-height:44px; padding:9px 12px; border:1px solid #241e2533; background:transparent; border-radius:8px; text-align:left; font-size:14px; }
#title-screen .title-info { display:block; min-height:44px; border:0; background:transparent; font-size:13px; text-decoration:underline; padding:10px 4px; }
#title-screen .title-hero { display:grid; grid-template-columns:minmax(0,1.04fr) minmax(0,1fr); align-items:center; gap:clamp(20px,3vw,56px); min-height:0; padding:24px 2.5%; }
#title-screen .title-copy { position:relative; z-index:1; }
#title-screen .title-wordmark { display:grid; justify-items:start; gap:2px; line-height:.98; margin:0 0 24px; font-size:clamp(64px,11.2vw,180px); font-weight:950; letter-spacing:-.055em; text-shadow:5px 6px 0 #ff9589; }
#title-screen .title-wordmark-emoji { font-family:'Arial Rounded MT Bold','Arial Black',var(--ui); font-weight:950; font-style:italic; transform:skew(-3deg); }
#title-screen .title-wordmark-local { font-family:var(--ui); font-weight:900; letter-spacing:-.055em; }
#title-screen .tagline { margin:0 0 8px; font-size:clamp(17px,1.9vw,28px); font-weight:850; line-height:1.5; }
#title-screen .title-caption { margin:0; color:#6c636e; font-size:clamp(13px,1.35vw,20px); font-weight:650; }
#title-screen .title-actions { display:flex; align-items:center; gap:24px; margin-top:32px; margin-bottom:28px; flex-wrap:wrap; }
#title-screen #start-btn { min-width:clamp(230px,24vw,360px); min-height:74px; padding:12px 32px; border:3px solid var(--home-ink); border-radius:24px; background:linear-gradient(#ff8580,#ff6363); color:#fff; box-shadow:0 6px 0 var(--home-ink); font-size:clamp(22px,2.4vw,34px); line-height:1.2; font-weight:900; letter-spacing:.015em; text-shadow:0 2px 0 #c34c4c55; transition:transform 100ms ease,box-shadow 100ms ease,background 100ms ease; }
#title-screen #start-btn:active { transform:translateY(4px); box-shadow:0 2px 0 var(--home-ink); }
#title-screen #theatre-btn { min-height:44px; display:flex; align-items:center; gap:10px; padding:5px 0; border:0; background:transparent; color:var(--home-ink); font-weight:800; font-size:clamp(15px,1.35vw,21px); text-decoration:none; }
#title-screen .title-play-icon { width:30px; height:30px; border:2px solid var(--home-ink); border-radius:50%; display:grid; place-items:center; flex-shrink:0; }
#title-screen .title-play-icon:after { content:''; border-left:9px solid var(--home-ink); border-top:6px solid transparent; border-bottom:6px solid transparent; margin-left:3px; }
#title-screen .title-pool { display:flex; align-items:center; flex-wrap:wrap; gap:14px; }
#title-screen #kset { margin:0; padding:0; }
#title-screen .kset-row { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-start; }
#title-screen .kset-h,#title-screen .kset-note { display:none; }
#title-screen .kchk { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:6px 10px; border:2px solid var(--home-ink); border-radius:12px; background:transparent; box-shadow:none; font-size:14px; line-height:1.4; font-weight:750; }
#title-screen .kchk input { width:20px; height:20px; margin:0; accent-color:var(--home-coral); }
#title-screen .kchk:has(input:checked) { background:#fff0e9; }
#title-screen #how-btn { min-height:40px; border:0; border-left:1px solid #241e2540; padding:4px 0 4px 14px; background:transparent; color:#716670; font-size:14px; font-weight:750; text-decoration:underline; text-underline-offset:4px; }
#title-screen .title-visual { position:relative; margin:0; min-width:0; min-height:0; width:100%; height:100%; display:grid; place-items:center; isolation:isolate; }
#title-screen .title-visual:before { content:''; position:absolute; z-index:-1; width:100%; aspect-ratio:1; max-height:90%; background:#ecdff4; border-radius:50%; opacity:.72; }
#title-screen .title-visual img { display:block; width:100%; height:100%; max-height:min(760px,calc(var(--game-viewport-height) - 155px)); object-fit:contain; }
#title-screen .title-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:42px; padding-top:12px; border-top:1px solid #241e2533; }
#title-screen .title-legal { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; }
#title-screen .title-legal a { color:#6c636e; font-size:12px; text-decoration:none; font-weight:650; padding-block:6px; }
#title-screen .title-audio-shortcuts { display:flex; gap:20px; }
#title-screen .title-audio-shortcuts button { display:flex; gap:8px; align-items:center; padding:4px 0; min-height:32px; border:0; background:transparent; font-size:12px; color:#665b67; }
#title-screen .title-audio-shortcuts svg { width:19px; height:19px; }
#title-screen [data-muted="true"] [data-audio-on],#title-screen [data-muted="false"] [data-audio-off] { display:none; }
#title-screen .title-wordmark,#title-screen .title-visual img { animation:title-enter 360ms cubic-bezier(.2,.7,.2,1) both; }
#title-screen .title-visual img { animation-delay:70ms; }
/* Title-only suppression reverts immediately when the native game is shown. */
.game-shell:has(#title-screen:not([hidden])) > canvas.fx { visibility:hidden; }
#app:has(#title-screen:not([hidden])) { padding:0; }
@keyframes title-enter { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes title-menu-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
@media (hover:hover) {
  #title-screen #start-btn:hover { background:#ff7770; }
  #title-screen .title-icon:hover,#title-screen summary:hover { background:#f9ece5; }
  #title-screen .title-legal a:hover { text-decoration:underline; }
}
@media (max-width:700px) and (orientation:portrait) {
  #title-screen { padding:max(10px,env(safe-area-inset-top)) 18px max(8px,env(safe-area-inset-bottom)); grid-template-rows:52px minmax(0,1fr) 39px; }
  #title-screen .title-header { min-height:0; padding-bottom:8px; gap:8px; }
  #title-screen .title-brand { font-size:23px; }
  #title-screen .title-tools { gap:3px; }
  #title-screen .title-language > summary { font-size:12px; padding:4px 11px; min-height:44px; gap:8px; }
  #title-screen .title-icon { min-width:44px; min-height:44px; padding:8px; }
  #title-screen .title-icon svg { width:22px; height:22px; }
  #title-screen .title-hero { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto minmax(0,1fr) auto auto; justify-items:center; align-items:stretch; gap:6px; padding:16px 0 14px; }
  #title-screen .title-copy { display:contents; }
  #title-screen .title-wordmark { grid-row:1; display:flex; flex-wrap:nowrap; align-items:baseline; justify-content:center; gap:12px; margin:0 0 4px; font-size:clamp(36px,11.7vw,64px); text-shadow:3px 4px 0 #ff9589; }
  #title-screen .tagline { grid-row:2; font-size:15px; text-align:center; margin:0; }
  #title-screen .title-caption { grid-row:3; text-align:center; font-size:12px; }
  #title-screen .title-visual { grid-row:4; max-width:330px; padding:3px 0; }
  #title-screen .title-visual:before { width:87%; max-height:92%; }
  #title-screen .title-visual img { height:100%; min-height:0; max-height:100%; width:100%; }
  #title-screen .title-actions { grid-row:5; margin:4px 0 8px; justify-content:center; gap:12px; flex-wrap:nowrap; width:100%; }
  #title-screen #start-btn { min-width:0; flex:1; max-width:245px; min-height:55px; padding:10px 14px; font-size:22px; border-radius:20px; }
  #title-screen #theatre-btn { font-size:14px; gap:7px; white-space:nowrap; }
  #title-screen .title-play-icon { width:24px; height:24px; }
  #title-screen .title-play-icon:after { border-left-width:7px; border-top-width:5px; border-bottom-width:5px; }
  #title-screen .title-pool { grid-row:6; gap:9px; justify-content:center; flex-wrap:nowrap; }
  #title-screen .kset-row { gap:7px; flex-wrap:nowrap; }
  #title-screen .kchk { gap:5px; font-size:11px; min-height:36px; padding:5px 6px; border-width:1.5px; border-radius:9px; }
  #title-screen .kchk input { width:16px; height:16px; flex-shrink:0; }
  #title-screen #how-btn { font-size:12px; padding-left:9px; min-height:36px; }
  #title-screen .title-footer { justify-content:center; min-height:0; padding-top:5px; }
  #title-screen .title-legal { gap:6px 15px; justify-content:center; }
  #title-screen .title-legal a { font-size:10px; }
  #title-screen .title-audio-shortcuts { display:none; }
  #title-screen .title-menu { max-height:calc(var(--game-viewport-height) - 85px); }
}
@media (max-height:600px) and (min-width:600px) {
  #title-screen { padding:6px max(20px,env(safe-area-inset-right)) 6px max(20px,env(safe-area-inset-left)); }
  #title-screen .title-header { min-height:40px; padding-bottom:5px; }
  #title-screen .title-brand { font-size:20px; }
  #title-screen .title-language > summary { min-height:32px; font-size:12px; padding:3px 12px; }
  #title-screen .title-icon { min-width:36px; min-height:36px; padding:5px; }
  #title-screen .title-hero { padding:10px 2%; gap:24px; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); }
  #title-screen .title-wordmark { display:flex; align-items:baseline; gap:10px; margin-bottom:10px; font-size:clamp(33px,5.3vw,58px); text-shadow:3px 3px 0 #ff9589; }
  #title-screen .tagline { font-size:15px; margin-bottom:2px; }
  #title-screen .title-caption { font-size:11px; }
  #title-screen .title-actions { margin:14px 0 14px; gap:16px; flex-wrap:nowrap; }
  #title-screen #start-btn { min-width:150px; min-height:46px; font-size:20px; padding:8px 20px; border-radius:17px; }
  #title-screen #theatre-btn { font-size:13px; gap:7px; }
  #title-screen .title-play-icon { width:24px; height:24px; }
  #title-screen .title-pool { gap:10px; }
  #title-screen .kset-row { gap:7px; }
  #title-screen .kchk { font-size:11px; padding:4px 7px; min-height:32px; gap:5px; border-width:1.5px; }
  #title-screen .kchk input { width:16px; height:16px; }
  #title-screen #how-btn { font-size:12px; min-height:32px; }
  #title-screen .title-visual img { max-height:calc(var(--game-viewport-height) - 100px); }
  #title-screen .title-footer { min-height:28px; padding-top:5px; }
  #title-screen .title-legal a,#title-screen .title-audio-shortcuts button { font-size:10px; }
  #title-screen .title-audio-shortcuts { gap:12px; }
}
@media (prefers-reduced-motion:reduce) { #title-screen *,#title-screen *:before,#title-screen *:after { animation:none!important; transition:none!important; } }
html.reduce #title-screen *,html.reduce #title-screen *:before,html.reduce #title-screen *:after { animation:none!important; transition:none!important; }

@media (max-width:700px) and (orientation:portrait) and (max-height:700px) {
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen { grid-template-rows:44px minmax(0,1fr) 30px; padding-block:6px; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen .title-hero { padding-block:9px; gap:4px; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen .title-wordmark { font-size:36px; margin:0; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen .tagline { font-size:13px; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen .title-caption { font-size:11px; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen .title-actions { margin-block:3px 6px; }
  body:is([data-banner-state=pending],[data-banner-state=filled]) #title-screen #start-btn { min-height:48px; font-size:20px; }
}
