:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --ink: #1f2328;
  --muted: #68707a;
  --line: #d9d3c7;
  --panel: #fffdfa;
  --orange: #f47b20;
  --teal: #127c7a;
  --green: #5d7d2f;
  --red: #ba4a3a;
  --blue: #385d9d;
  --forest: #b9483b;
  --river: #16816f;
  --mountain: #3d61a4;
  --city: #d79a28;
  --lichen: #7f9239;
  --mist: rgba(246, 243, 236, 0.78);
  --shadow: 0 18px 40px rgba(58, 45, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 7%, rgba(215, 154, 40, 0.22), transparent 25%),
    radial-gradient(circle at 12% 18%, rgba(22, 129, 111, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(244, 123, 32, 0.16), transparent 310px),
    repeating-linear-gradient(
      118deg,
      rgba(56, 93, 157, 0.045) 0 1px,
      transparent 1px 42px
    ),
    repeating-linear-gradient(
      16deg,
      rgba(93, 125, 47, 0.035) 0 1px,
      transparent 1px 54px
    ),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 28px, rgba(186, 74, 58, 0.11) 28px 30px, transparent 30px 100%),
    linear-gradient(180deg, transparent 0 28px, rgba(22, 129, 111, 0.1) 28px 30px, transparent 30px 100%);
  background-size: 112px 112px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 74%);
  content: "";
}

.alula-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.decor-card {
  position: absolute;
  display: block;
  width: 218px;
  height: 218px;
  border: 1px solid rgba(58, 45, 28, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 34%, rgba(22, 129, 111, 0.18), transparent 22%),
    radial-gradient(circle at 74% 70%, rgba(186, 74, 58, 0.18), transparent 18%),
    linear-gradient(135deg, rgba(255, 253, 250, 0.9), rgba(246, 243, 236, 0.58)),
    linear-gradient(135deg, transparent 0 48%, rgba(56, 93, 157, 0.24) 48% 51%, transparent 51%),
    repeating-linear-gradient(90deg, rgba(31, 35, 40, 0.06) 0 1px, transparent 1px 18px);
  box-shadow: 0 28px 80px rgba(58, 45, 28, 0.12);
}

.decor-card::before,
.decor-card::after {
  position: absolute;
  content: "";
}

.decor-card::before {
  inset: 16px;
  border: 1px solid rgba(58, 45, 28, 0.12);
  border-radius: 9px;
}

.decor-card::after {
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 34px;
  border-radius: 70% 70% 16px 16px;
  background:
    linear-gradient(90deg, transparent 11px, rgba(31, 35, 40, 0.18) 11px 14px, transparent 14px),
    var(--forest);
  opacity: 0.46;
}

.decor-card-a {
  top: 14px;
  right: max(-20px, calc((100vw - 1280px) / 2 - 112px));
  transform: rotate(8deg);
}

.decor-card-b {
  bottom: 40px;
  left: max(-110px, calc((100vw - 1280px) / 2 - 150px));
  transform: rotate(-11deg);
}

.decor-path {
  position: absolute;
  top: 126px;
  right: max(90px, calc((100vw - 1280px) / 2 + 30px));
  width: 246px;
  height: 114px;
  border-top: 2px dashed rgba(22, 129, 111, 0.2);
  border-left: 2px dashed rgba(215, 154, 40, 0.18);
  border-radius: 70% 0 0 0;
  transform: rotate(-9deg);
}

.decor-orbit {
  position: absolute;
  display: block;
  border: 2px dashed rgba(56, 93, 157, 0.18);
  border-radius: 50%;
}

.decor-orbit-a {
  top: -160px;
  left: 9vw;
  width: 560px;
  height: 360px;
  transform: rotate(-16deg);
}

.decor-orbit-b {
  right: -120px;
  bottom: 18vh;
  width: 430px;
  height: 250px;
  border-color: rgba(186, 74, 58, 0.16);
  transform: rotate(22deg);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid rgba(58, 45, 28, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 253, 250, 0.9), rgba(255, 253, 250, 0.42)),
    linear-gradient(90deg, rgba(186, 74, 58, 0.14), rgba(22, 129, 111, 0.14) 34%, rgba(56, 93, 157, 0.14) 67%, rgba(215, 154, 40, 0.16));
  box-shadow: var(--shadow);
}

.topbar::before,
.topbar::after {
  position: absolute;
  content: "";
}

.topbar::before {
  right: 22px;
  bottom: 0;
  width: 46%;
  height: 74%;
  background:
    radial-gradient(ellipse at 66% 76%, rgba(186, 74, 58, 0.3) 0 18%, transparent 19%),
    linear-gradient(145deg, transparent 0 54%, rgba(56, 93, 157, 0.22) 54% 58%, transparent 58%),
    linear-gradient(0deg, rgba(22, 129, 111, 0.18), transparent 42%);
  clip-path: polygon(0 100%, 10% 62%, 28% 72%, 44% 42%, 61% 66%, 79% 31%, 100% 56%, 100% 100%);
  opacity: 0.78;
}

.topbar::after {
  left: 24px;
  right: 24px;
  bottom: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--forest), var(--river), var(--mountain), var(--city));
  opacity: 0.58;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 42px;
  line-height: 1;
}

.biome-trail {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 7px;
  margin-top: 14px;
}

.biome-chip {
  display: block;
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 -1px 0 rgba(31, 35, 40, 0.18);
}

.biome-forest {
  background: var(--forest);
}

.biome-river {
  background: var(--river);
}

.biome-mountain {
  background: var(--mountain);
}

.biome-city {
  background: var(--city);
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.status strong {
  color: #fff;
  background: linear-gradient(135deg, #24282d, #315c55);
  border-radius: 999px;
  padding: 8px 12px;
}

.entry-open {
  border: 1px solid rgba(31, 35, 40, 0.14);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.metrics article::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  background: rgba(244, 123, 32, 0.12);
  content: "";
}

.metrics article:nth-child(2)::after {
  background: rgba(22, 129, 111, 0.13);
}

.metrics article:nth-child(3)::after {
  background: rgba(56, 93, 157, 0.13);
}

.metrics article:nth-child(4)::after {
  background: rgba(215, 154, 40, 0.15);
}

.metrics span,
.metrics small,
.panel-head p {
  color: var(--muted);
}

.metrics span,
.metrics small {
  display: block;
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 28px;
  line-height: 1;
}

.rule-summary {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #24282d;
  border: 1px solid rgba(31, 35, 40, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
}

.rule-summary::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(186, 74, 58, 0.18), transparent 28%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
  content: "";
}

.rule-summary > * {
  position: relative;
  z-index: 1;
}

.rule-summary span,
.rule-summary strong,
.rule-summary small {
  display: block;
}

.rule-summary span {
  color: #f8a35e;
  font-size: 12px;
  font-weight: 800;
}

.rule-summary strong {
  margin: 3px 0;
  font-size: 17px;
}

.rule-summary small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.rule-trigger {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 9px 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--forest), var(--river), var(--mountain), var(--city));
  content: "";
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  align-items: center;
}

.panel-head p {
  margin-top: 5px;
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f0e4;
}

button,
select {
  font: inherit;
}

.segmented button {
  min-width: 58px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  cursor: pointer;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

select {
  max-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.rules-dialog {
  width: min(640px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(31, 35, 40, 0.26);
  color: var(--ink);
  padding: 0;
}

.entry-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(90vh, 820px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(31, 35, 40, 0.26);
  color: var(--ink);
  padding: 0;
}

.entry-dialog::backdrop {
  background: rgba(23, 26, 30, 0.42);
}

.entry-form {
  display: grid;
  gap: 14px;
  padding: 16px 22px 22px;
}

.entry-form > *,
.entry-meta,
.entry-meta label,
.entry-flow-head,
.entry-player-list,
.entry-player-card,
.entry-actions {
  min-width: 0;
  width: 100%;
}

.entry-meta {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
}

.entry-meta label {
  display: grid;
  gap: 6px;
}

.entry-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.entry-meta input,
.score-field input,
.player-input {
  display: block;
  min-width: 0;
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.entry-meta input {
  padding: 9px 10px;
}

.entry-code-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.entry-scan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(22, 129, 111, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(22, 129, 111, 0.1), transparent 54%),
    #fffdfa;
}

.entry-scan strong,
.entry-scan span {
  display: block;
}

.entry-scan span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.scan-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(18, 124, 122, 0.24);
  border-radius: 8px;
  background: rgba(18, 124, 122, 0.09);
  color: var(--teal);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
}

.scan-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.scan-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.scan-status[data-tone="success"] {
  color: var(--teal);
}

.scan-status[data-tone="error"] {
  color: var(--red);
}

.entry-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5ee;
}

.entry-flow-head strong,
.entry-flow-head span {
  display: block;
}

.entry-flow-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.entry-player-list {
  display: grid;
  gap: 12px;
  max-height: min(50vh, 430px);
  overflow-y: auto;
  padding-right: 2px;
}

.entry-player-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.entry-player-card.is-recognized {
  border-color: rgba(18, 124, 122, 0.34);
  box-shadow: inset 4px 0 0 rgba(18, 124, 122, 0.42);
}

.entry-player-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #ece6db;
  background:
    linear-gradient(90deg, rgba(22, 129, 111, 0.08), transparent 42%),
    #fbf7ef;
}

.entry-player-head label,
.score-field {
  display: grid;
  gap: 6px;
}

.entry-player-head span,
.score-field span,
.entry-player-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.player-input,
.score-field input {
  padding: 9px 10px;
}

.score-field input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entry-player-total {
  display: grid;
  gap: 6px;
  text-align: right;
}

.entry-total {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.row-remove {
  min-height: 38px;
  border: 1px solid rgba(186, 74, 58, 0.18);
  border-radius: 8px;
  background: rgba(186, 74, 58, 0.08);
  color: var(--red);
  cursor: pointer;
  font-weight: 900;
  padding: 0 10px;
}

.row-remove:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-action,
.secondary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 14px;
}

.primary-action {
  background: var(--ink);
  color: #fff;
}

.secondary-action {
  background: #fff;
  color: var(--ink);
}

.entry-status {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.entry-status[data-tone="success"] {
  color: var(--teal);
}

.entry-status[data-tone="error"] {
  color: var(--red);
}

.rules-dialog::backdrop {
  background: rgba(23, 26, 30, 0.42);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 24px;
}

.dialog-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.dialog-body {
  display: grid;
  gap: 0;
  padding: 6px 22px 22px;
}

.dialog-body section {
  padding: 16px 0;
  border-bottom: 1px solid #ece6db;
}

.dialog-body section:last-child {
  border-bottom: 0;
}

.dialog-body h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.dialog-body p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #ece6db;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.num {
  text-align: right;
}

.rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.player-name {
  font-weight: 800;
}

.tier {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.tier::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tier-color, var(--line));
  content: "";
}

.delta-up {
  color: var(--teal);
}

.delta-down {
  color: var(--red);
}

.player-detail {
  padding: 18px;
}

.rating-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5ee;
}

.rating-card strong {
  display: block;
  margin-top: 6px;
  font-size: 38px;
  line-height: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.mini-history {
  margin-top: 16px;
}

.mini-history h3,
.recent-form h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.recent-form {
  margin-top: 16px;
}

.form-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.form-chip {
  border: 1px solid rgba(18, 124, 122, 0.18);
  border-radius: 8px;
  background: rgba(18, 124, 122, 0.08);
  padding: 7px 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.form-chip.delta-down {
  border-color: rgba(186, 74, 58, 0.2);
  background: rgba(186, 74, 58, 0.08);
}

.form-chip strong,
.form-chip small {
  display: block;
}

.form-chip strong {
  font-size: 13px;
  line-height: 1;
}

.form-chip small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.bars {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 54px 1fr 44px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe4d8;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.game-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.game-item::after {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(31, 35, 40, 0.16);
  border-radius: 50% 50% 46% 54%;
  background:
    linear-gradient(90deg, transparent 11px, rgba(31, 35, 40, 0.14) 11px 13px, transparent 13px),
    rgba(255, 253, 250, 0.48);
  content: "";
}

.game-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--forest), var(--river) 36%, var(--mountain) 68%, var(--city));
  color: #fff;
  font-weight: 900;
}

.game-title strong,
.game-title span {
  position: relative;
  z-index: 1;
}

.game-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.game-players {
  display: grid;
}

.game-player {
  display: grid;
  grid-template-columns: 40px 1fr 54px 78px;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #f0eadf;
  align-items: center;
  font-size: 13px;
}

.game-player strong {
  font-size: 14px;
}

.game-player-name {
  min-width: 0;
}

.game-player-name strong,
.game-player-name small {
  display: block;
}

.board-move {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.board-move.move-up {
  color: var(--teal);
}

.board-move.move-down {
  color: var(--red);
}

.pill {
  width: fit-content;
  border-radius: 999px;
  background: #f0e6d5;
  padding: 4px 8px;
  color: #5f5344;
  font-weight: 800;
}

.score-impact {
  justify-self: end;
  min-width: 70px;
  border: 1px solid rgba(18, 124, 122, 0.18);
  border-radius: 8px;
  background: rgba(18, 124, 122, 0.08);
  padding: 5px 7px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-impact strong,
.score-impact small {
  display: block;
}

.score-impact strong {
  font-size: 15px;
  line-height: 1;
}

.score-impact small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.score-impact.delta-down {
  border-color: rgba(186, 74, 58, 0.2);
  background: rgba(186, 74, 58, 0.08);
}

@media (max-width: 920px) {
  .shell {
    width: min(100vw - 24px, 760px);
    padding-top: 20px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

  .layout,
  .game-list {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metrics article {
    min-height: 104px;
    padding: 14px;
  }

  .metrics article::after {
    width: 54px;
    height: 54px;
  }

  .metrics span,
  .metrics small {
    font-size: 12px;
  }

  .metrics strong {
    margin-top: 7px;
    font-size: 24px;
  }

  .rule-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .rule-trigger {
    width: 100%;
  }

  .status {
    align-self: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .entry-open {
    width: 100%;
  }

  .entry-meta,
  .entry-actions,
  .entry-flow-head,
  .entry-player-head {
    grid-template-columns: 1fr;
  }

  .entry-meta,
  .entry-actions,
  .entry-flow-head {
    display: grid;
  }

  .entry-scan {
    grid-template-columns: 1fr;
  }

  .scan-upload {
    width: 100%;
  }

  .entry-dialog {
    width: calc(100vw - 24px);
    max-height: 94vh;
  }

  .entry-dialog .dialog-head {
    padding: 18px 16px;
  }

  .entry-form {
    padding: 14px 12px 18px;
  }

  .entry-meta {
    align-items: stretch;
    justify-items: stretch;
  }

  .entry-player-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .entry-player-head {
    align-items: stretch;
  }

  .entry-player-total {
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
  }

  .score-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .score-field {
    grid-template-columns: 72px 1fr;
    align-items: center;
  }

  .entry-actions {
    align-items: stretch;
  }

  .entry-actions .primary-action,
  .entry-flow-head .secondary-action {
    width: 100%;
  }

  .entry-status {
    text-align: left;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    padding: 12px 10px;
  }

  th:nth-child(n + 5),
  td:nth-child(n + 5) {
    display: none;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 48px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 96px;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 74px;
  }

  .player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-player {
    grid-template-columns: 40px minmax(0, 1fr) 44px 74px;
    gap: 8px;
    padding: 10px 12px;
  }

  .game-player strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-move {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
