:root {
  color-scheme:dark;
  --paper:#101625;
  --ink:#eff1fb;
  --muted:#aab5ce;
  --line:#35415c;
  --mint:#9debd9;
  --gold:#edcf87;
  --peach:#f2baa5;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:radial-gradient(ellipse at 70% 0,#26345166,transparent 65%);
  min-height:100dvh;
}
button,select {
  font:inherit;
}
button {
  cursor:pointer;
  touch-action:manipulation;
}
button,a {
  -webkit-tap-highlight-color:transparent;
}
button:disabled {
  cursor:default;
}
button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid var(--peach);
  outline-offset:4px;
}
a {
  color:inherit;
}
[hidden] {
  display:none!important;
}
.shell {
  max-width:1100px;
  margin:auto;
  padding:0 36px;
}
.topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:22px 0;
  border-bottom:1px solid var(--line);
}
.wordmark {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  font-weight:750;
  letter-spacing:1.8px;
}
.brand-mark {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid #728798;
  border-radius:10px;
  background:#293f47;
  color:var(--mint);
  font-size:24px;
  font-weight:400;
}
.brand-mark svg {
  display:block;
  width:100%;
  height:100%;
}
.topbar nav {
  display:flex;
  gap:22px;
}
.text-button {
  color:var(--muted);
  border:0;
  background:none;
  padding:10px 0;
  font-size:12px;
  min-height:44px;
}
.text-button:hover {
  color:var(--mint);
}
.intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  padding:34px 0;
}
.eyebrow {
  color:var(--muted);
  font-size:10px;
  letter-spacing:1.8px;
  line-height:1.4;
  margin:0 0 12px;
  font-weight:600;
}
h1 {
  font-size:70px;
  font-weight:800;
  line-height:1;
  letter-spacing:-4px;
  margin:0 0 16px;
}
h1 span {
  color:var(--mint);
}
h2 {
  font-size:32px;
  letter-spacing:-1.2px;
  line-height:1.15;
  font-weight:700;
  margin:0 0 20px;
}
.subtitle {
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}
.record {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
  flex-shrink:0;
}
.record>span {
  color:var(--muted);
  font-size:11px;
}
.record strong {
  font-size:42px;
  letter-spacing:-2px;
  font-variant-numeric:tabular-nums;
}
.record small {
  color:var(--muted);
  font-size:11px;
}
.record #crystals,.record #stars {
  color:var(--gold);
}
/* На карте и в поле используются одни цвета фигур и состояний. */
#mode-panel {
  display:block;
  margin-bottom:24px;
  border:1px solid var(--line);
  border-radius:20px;
  background:#192337aa;
  padding:20px;
}
.mode-choice {
  display:grid;
  grid-template-columns:140px 180px 1fr;
  gap:16px;
  align-items:center;
}
.mode-choice label {
  color:var(--muted);
  font-size:10px;
  letter-spacing:1.6px;
}
#mode {
  color:var(--mint);
  border:1px solid #64807e;
  border-radius:12px;
  background:#243c45;
  padding:12px;
  font-size:16px;
  font-weight:700;
  width:100%;
  min-height:48px;
}
#mode-description {
  margin:0;
  font-size:12px;
  color:var(--muted);
  line-height:1.6;
}
#mode-panel[data-mode="7"] #mode {
  color:#e0e7fa;
  background:#2d3851;
  border-color:#8593af;
}
#mode-panel[data-mode="3"] #mode {
  color:var(--gold);
  background:#3e382c;
  border-color:#ab9565;
}
#trial-panel {
  border-top:1px solid var(--line);
  margin-top:18px;
  padding-top:18px;
}
#trial-panel p {
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}
#trial-chapters {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
#trial-chapters button {
  white-space:normal;
  text-align:left;
  line-height:1.5;
  min-height:76px;
}
#trial-resume,#trial-buy {
  max-width:380px;
}
#campaign {
  padding:26px;
  margin-bottom:24px;
  border:1px solid var(--line);
  border-radius:26px;
  background:radial-gradient(ellipse at 85% 0,#29345188,transparent 65%),#171e30;
  box-shadow:inset 0 1px 0 #c9d8ff0a;
}
.chapter-head {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}
.chapter-head>span {
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}
#campaign h2 {
  margin:8px 0 16px;
}
.campaign-goal {
  font-size:18px;
  line-height:1.5;
  max-width:700px;
  margin:0 0 10px;
}
#campaign #start {
  max-width:340px;
  margin:24px 0;
}
#level-map {
  border-top:1px solid var(--line);
  padding-top:14px;
}
summary {
  cursor:pointer;
  font-size:14px;
  min-height:44px;
  padding:12px 0;
}
.chapters>section>h3 {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:13px;
  color:var(--muted);
  font-weight:500;
  margin:18px 0 12px;
}
.chapter-mark {
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:36px;
  height:36px;
  color:var(--mint);
  background:#273447;
  border:1px solid #4c6170;
  border-radius:12px;
  font-size:24px;
}
.level-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:12px 0 24px;
}
.level-card {
  display:grid;
  gap:9px;
  text-align:left;
  color:var(--ink);
  background:linear-gradient(135deg,#27324a,#1d263b);
  border:1px solid #485773;
  border-radius:16px;
  padding:18px;
}
.level-card strong {
  color:var(--mint);
  font-size:21px;
  font-variant-numeric:tabular-nums;
}
.level-card>span {
  font-size:13px;
  line-height:1.5;
}
.level-card small {
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
}
.level-card.done {
  border-color:#436766;
}
.level-card:enabled:hover {
  background:#2c3b51;
  border-color:var(--mint);
}
.level-card:disabled {
  background:#171f31;
  color:#96a3be;
  border-color:#303b54;
}
.level-card:disabled strong {
  color:#9ba9c2;
}
.experience {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 16px;
  margin-top:24px;
  color:var(--muted);
  font-size:12px;
}
.experience progress {
  accent-color:var(--mint);
  width:160px;
  height:7px;
  border:0;
  border-radius:8px;
  background:var(--line);
  overflow:hidden;
}
progress::-webkit-progress-bar {
  background:var(--line);
}
progress::-webkit-progress-value {
  background:var(--mint);
}
progress::-moz-progress-bar {
  background:var(--mint);
}
.skills {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.upgrade {
  margin-top:22px;
  padding:20px;
  background:#242e45;
  border:1px solid var(--line);
  border-radius:16px;
}
.upgrade h3 {
  font-size:18px;
  margin:0 0 10px;
}
.upgrade p {
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
  margin:7px 0;
}
.skills small {
  display:block;
  color:var(--muted);
  font-size:11px;
  line-height:1.6;
}
.economy-note {
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
  margin:20px 0 0;
  max-width:800px;
}
.playing .intro {
  padding:16px 0;
}
.playing .intro .eyebrow,.playing .intro .subtitle {
  display:none;
}
.playing h1 {
  font-size:42px;
  letter-spacing:-2.5px;
  margin:0;
}
.playing .record {
  display:grid;
  grid-template-columns:auto auto;
  gap:4px 10px;
  text-align:right;
}
.playing .record>span,.playing .record>strong {
  grid-column:1/-1;
}
.playing .record strong {
  font-size:28px;
  line-height:1;
  letter-spacing:-1px;
}
.game {
  background:radial-gradient(ellipse at 60% 0,#29365499,transparent 70%),linear-gradient(145deg,#1b2236,#121828);
  border:1px solid #3d4962;
  border-radius:28px;
  padding:24px 28px 0;
  overflow:hidden;
  box-shadow:inset 0 1px 0 #c9d8ff17,0 18px 40px #03081733;
}
.game-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.game-top>div {
  display:flex;
  flex-direction:column;
  gap:5px;
}
.game-top .eyebrow {
  margin:0;
  font-size:9px;
  letter-spacing:1.6px;
}
#level-label {
  font-size:17px;
  font-weight:600;
  letter-spacing:-.4px;
}
.game-meta {
  align-items:flex-end;
  text-align:right;
}
#play-mode {
  color:var(--mint);
  font-size:10px;
  line-height:1.4;
}
#best-label {
  color:var(--muted);
  font-size:10px;
}
.goal {
  margin-top:20px;
}
.goal.met {
  background:#24413f66;
  box-shadow:0 0 0 8px #24413f66;
  border-radius:8px;
}
.goal-heading {
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:var(--muted);
  font-size:9px;
  letter-spacing:1.6px;
  margin-bottom:8px;
}
#goal-state {
  letter-spacing:0;
}
.goal.met #goal-state {
  color:#101625;
  background:var(--mint);
  border-radius:4px;
  padding:0 6px;
  font-weight:700;
}
.goal.met #goal-title {
  color:var(--mint);
}
#goal-title {
  margin:0 0 8px;
  font-size:16px;
  line-height:1.4;
  font-weight:500;
}
#goal-progress {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  color:var(--muted);
  font-size:11px;
}
#goal-progress>span {
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:7px;
}
#goal-progress .complete {
  color:var(--mint);
  background:#24413f66;
  border-color:#436d66;
}
#star-progress {
  color:var(--gold);
  font-size:11px;
  line-height:1.4;
  margin:9px 0 0;
}
#trial-attempt {
  margin:0 0 10px;
  color:var(--muted);
  font-size:10px;
  letter-spacing:.3px;
}
.bag-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  margin-top:16px;
  padding:13px 0;
}
.bag-label {
  font-size:11px;
  color:var(--muted);
}
.bag-label b {
  font-weight:400;
  color:var(--ink);
  margin-left:6px;
}
.bag {
  display:flex;
  gap:22px;
}
.bag-item {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-variant-numeric:tabular-nums;
}
.bag-item.exhausted {
  opacity:.4;
}
.shape {
  display:block;
  width:30px;
  height:30px;
  flex-shrink:0;
}
.shape.circle {
  border-radius:50%;
  background:linear-gradient(135deg,#c4ffeb,#82cfbf);
  box-shadow:inset 0 1px 2px #fff9,0 0 18px #83ead348;
}
.shape.triangle {
  background:linear-gradient(135deg,#ffe1d1,#e99d90);
  clip-path:polygon(50% 0,100% 100%,0 100%);
}
.shape.square {
  border-radius:7px;
  background:linear-gradient(135deg,#ddd7ff,#9684dd);
  box-shadow:inset 0 1px 2px #fff8,0 0 16px #bc99ff40;
}
.bag .shape {
  width:12px;
  height:12px;
  box-shadow:none;
}
.bag .shape.square {
  border-radius:3px;
}
.field-stage {
  position:relative;
}
.draw-zone {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:18px;
  padding:22px 0;
  min-height:108px;
}
.pending {
  display:grid;
  place-items:center;
  width:60px;
  height:60px;
  border:1px dashed #65748b;
  border-radius:50%;
  flex-shrink:0;
  background:#1c273b;
}
.pending.has-shape {
  border:1px solid #729c9c;
  background:radial-gradient(circle,#3c6c6a55,#223641);
  box-shadow:0 0 26px #72d7cf13;
}
.pending .shape {
  width:30px;
  height:30px;
  animation:appear .18s ease-out;
}
.unknown {
  color:var(--mint);
  font-size:29px;
  font-weight:400;
}
.draw-copy {
  max-width:340px;
}
.draw-copy p {
  font-size:17px;
  margin:0 0 7px;
  font-weight:500;
}
.draw-copy>span {
  display:block;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
.board {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:8px;
}
.cell {
  display:grid;
  place-items:center;
  position:relative;
  aspect-ratio:1;
  min-height:52px;
  min-width:0;
  padding:0;
  border:1px solid #495878;
  border-radius:15px;
  background:linear-gradient(150deg,#283653,#1c273e);
  box-shadow:inset 0 1px 0 #9eb4ee23,0 6px 12px #0003;
  color:var(--mint);
  transition:background .16s,border-color .16s,box-shadow .16s;
}
.cell:enabled {
  background:#243e49;
  border-color:#79c9be;
}
.cell:enabled:hover {
  background:#2e515a;
  border-color:var(--mint);
  box-shadow:0 0 0 4px #75e5d414,0 0 22px #75e5d423;
}
.cell:enabled::after {
  content:'+';
  font-size:24px;
  font-weight:300;
}
.cell.occupied:enabled::after {
  display:none;
}
.cell .shape {
  width:46%;
  height:46%;
}
.cell.occupied {
  border-color:#4d5c7a;
}
.cell.selected {
  outline:3px solid var(--gold);
  outline-offset:3px;
}
.cell .ghost {
  position:absolute;
  animation:vanish .5s ease-out forwards;
  pointer-events:none;
}
.cell.cleared {
  animation:clear .55s ease-out;
}
.cell-number {
  position:absolute;
  top:4px;
  left:6px;
  font-size:9px;
  color:var(--muted);
}
.board-caption {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:16px 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
#points-caption {
  display:grid;
  grid-template-columns:1fr 1fr 1.8fr;
  gap:6px;
  font-size:11px;
}
#points-caption>span {
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:5px 3px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#10172566;
}
#points-caption b {
  color:var(--ink);
  font-weight:500;
}
#points-caption>span>span {
  color:var(--mint);
  font-weight:600;
}
.five-reward {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  column-gap:5px;
}
.star-reward {
  color:var(--gold);
  white-space:nowrap;
}
#star-reward-note, .reward-note {
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
  margin:0;
}
.ring-game .field-stage {
  display:grid;
}
.ring-game .draw-zone,.ring-game .board {
  grid-area:1/1;
}
.ring-game .draw-zone {
  align-self:center;
  padding:0;
  min-height:0;
  pointer-events:none;
  z-index:2;
}
.ring-game .draw-copy {
  display:none;
}
.ring-game .pending {
  position:relative;
  width:56px;
  height:56px;
}
.ring-game .pending::before {
  content:attr(data-label);
  position:absolute;
  top:-22px;
  left:50%;
  transform:translateX(-50%);
  color:var(--muted);
  font-size:9px;
  letter-spacing:1px;
  text-transform:uppercase;
  white-space:nowrap;
}
.board.ring {
  display:block;
  position:relative;
  width:300px;
  height:300px;
  margin:12px auto 0;
}
.board.ring::before {
  content:'';
  position:absolute;
  inset:12%;
  border:1px solid #50607e;
  border-radius:50%;
}
:is(.ring,.loops) .cell {
  position:absolute;
  left:var(--x);
  top:var(--y);
  transform:translate(-50%,-50%);
  width:58px;
  height:58px;
  min-height:0;
  aspect-ratio:1;
  z-index:1;
}
:is(.ring,.loops) .cell:active:enabled {
  transform:translate(-50%,calc(-50% + 1px));
}
:is(.ring,.loops) .cell .shape {
  width:29px;
  height:29px;
}
#ring-join,#loop-links {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
#ring-join path {
  fill:none;
  stroke:var(--gold);
  stroke-width:1.5;
}
#loop-links path {
  fill:none;
  stroke:#617697;
  stroke-width:.7;
}
.loops-game .field-stage {
  display:grid;
  grid-template-columns:72px 1fr;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:390px;
  margin:auto;
}
.loops-game .draw-zone {
  padding:0;
  min-height:0;
  flex-direction:column;
  gap:8px;
  align-self:center;
}
.loops-game .draw-copy {
  display:none;
}
.loops-game .pending {
  width:48px;
  height:48px;
  position:relative;
}
.loops-game .pending::before {
  content:attr(data-label);
  position:absolute;
  top:-20px;
  color:var(--muted);
  font-size:9px;
  white-space:nowrap;
}
.loops-game .pending .shape {
  width:25px;
  height:25px;
}
.board.loops {
  display:block;
  position:relative;
  width:280px;
  height:300px;
  margin:12px auto 0;
}
.loops .cell {
  width:54px;
  height:54px;
}
.loops .hub {
  border-color:#a49bcf;
  box-shadow:0 0 22px #b5a1e719;
}
#match-gain {
  position:absolute;
  top:8px;
  right:0;
  color:var(--mint);
  font-size:25px;
  font-weight:700;
  pointer-events:none;
  text-shadow:0 0 20px #8cebd75c;
  animation:gain .8s ease-out both;
}
.status {
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:48px;
  margin:0 -28px;
  padding:12px 20px;
  background:#10172599;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  border-top:1px solid #344159;
}
.status.positive {
  color:var(--mint);
}
.status.negative {
  color:var(--peach);
}
.controls {
  display:grid;
  gap:18px;
  padding:22px 0;
}
.scores {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.score {
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:3px 0;
}
.score>span {
  font-size:11px;
  color:var(--muted);
}
.score strong {
  font-size:40px;
  font-weight:650;
  line-height:1.1;
  letter-spacing:-1.8px;
  font-variant-numeric:tabular-nums;
}
.score small {
  font-size:10px;
  color:var(--muted);
  line-height:1.4;
}
.score.saved {
  padding-left:18px;
  border-left:1px solid var(--line);
}
.score.saved strong {
  color:var(--mint);
}
.score.banked strong {
  animation:banked .6s ease-out;
}
.actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.primary,.secondary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  min-height:48px;
  padding:13px 18px;
  border:1px solid transparent;
  border-radius:14px;
  font-size:13px;
  font-weight:600;
  line-height:1.4;
  transition:background .15s,transform .15s,border-color .15s;
}
.primary {
  background:var(--mint);
  color:#183638;
  box-shadow:inset 0 1px 0 #ffffff88,0 4px 18px #83dbc710;
}
.primary:hover:enabled {
  background:#b8f9e9;
}
.secondary {
  background:#242e44;
  color:var(--ink);
  border-color:#4a5771;
}
.secondary:hover:enabled {
  background:#32415a;
  border-color:#738cac;
}
.primary:active:enabled,.secondary:active:enabled {
  transform:translateY(1px);
}
.primary:disabled,.secondary:disabled {
  background:#232c40;
  color:#909db8;
  border-color:#354158;
  box-shadow:none;
}
.primary span,.secondary span {
  font-size:18px;
}
.ability-controls {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:20px;
}
.ability-controls .secondary {
  min-height:44px;
  padding:10px 12px;
  font-size:12px;
}
.ability-controls small {
  display:block;
  color:var(--muted);
  font-size:10px;
  line-height:1.5;
  margin-top:7px;
}
#move-cancel {
  grid-column:1/-1;
  text-align:center;
}
.result-heading {
  display:flex;
  align-items:center;
  gap:14px;
  padding:4px 0 16px;
  border-bottom:1px solid var(--line);
  animation:result .35s ease-out;
}
#result-symbol {
  display:grid;
  place-items:center;
  width:54px;
  height:54px;
  flex-shrink:0;
  color:var(--gold);
  border:1px solid #80704d;
  border-radius:50%;
  background:radial-gradient(circle,#66552f33,transparent);
  font-size:30px;
  text-shadow:0 0 22px #e6c17b33;
}
#result-kicker {
  color:var(--muted);
  font-size:9px;
  letter-spacing:1.5px;
}
#result-title {
  font-size:27px;
  margin:7px 0 0;
}
.result-heading.lost #result-symbol {
  color:var(--peach);
  border-color:#8a6058;
}
.notice {
  padding:16px;
  margin-bottom:18px;
  color:var(--peach);
  border:1px solid #966a5e;
  background:#372b31;
  border-radius:14px;
  font-size:12px;
  line-height:1.6;
}
.notice p {
  margin:0 0 10px;
}
.notice button {
  width:auto;
  font-size:12px;
}
footer {
  display:flex;
  justify-content:space-between;
  gap:16px;
  color:var(--muted);
  border-top:1px solid var(--line);
  padding:20px 0 26px;
  font-size:10px;
  line-height:1.5;
}
dialog {
  color:var(--ink);
  background:linear-gradient(150deg,#242f46,#171e30);
  border:1px solid #52617c;
  border-radius:24px;
  padding:34px;
  max-width:560px;
  width:calc(100% - 28px);
  max-height:90dvh;
  box-shadow:0 20px 100px #0008;
}
dialog::backdrop {
  background:#080d19bf;
  backdrop-filter:blur(5px);
}
dialog .close {
  position:absolute;
  top:10px;
  right:12px;
  width:44px;
  height:44px;
  border:0;
  background:none;
  color:var(--muted);
  font-size:30px;
}
dialog ol {
  font-size:13px;
  line-height:1.7;
  padding-left:21px;
}
dialog li {
  padding-left:5px;
  margin-bottom:13px;
}
.rules-note {
  color:var(--muted);
  font-size:12px;
  line-height:1.7;
  border-top:1px solid var(--line);
  padding-top:16px;
  margin-bottom:20px;
}
.dialog-actions {
  display:grid;
  gap:10px;
}
.settings-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:24px 0;
  font-size:13px;
}
.settings-row button {
  width:auto;
  flex-shrink:0;
}
.secondary.danger {
  color:var(--peach);
  border-color:var(--peach);
}
#reset-description, #reset-description + p {
  font-size:14px;
  line-height:1.6;
}
#welcome {
  max-width:470px;
}
#welcome[open] {
  display:flex;
  flex-direction:column;
}
#tip-content {
  min-height:0;
  overflow-y:auto;
}
#welcome>.eyebrow, .tip-footer, .tip-actions, #welcome-skip {
  flex-shrink:0;
}
#tip-step {
  padding-right:30px;
  margin:0 0 12px;
}
#tip-title {
  font-size:29px;
  line-height:1.12;
  letter-spacing:-.9px;
  margin:18px 0 14px;
}
#tip-title:focus {
  outline:none;
}
#tip-body {
  font-size:15px;
  line-height:1.65;
  margin:0 0 14px;
  color:var(--muted);
}
#tip-body strong {
  color:var(--ink);
}
.tip-art {
  display:block;
  width:100%;
  max-height:165px;
  overflow:visible;
  border-radius:18px;
  background:radial-gradient(ellipse at 30% 40%,#43587866,transparent 70%),#111a2b;
}
.tip-art text {
  font:10px Arial,Helvetica,sans-serif;
  fill:var(--muted);
  letter-spacing:.8px;
}
.tip-art .tip-number {
  font-size:41px;
  font-weight:700;
  letter-spacing:-1px;
  fill:var(--ink);
}
.tip-art .tip-label {
  font-size:16px;
  fill:var(--ink);
  letter-spacing:0;
}
.tip-panel { fill:#243149; stroke:#52617c; stroke-width:1.5; }
.tip-line { fill:none; stroke:#aab5ce; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.tip-art .mint { fill:var(--mint); }
.tip-art .peach { fill:var(--peach); }
.tip-art .lavender { fill:#c6b9f1; }
.tip-art .gold { fill:var(--gold); }
.tip-art .dark text, .tip-art text.dark { fill:var(--paper); }
.tip-art .mint-stroke { stroke:var(--mint); }
.tip-art .peach-stroke { stroke:var(--peach); }
.tip-art .gold-stroke { stroke:var(--gold); }
.tip-note {
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  margin:0;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.tip-prices {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  font-size:12px;
  color:var(--muted);
}
.tip-prices>span {
  text-align:center;
  padding:10px 4px;
  background:#101725;
  border:1px solid var(--line);
  border-radius:12px;
}
.tip-prices b {
  display:block;
  color:var(--mint);
  margin-top:4px;
}
.tip-prices .star-reward {
  display:block;
}
.reward-note {
  margin-top:8px;
}
.tip-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:22px 0 14px;
  color:var(--muted);
  font-size:11px;
}
#tip-dots { display:flex; gap:6px; }
#tip-dots span { width:6px; height:6px; border-radius:50%; background:#536079; }
#tip-dots .current { width:22px; border-radius:4px; background:var(--mint); }
.tip-actions {
  display:grid;
  grid-template-columns:1fr 1.5fr;
  gap:10px;
}
.tip-actions button {
  justify-content:center;
}
#welcome-skip {
  display:block;
  margin:10px auto 0;
}
@media(max-width:360px) {
  #tip-title { font-size:25px; }
  #tip-body { font-size:14px; line-height:1.55; }
  .tip-art { max-height:135px; }
  .tip-footer { margin-top:16px; }
}
@media(max-width:600px) and (max-height:700px) {
  #welcome { padding:22px 18px; }
  .tip-art { max-height:100px; }
  #tip-title { font-size:24px; margin:12px 0 10px; }
  #tip-body { font-size:14px; line-height:1.5; margin-bottom:10px; }
  .tip-note { font-size:11px; line-height:1.5; padding-top:10px; }
  .tip-footer { margin:12px 0 10px; }
  #welcome-skip { margin-top:6px; }
}
@keyframes appear {
  from {
    transform:scale(.75);
    opacity:.4;
  }
  to {
    transform:scale(1);
    opacity:1;
  }
}
@keyframes vanish {
  from {
    transform:scale(1);
    opacity:1;
  }
  to {
    transform:scale(1.45);
    opacity:0;
  }
}
@keyframes clear {
  from {
    background:#426c68;
    box-shadow:0 0 25px #9debd955;
  }
  to {
    background:#243e49;
  }
}
@keyframes banked {
  50% {
    color:#d6fff1;
    text-shadow:0 0 22px #8cebd766;
    transform:translateY(-2px);
  }
}
@keyframes gain {
  from {
    transform:translateY(8px);
    opacity:0;
  }
  25%,70% {
    opacity:1;
  }
  to {
    transform:translateY(-6px);
    opacity:0;
  }
}
@keyframes result {
  from {
    transform:translateY(6px);
    opacity:0;
  }
  to {
    transform:translateY(0);
    opacity:1;
  }
}
@media(min-width:900px) {
  #play {
    display:grid;
    grid-template-columns:minmax(0,1fr) 280px;
    grid-template-rows:auto 1fr;
    gap:22px 28px;
    align-items:start;
  }
  #play .game {
    grid-row:1/3;
  }
  #play .controls {
    padding:16px 0 0;
  }
  #play .ability-controls {
    grid-column:2;
    grid-template-columns:1fr;
  }
  #play .actions {
    grid-template-columns:1fr;
  }
}
@media(min-width:601px) and (max-width:899px) {
  .controls {
    grid-template-columns:1fr 1fr;
    align-items:center;
    gap:24px;
  }
  .result-heading {
    grid-column:1/-1;
  }
}
@media(max-width:700px) {
  .mode-choice {
    grid-template-columns:1fr 1fr;
    gap:12px;
  }
  #mode-description {
    grid-column:1/-1;
  }
  #trial-chapters {
    grid-template-columns:1fr;
  }
  #trial-chapters button {
    min-height:48px;
  }
}
@media(max-width:600px) {
  .shell {
    padding:0 16px;
  }
  .topbar {
    padding:10px 0;
    gap:10px;
  }
  .wordmark {
    font-size:10px;
    letter-spacing:1px;
    gap:7px;
  }
  .brand-mark {
    width:26px;
    height:26px;
    font-size:20px;
  }
  .topbar nav {
    gap:14px;
  }
  .text-button {
    font-size:11px;
  }
  .intro {
    padding:24px 0;
    gap:12px;
  }
  .intro .eyebrow {
    font-size:8px;
    letter-spacing:1px;
  }
  h1 {
    font-size:46px;
    letter-spacing:-2.6px;
  }
  h2 {
    font-size:28px;
  }
  .subtitle {
    font-size:12px;
  }
  .record>span {
    font-size:9px;
  }
  .record strong {
    font-size:32px;
  }
  .record small {
    font-size:9px;
  }
  #mode-panel {
    padding:16px;
    margin-bottom:16px;
  }
  #campaign {
    padding:20px 16px;
    border-radius:22px;
  }
  .chapter-head {
    display:block;
  }
  .chapter-head>span {
    display:block;
    margin-bottom:14px;
    font-size:11px;
  }
  .campaign-goal {
    font-size:16px;
  }
  .level-grid,.skills {
    grid-template-columns:1fr;
  }
  .skills {
    gap:0;
  }
  .upgrade {
    margin-top:14px;
    padding:16px;
  }
  .playing .topbar {
    padding:4px 0;
  }
  .playing .intro {
    padding:12px 0;
  }
  .playing h1 {
    font-size:34px;
    letter-spacing:-1.8px;
  }
  .playing .record strong {
    font-size:24px;
  }
  .game {
    padding:16px 16px 0;
    border-radius:22px;
  }
  .game-top .eyebrow {
    font-size:8px;
    letter-spacing:1.1px;
  }
  #level-label {
    font-size:15px;
  }
  #play-mode {
    max-width:135px;
    font-size:9px;
  }
  #best-label {
    font-size:9px;
  }
  .goal {
    margin-top:14px;
  }
  .goal-heading {
    font-size:8px;
    margin-bottom:6px;
  }
  #goal-title {
    font-size:14px;
    margin-bottom:6px;
  }
  #goal-progress {
    gap:5px;
    font-size:10px;
  }
  #goal-progress>span {
    padding:3px 6px;
  }
  #star-progress {
    font-size:10px;
    margin-top:7px;
  }
  #trial-attempt {
    font-size:9px;
    margin-bottom:7px;
  }
  .bag-row {
    padding:10px 0;
    margin-top:12px;
  }
  .bag {
    gap:17px;
  }
  .bag-item {
    font-size:12px;
    gap:6px;
  }
  .draw-zone {
    min-height:90px;
    padding:14px 0;
    gap:14px;
  }
  .pending {
    width:50px;
    height:50px;
  }
  .draw-copy p {
    font-size:14px;
    margin-bottom:5px;
  }
  .draw-copy>span {
    font-size:11px;
  }
  .board {
    gap:5px;
  }
  .cell {
    min-height:48px;
    border-radius:10px;
  }
  .cell .shape {
    width:55%;
    height:42%;
  }
  .cell .shape.circle {
    aspect-ratio:1;
    height:auto;
  }
  .cell .shape.square {
    aspect-ratio:1;
    height:auto;
    border-radius:4px;
  }
  .board.ring {
    width:244px;
    height:244px;
    margin-top:12px;
  }
  .ring .cell {
    width:50px;
    height:50px;
    border-radius:14px;
  }
  .ring .cell .shape {
    width:25px;
    height:25px;
  }
  .ring-game .pending {
    width:46px;
    height:46px;
  }
  .ring-game .pending .shape {
    width:25px;
    height:25px;
  }
  .loops-game .field-stage {
    grid-template-columns:42px 1fr;
    gap:4px;
  }
  .loops-game .pending {
    width:38px;
    height:38px;
  }
  .loops-game .pending .shape {
    width:21px;
    height:21px;
  }
  .board.loops {
    width:208px;
    height:224px;
    margin:12px auto 0;
  }
  .loops .cell {
    width:46px;
    height:46px;
    border-radius:12px;
  }
  .loops .cell .shape {
    width:24px;
    height:24px;
  }
  .board-caption {
    margin:10px 0;
    font-size:9px;
  }
  .status {
    margin:0 -16px;
    padding:10px 14px;
    font-size:11px;
    min-height:42px;
  }
  .controls {
    padding:14px 0;
    gap:12px;
  }
  .score strong {
    font-size:32px;
  }
  .score>span {
    font-size:10px;
  }
  .score small {
    font-size:9px;
  }
  .primary,.secondary {
    padding:12px;
    font-size:12px;
  }
  .ability-controls {
    gap:10px;
    margin-bottom:16px;
  }
  .ability-controls .secondary {
    font-size:11px;
  }
  .ability-controls small {
    font-size:9px;
    margin-top:5px;
  }
  #result-title {
    font-size:24px;
  }
  footer {
    font-size:9px;
    padding:16px 0;
  }
  dialog {
    padding:30px 22px;
  }
}
@media(max-width:360px) {
  .shell {
    padding:0 12px;
  }
  .topbar nav {
    gap:10px;
  }
  .wordmark {
    font-size:9px;
  }
  .brand-mark {
    width:23px;
    height:23px;
  }
  h1 {
    font-size:39px;
  }
  .playing h1 {
    font-size:31px;
  }
  .game {
    padding-left:12px;
    padding-right:12px;
  }
  .status {
    margin-left:-12px;
    margin-right:-12px;
  }
  .board {
    gap:4px;
  }
  .board.ring {
    width:232px;
    height:232px;
  }
  .ring .cell {
    width:48px;
    height:48px;
  }
  .board.loops {
    width:204px;
  }
  .game-top .eyebrow {
    letter-spacing:.5px;
  }
  #play-mode {
    max-width:112px;
  }
  .board-caption {
    font-size:8px;
  }
}
@media(min-width:900px) and (max-height:800px) {
  .topbar {
    padding:10px 0;
  }
  .playing .intro {
    padding:12px 0;
  }
  .game {
    padding-top:18px;
  }
  .goal {
    margin-top:14px;
  }
  .bag-row {
    margin-top:12px;
    padding:10px 0;
  }
  .board.ring {
    width:270px;
    height:270px;
  }
  .board.loops {
    width:250px;
    height:270px;
  }
  :is(.ring,.loops) .cell {
    width:52px;
    height:52px;
  }
  .board-caption {
    margin:10px 0;
  }
}
@media(max-width:600px) and (max-height:850px) {
  .playing .intro {
    padding:8px 0;
  }
  .playing .record>span {
    grid-column:1;
    max-width:48px;
    align-self:center;
  }
  .playing .record>strong {
    grid-column:2;
    grid-row:1;
  }
  .goal {
    margin-top:10px;
  }
  .goal-heading {
    margin-bottom:4px;
  }
  #goal-title {
    margin-bottom:4px;
  }
  #star-progress {
    margin-top:5px;
  }
  .bag-row {
    margin-top:8px;
    padding:8px 0;
  }
  .board.ring {
    width:200px;
    height:200px;
    margin-top:8px;
  }
  .ring .cell {
    width:46px;
    height:46px;
  }
  .board.loops {
    height:208px;
    margin-top:8px;
  }
  .board-caption {
    margin:3px 0;
    gap:2px;
  }
  #points-caption>span {
    padding:4px 3px;
  }
  .controls {
    padding:8px 0;
    gap:6px;
  }
  .score {
    display:grid;
    grid-template-columns:auto 1fr;
    gap:4px 8px;
    align-items:center;
  }
  .score>span {
    grid-column:1/-1;
  }
  .score strong {
    font-size:30px;
  }
  .score small {
    max-width:95px;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
  .cell .ghost {
    display:none;
  }
  #match-gain {
    opacity:1;
  }
}
