:root {
  --canvas: #eef4f3;
  --panel: #f9fcfb;
  --surface: #fff;
  --ink: #202a3f;
  --muted: #5c697d;
  --line: #d5e2e5;
  --accent: #00796e;
  --accent-fill: #8af4d8;
  --accent-ink: #083c35;
  --header-h: clamp(54px, 8.4cqh, 76px);
  --footer-h: 30px;
  background: #111b2a;
  color: var(--ink);
}

:root[data-theme="dark"] {
  --canvas: #16222e;
  --panel: #1a2736;
  --surface: #233448;
  --ink: #edf6f5;
  --muted: #acbbcc;
  --line: #3b5064;
  --accent: #80ebd0;
  --accent-fill: #80ebd0;
  --accent-ink: #0c3834;
}

body { min-height: 100dvh; }
button, select, input { font-family: inherit; }
:is(button, select, input, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#start-screen, :root[data-theme="dark"] #start-screen {
  overflow: auto;
  padding: 20px;
  background: radial-gradient(ellipse at 23% 25%, #235364, transparent 55%),
              radial-gradient(ellipse at 88% 72%, #323563, transparent 55%), #101c2e;
}
.start-panel {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 52px);
  align-items: center;
  width: min(100%, 700px);
  padding: clamp(22px, 5vw, 54px);
  border-radius: 24px;
  border: 1px solid #90d9d548;
  background: linear-gradient(135deg, #24394dee, #19273bef);
  box-shadow: 0 24px 80px #040a1480;
  color: #f0fffc;
}
.start-content { min-width: 0; text-align: left; }
#start-screen .start-icon { width: 120px; height: 120px; border-radius: 25px; box-shadow: 0 12px 30px #07102980; }
#start-screen h1 { margin: 0 0 0 -.04em; font-size: clamp(34px, 7vw, 60px); letter-spacing: .025em; line-height: 1.05; }
#start-screen .start-subtitle { margin: 10px 0 20px; color: #b7e1dc; font-size: clamp(17px, 2.5vw, 24px); font-weight: 600; }
.start-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 12px; }
#start-screen .start-actions > :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin: 0;
  padding: 8px 16px;
  border-radius: 12px;
  line-height: 1.2;
}
#start-screen .start-actions button { width: auto; min-width: 136px; font-size: 18px; }
#start-screen .primary { background: var(--accent-fill); color: var(--accent-ink); border: 0; box-shadow: none; }
#start-screen .start-meta { display: block; margin-top: 18px; color: #b6c8d9; font-size: 13px; }
#start-screen #startup-status { margin: 12px 0 0; color: #ffd9ce; font-size: 14px; }
.windows-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  text-decoration: none;
}
.windows-download small { color: var(--muted); font-size: 12px; }
#start-screen .windows-download { color: #f0fffc; background: #233b4c; border-color: #9bbfc77a; }
#start-screen .windows-download small { color: #c2dbdf; }

#game, :root[data-theme="dark"] #game {
  container-type: size;
  width: min(calc(100vw - 24px), calc((100dvh - 24px) * 16 / 9), 1640px);
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--canvas);
  box-shadow: 0 16px 60px #040b176b;
}
#game::before { display: none; }
#game header, :root[data-theme="dark"] #game header {
  height: var(--header-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.page-title { letter-spacing: .02em; }
.page-title small { color: var(--accent); }
.resources { gap: 10px; }
#game .resources > span { background: var(--surface); border-color: var(--line); color: var(--ink); border-radius: 8px; }
#menu, #back { min-width: 40px; min-height: 40px; border-radius: 9px; }
#lobby {
  top: auto !important;
  bottom: auto !important;
  height: calc(100% - var(--header-h) - var(--footer-h)) !important;
  padding: 10px;
  gap: 10px;
  grid-template: minmax(0, 1fr) auto / minmax(170px, 22%) minmax(0, 1fr) !important;
}
#lobby aside, :root[data-theme="dark"] #lobby aside {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  padding: 10px !important;
  gap: 6px;
}
aside #choose { background: var(--accent); color: #fff; border: 0; border-radius: 8px; min-height: 42px; }
:root[data-theme="dark"] aside #choose { color: var(--accent-ink); }
#quick-pools { overscroll-behavior: contain; padding: 3px; }
.quick-pool.active { box-shadow: 0 0 0 1px var(--accent); }
.quick-pool.active::after { display: none; }
.banner-stage {
  border-radius: 14px;
  isolation: isolate;
  background: linear-gradient(125deg, #2c5164, #19283d);
  box-shadow: inset 0 0 0 1px #fff3;
}
.banner-shade { background: linear-gradient(0deg, #132039bc, transparent 45%), linear-gradient(180deg, #1320398f, transparent 40%); }
.pool-actions button { box-shadow: 0 2px 9px #10192b40; border-radius: 8px; }
.draw-panel, :root[data-theme="dark"] .draw-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 18px;
}
.draw-panel .bonus { color: var(--muted); }
.draw-panel #pool-warning:empty, .draw-panel .bonus:empty { display: none; }
.draw-buttons { gap: 14px; padding-top: 10px; }
.draw-button { background: var(--surface); border-color: var(--line); color: var(--ink); border-radius: 10px; box-shadow: 0 2px 0 var(--line); }
.draw-button.primary, #ok.primary { background: var(--accent-fill); color: var(--accent-ink); border-color: #10837445; box-shadow: 0 2px 0 #10837455; }
.draw-button em { border-radius: 8px 8px 0 0; }
.sim-note { color: var(--muted); margin: 6px 0 0; }

#result, :root[data-theme="dark"] #result {
  top: var(--header-h);
  bottom: var(--footer-h);
  padding: 14px clamp(12px, 5cqw, 70px) 10px;
  background: radial-gradient(ellipse at 12% 100%, #58e4cb23, transparent 60%), var(--canvas);
  color: var(--ink);
}
#result:not([hidden]) { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
#result-grid {
  --result-gap: clamp(8px, 1.5vw, 16px);
  container-type: size;
  width: min(100%, 720px);
  height: 100%;
  min-height: 0;
  max-height: 300px;
  place-self: center;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  padding: 10px 0 4px;
  gap: var(--result-gap);
}
#result-grid .result-card {
  width: min(100%, 124px, calc((100cqh - var(--result-gap)) / 2));
  min-width: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: 1;
}
#result-grid .result-card:only-child {
  grid-column: 1 / -1;
  width: min(146px, 100cqh, 45cqw);
}
#result-grid .result-card .card-portrait { height: 100%; width: 100%; }
.reveal > #reveal-art.reveal-preview {
  position: absolute;
  inset: 9% auto 9% 20%;
  width: min(44%, 240px);
  height: 82%;
  object-fit: contain;
  background: none;
}
#unity-retry {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  min-height: 44px;
  padding: 8px 20px;
  background: var(--accent-fill);
  color: var(--accent-ink);
}
#result-grid .result-card > .original-new {
  width: min(52px, 48%) !important;
  height: auto !important;
  top: -9px !important;
  left: -5px !important;
}
.result-top { min-height: 0; }
.result-top h1 { margin: 0; }
.result-bottom > button { min-height: 44px; }
.duplicate-note { color: var(--muted); margin: 4px 0; }

footer, :root[data-theme="dark"] footer {
  height: var(--footer-h);
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}
.web-save-note { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.detail-status { padding: 14px; color: var(--muted); font-size: 14px; }

dialog, :root[data-theme="dark"] dialog { border-radius: 16px; border: 1px solid var(--line); }
#more-pools { display: block; margin: 14px auto 0; min-height: 44px; padding: 8px 22px; border-radius: 9px; }
#collection-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#collection-dialog > :not(#collection-list) { flex-shrink: 0; }
#collection-list { min-height: 0; max-height: none; overscroll-behavior: contain; }
#collection-list .owned-card { min-width: 0; }
#collection-list .owned-card > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}
#collection-list .owned-card .card-portrait { width: 100%; height: auto; margin: 0; flex: none; }
#collection-list .owned-card .portrait-art {
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  border-radius: 0;
}
#collection-list .owned-card > button > b { margin: 6px 5px 0; font-size: 14px; }
#collection-list .owned-card > button > small { margin: 0 5px 6px; font-size: 12px; overflow-wrap: anywhere; }
#collection-list .owned-card .owned-count {
  top: 5px;
  right: 5px;
  color: #fff;
  background: #172739e8;
  pointer-events: none;
}

@media (max-width: 520px) {
  .start-panel { grid-template-columns: 1fr; gap: 22px; }
  #start-screen .start-icon { width: 76px; height: 76px; border-radius: 18px; }
  .start-actions > * { flex: 1 0 100%; }
  .start-panel .start-subtitle { margin-bottom: 16px; }
}

/* Use the device viewport for menus, and keep the original 16:9 canvas in its player. */
#mobile-pools, #unity-fullscreen, #unity-fit, #unity-skip, #unity-more { display: none; }
#card-zoom-dialog[open] { display:flex; flex-direction:column; max-width: 900px; }
#zoom-viewport { height:min(52dvh, 440px); min-height:0; overflow:auto; background:#142130; overscroll-behavior:contain; touch-action:none; cursor:grab; }
#zoom-viewport:active { cursor:grabbing; }
#zoom-image { display:block; width:100%; max-width:none; height:auto; margin:0; user-select:none; }
#zoom-status { margin:0; padding:16px; text-align:center; color:#f3fffc; }
.zoom-controls { flex:none; display:flex; align-items:center; justify-content:center; gap:18px; padding-top:10px; }
.zoom-controls button { width:48px; min-height:44px; font-size:22px; }
.zoom-controls output { min-width:52px; text-align:center; }
:root[data-web-mobile] {
  --screen-w:100dvw;
  --screen-h:100dvh;
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-right:env(safe-area-inset-right, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --safe-left:env(safe-area-inset-left, 0px);
  --usable-w:calc(var(--screen-w) - var(--safe-left) - var(--safe-right));
  --usable-h:calc(var(--screen-h) - var(--safe-top) - var(--safe-bottom));
  --control:44px;
  --control-radius:10px;
  --control-gap:8px;
  --header-h:54px;
  --footer-h:44px;
}
:root[data-web-mobile] body { display:block; }
:root[data-web-mobile] #start-screen { padding:max(12px,var(--safe-top)) max(12px,var(--safe-right)) max(12px,var(--safe-bottom)) max(12px,var(--safe-left)); }
:root[data-web-mobile] #start-screen .windows-download { display:none; }
:root[data-web-mobile] #start-screen #open-display-help { color:#e8fffd; background:#233b4c; border-color:#9bbfc77a; }
:root[data-web-mobile] #game {
  margin:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  width:var(--usable-w);
  height:var(--usable-h);
  aspect-ratio: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
:root[data-web-mobile] #game header { padding: 0 10px; gap: 8px; }
:root[data-web-mobile] .resources { gap:var(--control-gap); }
:root[data-web-mobile] #game :is(#menu,#back,#fullscreen) { width:var(--control); height:var(--control); min-width:var(--control); min-height:var(--control); padding:0; border-radius:var(--control-radius); }
:root[data-web-mobile] #lobby { grid-template: minmax(0,1fr) auto / clamp(154px, 24%, 236px) minmax(0,1fr) !important; padding:var(--control-gap); gap:var(--control-gap); }
:root[data-web-mobile] #lobby aside { padding: 5px !important; gap: 4px; }
:root[data-web-mobile] aside #quick-pools { min-height:0; }
:root[data-web-mobile] .quick-pool { flex-shrink:0; min-height:58px; border-radius:var(--control-radius); }
:root[data-web-mobile] .library-nav { grid-template-columns:repeat(2,minmax(0,1fr)); padding:2px 0; gap:var(--control-gap); }
:root[data-web-mobile] #game :is(.library-nav .subtle, #update-data, #choose, #mobile-pools, .pool-actions button, #ok),
:root[data-web-mobile] dialog :is(button:not([data-card]):not([data-pool]):not([data-select]):not([data-music]),select) {
  min-height:var(--control);
  border-radius:var(--control-radius);
}
:root[data-web-mobile] #game :is(.library-nav .subtle, #update-data, #choose, .pool-actions button) { padding:4px 7px !important; font-size:13px !important; }
:root[data-web-mobile] #game :is(.library-nav .subtle,.pool-actions button) { background:var(--surface); color:var(--ink); border:1px solid var(--line); box-shadow:none; }
:root[data-web-mobile] #game :is(#choose, #update-data) { margin:0; }
:root[data-web-mobile] .draw-panel { padding:4px 8px; }
:root[data-web-mobile] .draw-buttons, :root[data-web-mobile] .pool-actions { gap:var(--control-gap); }
:root[data-web-mobile] .draw-panel .pool-actions {
  position:static;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  width:min(100%, 520px);
  margin-block:4px 8px;
}
:root[data-web-mobile] .draw-buttons { width:min(100%, 520px); }
:root[data-web-mobile] .draw-buttons > button { flex:1; width:auto; }
:root[data-web-mobile] .draw-panel .bonus { position:static; margin-bottom:4px; font-size:11px; }
:root[data-web-mobile] .draw-panel .sim-note { margin-top:6px; }
:root[data-web-mobile] .draw-buttons > button, :root[data-web-mobile] #result :is(#ok,#again) { min-height:52px; border-radius:var(--control-radius); }
:root[data-web-mobile] .draw-button strong { font-size: 17px; }
:root[data-web-mobile] .art-arrow { min-height:var(--control); min-width:var(--control); }
:root[data-web-mobile] #art-dots { left:50%; transform:translateX(-50%); }
:root[data-web-mobile] #result { padding: 6px 18px; }
:root[data-web-mobile] .result-top h1 { font-size: 22px; }
:root[data-web-mobile] #collection-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
:root[data-web-mobile] #reveal-new.original-new { width: clamp(55px, 18cqh, 122px) !important; }
:root[data-web-mobile] #reveal-next, :root[data-web-mobile] #reveal-skip { min-height: 44px; }
:root[data-web-mobile] dialog[open] {
  position: fixed;
  inset: calc(var(--safe-top) + 8px) var(--safe-right) auto var(--safe-left);
  margin: 0 auto;
  width:min(calc(var(--usable-w) - 16px), 960px);
  max-width:min(calc(var(--usable-w) - 16px), 960px);
  max-height:calc(var(--usable-h) - 16px);
  padding: 12px;
  transform: none;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}
:root[data-web-mobile] dialog::backdrop { backdrop-filter: none; }
:root[data-web-mobile] dialog :is(input:not([type='range']),select) { font-size:16px; min-height:var(--control); border-radius:var(--control-radius); }
:root[data-web-mobile] dialog .dialog-title { position:sticky; top:0; z-index:4; background:var(--panel); gap:var(--control-gap); }
:root[data-web-mobile] dialog .dialog-title h2 { font-size:clamp(18px, 4vw, 23px); }
:root[data-web-mobile] dialog :is(.filters,.save-tools,.settings-actions) { gap:var(--control-gap); }
:root[data-web-mobile] dialog .settings-actions { flex-wrap:wrap; }
:root[data-web-mobile] #collection-dialog[open] { overflow:auto; }
:root[data-web-mobile] #card-dialog[open] {
  width:min(calc(var(--usable-w) - 16px), 960px) !important;
  height:calc(var(--usable-h) - 16px);
  padding: 8px 12px 12px !important;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) !important;
  align-items: start;
  gap: 12px;
}
:root[data-web-mobile] #card-dialog #full-card { max-height: none; }
:root[data-web-mobile] #card-dialog .large-card { background:var(--surface); }
:root[data-web-mobile] dialog :is(.dialog-title button[data-close],.close-card) {
  display:grid; place-items:center; padding:0;
  flex:0 0 var(--control); width:var(--control); height:var(--control);
  color:var(--ink); background:var(--surface); border:1px solid var(--line);
  border-radius:var(--control-radius);
}
:root[data-web-mobile] #card-dialog .close-card {
  position:sticky;
  grid-column:1 / -1;
  justify-self:end;
  top:0;
  right:auto;
}
:root[data-web-mobile] #card-dialog .detail-tools { gap:var(--control-gap); }
:root[data-web-mobile] #card-dialog .detail-tools button { border-radius:var(--control-radius) !important; padding:6px 12px !important; }

#unity-scene { position:absolute; inset:0; overflow:hidden; }
:root[data-web-mobile] #unity-stage:not([hidden]) {
  display:block;
  overflow:hidden;
  inset:var(--stage-top,0px) auto auto var(--stage-left,0px);
  width:var(--stage-width,100dvw);
  height:var(--stage-height,100dvh);
  background:#142337;
  z-index:30;
}
:root[data-web-mobile]:has(#unity-stage:not([hidden])) { overflow:hidden; overscroll-behavior:none; }
:root[data-web-mobile] #unity-stage[data-stage-fit] #unity-scene {
  --fit-width:calc(var(--stage-width,100dvw) - var(--safe-left) - var(--safe-right));
  --fit-height:calc(var(--stage-height,100dvh) - var(--safe-top) - var(--safe-bottom));
  inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  width:min(var(--fit-width), calc(var(--fit-height) * 16 / 9));
  height:min(var(--fit-height), calc(var(--fit-width) * 9 / 16));
  margin:auto;
}
:root[data-web-mobile] #unity-frame { position:absolute; inset:0; display:block; }
:root[data-web-mobile] .unity-tools {
  position:absolute;
  inset:calc(var(--safe-top) + 8px) calc(var(--safe-right) + 8px) calc(var(--safe-bottom) + 8px) calc(var(--safe-left) + 8px);
  pointer-events:none;
  z-index:4;
}
:root[data-web-mobile] .unity-tools button { touch-action:manipulation; }
:root[data-web-mobile] .unity-tools :is(#unity-skip,#unity-more) {
  position:absolute;
  right:0;
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:var(--control);
  min-width:var(--control);
  gap:4px;
  padding:4px 9px;
  border:0;
  border-radius:50px;
  color:#fff;
  background:transparent;
  text-shadow:0 1px 3px #10253a,0 1px 6px #10253a,0 0 2px #10253a;
  font-size:13px;
}
:root[data-web-mobile] #unity-skip { top:0; }
:root[data-web-mobile] .unity-tools #unity-more { bottom:0; font-size:24px; letter-spacing:1px; }
:root[data-web-mobile] .unity-view-tools {
  position:absolute; bottom:var(--control); right:0;
  display:grid; gap:2px; padding:4px;
  border:1px solid #ffffff56; border-radius:10px;
  background:#142337e8; pointer-events:auto;
}
:root[data-web-mobile] .unity-view-tools :is(#unity-exit,#unity-fit,#unity-fullscreen) {
  position:static; display:block; min-height:var(--control); padding:4px 12px;
  color:#f4fffe; background:none; border:0; text-align:left; font-size:14px;
}
:root[data-web-mobile] #unity-loading { inset:0; padding:18px; text-align:center; font-size:16px; }
:root[data-web-mobile] #unity-retry { top:calc(50% + 65px); }
:root[data-web-mobile] #unity-new { top:22%; left:5%; width:clamp(62px,14vw,110px); }
:root[data-web-mobile] #toast { z-index:100; }

@media (orientation: portrait) {
  :root[data-web-mobile] #game {
    display:flex;
    flex-direction:column;
    width:100%;
    height:auto;
    min-height:var(--usable-h);
    overflow:visible;
    container-type:inline-size;
  }
  :root[data-web-mobile] #game header { position:sticky; top:var(--safe-top); flex:none; }
  :root[data-web-mobile] #game footer { position:static; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; margin-top:auto; padding:5px 8px; min-height:var(--control); height:auto; font-size:11px; }
  :root[data-web-mobile] #game footer > span:nth-last-child(2) { display:none; }
  :root[data-web-mobile] #game footer :is(#data-status,.web-save-note) { grid-column:1; margin:0; font-size:11px; }
  :root[data-web-mobile] #game footer #fullscreen { grid-column:2; grid-row:1 / span 2; }
  :root[data-web-mobile] #game .resources > span { min-width:0; padding:4px 6px; gap:5px; }
  :root[data-web-mobile] #game .resources > span i.gem { width:19px; height:19px; }
  :root[data-web-mobile] #game .jp { display:none; }
  :root[data-web-mobile] #mobile-pools { display:inline-flex; align-items:center; padding:0 8px; }
  :root[data-web-mobile] #lobby:not([hidden]) { display:flex; flex-direction:column; height:auto !important; padding:8px; gap:8px; }
  :root[data-web-mobile] #lobby aside { order:3; padding:9px !important; }
  :root[data-web-mobile] #lobby aside #choose { display:none; }
  :root[data-web-mobile] .banner-stage { order:1; min-height:214px; aspect-ratio:16/10; }
  :root[data-web-mobile] .draw-panel { order:2; min-height:96px; }
  :root[data-web-mobile] #quick-pools { flex-direction:row; overflow-x:auto; min-height:75px; }
  :root[data-web-mobile] #quick-pools .quick-pool { flex:0 0 42%; min-width:115px; }
  :root[data-web-mobile] #quick-pools .quick-pool span { font-size:11px; }
  :root[data-web-mobile] #result:not([hidden]) { position:static; display:flex; flex-direction:column; padding:10px 12px; gap:12px; }
  :root[data-web-mobile] #result .result-top { gap:8px; flex-wrap:wrap; }
  :root[data-web-mobile] #result-grid { container-type:inline-size; width:100%; height:auto; max-height:none; grid-template-rows:auto auto; padding:14px 0; }
  :root[data-web-mobile] #result-grid .result-card { width:min(100%,124px); }
  :root[data-web-mobile] #result-grid .result-card:only-child { width:min(146px,45cqw); }
  :root[data-web-mobile] #result .result-bottom { flex-wrap:wrap; justify-content:center; }
  :root[data-web-mobile] #result .result-bottom > span { flex:1 0 100%; text-align:center; }
  :root[data-web-mobile] #collection-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  :root[data-web-mobile] #card-dialog[open] { grid-template-columns:minmax(0,1fr) !important; }
  :root[data-web-mobile] #card-dialog .detail-tools { justify-content:flex-start; flex-wrap:wrap; }
  :root[data-web-mobile] #period { font-size:11px; }
  :root[data-web-mobile] .unity-tools #unity-fit { display:none; }
}

@media (orientation: landscape) and (max-height: 430px) {
  :root[data-web-mobile] #unity-stage #unity-retry { top:68%; }
  :root[data-web-mobile] #game:has(#lobby:not([hidden])) { min-height:365px; }
  :root[data-web-mobile] #lobby { grid-template-rows:minmax(104px,1fr) auto !important; }
  :root[data-web-mobile] .draw-panel .sim-note { display:none; }
}

:root:fullscreen:not([data-web-mobile]) #game { width: min(100vw, calc(100dvh * 16 / 9)); border-radius: 0; }
