:root {
  color-scheme:dark;
  --table:#123e38;
  --deep:#0c2b28;
  --ink:#17322e;
  --cream:#f7f3e9;
  --muted:#b4cbc0;
  --gold:#e9c786;
  --line:#ffffff24;
  --heart:#b43b40;
  --card-height:clamp(66px,9.8vw,142px);
  --radius:9px;
  --rank-size:clamp(16px,2.1vw,29px);
  --card-shadow:0 1px 0 #0003,0 3px 5px #0002;
  font-family:Arial,Helvetica,sans-serif;
  font-size:16px;
  color:var(--cream);
  background:var(--deep)
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background-color:var(--body-color,#08271f);
  background-image:linear-gradient(var(--body-shade-top,#061d164d),var(--body-shade-bottom,#061d1680)),var(--theme-table,url('./themes/emerald-nocturne/table.webp'));
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  overflow:hidden
}
button,input,select {
  font:inherit
}
button {
  color:inherit;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation
}
button:disabled {
  cursor:default;
  opacity:.42
}
button {
  transition:background .16s,box-shadow .16s
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible {
  outline:3px solid var(--gold);
  outline-offset:4px
}
button:hover:not(:disabled) {
  background-color:#ffffff12
}
button:active:not(:disabled) {
  filter:brightness(1.1)
}
.app-shell {
  height:100dvh;
  max-width:1540px;
  margin:auto;
  display:flex;
  flex-direction:column;
  padding:0 38px
}
.header {
  height:99px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  flex-shrink:0
}
.brand {
  display:flex;
  gap:15px;
  align-items:center
}
.brand-suits {
  position:relative;
  font:40px Georgia,serif;
  color:var(--cream);
  width:49px;
  line-height:1
}
.brand-suits span {
  font-size:26px;
  position:absolute;
  left:23px;
  top:18px;
  color:var(--gold)
}
h1 {
  font:34px/1 Georgia,'Times New Roman',serif;
  letter-spacing:-1px;
  margin:0
}
.brand-caption {
  display:block;
  font:10px/1.8 Arial,sans-serif;
  letter-spacing:2.3px;
  margin-top:8px;
  color:var(--muted)
}
nav {
  display:flex;
  gap:16px
}
button.quiet {
  border:0;
  background:transparent;
  border-radius:8px;
  min-height:44px;
  padding:8px 12px;
  display:inline-flex;
  gap:9px;
  align-items:center;
  font-size:14px
}
nav button span:first-child {
  font-size:20px;
  width:22px
}
main {
  display:flex;
  flex-direction:column;
  min-height:0;
  flex:1
}
.game-meta {
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:61px;
  font-size:13px;
  color:var(--muted)
}
.mode-label {
  letter-spacing:1.8px;
  font-size:11px;
  display:flex;
  gap:12px;
  align-items:center
}
.mode-dot {
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--gold)
}
.divider {
  opacity:.4
}
.counters {
  display:flex;
  gap:24px;
  align-items:center;
  font-variant-numeric:tabular-nums
}
.counters b {
  font-weight:400;
  color:var(--cream);
  font-size:16px;
  margin-right:5px
}
.timer {
  border:0;
  background:none;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:8px;
  border-radius:6px
}
time {
  color:var(--cream)
}
.deck-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:5px 0 28px;
  flex-shrink:0
}
.runs-wrap {
  display:flex;
  gap:15px;
  align-items:center
}
#runs {
  display:flex;
  gap:7px
}
.run-slot {
  width:37px;
  height:49px;
  border:1px solid #ffffff25;
  border-radius:5px;
  display:grid;
  place-items:center;
  font:22px Georgia,serif;
  color:#ffffff25
}
.run-slot.complete {
  background:var(--cream);
  color:var(--ink);
  border-color:var(--cream)
}
.run-slot.complete.heart {
  color:var(--heart)
}
.deck-label {
  font-size:10px;
  letter-spacing:1.5px;
  color:var(--muted)
}
.deck-label b {
  color:var(--cream);
  font-weight:400
}
.run-short {
  display:none
}
.stock {
  border:0;
  background:none;
  display:flex;
  align-items:center;
  gap:17px;
  padding:0 4px;
  min-height:49px;
  border-radius:7px;
  text-align:left
}
#stock-cards {
  display:block;
  width:70px;
  height:49px;
  position:relative
}
.stock-back {
  position:absolute;
  left:calc(var(--i)*7px);
  width:37px;
  height:49px;
  border:1px solid #84927d;
  border-radius:5px;
  box-shadow:1px 2px 3px #0002
}
.stock-copy {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:11px;
  color:var(--muted)
}
.stock-blocked #stock-cards {
  opacity:.45
}
.stock-blocked .stock-copy {
  max-width:140px;
  color:var(--gold)
}
.stock-copy b {
  font-size:14px;
  color:var(--cream);
  font-weight:400
}
.board-scroll {
  flex:1;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#9ab3a366 transparent;
  padding:5px 4px 16px;
  margin:0 -4px
}
.tableau,.column-labels {
  display:grid;
  grid-template-columns:repeat(10,minmax(0,1fr));
  gap:clamp(3px,1.2vw,18px)
}
.column-labels {
  flex-shrink:0;
  height:24px;
  align-items:center;
  font-size:12px;
  color:var(--muted);
  text-align:center;
  font-variant-numeric:tabular-nums;
  pointer-events:none
}
.column-labels span {
  border:1px solid transparent;
  border-radius:4px
}
.column-labels .target-valid {
  border-color:var(--gold);
  border-style:dashed
}
.column-labels .target-hover,.column-labels .hint-target {
  background:var(--gold);
  color:var(--ink);
  border-color:var(--gold);
  border-style:solid;
  font-weight:bold
}
.tableau {
  min-height:100%;
  position:relative
}
.column {
  position:relative;
  min-width:0;
  min-height:100%;
  border-radius:var(--radius)
}
.folded-stack {
  position:absolute;
  inset:0 0 auto;
  width:100%;
  height:44px;
  padding:3px 0;
  border:1px solid #e9c78680;
  border-radius:var(--radius);
  background:var(--back-color,#123129);
  color:var(--gold);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-variant-numeric:tabular-nums;
  line-height:16px;
  touch-action:manipulation
}
.column.compact-column .corner:not(.bottom-corner),.compact-card .corner:not(.bottom-corner) {
  font-size:min(18px,var(--normal-rank-size));
  padding-top:2px;
  padding-bottom:2px
}
.compact-card .bottom-corner {
  font-size:min(12px,calc(var(--normal-rank-size)*.7))
}
.fold-chevron {
  font-size:14px;
  line-height:12px
}
.tucked-order {
  margin-bottom:8px
}
.tucked-cards {
  padding-left:28px;
  margin:0;
  columns:2;
  column-gap:28px
}
.tucked-cards li {
  padding:7px 0;
  break-inside:avoid;
  font-family:Georgia,'Times New Roman',serif
}
.tucked-cards .heart {
  color:var(--heart)
}
@media(max-width:400px) {
  .tucked-cards {
    columns:1
  }
}
.column::before {
  content:attr(data-number);
  height:var(--card-height);
  border:1px solid #ffffff1e;
  border-radius:var(--radius);
  color:#ffffff30;
  display:grid;
  place-items:center;
  position:absolute;
  inset:0 0 auto;
  font:20px Georgia,serif
}
.column.drop-valid::before {
  border:2px dashed var(--gold);
  background:#e9c78612
}
.column.drop-hover::before,.column.hint-destination::before {
  border:3px solid var(--gold);
  background:#e9c7861c;
  box-shadow:0 0 0 3px #123e38
}
.column.drop-valid > .card:last-child {
  outline:3px dashed #735514;
  outline-offset:-3px
}
.column.drop-hover > .card:last-child,.column.hint-destination > .card:last-child {
  outline:3px solid #735514;
  outline-offset:-3px;
  box-shadow:0 0 0 2px var(--gold),var(--card-shadow)
}
.card {
  position:absolute;
  top:var(--top);
  left:0;
  width:100%;
  height:var(--card-height);
  border:1px solid #cdc6b5;
  border-radius:var(--radius);
  padding:0;
  background:var(--cream);
  color:var(--ink);
  box-shadow:var(--card-shadow);
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
  text-align:left;
  overflow:hidden;
  contain:layout style
}
.card:hover:not(:disabled) {
  background-color:#fffdf7
}
.card.face-down,.stock-back {
  background-color:var(--back-color,#123129);
  background-image:var(--theme-back,url('./themes/emerald-nocturne/back.webp'));
  background-size:100% 100%;
  background-position:center;
  background-repeat:no-repeat;
  border-color:#84927d
}
.card.face-down::after,.stock-back::after {
  content:'';
  position:absolute;
  inset:5px;
  border:1px solid #e9c78673;
  border-radius:4px;
  pointer-events:none
}
.stock-back::after {
  inset:3px;
  border-radius:2px
}
.card.heart {
  color:var(--heart)
}
.corner {
  display:flex;
  align-items:baseline;
  gap:4px;
  padding:5px 7px;
  font:700 var(--rank-size)/1 'Times New Roman',Times,serif;
  font-variant-numeric:lining-nums;
  letter-spacing:0
}
.corner .suit {
  font-size:.72em
}
.card-center {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  pointer-events:none;
  text-align:center;
  font:clamp(15px,2.6vw,38px)/1 Georgia,serif
}
.ace .card-center {
  font-size:clamp(23px,4.1vw,59px)
}
.bottom-corner {
  font-size:calc(var(--rank-size)*.7);
  font-weight:400;
  position:absolute;
  right:0;
  bottom:0;
  transform:rotate(180deg)
}
.card.immovable {
  cursor:default
}
.dim-cards .card.immovable {
  background:#c1c9be;
  color:#526358
}
.dim-cards .card.immovable.heart {
  color:#8d5757
}
.card.hint-source,.card.keyboard-selected {
  outline:3px solid var(--gold);
  outline-offset:1px;
  box-shadow:0 0 0 5px #143e38,var(--card-shadow);
  z-index:120!important
}
.card.drag-source {
  opacity:.25
}
.drag-ghost {
  position:fixed;
  left:0;
  top:0;
  z-index:999;
  pointer-events:none;
  will-change:transform;
  filter:drop-shadow(0 12px 12px #0005)
}
.drag-ghost .card {
  box-shadow:0 2px 4px #0005
}
.dragging {
  cursor:grabbing!important
}
.deal-layer {
  position:fixed;
  inset:0;
  overflow:hidden;
  pointer-events:none;
  z-index:800
}
.deal-layer .card {
  position:absolute;
  top:0;
  left:0;
  transform-origin:top left;
  will-change:transform,opacity;
  pointer-events:none;
  box-shadow:0 4px 9px #0004
}
.collection-card {
  border-color:var(--gold);
  box-shadow:0 0 0 1px #e9c78666,0 4px 18px #0005!important
}
.celebration-sprite {
  position:absolute;
  top:0;
  left:0;
  display:grid;
  place-items:center;
  color:var(--gold);
  pointer-events:none;
  will-change:transform,opacity
}
.celebration-sprite img {
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none
}
.celebration-sprite .theme-art:not([hidden]) + span {
  display:none
}
.collection-sparkle {
  filter:drop-shadow(0 0 5px #e9c786aa)
}
.victory-layer {
  position:absolute;
  inset:0;
  overflow:hidden;
  pointer-events:none;
  z-index:10
}
.victory-particle {
  filter:drop-shadow(0 2px 3px #123e3844)
}
.hint-preview-layer {
  position:fixed;
  overflow:hidden;
  pointer-events:none;
  z-index:900
}
.hint-preview-ghost {
  position:absolute;
  top:0;
  left:0;
  transform-origin:top left;
  will-change:transform,opacity
}
.card.hint-preview-source {
  opacity:.25
}
.card.hint-preview-card {
  outline:2px solid var(--gold);
  outline-offset:-2px;
  box-shadow:0 8px 12px #0004
}
.action .action-label {
  font:inherit
}
.feedback {
  min-height:52px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:15px;
  flex-shrink:0;
  color:var(--muted);
  font-size:13px;
  text-align:center;
  line-height:1.4;
  padding:6px 4px
}
.feedback button {
  background:none;
  border:0;
  border-bottom:1px solid var(--gold);
  padding:5px 3px;
  min-height:44px;
  flex-shrink:0;
  color:var(--gold);
  font-size:13px;
  white-space:nowrap
}
.toolbar {
  min-height:88px;
  border-top:1px solid var(--line);
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  flex-shrink:0;
  padding-bottom:env(safe-area-inset-bottom)
}
.game-actions,.play-actions {
  display:flex;
  gap:8px
}
.game-actions .quiet {
  color:var(--muted)
}
.game-actions .quiet span:first-child {
  font-size:23px
}
.action {
  border:1px solid #ffffff35;
  background:#ffffff06;
  border-radius:9px;
  min-height:47px;
  min-width:116px;
  font-size:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px
}
.action span {
  font-size:23px;
  line-height:1
}
.action.primary {
  background:var(--gold);
  color:var(--ink);
  border-color:var(--gold)
}
.action.primary:hover {
  background:#f2d79f
}
.save-status {
  justify-self:end;
  font-size:11px;
  color:var(--muted)
}
.save-warning {
  background:#4f3022;
  color:#ffe1b7;
  border:1px solid #e9c78680;
  border-radius:6px;
  padding:9px;
  font-size:13px;
  margin-bottom:5px
}
.save-warning button {
  background:transparent;
  border:0;
  text-decoration:underline
}
.skip-link {
  position:fixed;
  top:-60px;
  left:10px;
  z-index:2000;
  padding:12px;
  background:var(--cream);
  color:var(--ink)
}
.skip-link:focus {
  top:10px
}
dialog {
  background:#f7f3e9;
  color:var(--ink);
  border:0;
  border-radius:18px;
  padding:28px;
  max-width:480px;
  width:calc(100% - 28px);
  max-height:calc(100dvh - 36px);
  box-shadow:0 30px 100px #0005;
  overscroll-behavior:contain
}
dialog::backdrop {
  background:var(--dialog-backdrop,#061e1be0);
  backdrop-filter:blur(5px)
}
.modal-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px
}
.eyebrow {
  font-size:10px;
  letter-spacing:2px;
  color:#556a60
}
.icon-button {
  border:0;
  background:transparent;
  color:inherit;
  width:44px;
  height:44px;
  font-size:28px;
  border-radius:50%
}
h2 {
  font:34px/1.15 Georgia,serif;
  letter-spacing:-.6px;
  margin:0 0 22px
}
dialog p,dialog li {
  font-size:15px;
  line-height:1.6;
  color:var(--dialog-muted,#40594f)
}
dialog ul,dialog ol {
  padding-left:22px
}
dialog h3 {
  font:22px Georgia,serif;
  margin:25px 0 10px
}
dialog button:hover:not(:disabled) {
  background-color:#123e3810
}
.dialog-actions {
  display:flex;
  gap:10px;
  margin-top:24px;
  flex-wrap:wrap
}
.dialog-button {
  border:1px solid #123e3830;
  padding:13px 17px;
  border-radius:8px;
  background:transparent;
  color:var(--ink);
  font-size:15px;
  min-height:46px
}
.dialog-button.primary {
  background:var(--table);
  color:white
}
.setting {
  display:flex;
  gap:18px;
  align-items:center;
  justify-content:space-between;
  padding:17px 0;
  border-bottom:1px solid #123e381c
}
.setting label {
  font-size:15px
}
.setting small {
  display:block;
  font-size:13px;
  line-height:1.5;
  color:#52695e;
  margin-top:6px
}
.setting input {
  width:23px;
  height:23px;
  accent-color:var(--table);
  flex-shrink:0
}
.hint-explanation {
  padding:15px;
  background:#e7eadd;
  border-radius:9px
}
.record-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:22px 0
}
.record-tile {
  background:#e8ebdf;
  border-radius:9px;
  padding:15px
}
.record-tile b {
  font:28px Georgia,serif;
  display:block;
  margin-bottom:6px
}
.record-tile span {
  font-size:12px;
  color:#52695e
}
.record-tabs {
  display:flex;
  gap:8px
}
.record-tabs button[aria-pressed=true] {
  background:var(--table);
  color:white
}
.history-list {
  list-style:none;
  padding:0
}
.history-list li {
  display:flex;
  justify-content:space-between;
  gap:15px;
  border-bottom:1px solid #123e3818;
  padding:10px 0;
  font-size:13px
}
.history-list small {
  display:block
}
.victory-mark {
  font:58px Georgia,serif;
  text-align:center;
  color:#1c5146;
  margin-bottom:18px
}
.record-badge {
  display:inline-block;
  border:1px solid #bda572;
  border-radius:20px;
  padding:7px 12px;
  font-size:13px;
  margin:3px
}
.keyboard-help {
  font-size:13px!important
}
kbd {
  background:#e4e7db;
  border:1px solid #cbd1c4;
  border-radius:4px;
  padding:1px 4px;
  font-size:12px
}
.paused-table .tableau {
  visibility:hidden
}
.corner {
  position:absolute;
  top:0;
  left:0
}
.bottom-corner {
  top:auto;
  left:auto;
  right:0;
  bottom:0
}
.card.hint-source,.card.keyboard-selected {
  z-index:var(--card-layer)!important
}
.card.hint-member {
  border-color:#967124;
  box-shadow:0 0 0 2px var(--gold),var(--card-shadow)
}
.card:focus-visible {
  outline:3px solid #735514;
  outline-offset:-3px
}
dialog :focus-visible {
  outline-color:var(--table)
}
.dim-cards .card.immovable {
  color:#3f5047
}
.dim-cards .card.immovable.heart {
  color:#78383f
}
@media(min-width:1600px) {
  .app-shell {
    padding:0 55px
  }
}
@media(max-width:900px) {
  .app-shell {
    padding:0 22px
  }
  .header {
    height:84px
  }
  .save-status {
    display:none
  }
  .toolbar {
    grid-template-columns:1fr auto
  }
  .deck-label {
    display:none
  }
  .corner {
    padding:5px 5px;
    gap:3px
  }
  .bottom-corner {
    display:none
  }
  .runs-wrap {
    gap:7px
  }
  .run-slot {
    width:31px;
    height:43px
  }
  .stock-back {
    width:31px;
    height:43px
  }
  #stock-cards {
    height:43px;
    width:59px
  }
  .deck-row {
    padding-bottom:24px
  }
  .action {
    min-width:100px
  }
}
@media(max-width:600px) {
  :root {
    --radius:5px;
    --card-height:clamp(48px,14vw,80px)
  }
  .app-shell {
    padding:env(safe-area-inset-top) max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left))
  }
  .header {
    height:48px
  }
  .brand {
    gap:8px
  }
  .brand-suits {
    font-size:31px;
    width:35px
  }
  .brand-suits span {
    font-size:20px;
    left:16px;
    top:15px
  }
  h1 {
    font-size:25px
  }
  .brand-caption {
    display:none
  }
  nav {
    gap:3px
  }
  .nav-label {
    display:none
  }
  nav button.quiet {
    padding:8px;
    min-width:44px
  }
  .game-meta {
    min-height:44px
  }
  .mode-label {
    font-size:9px;
    letter-spacing:1px;
    gap:7px
  }
  .counters {
    gap:10px;
    font-size:11px
  }
  .counters b {
    font-size:14px
  }
  .timer {
    gap:5px;
    padding:5px;
    font-size:12px
  }
  .deck-row {
    padding:0;
    align-items:center
  }
  .run-slot {
    width:21px;
    height:30px;
    font-size:15px;
    border-radius:4px
  }
  #runs {
    gap:4px
  }
  .stock {
    gap:8px;
    min-height:44px
  }
  .stock-blocked .stock-copy {
    max-width:90px
  }
  .run-slot {
    width:clamp(15px,4.3vw,21px)
  }
  .stock-copy b {
    font-size:12px
  }
  .stock-copy {
    font-size:10px;
    gap:3px
  }
  #stock-cards {
    width:47px;
    height:34px
  }
  .stock-back {
    width:25px;
    height:34px;
    left:calc(var(--i)*5px);
    border-radius:4px
  }
  .corner {
    padding:4px 1px;
    font-size:clamp(14px,4.1vw,17px);
    gap:1px
  }
  .card-center {
    font-size:clamp(15px,4.3vw,17px)
  }
  .ace .card-center {
    font-size:clamp(23px,6.4vw,27px)
  }
  .card.face-down::after {
    inset:3px;
    border-radius:2px
  }
  .tableau,.column-labels {
    gap:2px
  }
  .column-labels {
    height:18px;
    font-size:11px
  }
  .board-scroll {
    padding-bottom:8px;
    scrollbar-width:none
  }
  .feedback {
    min-height:28px;
    font-size:12px;
    gap:8px;
    padding:4px 0
  }
  .feedback button {
    font-size:12px
  }
  .toolbar {
    min-height:52px;
    gap:4px
  }
  .game-actions {
    gap:0
  }
  .game-actions .quiet {
    padding:8px 5px;
    font-size:12px;
    gap:3px
  }
  #restart {
    min-width:44px;
    justify-content:center
  }
  .restart-label {
    display:none
  }
  .play-actions {
    gap:6px
  }
  .action {
    min-width:77px;
    min-height:44px;
    font-size:13px;
    gap:5px;
    border-radius:7px
  }
  .action span {
    font-size:20px
  }
  dialog {
    padding:23px
  }
  h2 {
    font-size:30px
  }
}
@media(max-height:800px) and (min-width:901px), (max-height:500px) and (orientation:landscape) {
  .app-shell {
    padding:0 18px
  }
  .header {
    height:44px
  }
  .brand-caption {
    display:none
  }
  h1 {
    font-size:25px
  }
  .brand-suits {
    font-size:28px
  }
  .brand-suits span {
    font-size:19px
  }
  nav .nav-label {
    display:none
  }
  nav button.quiet {
    min-width:44px;
    justify-content:center
  }
  main {
    display:grid;
    grid-template-columns:max-content minmax(0,1fr) max-content;
    grid-template-rows:44px 22px minmax(0,1fr) auto auto;
    column-gap:12px
  }
  .game-meta {
    display:contents
  }
  .mode-label {
    grid-column:1;
    grid-row:1;
    font-size:9px;
    letter-spacing:1px;
    gap:7px
  }
  .counters {
    grid-column:3;
    grid-row:1;
    gap:10px;
    font-size:11px
  }
  .counters b {
    font-size:14px
  }
  .timer {
    gap:5px;
    padding:5px;
    font-size:12px
  }
  .deck-row {
    grid-column:2;
    grid-row:1;
    padding:0;
    min-width:0;
    gap:8px;
    align-items:center
  }
  .column-labels {
    grid-column:1 / -1;
    grid-row:2;
    height:22px
  }
  .board-scroll {
    grid-column:1 / -1;
    grid-row:3;
    padding-bottom:8px
  }
  .feedback {
    grid-column:1 / -1;
    grid-row:4
  }
  .save-warning {
    grid-column:1 / -1;
    grid-row:5
  }
  .runs-wrap {
    gap:5px
  }
  .deck-label {
    display:block;
    white-space:nowrap;
    letter-spacing:0
  }
  .run-long,.deal-long {
    display:none
  }
  .run-short {
    display:inline
  }
  .run-slot {
    height:26px;
    width:17px;
    font-size:15px
  }
  #runs {
    gap:4px
  }
  #stock-cards {
    height:28px;
    width:47px
  }
  .stock-back {
    height:28px;
    width:23px;
    left:calc(var(--i)*5px)
  }
  .stock {
    min-height:44px;
    gap:8px
  }
  .stock-copy {
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
    font-size:10px
  }
  .stock-copy b {
    font-size:12px
  }
  .stock-blocked .stock-copy {
    max-width:90px
  }
  .toolbar {
    min-height:48px
  }
  .feedback {
    min-height:32px;
    padding:2px 0;
    font-size:12px
  }
  .action {
    min-height:44px
  }
  .corner {
    font-size:clamp(14px,3.4vw,20px)
  }
}
@media(max-height:500px) and (orientation:landscape) and (max-width:700px) {
  main {
    column-gap:8px
  }
  #runs {
    display:none
  }
}
/* Phones in landscape need their short viewport for the cards. */
@media(max-height:500px) and (orientation:landscape) and (max-width:1024px) {
  :root {
    --card-height:clamp(60px,min(12vw,26dvh),100px);
    --radius:6px
  }
  .app-shell {
    display:grid;
    grid-template-columns:max-content minmax(0,1fr) max-content;
    grid-template-rows:44px 18px minmax(0,1fr) auto auto 48px;
    column-gap:8px;
    padding:env(safe-area-inset-top) max(6px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px,env(safe-area-inset-left))
  }
  .header,main,.toolbar {
    display:contents
  }
  .brand {
    display:none
  }
  .header nav {
    grid-column:1;
    grid-row:6;
    align-self:center;
    gap:4px
  }
  nav button.quiet {
    padding:8px
  }
  .game-actions {
    grid-column:2;
    grid-row:6;
    align-self:center;
    justify-content:center;
    gap:0
  }
  .game-actions .quiet {
    padding:8px 6px;
    gap:4px;
    font-size:12px
  }
  #restart {
    min-width:44px;
    justify-content:center
  }
  .restart-label,.save-status {
    display:none
  }
  .play-actions {
    grid-column:3;
    grid-row:6;
    align-self:center;
    gap:6px
  }
  .action {
    min-width:78px;
    padding:8px;
    font-size:13px;
    gap:5px
  }
  .column-labels {
    height:18px;
    width:calc(min(100%,190dvh) - 8px);
    margin:auto;
    font-size:11px
  }
  .board-scroll {
    width:min(100%,190dvh);
    margin:0 auto;
    scrollbar-width:none
  }
  .tableau,.column-labels {
    gap:6px
  }
  .feedback {
    min-height:28px;
    padding:2px 0
  }
  .stock {
    padding:0;
    gap:6px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important
  }
}
.reduce-motion * {
  animation:none!important;
  transition:none!important;
  scroll-behavior:auto!important
}
.app-shell {
  background:linear-gradient(var(--shell-shade,#041a1666),var(--shell-center,#041a1610) 34%,var(--shell-shade,#041a1666))
}
.board-scroll {
  background-image:linear-gradient(var(--surface-wash,#092b23eb),var(--surface-wash,#092b23eb)),var(--theme-silk,url('./themes/emerald-nocturne/silk.webp'));
  background-size:auto,192px 192px;
  border-radius:8px
}
.theme-art {
  pointer-events:none;
  user-select:none;
  -webkit-user-select:none;
  object-fit:contain
}
.theme-icon {
  display:block;
  width:24px;
  height:24px
}
.brand-suits {
  height:1.2em
}
.brand-suits .theme-art {
  position:absolute;
  left:0;
  top:0;
  width:.92em;
  height:.92em
}
.brand-suits .theme-art + .theme-art {
  left:.52em;
  top:.45em;
  width:.65em;
  height:.65em
}
.suit-medallion {
  position:relative;
  display:grid;
  place-items:center;
  width:52%;
  max-width:60px;
  aspect-ratio:1
}
.suit-art {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain
}
.suit-art:not([hidden]) + .suit-fallback {
  display:none
}
.ace .suit-medallion {
  width:72%;
  max-width:86px
}
.court-medallion {
  position:absolute;
  top:40%;
  left:50%;
  transform:translate(-50%,-50%);
  display:block;
  width:62%;
  max-width:76px;
  height:40%;
  color:#856323
}
.court-art {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain
}
.court-fallback {
  display:grid;
  place-items:center;
  height:100%
}
.court-art:not([hidden]) + .court-fallback {
  display:none
}
.court .suit-medallion {
  position:absolute;
  top:72%;
  left:50%;
  transform:translate(-50%,-50%);
  width:26%;
  max-width:30px
}
.dim-cards .immovable .suit-art,
.dim-cards .immovable .court-art {
  opacity:.45;
  filter:saturate(.4)
}
.dim-cards .immovable .court-fallback {
  opacity:.6
}
.run-slot .suit-art {
  width:85%;
  height:85%
}
.run-crown {
  width:85%;
  height:85%;
  opacity:.3
}
.theme-preview {
  display:flex;
  align-items:center;
  gap:18px;
  padding-bottom:20px;
  margin-bottom:20px;
  border-bottom:1px solid #123e3820
}
.theme-back-preview {
  width:64px;
  height:96px;
  border-radius:5px;
  flex-shrink:0
}
.theme-preview h3 {
  margin:0;
  font:23px Georgia,serif
}
.theme-preview p {
  margin:8px 0;
  font-size:13px
}
.theme-suits {
  display:flex;
  gap:8px
}
.theme-suits img {
  width:28px;
  height:28px
}
.victory-scene {
  position:relative;
  height:180px;
  margin-bottom:20px;
  overflow:hidden;
  border-radius:10px;
  background:var(--table)
}
.victory-art {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center 23%
}
.victory-laurel {
  position:absolute;
  bottom:8px;
  right:8px;
  width:72px;
  height:72px;
  filter:drop-shadow(0 2px 6px #0008)
}
@media(max-width:900px) and (orientation:portrait) {
  body {
    background-image:linear-gradient(var(--body-shade-top,#061d164d),var(--body-shade-bottom,#061d1680)),var(--theme-tableSmall,url('./themes/emerald-nocturne/table-small.webp'))
  }
}
@media(max-width:600px) {
  .theme-icon {
    width:21px;
    height:21px
  }
  .victory-scene {
    height:140px
  }
}
[hidden] {
  display:none!important
}

.theme-setting {
  display:grid;
  gap:9px;
  margin-bottom:18px
}
.theme-setting label {
  font-weight:bold;
  font-size:14px
}
.theme-setting select {
  color-scheme:light;
  width:100%;
  min-height:46px;
  padding:10px 12px;
  border:1px solid #b9aa94;
  border-radius:7px;
  background:#fffcf5;
  color:var(--ink)
}
.theme-setting p {
  margin:0;
  font-size:13px
}
body[data-theme="clockwork-atelier"] .eyebrow,
body[data-theme="clockwork-atelier"] .setting small,
body[data-theme="clockwork-atelier"] .record-tile span,
body[data-theme="clockwork-atelier"] .history-list small {
  color:var(--dialog-muted)
}
body[data-theme="clockwork-atelier"] .record-tile,
body[data-theme="clockwork-atelier"] .hint-explanation,
body[data-theme="clockwork-atelier"] .tucked-card-name {
  background:#eee3d1
}
body[data-theme="velvet-midnight"] .eyebrow,
body[data-theme="velvet-midnight"] .setting small,
body[data-theme="velvet-midnight"] .record-tile span,
body[data-theme="velvet-midnight"] .history-list small {
  color:var(--dialog-muted)
}
body[data-theme="velvet-midnight"] .record-tile,
body[data-theme="velvet-midnight"] .hint-explanation,
body[data-theme="velvet-midnight"] .tucked-card-name {
  background:#f0e1e6
}

/* Classic faces use printed pip layouts and double-ended court portraits. */
.classic-pips {
  position:absolute;
  inset:calc(var(--classic-index-space) + 6%) 28% calc(var(--classic-footer-space) + 6%)
}
.classic-pip {
  position:absolute;
  display:grid;
  place-items:center;
  left:var(--pip-x);
  top:var(--pip-y);
  width:35%;
  height:20%;
  transform:translate(-50%,-50%);
  font-size:clamp(7px,1.8vw,24px)
}
.classic-pip.inverted {
  transform:translate(-50%,-50%) rotate(180deg)
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .card:not(.face-down) {
  border-color:#c9d0ca;
  --classic-index-font:clamp(14px,1.65vw,23px);
  --classic-index-space:calc(var(--classic-index-font) + 9px);
  --classic-footer-space:var(--classic-index-space)
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .corner {
  font-size:var(--classic-index-font);
  font-weight:700;
  padding:3px 4px;
  gap:2px
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .bottom-corner {
  display:flex
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .compact-card .corner,
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .compact-column .corner {
  font-size:min(18px,var(--classic-index-font));
  padding-top:2px;
  padding-bottom:2px
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .card:hover:not(:disabled):not(.immovable) {
  background-color:#fff
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) :is(.face-down,.stock-back)::after {
  display:none
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .court-medallion {
  inset:var(--classic-index-space) 3% var(--classic-footer-space);
  width:auto;
  height:auto;
  transform:none;
  max-width:none;
  color:inherit
}
.court-half {
  position:absolute;
  inset:0 0 50%;
  overflow:hidden
}
.court-half.inverted {
  inset:50% 0 0;
  transform:rotate(180deg)
}
.court-half .court-art {
  width:100%;
  height:200%;
  object-fit:contain;
  object-position:center top
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .court .suit-medallion {
  top:auto;
  bottom:calc(var(--classic-footer-space) / 2);
  left:16%;
  transform:translate(-50%,50%);
  width:14%;
  max-width:14px
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) :is(.eyebrow,.setting small,.record-tile span,.history-list small) {
  color:var(--dialog-muted)
}
body:is([data-theme="classic-blue"],[data-theme="classic-red"]) :is(.record-tile,.hint-explanation,.tucked-card-name) {
  background:#edf2ee
}
@media(max-width:900px) {
  body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .card:not(.face-down) {
    --classic-footer-space:8px
  }
  body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .bottom-corner {
    display:none
  }
}
@media(max-width:600px) {
  body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .card:not(.face-down) {
    --classic-index-font:clamp(14px,4.1vw,17px)
  }
  body:is([data-theme="classic-blue"],[data-theme="classic-red"]) .corner {
    padding:3px 1px;
    gap:1px
  }
}
