:where(.play-screen, .game-dialog[data-round-panel], .chest-dialog) {
  --round-serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --round-cream: #fff6df;
  --round-gold: #f6d797;
  --round-rim: #c7a970;
  --round-glass: linear-gradient(142deg, #536647ed, #21382de8 80%);
}
.game-shell[data-view="play"] .landscape { display: none; }
.play-screen {
  --round-scene: url("assets/battle/conservatory.webp");
  --round-shade: linear-gradient(180deg, #192d23cd, #26392d46 23%, transparent 37% 79%, #192b22a6);
  --round-edge: clamp(9px, 3.2vw, 18px);
  --round-control-size: clamp(44px, 12vw, 50px);
  --round-stat-art: clamp(21px, 6.9vw, 32px);
  display: grid;
  grid-template-rows: auto minmax(min(220px, 45dvh), 1fr) auto;
  gap: 0;
  padding: max(8px, var(--top)) var(--round-edge) var(--bottom);
  overflow-y: auto;
  color: var(--round-cream);
  background: var(--round-shade), #475c3c var(--round-scene) center 56% / cover no-repeat;
}
.play-screen:has(.stage[data-weather="autumn"]) { --round-scene: url("assets/lobby-orchard.webp"); }
.play-screen:has(.stage[data-weather="rain"]) { --round-scene: url("assets/lobby-rain.webp"); }
.play-screen:has(.stage[data-weather="winter"]) { --round-scene: url("assets/lobby-winter.webp"); }
.play-screen[data-mode="wind-post"] {
  --round-scene: url("assets/wind-post-hub-portrait.webp");
  --round-shade: linear-gradient(180deg, #0e262ee6, #14323e4f 32%, #172b2744 70%, #12292fb5);
  --round-glass: linear-gradient(142deg, #405f61f5, #142e35f0 85%);
}
.play-screen[data-mode="wind-post"][data-difficulty="hard"] {
  --round-scene: url("assets/wind-post-stage-night.webp");
  --round-rim: #adc4cc;
  --round-gold: #d8ecf1;
  --round-glass: linear-gradient(142deg, #405c78f5, #15293df0 85%);
}
.round-panel { min-width: 0; z-index: 2; }
.play-header {
  display: grid;
  grid-template-columns: var(--round-control-size) minmax(0, 1fr) var(--round-control-size);
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(7px, 1.4dvh, 13px);
  text-align: center;
}
.round-heading small {
  display: block;
  color: var(--round-gold);
  font-size: var(--text-small);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 3px #12251a;
  text-wrap: balance;
}
.round-heading h2 {
  margin: 2px 0 0;
  font: 700 clamp(18px, 5.3vw, 28px)/1.15 var(--round-serif);
  letter-spacing: .04em;
  text-shadow: 0 2px 6px #0e2016;
  text-wrap: balance;
}
.round-control,
.round-star-button {
  border: 1px solid var(--round-rim);
  border-top-color: var(--round-gold);
  color: var(--round-cream);
  background: radial-gradient(ellipse at 40% -20%, #f6dea940, transparent 72%), var(--round-glass);
  box-shadow: inset 0 0 0 2px #fce6ae20, 0 2px 0 #27291bd9, 0 4px 9px #14261966;
}
.round-control {
  display: grid;
  place-items: center;
  width: var(--round-control-size);
  height: var(--round-control-size);
  padding: 0;
  border-radius: 12px 7px 12px 17px;
}
#pause-button { border-radius: 7px 12px 17px 12px; }
.round-control .icon { width: 22px; height: 22px; }
.round-control:disabled, .round-star-button:disabled { opacity: .85; }
.round-control:active:not(:disabled), .round-star-button:active:not(:disabled) { transform: translateY(1px); }
.play-screen button:focus-visible { outline: 2px solid #fff0b8; outline-offset: 2px; }
.round-hud {
  padding: 0 8px 7px;
  border: 1px solid var(--round-rim);
  border-top-color: var(--round-gold);
  border-radius: 9px 20px;
  background: var(--round-glass);
  box-shadow: inset 0 0 0 2px #efd39b21, 0 3px 10px #1925198c;
}
.scorebar {
  display: grid;
  grid-template-columns: minmax(0, 1.46fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  margin: 0;
  padding: 6px 0 5px;
}
.play-screen[data-mode="wind-post"] .scorebar { grid-template-columns: 1fr; }
.round-stat {
  display: grid;
  grid-template-columns: auto minmax(0, auto);
  grid-template-rows: auto auto;
  justify-content: center;
  align-content: center;
  column-gap: clamp(4px, 1.3vw, 7px);
  min-width: 0;
  min-height: 42px;
  padding-inline: 4px;
}
.round-stat + .round-stat { border-inline-start: 1px solid #e7ca8b47; }
.round-stat > :is(img, .icon) {
  grid-row: 1 / -1;
  align-self: center;
  width: var(--round-stat-art);
  height: var(--round-stat-art);
  object-fit: contain;
  color: var(--round-gold);
  filter: drop-shadow(0 2px 2px #162c1e98);
}
.round-stat > .icon { width: calc(var(--round-stat-art) * .7); height: calc(var(--round-stat-art) * .7); }
.round-stat dt {
  color: var(--round-gold);
  font-size: var(--text-micro);
  font-weight: 700;
  line-height: 1.15;
}
.round-stat dd {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 1px 0 0;
  color: var(--round-cream);
  line-height: 1;
  white-space: nowrap;
}
.round-stat dd strong { font-size: clamp(17px, 5.2vw, 26px); font-variant-numeric: tabular-nums; }
.round-clock dd strong { font-size: clamp(19px, 5.7vw, 29px); }
.round-stat dd small { font-size: var(--text-micro); }
.round-clock .urgent { color: #ffb5a6; }
.timer-track {
  height: 6px;
  overflow: hidden;
  border: 1px solid #efcc8655;
  border-radius: 20px;
  background: #0d231ab8;
}
.timer-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#ffe9ae, #dba651);
  transform-origin: left;
}
.timer-track.urgent { border-color: #ffbca47a; }
.timer-track.urgent i { background: linear-gradient(#ffc8aa, #e87359); }
.round-objectives {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 7px;
}
.round-objectives:has(.round-star-button[hidden]) { grid-template-columns: minmax(0, 1fr); }
.round-goals { display: flex; gap: 6px; min-width: 0; }
.goal {
  --goal-icon-size: clamp(23px, 7.4vw, 38px);
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 48px;
  padding: 5px clamp(4px, 1.55vw, 8px);
  border: 1px solid #d8bd83;
  border-top-color: #fffbe3;
  border-radius: 7px 13px;
  color: #4e3d28;
  background: radial-gradient(ellipse at 22% 2%, #fffdf0, transparent 78%), linear-gradient(135deg, #f9f0d5, #e6d3a8);
  box-shadow: inset 0 0 0 1px #fff6dc80, 0 2px 5px #1f2f1e68;
}
.goal-art {
  display: grid;
  flex: none;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: var(--goal-icon-size);
  height: var(--goal-icon-size);
  filter: drop-shadow(0 2px 2px #5b422938);
}
.goal-art > :is(.marker-art, .mini-target, .post-delivery-mark) { width: 100%; height: 100%; object-fit: contain; }
.goal-art .mini-target { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.goal-art .mini-target .mole { width: 100%; height: 100%; }
.goal-art .mini-target-badge { width: 12px; height: 12px; }
.goal-readout { display: grid; flex: 1; min-width: 0; gap: 2px; }
.goal-readout small { font-size: var(--text-micro); font-weight: 750; line-height: 1.13; }
.goal-readout strong {
  color: #493b27;
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.goal-readout strong span { font-size: var(--text-micro); font-weight: 650; }
.goal progress {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 1px;
  padding: 0;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 4px;
  background: #9c754851;
}
.goal progress::-webkit-progress-bar { background: #9c754851; }
.goal progress::-webkit-progress-value { border-radius: 4px; background: #7a8a4b; }
.goal progress::-moz-progress-bar { border-radius: 4px; background: #7a8a4b; }
.goal.done { border-color: #9da773; border-top-color: #edf1cf; background: linear-gradient(140deg, #f5f7dc, #d8e0b6); }
.goal-check {
  position: absolute;
  inset: auto auto 4px var(--goal-icon-size);
  display: none;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid #e8ebc0;
  border-radius: 50%;
  background: #57774d;
  color: #fffbea;
}
.goal-check .icon { width: 9px; height: 9px; stroke-width: 2.7; }
.goal.done .goal-check { display: grid; }
.play-screen[data-mode="wind-post"] .goal { border-color: var(--round-rim); color: var(--round-gold); background: var(--round-glass); }
.play-screen[data-mode="wind-post"] .goal-readout strong { color: var(--round-cream); }
.round-star-button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: clamp(66px, 19vw, 87px);
  min-height: 48px;
  padding: 4px 5px;
  border-radius: 7px 13px;
  font-size: var(--text-micro);
  font-weight: 750;
  line-height: 1.25;
}
.round-star-icons { display: flex; gap: 2px; }
.round-star-icons img {
  width: clamp(13px, 4vw, 19px);
  aspect-ratio: 1;
  object-fit: contain;
  opacity: .58;
  filter: grayscale(1) brightness(.74);
}
.round-star-icons .is-lit { opacity: 1; filter: drop-shadow(0 1px 3px #ffdc766b); }
.battle-panel { position: relative; display: flex; min-width: 0; min-height: 0; }
.battle-panel .stage { flex: 1; min-height: 0; background: transparent; }
.stage .burrows { inset: 4% 1.5% 3%; }
.play-screen[data-mode="wind-post"] .burrows { inset-block-start: 11%; }
.burrow-art { filter: drop-shadow(0 3px 3px #253017a6); }
.burrow:focus-visible { outline-offset: -5px; }
.stage-tip {
  justify-self: center;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 6px 12px;
  border: 1px solid #e5ce9251;
  border-radius: 20px;
  background: #24372bc9;
  color: #fff4d7;
  font-size: var(--text-small);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}
.stage .countdown {
  background: radial-gradient(ellipse at center, #1c2f217a, transparent 72%);
  font: 700 clamp(54px, 17vw, 84px)/1 var(--round-serif);
  font-variant-numeric: tabular-nums;
}
#round-count {
  display: grid;
  place-items: center;
  width: clamp(90px, min(29vw, 33dvh), 148px);
  aspect-ratio: 1;
  padding-bottom: .04em;
  border: 2px solid var(--round-gold);
  border-radius: 50%;
  background: radial-gradient(ellipse at 38% 17%, #cbb17046, transparent 65%), var(--round-glass);
  box-shadow: inset 0 0 0 4px #f8df895c, 0 6px 25px #1a291b9c;
}
.play-screen .finale-banner strong {
  padding: .32em 1.3em;
  border: 1px solid var(--round-gold);
  border-radius: 1em .4em;
  background: var(--round-glass);
  color: var(--round-cream);
  font-family: var(--round-serif);
  text-shadow: 0 2px 3px #233126;
  box-shadow: inset 0 0 0 2px #e8ca7960, 0 3px 9px #22352290;
}
.play-screen .round-finale[data-outcome="timeout"] .finale-banner strong { background: #263d36; }

.game-dialog:is([data-round-panel], .chest-dialog) {
  --round-close: 44px;
  --round-reserve: calc(var(--round-close) + 13px);
  --round-paper: linear-gradient(145deg, #fffbef, #ecdbbf);
  --round-ink: #493522;
  --round-line: #b88d535c;
  --round-dialog-hero: url("assets/adventure/valley/dialog-grove.webp");
  --round-dialog-width: 26rem;
  inset: var(--top) var(--safe-right) calc(var(--bottom) + var(--round-reserve)) var(--safe-left);
  width: min(calc(100% - var(--safe-left) - var(--safe-right) - 2 * var(--edge)), var(--round-dialog-width));
  max-height: min(calc(100dvh - var(--top) - var(--bottom) - var(--round-reserve) - 3px), 44rem);
  padding: 0 0 9px;
  overflow: visible;
  border: 1px solid #cea563;
  border-top-color: #ffedbe;
  border-radius: 13px 30px 13px 25px;
  background: radial-gradient(ellipse at 15% 0%, #fffdf6 5%, transparent 60%), var(--round-paper);
  color: var(--round-ink);
  box-shadow: inset 0 0 0 2px #fff9e6c9, 0 4px 0 #755736, 0 22px 55px #0008;
}
.game-dialog:is([data-round-panel], .chest-dialog)::backdrop,
.game-shell:has(.game-dialog:is([data-round-panel="result"], .chest-dialog)[open]) .reward-reveal:not([data-companion-unlock])::backdrop {
  background: var(--game-backdrop);
}
.game-shell:has(.reward-reveal[open]) .game-dialog:is([data-round-panel="result"], .chest-dialog)::backdrop { background: transparent; }
.game-dialog[data-round-panel="prepare"] { --round-dialog-width: 28rem; }
.game-dialog[data-round-panel][data-wind-post-panel] {
  --round-paper: linear-gradient(142deg, #28484a, #142e34);
  --round-ink: #fff0d3;
  --round-line: #e5c49355;
  --round-dialog-hero: url("assets/wind-post-hub-wide.webp");
  background: var(--round-paper);
  border-color: #b39162;
  box-shadow: inset 0 0 0 2px #e8cba423, 0 4px 0 #11282c, 0 22px 55px #0009;
}
.game-dialog[data-round-panel][data-difficulty="hard"] {
  --round-paper: linear-gradient(142deg, #293d56, #152939);
  --round-line: #b9d6e055;
  --round-gold: #d6e9ed;
  --round-dialog-hero: url("assets/wind-post-stage-night.webp");
  border-color: #9bb8c8;
}
.round-dialog-heading, .game-dialog.chest-dialog .chest-heading {
  position: relative;
  isolation: isolate;
  flex: none;
  display: grid;
  align-items: center;
  min-height: clamp(78px, 13dvh, 112px);
  padding: 10px 36% 10px clamp(15px, 5vw, 26px);
  overflow: hidden;
  border-radius: 12px 29px 0 0;
  background:
    linear-gradient(90deg, #152d23ea 4%, #203828b2 53%, #5b5e292a),
    #334c36 var(--round-dialog-hero) center 53% / cover no-repeat;
  box-shadow: inset 0 0 0 2px #ebce8855;
}
.round-dialog-heading::after, .game-dialog.chest-dialog .chest-heading::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(#fff4c5, #d5ad61 48%, #8f6334);
  box-shadow: 0 -2px 6px #2b2b1866;
}
.round-dialog-title { min-width: 0; }
.game-dialog:is([data-round-panel], .chest-dialog) :is(.round-dialog-heading, .chest-heading) h2 {
  margin: 3px 0 0;
  padding: 0;
  color: var(--round-cream);
  font: 700 clamp(23px, 6.4vw, 34px)/1.12 var(--round-serif);
  letter-spacing: .045em;
  text-align: start;
  text-shadow: 0 2px 4px #182d23;
  text-wrap: balance;
}
.round-dialog-heading p, .game-dialog.chest-dialog .chest-heading p {
  margin: 0;
  color: var(--round-gold);
  font-size: var(--text-small);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 3px #192a19;
}
.round-dialog-heading > img {
  position: absolute;
  z-index: -1;
  inset: 4% 6px 0 auto;
  width: 36%;
  height: 92%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 4px 4px #172b25ad);
}
[data-round-panel="prepare"] .round-dialog-heading {
  min-height: clamp(104px, 17dvh, 148px);
  padding-inline: clamp(27px, 11%, 50px) 36%;
  background: linear-gradient(90deg, #21351e38, #162d2224 52%, transparent 80%),
    #485e3e url("assets/battle/conservatory-entrance.webp") center / cover no-repeat;
}
[data-round-panel="result"] .round-dialog-heading { min-height: clamp(99px, 18dvh, 144px); }
[data-round-panel="result"] .round-dialog-heading > img { width: 41%; height: 98%; inset: auto 4px 0 auto; }
.game-dialog[data-round-panel][data-wind-post-panel] .round-dialog-heading {
  background: linear-gradient(90deg, #102b33e8, #142b37a8 56%, #1830413b), var(--round-dialog-hero) center 33% / cover;
}
.round-dialog-rating { margin-top: 6px; }
.round-dialog-rating .star-rating { --star-size: clamp(16px, 5vw, 22px); gap: 3px; }
.round-dialog-rating .carved-stars i:not(.earned)::before { background: #d1bf8966; }
.game-dialog:is([data-round-panel], .chest-dialog)[open] .dialog-close {
  inset: calc(100% + 10px) auto auto 50%;
  display: grid;
  place-items: center;
  width: var(--round-close);
  height: var(--round-close);
  padding: 0;
  translate: -50% 0;
  border: 1px solid var(--round-rim);
  border-top-color: #ffe5a9;
  border-radius: 50%;
  color: #fff2c9;
  background: radial-gradient(circle at 33% 16%, #7d8764, #3a523e 63%, #253c32);
  box-shadow: inset 0 0 0 2px #f7d89f44, 0 3px 0 #151f18b8, 0 5px 10px #0006;
  animation: none;
}
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-close .collection-close-icon {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  border: 0;
  background: none;
}
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-close .icon { width: 21px; height: 21px; stroke-width: 2; }
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-close:hover { transform: none; }
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-close:active { transform: scale(.94); }
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-scroll {
  padding: clamp(8px, 2.9vw, 14px) clamp(9px, 4vw, 18px) 3px;
  scrollbar-width: thin;
  scrollbar-color: #b69561 transparent;
}
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-body { color: var(--round-ink); }
.game-dialog[data-round-panel] .dialog-pages:not(:empty) { padding-inline: clamp(9px, 4vw, 18px); margin-top: 3px; }
.game-dialog[data-round-panel] .dialog-actions {
  width: auto;
  margin: 6px 0 0;
  padding: 3px clamp(9px, 4vw, 18px) 0;
}
.game-dialog[data-round-panel] .dialog-actions .game-button {
  flex: 1 1 6.6rem;
  min-height: 44px;
  min-width: 0;
  max-width: 19rem;
  padding: 5px 8px;
  border: 1px solid #ad8651;
  border-top-color: #f0cf85;
  border-radius: 9px 15px;
  background: radial-gradient(ellipse at 25% -14%, #f4eab943, transparent 64%), linear-gradient(145deg, #5b704b, #294436);
  box-shadow: inset 0 0 0 2px #edcf8b35, 0 3px 0 #76573787;
  color: #fff8e5;
  font-size: var(--text-body);
  font-weight: 850;
  line-height: 1.2;
  text-shadow: 0 1px 2px #24372f;
}
.game-dialog[data-round-panel="prepare"] .dialog-actions .game-button { font-size: var(--text-action); }
.game-dialog[data-round-panel] .dialog-actions .game-button-alt {
  border-color: #c0a47b;
  border-top-color: #fff9e8;
  background: linear-gradient(145deg, #fff8e8, #e7d7b9);
  color: #59432d;
  text-shadow: none;
}
.game-dialog[data-round-panel="exit"] .dialog-actions .game-button-alt {
  border-color: #b79168;
  background: linear-gradient(145deg, #ead4be, #d6ad95);
  color: #562d20;
}
.game-dialog[data-round-panel][data-wind-post-panel] .dialog-actions .game-button-alt {
  border-color: var(--round-line);
  background: linear-gradient(145deg, #3d5759, #233d45);
  color: var(--round-cream);
}
.game-dialog[data-round-panel] .dialog-actions .game-button:active:not(:disabled) { box-shadow: inset 0 0 0 1px #ffd98d55; }
.game-dialog:is([data-round-panel], .chest-dialog) :is(button, summary):focus-visible { outline: 2px solid #a7793a; outline-offset: 2px; }
.game-dialog:is([data-round-panel], .chest-dialog) .dialog-close:focus-visible,
.game-dialog[data-round-panel][data-wind-post-panel] button:focus-visible { outline-color: #ffdf8e; }
.dialog-body .round-dialog-note { margin: 4px 0; padding: 5px 3px; line-height: 1.55; }
.round-pause-time {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-block: 1px solid var(--round-line);
}
.round-pause-time img { width: 34px; height: 34px; object-fit: contain; }
.round-pause-time > span { font-weight: 750; }
.round-pause-time strong { margin-left: auto; font-size: var(--text-subheading); font-variant-numeric: tabular-nums; }
.round-pause-time strong small { font-size: var(--text-small); }
[data-round-panel="stars"] .star-conditions { margin: 0; }
[data-round-panel="stars"] .star-conditions header { justify-content: space-between; margin: 0 0 6px; }
.round-rating-status { color: #40502f; }
[data-round-panel="stars"] .star-conditions ol { grid-template-columns: 1fr; }
[data-round-panel="stars"] .star-conditions li {
  grid-template-columns: 3.2rem minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  text-align: start;
}
[data-round-panel="stars"] .star-conditions li > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; }
[data-round-panel="stars"] .star-conditions li small { margin: 0; font-size: inherit; }
[data-round-panel="guide"] .tutorial-art {
  min-height: clamp(80px, 15dvh, 130px);
  padding: 6px;
  border: 1px solid #ba9e6f;
  border-radius: 8px 16px;
  background: linear-gradient(#f5efcc27, #243b2895), var(--round-dialog-hero) center 63% / cover;
}
[data-round-panel="guide"] .tutorial-rule { background: #ecddbd80; color: var(--round-ink); }
.round-page-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  border: 1px solid #c7a673;
  border-radius: 8px 13px;
  background: var(--round-paper);
  color: #694d30;
}
.round-page-button::before {
  content: "";
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  rotate: -45deg;
}
.round-page-button[data-step="-1"]::before { rotate: 135deg; }
.round-page-button:disabled { opacity: .43; }
[data-round-panel="result"] .result-stars {
  border: 0;
  background: radial-gradient(ellipse, #f9e3a8 5%, transparent 72%);
  box-shadow: none;
}
[data-round-panel="result"] .result-scorecard { border-radius: 8px 15px; }
[data-round-panel="result"] .result-stat { border-radius: 7px 13px; background: #fffaedaf; }
[data-round-panel="result"] .result-stat:first-child {
  background: radial-gradient(ellipse at top, #fff8dc, #e9d2a1);
}
[data-round-panel="result"] .dialog-body .result-star-detail { background: #e9d6af82; }

.level-dialog[data-round-panel] .level-objectives { margin-top: 0; }
.level-dialog[data-round-panel] :is(.level-objectives h3, .mission-name, .mission strong, .level-detail-name) { color: var(--round-ink); }
.level-dialog[data-round-panel] .level-objectives header > span {
  padding: 3px 7px;
  border: 1px solid var(--round-line);
  border-radius: 6px 11px;
  background: #ead5ae75;
}
.level-dialog[data-round-panel] .mission-grid { gap: 6px; padding: 0; border: 0; background: none; }
.level-dialog[data-round-panel] .mission {
  grid-template-columns: minmax(29px, 24%) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  column-gap: 6px;
  padding: 7px clamp(4px, 2.2vw, 12px);
  border: 1px solid #d3b47e;
  border-top-color: #fffdfa;
  border-radius: 8px 16px;
  background: linear-gradient(140deg, #fcf5e4, #ede0bf);
  box-shadow: inset 0 0 0 1px #fff8e6, 0 2px 3px #805f3321;
  text-align: start;
}
.level-dialog[data-round-panel] .mission-art { grid-row: 1 / -1; width: 100%; }
.level-dialog[data-round-panel] .mission-art > :is(.marker-art, .mini-target) { max-width: 100%; }
.level-dialog[data-round-panel] .mission strong { grid-area: 2 / 2; }
.level-dialog[data-round-panel] .mission-name { grid-area: 1 / 2; font-size: var(--text-small); line-height: 1.2; }
.level-dialog[data-round-panel] .target-rules { margin-top: 3px; padding-inline: 2px; border-color: var(--round-line); }
.level-dialog[data-round-panel] .level-details-content { background: #fff7e5; border-color: var(--round-line); }
.level-dialog[data-round-panel] .battle-loadout { margin-top: 8px; padding: 0 1px 5px; }
.battle-loadout header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  margin: 0 1px 6px;
  color: #594229;
  font-size: var(--text-small);
}
#battle-loadout-count { color: #6b5638; font-variant-numeric: tabular-nums; }
.battle-loadout-grid { display: flex; justify-content: center; gap: clamp(4px, 1.3vw, 7px); }
.battle-item {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  flex: 0 1 6rem;
  min-width: 0;
  min-height: 55px;
  padding: 4px 2px 5px;
  border: 1px solid #c6ad846b;
  border-top-color: #fffaf0;
  border-radius: 7px 13px;
  background: linear-gradient(145deg, #faf1dc, #e8d6b5);
  box-shadow: inset 0 0 0 1px #fff9e08c;
  text-align: center;
  line-height: 1.2;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.battle-item-art { display: grid; place-items: center; width: 100%; }
.battle-item-art img {
  width: clamp(29px, 72%, 53px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #6a472939);
}
.battle-item small { color: #5e492f; font-size: var(--text-micro); font-weight: 700; text-wrap: balance; }
.battle-item-stock {
  position: absolute;
  top: 4px;
  right: 3px;
  padding: 1px 3px;
  border-radius: 4px 6px;
  background: #674c30df;
  color: #fff5dd;
  font-size: var(--text-micro);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}
.battle-item-seal {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #ffe9a4;
  border-radius: 50%;
  background: #50603c;
  box-shadow: 0 1px 2px #674b2a6b, inset 0 0 0 1px #c3ac72;
  color: #fff5c6;
  opacity: 0;
  scale: .76;
  transition: opacity .16s ease, scale .16s ease;
}
.battle-item-seal .icon { width: 11px; height: 11px; stroke-width: 2.5; }
.battle-item[aria-pressed="true"] {
  border-color: #ae762d;
  border-top-color: #fff3ae;
  background: radial-gradient(ellipse at 48% 38%, #fffcdf 6%, #f3dfa1 69%, #d5a757);
  box-shadow: inset 0 0 0 2px #ffe8a5, inset 0 -2px 5px #bb772756, 0 2px 6px #c18835a6;
}
.battle-item[aria-pressed="true"] .battle-item-seal { opacity: 1; scale: 1; }
.battle-item[aria-pressed="true"] small { color: #533819; font-weight: 850; }
.battle-item:disabled { opacity: .53; }
.level-dialog[data-round-panel] .level-energy-note { margin: 0 0 1px; color: #6d523a; }

.game-dialog.chest-dialog { --round-dialog-width: 29rem; }
.game-dialog.chest-dialog .chest-heading {
  align-content: center;
  grid-template-columns: minmax(0, 1fr) clamp(58px, 20vw, 90px);
  grid-template-rows: auto auto;
  gap: 5px 8px;
  margin: 0;
  padding: 9px clamp(13px, 4.5vw, 22px) 12px;
}
.game-dialog.chest-dialog .chest-heading h2 {
  align-self: end;
  font-size: clamp(21px, 5.9vw, 30px);
}
.game-dialog.chest-dialog .chest-heading p { align-self: start; }
.adventure-chest-emblem {
  grid-area: 1 / 2 / 3;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px #18271db0);
}
.chest-dialog .chest-tier {
  border-color: #cbb0838a;
  border-top-color: #fffdf5;
  border-radius: 8px 15px;
  background: linear-gradient(145deg, #fdf6e7, #efdfc4);
}
.chest-dialog .chest-tier[data-status="ready"] {
  border-color: #c7a05e;
  background: linear-gradient(145deg, #fff4d4, #eddaaa);
}
.chest-dialog .chest-tier[data-status="claimed"] { background: linear-gradient(145deg, #f2f4e5, #e7e9cf); }
.chest-dialog .chest-reward strong { color: var(--round-ink); }

@media (orientation: landscape) and (max-height: 540px),
       (min-width: 34rem) and (max-width: 64rem) and (min-aspect-ratio: 5/4),
       (min-width: 34rem) and (any-pointer: coarse) and (min-aspect-ratio: 5/4) {
  .game-shell[data-view="play"] { width: 100%; }
  .play-screen {
    --round-edge: clamp(7px, 2.65dvh, 16px);
    --round-control-size: 44px;
    --round-stat-art: clamp(16px, 5.5dvh, 25px);
    grid-template-columns: clamp(175px, 31%, 248px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 5px 8px;
    background-position: center 57%;
  }
  .round-panel { overflow: auto; padding: 0 2px 4px; overscroll-behavior: contain; }
  .round-heading h2 { font-size: clamp(17px, 5.2dvh, 24px); }
  .play-header { gap: 4px; }
  .round-hud { padding-inline: 4px; }
  .round-stat { padding-inline: 2px; column-gap: 3px; }
  .round-stat > img { width: 17px; }
  .round-stat dd strong { font-size: clamp(15px, 4.2dvh, 22px); }
  .round-stat > .icon { width: 13px; height: 13px; }
  .round-clock dd small { font-size: 9px; }
  .round-objectives { grid-template-columns: minmax(0, 1fr); }
  .round-star-button { grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 7px; min-height: 40px; }
  .round-star-icons img { width: 14px; }
  .goal { --goal-icon-size: 24px; min-height: 41px; padding: 4px; }
  .goal-readout small { font-size: 10px; }
  .goal-readout strong { font-size: 14px; }
  .battle-panel { grid-area: 1 / 2 / 3; }
  .battle-panel .burrows { inset: 1% 2%; }
  .stage-tip { grid-area: 2 / 1; margin: 0; padding: 4px 7px; }
}
@media (max-height: 540px) {
  .game-dialog:is([data-round-panel], .chest-dialog) { --round-close: 40px; --round-reserve: calc(var(--round-close) + 10px); }
  .game-dialog:is([data-round-panel], .chest-dialog)[open] .dialog-close { top: calc(100% + 8px); }
  .game-dialog[data-round-panel] .round-dialog-heading { min-height: 67px; padding-block: 7px; }
  .game-dialog[data-round-panel] .round-dialog-heading h2 { font-size: clamp(21px, 6.4dvh, 29px); }
  .round-dialog-rating { margin-top: 3px; }
}
@media (hover: hover) {
  .round-control:hover:not(:disabled), .round-star-button:hover:not(:disabled) { filter: brightness(1.12); }
  .battle-item:hover:not(:disabled) { border-color: #b1874e; }
}
