/* Mullsifter as a mid-90s desktop: grey bevelled windows with navy title bars on a teal
   desktop, a taskbar along the bottom, system fonts only. After budget-commanders' theme. */
:root {
  --desk: #008080;
  --face: #c0c0c0;
  --hi: #fff;
  --light: #dfdfdf;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --title-end: #1084d0;
  --tip: #ffffe1;
  --text: #000;
  --muted: #404040;
  --link: #0000c0;
  --good: #006000;
  --bad: #a00000;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --window: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
  --field: inset -1px -1px var(--hi), inset 1px 1px var(--shadow);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='34' viewBox='0 0 11 17' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM0 1h2v1h-2zM0 2h3v1h-3zM0 3h4v1h-4zM0 4h5v1h-5zM0 5h6v1h-6zM0 6h7v1h-7zM0 7h8v1h-8zM0 8h9v1h-9zM0 9h10v1h-10zM0 10h11v1h-11zM0 11h7v1h-7zM0 12h3v1h-3zM4 12h4v1h-4zM0 13h2v1h-2zM4 13h4v1h-4zM0 14h1v1h-1zM5 14h4v1h-4zM5 15h4v1h-4zM6 16h2v1h-2z'/%3E%3Cpath fill='%23fff' d='M1 2h1v1h-1zM1 3h2v1h-2zM1 4h3v1h-3zM1 5h4v1h-4zM1 6h5v1h-5zM1 7h6v1h-6zM1 8h7v1h-7zM1 9h8v1h-8zM1 10h5v1h-5zM1 11h2v1h-2zM4 11h2v1h-2zM1 12h1v1h-1zM5 12h2v1h-2zM5 13h2v1h-2zM6 14h2v1h-2zM6 15h2v1h-2z'/%3E%3C/svg%3E");
  --glyph-min: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath d='M4 10h6v2H4z'/%3E%3C/svg%3E");
  --glyph-max: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill-rule='evenodd' d='M3 2h9v9H3zM4 4v6h7V4z'/%3E%3C/svg%3E");
  --glyph-restore: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath d='M5 1h7v2H5zM11 3h1v4h-1zM10 6h1v1h-1zM5 3h1v1H5zM3 4h7v2H3zM3 6h1v5H3zM9 6h1v5H9zM4 10h5v1H4z'/%3E%3C/svg%3E");
  --glyph-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath d='M4 3h2v1H4zM10 3h2v1h-2zM5 4h2v1H5zM9 4h2v1H9zM6 5h4v1H6zM7 6h2v1H7zM6 7h4v1H6zM5 8h2v1H5zM9 8h2v1H9zM4 9h2v1H4zM10 9h2v1h-2z'/%3E%3C/svg%3E");
  --glyph-drop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' shape-rendering='crispEdges'%3E%3Crect width='18' height='18' fill='%23c0c0c0'/%3E%3Cpath d='M0 0h17v1H1v16H0z' fill='%23dfdfdf'/%3E%3Cpath d='M1 1h15v1H2v14H1z' fill='%23fff'/%3E%3Cpath d='M17 0h1v18H0v-1h17z' fill='%230a0a0a'/%3E%3Cpath d='M16 1h1v16H1v-1h15z' fill='%23808080'/%3E%3Cpath d='M5 7h8v1H5zM6 8h6v1H6zM7 9h4v1H7zM8 10h2v1H8z'/%3E%3C/svg%3E");
  /* A card back for slots whose image has not loaded: navy, a bevelled border and a diamond. */
  --card-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 61 85' shape-rendering='crispEdges'%3E%3Crect width='61' height='85' fill='%23000080'/%3E%3Cpath fill='none' stroke='%231084d0' stroke-width='2' d='M5 5h51v75H5z'/%3E%3Cpath fill='%23c0c0c0' d='M30 30h1v1h1v1h1v1h1v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1z'/%3E%3C/svg%3E");
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--desk); }
body { margin: 0; padding-bottom: 52px; color: var(--text); background: var(--desk); font: 14px/1.5 "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, Verdana, sans-serif; -webkit-font-smoothing: none; cursor: var(--arrow), default; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--link); }
a:visited { color: #800080; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 1px dotted var(--dark); outline-offset: -5px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 1px dotted var(--dark); outline-offset: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.85rem; margin-bottom: 10px; }
h2 { font-size: 1.3rem; margin: 22px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin-bottom: 12px; }
.dim { color: var(--muted); }
.small { font-size: .86rem; }

/* Controls */
button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 16px; min-height: 34px; border: 0; border-radius: 0; background: var(--face); box-shadow: var(--raised); color: var(--text); white-space: nowrap; cursor: pointer; }
button:active:not(:disabled) { box-shadow: var(--pressed); padding: 7px 15px 5px 17px; }
button:disabled { color: var(--shadow); text-shadow: 1px 1px var(--hi); cursor: default; }
button.primary { font-weight: 700; box-shadow: var(--raised), 0 0 0 1px var(--dark); }
button.primary:active:not(:disabled) { box-shadow: var(--pressed), 0 0 0 1px var(--dark); }
button.quiet { background: transparent; box-shadow: none; text-decoration: underline; }
button.quiet:active:not(:disabled) { box-shadow: none; padding: 6px 16px; }
button.danger { color: var(--bad); }
button.link { background: transparent; box-shadow: none; color: var(--link); text-decoration: underline; padding: 6px 0; min-height: 0; }
button.link:active:not(:disabled) { box-shadow: none; padding: 6px 0; }
button.big { min-height: 42px; font-size: 1.07rem; }
.ui-icon { flex-shrink: 0; }
.icon-button { width: 34px; height: 34px; min-height: 34px; padding: 0; }
.icon-button:active:not(:disabled) { padding: 1px 0 0 1px; }
textarea, input, select { width: 100%; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 0; background: var(--hi); box-shadow: var(--sunken); color: var(--text); }
textarea { resize: vertical; font-family: "Fixedsys", "Lucida Console", "Courier New", monospace; font-size: 13px; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; background: var(--hi) var(--glyph-drop) no-repeat right 3px center; }
input[type=radio], input[type=checkbox] { width: auto; min-height: 0; box-shadow: none; accent-color: var(--navy); }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 24px; border: 0; padding: 3px; background: var(--face); box-shadow: var(--field); }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: repeating-linear-gradient(90deg, var(--navy) 0 12px, transparent 12px 14px); }
progress::-moz-progress-bar { background: repeating-linear-gradient(90deg, var(--navy) 0 12px, transparent 12px 14px); }

/* Desktop, window and taskbar */
.app { min-height: calc(100vh - 52px); display: flex; flex-direction: column; }
.shell { width: 100%; max-width: 1180px; padding: 24px 20px 8px; margin: 0 auto; flex: 1; }
.window { background: var(--face); box-shadow: var(--window), 2px 2px 0 #0004; padding: 4px; min-width: 0; }
.title-bar { display: flex; align-items: center; gap: 6px; padding: 3px 3px 3px 5px; background: linear-gradient(90deg, var(--navy), var(--title-end)); color: var(--hi); font-weight: 700; min-height: 24px; }
.title-icon { flex: none; image-rendering: pixelated; }
.title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-controls { display: flex; flex: none; }
.ctl { width: 16px; height: 14px; min-height: 0; padding: 0; background: var(--face) center no-repeat; box-shadow: var(--raised); cursor: default; }
.ctl:active:not(:disabled) { padding: 0; box-shadow: var(--pressed); background-position: calc(50% + 1px) calc(50% + 1px); }
.ctl:focus-visible { outline-offset: -3px; }
.ctl-min { background-image: var(--glyph-min); }
.ctl-max { background-image: var(--glyph-max); }
.win-max .ctl-max { background-image: var(--glyph-restore); }
.ctl-close { background-image: var(--glyph-close); margin-left: 2px; }
.window-body { padding: 20px; }
/* Title-bar buttons (app.js): maximized fills the desktop, minimized leaves only the taskbar. */
.win-max .shell { max-width: none; padding: 0; display: flex; flex-direction: column; }
.win-max .app-window { flex: 1; display: flex; flex-direction: column; box-shadow: var(--window); }
.win-max .window-body { flex: 1; }
.win-min .app-window { display: none; }
.win-min .task[aria-current] { box-shadow: var(--raised); font-weight: 400; background: var(--face); }
.taskbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch; gap: 4px; padding: 4px 4px 3px; background: var(--face); box-shadow: inset 0 1px var(--light), inset 0 2px var(--hi); }
.start, .task { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; min-height: 34px; background: var(--face); box-shadow: var(--raised); color: var(--text); text-decoration: none; white-space: nowrap; }
.start:visited, .task:visited { color: var(--text); }
.start { flex: none; padding-left: 6px; }
.start img { image-rendering: pixelated; }
.start:active, .task:active { box-shadow: var(--pressed); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.task { flex: 0 1 170px; min-width: 0; overflow: hidden; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.task-short { display: none; }
.task-window { font: inherit; cursor: default; }
.task-window img { flex: none; image-rendering: pixelated; }
.task[aria-current] { box-shadow: var(--pressed); font-weight: 700; background: repeating-conic-gradient(var(--hi) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px; }
.tray { flex: none; display: flex; align-items: center; padding: 4px 12px; box-shadow: var(--field); font-size: .86rem; }
/* Status bar along the window's foot, and the About dialog it opens (the Fan Content notice). */
.status-bar { display: flex; gap: 2px; margin-top: 2px; font-size: .79rem; }
.status-field { flex: 1; min-width: 0; padding: 2px 6px; box-shadow: var(--field); }
.status-page:empty { display: none; }
.status-about { min-height: 0; padding: 1px 10px; font-size: .79rem; }
.status-about:active:not(:disabled) { padding: 2px 9px 0 11px; }
.about { width: min(460px, calc(100vw - 32px)); border: 0; color: var(--text); }
.about::backdrop { background: transparent; }
.about-body { display: flex; gap: 14px; padding: 16px 14px 4px; }
.about-body img { flex: none; image-rendering: pixelated; }
.about-body p { margin: 0 0 10px; }
.about-actions { display: flex; justify-content: flex-end; padding: 4px 10px 10px; }
.about-actions button { min-width: 80px; }

/* Shared text and lists */
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--navy); font-size: .79rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
.eyebrow::before { content: ""; flex: none; width: 8px; height: 8px; background: #00c000; box-shadow: inset -1px -1px #006000, inset 1px 1px #80ff80; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.page-head p:last-child { margin: 0; }
.page-head > button { flex-shrink: 0; }
.empty-state { text-align: center; background: var(--hi); box-shadow: var(--sunken); padding: 40px 24px 44px; }
.empty-state h2 { margin: 14px 0 10px; }
.empty-state p { max-width: 460px; margin: 0 auto 20px; }
.empty-state button + p { margin-top: 16px; margin-bottom: 0; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: var(--face); box-shadow: var(--raised); color: var(--navy); }
.empty-icon .ui-icon { width: 28px; height: 28px; }
.deck-list, .card-rows { list-style: none; padding: 0; margin: 0; }
.deck-list { background: var(--hi); box-shadow: var(--sunken); padding: 2px 12px; }
.deck-list:empty { display: none; }
.deck-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 12px 0; border-bottom: 1px dotted var(--shadow); }
.deck-row:last-child { border-bottom: 0; }
.deck-identity { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.portrait { width: 52px; height: 72px; flex-shrink: 0; background: var(--card-back) center / cover, var(--navy); box-shadow: 0 0 0 1px var(--dark); display: flex; align-items: center; justify-content: center; color: var(--hi); overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.identity-copy { min-width: 0; }
.identity-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.07rem; }
.identity-title strong { font-weight: 700; }
.identity-copy p { margin: 4px 0 0; }
.mana { display: inline-flex; gap: 3px; align-items: center; }
.mana img { display: block; border-radius: 50%; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.delete-confirm { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; background: var(--tip); border: 1px solid var(--dark); }
.delete-confirm span { margin-right: auto; }
.share-row p { margin: 4px 0 0; }

/* Forms and deck review */
.form-page { max-width: 800px; margin: 0 auto; }
.form-panel { padding: 0; }
.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: .86rem; margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.actions.sticky { position: sticky; bottom: 52px; z-index: 2; background: var(--face); padding: 10px 0; margin: 0; border-top: 1px solid var(--shadow); box-shadow: inset 0 1px var(--hi); }
.status { color: var(--muted); }
.error { color: var(--bad); }
.status:empty, .error:empty { display: none; }
.status:not(:empty), .error:not(:empty) { margin-top: 14px; }
.warn { position: relative; background: var(--tip); border: 1px solid var(--dark); padding: 10px 14px 10px 44px; }
.warn::before { content: "!"; position: absolute; left: 12px; top: 9px; width: 22px; height: 22px; background: #ffd800; border: 1px solid var(--dark); font: 700 15px/20px Arial, sans-serif; text-align: center; clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--hi); box-shadow: var(--field); padding: 2px 2px 2px 10px; }
.chip-x { min-height: 26px; padding: 0 8px; }
.summary { font-weight: 700; padding: 10px 12px; background: var(--hi); box-shadow: var(--sunken); }
.card-rows { margin: 20px 0; background: var(--hi); box-shadow: var(--sunken); padding: 2px 10px; }
.card-row { display: grid; grid-template-columns: 30px 25px 1fr 25px 110px; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--shadow); }
.card-row:last-child { border-bottom: 0; }
.card-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .qty, .card-row .mv { text-align: right; font-variant-numeric: tabular-nums; }
.card-row select { padding: 4px 26px 4px 6px; min-height: 28px; font-size: .86rem; }
.card-row.overridden select { font-weight: 700; }
.star { background: none; box-shadow: none; font-size: 20px; padding: 0; min-height: 0; color: var(--shadow); }
.star:active:not(:disabled) { box-shadow: none; padding: 0; }
.star.on { color: #c08000; }
fieldset { min-width: 0; margin: 0; padding: 12px 16px 10px; border: 1px solid var(--shadow); box-shadow: 1px 1px var(--hi), inset 1px 1px var(--hi); }
legend { padding: 0 4px; background: var(--face); font-size: .93rem; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.opt input { margin-top: 3px; }
.opt > span { display: flex; flex-direction: column; gap: 1px; }
.opt strong { font-weight: 700; }
.profile { margin: 22px 0; }
.combos { padding-left: 20px; }
.badge { display: inline-block; margin-left: 6px; padding: 0 5px; font-size: .72rem; font-weight: 700; background: var(--navy); color: var(--hi); vertical-align: middle; }

/* Practice */
.train-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--shadow); box-shadow: 0 1px var(--hi); }
.compact .portrait { width: 36px; height: 50px; }
.compact { gap: 12px; }
.compact .identity-title { font-size: 1rem; }
.compact .identity-copy p { margin-top: 2px; font-size: .79rem; }
.session-progress { text-align: right; font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress-segments { display: flex; gap: 2px; margin-top: 6px; padding: 3px; box-shadow: var(--field); }
.progress-segments span { width: 12px; height: 14px; background: transparent; }
.progress-segments .done { background: var(--navy); }
.progress-segments .current { background: var(--title-end); }
.setup { max-width: 920px; margin: 8px auto 0; }
.setup-heading { margin-bottom: 20px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.setup .actions { justify-content: flex-end; margin-top: 22px; }
.setup .actions .big { flex: 0 1 auto; min-width: 220px; }
.preparing { max-width: 560px; margin: 40px auto; text-align: center; }
.preparing h1 { margin-top: 18px; }
.preparing progress { margin: 16px 0; }
.table-panel { position: relative; background: var(--desk); box-shadow: var(--sunken); padding: 18px 18px 20px; color: var(--hi); }
.table-panel .dim, .table-panel .eyebrow { color: var(--hi); }
.table-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 8px; }
.table-heading p:last-child { margin: 0; }
.table-hint { padding-bottom: 2px; text-align: right; }
/* A hand is held as a fan. Each card carries `--k`, its distance from the middle, and `--n`,
   the hand's size: seven cards span `--spread`, tilting about their bottom edge, and sit on
   an arc four card widths across so the outer ones hang lower. Cards overlap by at least 40%
   of their width, and by more when the window is too narrow, keeping `--spare` card widths
   free for the tilted corners at either end. A narrow window tilts the fan less. */
.hand { --card: clamp(92px, 19vw, 176px); --spread: 30deg; --spare: .8; display: flex; justify-content: center; padding: 30px 12px calc(var(--card) * .3); overflow: hidden; }
.hand-card { --angle: calc(var(--k) * var(--spread) / max(6, var(--n) - 1)); position: relative; flex: none; width: var(--card); transform: translateY(calc(var(--card) * 4 * (1 - cos(var(--angle))))) rotate(var(--angle)); transform-origin: 50% 100%; }
.hand-card + .hand-card { margin-left: calc(-1 * max(var(--card) * .4, (var(--n) * var(--card) + var(--card) * var(--spare) - 100%) / (var(--n) - 1))); }
.hand-card:hover, .hand-card:focus-within { z-index: 1; }
.tile { position: relative; display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; box-shadow: none; min-height: 0; line-height: 0; transition: transform .15s, border-color .15s; }
.tile:active:not(:disabled) { box-shadow: none; padding: 0; }
.tile img { display: block; width: 100%; aspect-ratio: 488 / 680; border-radius: 4.5% / 3.2%; background: var(--card-back) center / cover, var(--navy); object-fit: cover; box-shadow: 2px 2px 0 #0006; color: transparent; }
.tile:hover:not(:disabled) { transform: translateY(-20px); border-color: var(--hi); background: none; }
.tile.bottomed { border-color: #ffd800; transform: translateY(14px); }
.tile.bottomed img { opacity: .5; }
.tile.best-bottom { border-color: #00ff00; }
.bottom-label, .best-label { position: absolute; bottom: 10px; left: 5px; background: var(--tip); color: var(--text); border: 1px solid var(--dark); padding: 5px 7px; font-size: .72rem; font-weight: 700; line-height: 1.2; }
.best-label { bottom: auto; top: 8px; }
.inspect-chip { position: absolute; top: 12%; left: 6px; width: 28px; height: 28px; min-height: 0; padding: 0; }
.inspect-chip:active:not(:disabled) { padding: 1px 0 0 1px; }
.actions.decide { justify-content: center; margin: 18px auto 0; max-width: 520px; flex-wrap: nowrap; }
.actions.decide button { flex: 1; }
.table-panel > .link { display: flex; margin: 8px auto 0; color: var(--hi); }
.card-inspector { display: flex; align-items: flex-start; gap: 22px; margin-top: 18px; padding: 18px; position: relative; background: var(--face); color: var(--text); box-shadow: var(--window), 2px 2px 0 #0004; }
.card-inspector .dim { color: var(--muted); }
.card-inspector .eyebrow { color: var(--navy); }
.inspect-image { width: 215px; max-width: 40%; border-radius: 4.5% / 3.2%; }
.inspect-copy { flex: 1; padding-right: 30px; min-width: 0; }
.inspect-copy h2 { margin: 0 0 8px; }
.inspect-copy .eyebrow { margin-bottom: 8px; }
.inspector-close { position: absolute; right: 10px; top: 10px; width: 22px; height: 20px; min-height: 0; }
.oracle { white-space: pre-line; background: var(--hi); box-shadow: var(--sunken); padding: 10px 12px; font-family: "Courier New", Courier, monospace; }
.card-face + .card-face { border-top: 1px solid var(--shadow); margin-top: 18px; padding-top: 18px; }
.face-image { max-width: 180px; width: 100%; border-radius: 4.5% / 3.2%; }
.reveal { position: relative; margin: 18px 0 0; padding: 18px 20px 18px 66px; background: var(--face); box-shadow: var(--window), 2px 2px 0 #0004; }
.reveal::before { content: "i"; position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--hi); font: italic 700 22px/32px "Times New Roman", serif; text-align: center; box-shadow: 1px 1px 0 var(--dark); }
.reveal.wrong::before { content: "\00d7"; background: #e00000; font: 700 26px/31px Arial, sans-serif; font-style: normal; }
.reveal .verdict { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 0 0 6px; }
.strength-comparison { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.strength-comparison > div { display: flex; flex-direction: column; min-width: 140px; padding: 8px 14px; background: var(--hi); box-shadow: var(--sunken); }
.strength-comparison strong { font-size: 1.7rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.strength-comparison > p { max-width: 260px; margin: 0 0 0 auto; align-self: center; }
.reasons { list-style: none; padding: 0; margin: 16px 0 20px; }
.reasons li { display: flex; gap: 10px; padding: 3px 0; }
.reasons .icon { width: 16px; flex-shrink: 0; font-weight: 700; text-align: center; }
.reasons .good .icon { color: var(--good); }
.reasons .bad .icon { color: var(--bad); }
.reasons .neutral .icon { color: var(--shadow); }
.footnote { text-align: center; margin: 18px auto 0; max-width: 740px; padding: 3px 8px; box-shadow: var(--field); }
.summary-card { max-width: 850px; margin: auto; }
.summary-card .score { font-size: 1.5rem; font-weight: 700; margin-top: 18px; padding: 8px 14px; background: var(--hi); box-shadow: var(--sunken); }
.calls { list-style: none; padding: 2px 12px; margin: 20px 0; background: var(--hi); box-shadow: var(--sunken); }
.calls li { padding: 8px 0; border-bottom: 1px dotted var(--shadow); }
.calls li:last-child { border-bottom: 0; }
.calls li.wrong { color: var(--bad); }

/* Shared hands */
.sheet { margin: 18px 0; padding: 18px 20px; max-width: 800px; background: var(--face); box-shadow: var(--window), 2px 2px 0 #0004; }
.sheet h2 { margin-top: 0; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sheet-grid .field { margin: 8px 0; }
.share-link { font-family: "Courier New", Courier, monospace; font-size: .86rem; }
.tile.empty { aspect-ratio: 488 / 680; border: 1px dashed var(--hi); background: var(--card-back) center / cover; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--hi); }
.compose > .hand { margin: 20px 0; background: var(--desk); box-shadow: var(--sunken); }
.compose > .field { max-width: 800px; }
.share-help { margin-top: 16px; }
.vote-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.vote-head h1 { margin-bottom: 6px; }
.vote-head p { margin: 0; }
.commander { width: 50px; aspect-ratio: 488 / 680; background: var(--card-back) center / cover; box-shadow: 0 0 0 1px var(--dark); }
.step { font-weight: 700; }
.note { margin: 18px 0; padding: 10px 14px; background: var(--tip); border: 1px solid var(--dark); }
.vote > .hand { margin: 20px 0; background: var(--desk); box-shadow: var(--sunken); }
.vote .ballot { max-width: 600px; }
.vote .actions.decide { max-width: 100%; }
.results { margin: 20px 0; padding: 18px 20px; background: var(--face); box-shadow: var(--window), 2px 2px 0 #0004; }
.results .tally { font-size: 1.5rem; font-weight: 700; }
.bar { height: 24px; padding: 3px; background: repeating-linear-gradient(90deg, var(--bad) 0 12px, transparent 12px 14px) content-box, var(--face); box-shadow: var(--field); overflow: hidden; }
.bar .keep { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--navy) 0 12px, var(--face) 12px 14px); }
.voters { list-style: none; padding: 2px 12px; margin: 18px 0; background: var(--hi); box-shadow: var(--sunken); }
.voters li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dotted var(--shadow); }
.voters li:last-child { border-bottom: 0; }
.voters .keep { color: var(--good); font-weight: 700; }
.voters .ship { color: var(--bad); font-weight: 700; }
.voters li > span { min-width: 0; }
.vote-reason { display: block; margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.sim { margin: 18px 0 0; }
.decklist { margin: 20px 0; padding: 12px 14px; border: 1px solid var(--shadow); box-shadow: 1px 1px var(--hi), inset 1px 1px var(--hi); }
summary { cursor: pointer; }
.decklist ul { columns: 2; padding-left: 20px; font-size: .86rem; }
.pick-list { list-style: none; padding: 2px; margin: 0; background: var(--hi); box-shadow: var(--sunken); }
.pick-list button { width: 100%; justify-content: flex-start; text-align: left; background: transparent; box-shadow: none; min-height: 38px; padding: 6px 10px; }
.pick-list button:hover:not(:disabled), .pick-list button:focus-visible { background: var(--navy); color: var(--hi); }
.pick-list button:active:not(:disabled) { box-shadow: none; padding: 6px 10px; }

@media (max-width: 1000px) {
  .deck-row .deck-identity { flex-basis: 100%; }
  .deck-row .row-actions { padding-left: 66px; }
  .table-hint { max-width: 180px; }
}
@media (max-width: 760px) {
  .shell { padding: 12px 8px 4px; }
  .window-body { padding: 14px 12px; }
  .status-bar { flex-wrap: wrap; }
  .status-page { flex-basis: 100%; }
  button { min-height: 40px; }
  .task-long, .tray { display: none; }
  .task-short { display: inline; }
  .task { flex: 1 1 0; justify-content: center; min-height: 40px; }
  .start { min-height: 40px; }
  .start b { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 16px; }
  h1 { font-size: 1.55rem; }
  .empty-state { padding: 28px 16px; }
  .deck-row .row-actions { padding-left: 0; flex-wrap: wrap; }
  .deck-row .row-actions button { padding: 6px 11px; }
  .deck-identity { gap: 12px; }
  .identity-title { font-size: 1rem; }
  .portrait { width: 44px; height: 62px; }
  .train-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .train-head .deck-identity { flex-basis: 100%; }
  .session-progress { width: 100%; display: flex; justify-content: space-between; align-items: center; }
  .progress-segments { margin-top: 0; }
  .setup-grid { grid-template-columns: 1fr; gap: 14px; }
  .table-panel { padding: 14px 8px 12px; }
  .table-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .table-hint { max-width: none; text-align: left; font-size: .79rem; }
  .hand { --spread: 20deg; --spare: .5; padding: 22px 0 calc(var(--card) * .2); }
  .actions.decide { margin-top: 18px; }
  .bottom-label, .best-label { font-size: .65rem; padding: 4px 4px; left: 3px; }
  .inspect-chip { width: 24px; height: 24px; left: 3px; }
  .inspect-chip .ui-icon { width: 14px; height: 14px; }
  .card-inspector { gap: 14px; padding: 14px; flex-wrap: wrap; }
  .inspect-image { width: 210px; max-width: 80%; margin: auto; }
  .inspect-copy { flex-basis: 100%; padding-right: 0; }
  .reveal { padding: 14px 14px 14px 56px; }
  .reveal::before { left: 12px; top: 14px; }
  .sheet, .results { padding: 14px; }
  .strength-comparison > p { margin: 0; max-width: none; flex-basis: 100%; }
  .sheet-grid { grid-template-columns: 1fr; gap: 0; }
  .card-row { grid-template-columns: 25px 20px 1fr 20px 88px; gap: 4px; font-size: .86rem; }
  .card-row .badge { display: none; }
  .decklist ul { columns: 1; }
  textarea, input, select { font-size: 16px; min-height: 40px; }
  .card-row select { font-size: .86rem; min-height: 32px; }
  .actions .big { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (min-width: 761px) {
  .setup-grid:has(.cedh-settings) { grid-template-columns: 1.1fr 1fr; }
  .cedh-settings { grid-row: span 3; }
}
