:root {
  color-scheme: dark;
  --bg: #101412;
  --panel: #1b221e;
  --line: #344136;
  --text: #f5f7ef;
  --muted: #a9b5a7;
  --lime: #c5f75a;
  --gold: #e8c779;
  --red: #ff9f9f;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, #253026 0, #101412 65%);
  height: 100%;
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
button {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #232d25;
  min-height: 44px;
  padding: 10px 14px;
}
button:hover:not(:disabled) {
  border-color: var(--lime);
}
.primary {
  background: var(--lime);
  color: #142008;
  border: 0;
  font-weight: 850;
  box-shadow: 0 4px 22px #a6f23816;
}
.primary span {
  float: right;
  font-size: 20px;
}
.ghost {
  background: transparent;
}
.danger {
  color: var(--red);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.7px;
  line-height: 1.15;
}
h3 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
p {
  line-height: 1.6;
  color: var(--muted);
}
small,
.muted {
  color: var(--muted);
}
em {
  font-style: normal;
  color: var(--lime);
}
[hidden] {
  display: none !important;
}
#app {
  height: 100vh;
  height: var(--app-height, 100dvh);
  max-width: 1260px;
  margin: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}
header {
  padding: calc(10px + var(--safe-top)) 16px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
}
.brandmark {
  font-family: Georgia, serif;
  font-size: 25px;
  color: var(--lime);
  border: 1px solid #8da94d80;
  border-radius: 11px;
  padding: 5px;
  position: relative;
}
.brandmark span {
  position: absolute;
  right: -5px;
  top: -7px;
  color: var(--gold);
  font-size: 14px;
}
h1 {
  font-size: 12px;
  letter-spacing: 1.1px;
}
h1 em {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}
header small {
  font-size: 10px;
  display: block;
  margin-top: 4px;
}
.iconbtn {
  padding: 7px;
  width: 44px;
  font-size: 24px;
  background: #202a23;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
  color: var(--lime);
}
#indicators {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 12px 8px;
  padding: 11px 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(120deg, #273126b0, #172019b0);
}
#indicators > div {
  padding: 0 8px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
#indicators > div:last-child {
  border: 0;
}
#indicators small {
  font-size: 8px;
  letter-spacing: 0.8px;
  display: block;
  white-space: nowrap;
}
#indicators strong {
  font-size: 17px;
  display: block;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
#cash {
  color: var(--lime);
}
#worth {
  color: var(--gold);
}
#main {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 12px;
  scrollbar-width: thin;
}
#boardPage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin: auto;
}
.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px;
}
.board-heading h2 {
  font-size: 17px;
  margin-top: 4px;
}
.chip {
  border: 1px solid #46553a;
  color: var(--gold);
  font-size: 10px;
  padding: 8px;
  border-radius: 9px;
  white-space: nowrap;
}
#board {
  position: relative;
  width: min(100%, calc(var(--app-height, 100dvh) - 326px), 575px);
  min-width: 200px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #3b4935 0,
    #17241c 32%,
    #17211a 55%,
    #283128 71%,
    #0b100d 73%
  );
  box-shadow:
    inset 0 0 0 2px #515c3b,
    0 15px 35px #0006;
  isolation: isolate;
  container-type: inline-size;
}
.board-path {
  position: absolute;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #a6c56e35;
  stroke-width: 27px;
  filter: drop-shadow(0 0 5px #bcf65d35);
}
.board-path circle:nth-child(2) {
  stroke-width: 26px;
}
.board-path .dash {
  stroke-width: 1;
  stroke-dasharray: 3 8;
  stroke: #afca7850;
}
.board-center {
  position: absolute;
  left: 31%;
  top: 28%;
  width: 38%;
  text-align: center;
  z-index: -1;
}
.board-center img {
  display: block;
  width: 100%;
  border-radius: 50%;
  mix-blend-mode: screen;
}
.center-badge {
  font-size: 2.2cqw;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.4px;
  margin-top: -5px;
}
.board-center > span {
  font-size: 1.7cqw;
  letter-spacing: 0.5px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.tile {
  position: absolute;
  translate: -50% -50%;
  width: 8.7%;
  height: 8.7%;
  border-radius: 24%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid #7e996850;
  background: linear-gradient(145deg, #3e5434, #1d3022);
  box-shadow:
    0 3px 0 #080f0a,
    0 4px 8px #0005;
  font-size: 3.5cqw;
  color: var(--lime);
}
.tile.outer {
  width: 9.4%;
  height: 9.4%;
  background: linear-gradient(135deg, #615538, #2d2a20);
  color: var(--gold);
  border-color: #c8ab6660;
}
.tile small {
  font-size: 1.8cqw;
  line-height: 1;
  color: #d4dbc8;
}
.tile.social {
  color: #a7d1ff;
  background: linear-gradient(135deg, #344850, #1c2c38);
}
.tile.family,
.tile.wellbeing {
  color: #edb8cc;
  background: linear-gradient(135deg, #503743, #30232c);
}
.tile.market {
  color: #dcc6ff;
  background: linear-gradient(135deg, #403253, #282032);
}
.tile.active {
  box-shadow:
    0 0 0 2px var(--lime),
    0 0 20px #c5f75a80;
}
.tile.active.outer {
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 20px #e8c77980;
}
#pawn {
  position: absolute;
  width: 7.5%;
  height: 11%;
  translate: -50% -80%;
  z-index: 5;
  transition:
    left 0.14s ease,
    top 0.14s ease;
  filter: drop-shadow(0 5px 4px #0009);
  pointer-events: none;
}
#pawn i {
  position: absolute;
  bottom: 0;
  left: 8%;
  width: 84%;
  height: 25%;
  border-radius: 50%;
  background: linear-gradient(#ffe4a4, #9d7023);
  border: 1px solid #ffdf91;
}
#pawn b {
  position: absolute;
  bottom: 12%;
  left: 25%;
  width: 50%;
  height: 62%;
  border-radius: 45% 45% 25% 25%;
  background: linear-gradient(90deg, #678b18, #d6ff7a 40%, #8daf30);
}
#pawn span {
  position: absolute;
  top: 0;
  left: 26%;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #f0ffc5, #b8df48 45%, #577012);
}
.board-caption {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.market-ticker {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 9px 4px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.market-ticker > span {
  color: var(--lime);
  font-size: 10px;
}
.market-ticker b {
  font-size: 11px;
  color: var(--gold);
}
.market-ticker p {
  font-size: 10px;
  line-height: 1.4;
  margin-top: 2px;
}
#controls {
  position: relative;
  z-index: 10;
  background: linear-gradient(#18221bd9, #111713);
  border-top: 1px solid #50633b;
  padding: 8px 12px calc(4px + var(--safe-bottom));
  box-shadow: 0 -10px 30px #0003;
}
.action-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 680px;
  margin: 0 auto 6px;
}
.die-wrap {
  perspective: 250px;
}
#die {
  font-size: 44px;
  color: #e5f2ce;
  line-height: 1;
  width: 50px;
  height: 52px;
  display: grid;
  place-items: center;
  text-shadow: 1px 2px 0 #678b36;
  transform: rotate(-6deg);
  background: linear-gradient(135deg, #3b4d33, #1e2d20);
  border: 1px solid #687d4a;
  border-radius: 13px;
  box-shadow: 2px 3px 0 #070c08;
}
.rolling {
  animation: roll 0.32s linear infinite;
}
.roll-area {
  flex: 1;
  min-width: 0;
}
.roll-area > button {
  width: 100%;
  min-height: 46px;
  letter-spacing: 0.8px;
  font-size: 13px;
}
.roll-area small {
  font-size: 9px;
  display: block;
  text-align: center;
  margin-top: 4px;
  min-height: 12px;
}
nav {
  display: flex;
  max-width: 720px;
  margin: auto;
  justify-content: space-around;
  border-top: 1px solid #34413670;
  padding-top: 4px;
  gap: 3px;
}
nav button {
  flex: 1;
  min-width: 0;
  background: transparent;
  border-color: transparent;
  min-height: 48px;
  padding: 4px 0;
  font-size: 9px;
  color: var(--muted);
  border-radius: 9px;
}
nav button > span {
  display: block;
  font-size: 20px;
  line-height: 23px;
}
nav button.selected {
  color: var(--lime);
  background: #c5f75a0d;
}
#panelPage {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 0 24px;
}
#panelPage > h2 {
  margin: 5px 0 14px;
}
.panel-intro {
  margin-bottom: 18px;
}
.card {
  background: linear-gradient(140deg, #263027, #19221b);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 16px;
  margin: 12px 0;
}
.cardhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cardhead img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 13px;
}
.cardhead p {
  font-size: 11px;
  margin-top: 5px;
}
.row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #81936820;
  font-size: 12px;
}
.row span {
  color: var(--muted);
}
.row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.row.total {
  color: var(--lime);
  font-size: 15px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.grid .metric {
  background: #0c130e70;
  border: 1px solid #3b4a36;
  border-radius: 11px;
  padding: 10px;
  min-width: 0;
}
.metric small {
  display: block;
  font-size: 10px;
}
.metric b {
  display: block;
  font-size: 16px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.positive {
  color: var(--lime);
}
.negative {
  color: var(--red);
}
.gold {
  color: var(--gold);
}
.progress {
  background: #0d140e;
  height: 6px;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}
.progress > i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #769e2d, var(--lime));
}
.buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.buttons button {
  flex: 1;
}
.note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 10px;
}
.empty {
  padding: 24px 18px;
  border: 1px dashed #526348;
  border-radius: 15px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.statsbar {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.statsbar > div {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 10px;
  color: var(--muted);
}
.statsbar b {
  display: block;
  font-size: 19px;
  color: var(--text);
  margin-top: 5px;
}
.timeline {
  border-left: 1px solid #526547;
  margin: 14px 0 0 7px;
  padding-left: 17px;
}
.timeline article {
  position: relative;
  margin-bottom: 16px;
}
.timeline article:before {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  left: -21px;
  top: 5px;
  background: var(--lime);
  border-radius: 50%;
}
.timeline p {
  font-size: 12px;
  line-height: 1.5;
}
.timeline small {
  font-size: 9px;
  color: var(--gold);
}
.badge {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #b799564d;
  color: var(--gold);
  background: #e8c77909;
  border-radius: 20px;
  padding: 8px 11px;
  margin: 3px;
}
.chart {
  width: 100%;
  height: 160px;
  display: block;
  margin: 8px 0;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.tabs button {
  min-height: 38px;
  font-size: 11px;
}
.tabs button.on {
  background: var(--lime);
  color: #17210c;
}
.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--muted);
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050a08c9;
  backdrop-filter: blur(9px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
}
.modal {
  background: linear-gradient(145deg, #293327, #151e18);
  width: min(100%, 540px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #667848;
  border-radius: 24px;
  box-shadow: 0 30px 100px #000b;
  overflow: hidden;
  animation: appear 0.2s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
  gap: 12px;
}
.modal-head .eyebrow {
  font-size: 9px;
}
.modal-head button {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0;
}
.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 6px 18px 16px;
}
.modal-body h2 {
  margin: 7px 0 10px;
}
.modal-art {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center 48%;
  border-radius: 16px;
  margin: 4px 0 8px;
  mask-image: linear-gradient(#000 85%, transparent);
}
.modal-body > p {
  font-size: 13px;
  margin-bottom: 12px;
}
.modal-foot {
  flex-shrink: 0;
  max-height: calc(var(--app-height, 100dvh) * 0.48);
  overflow-y: auto;
  border-top: 1px solid #566640;
  padding: 12px 18px;
  background: #19231bf5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice {
  width: 100%;
  text-align: left;
  background: #29372b;
  padding: 11px 13px;
}
.choice small {
  display: block;
  font-size: 10px;
  line-height: 1.4;
  margin-top: 5px;
  font-weight: 400;
  color: #bdcdb4;
}
.choice:first-child {
  border-color: #a0c252;
  color: var(--lime);
}
.choice.selected {
  background: #43532e;
  border-color: var(--lime);
}
.mode-options {
  display: flex;
  gap: 7px;
  margin: 15px 0;
}
.mode-options button {
  flex: 1;
  font-size: 12px;
  padding: 10px 6px;
}
.jobgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.jobgrid button {
  text-align: left;
  padding: 12px;
}
.jobgrid b {
  font-size: 12px;
  display: block;
}
.jobgrid small {
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
.form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
input,
select {
  min-width: 0;
  max-width: 100%;
  background: #101a13;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  padding: 12px;
  min-height: 44px;
}
input {
  flex: 1;
  width: 100%;
}
select {
  width: 100%;
}
.filelabel {
  display: block;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
}
.filelabel input {
  display: none;
}
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
  padding: 12px;
}
summary {
  cursor: pointer;
  min-height: 30px;
  font-weight: 650;
  line-height: 1.5;
}
details p {
  font-size: 12px;
  margin-top: 10px;
}
.data-table {
  font-size: 10px;
  width: 100%;
  border-collapse: collapse;
}
.data-table td,
.data-table th {
  padding: 8px 3px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.data-table td:first-child,
.data-table th:first-child {
  text-align: left;
}
#toast {
  position: fixed;
  z-index: 200;
  top: calc(10px + var(--safe-top));
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: 92%;
  background: #d5eea7;
  color: #17230c;
  border: 1px solid #eefcce;
  border-radius: 13px;
  padding: 12px 18px;
  box-shadow: 0 8px 40px #0008;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
.save-error {
  color: var(--red) !important;
}
.reduce * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}
@keyframes roll {
  0% {
    transform: rotateX(0) rotateZ(-10deg);
  }
  50% {
    transform: rotateX(180deg) rotateZ(16deg);
  }
  100% {
    transform: rotateX(360deg) rotateZ(-10deg);
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
@media (min-width: 800px) and (min-height: 600px) {
  header {
    padding: 18px 30px;
  }
  h1 {
    font-size: 14px;
  }
  h1 em {
    font-size: 18px;
  }
  header small {
    font-size: 12px;
  }
  #indicators {
    max-width: 760px;
    width: calc(100% - 48px);
    margin: 0 auto 8px;
    padding: 14px;
  }
  #indicators small {
    font-size: 10px;
  }
  #indicators strong {
    font-size: 23px;
  }
  #board {
    width: min(calc(var(--app-height, 100dvh) - 370px), 560px);
  }
  .board-heading h2 {
    font-size: 22px;
  }
  #controls {
    border-radius: 22px 22px 0 0;
    margin: 0 auto;
    width: min(100%, 820px);
  }
  .market-ticker p {
    font-size: 12px;
  }
}
@media (orientation: landscape) and (max-height: 550px) {
  #app {
    grid-template-columns: minmax(0, 1fr) 250px;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  header {
    grid-column: 1;
    grid-row: 1;
    padding: calc(5px + var(--safe-top)) 14px 5px;
  }
  header small {
    display: none;
  }
  h1 em {
    display: inline;
    font-size: 12px;
  }
  .brandmark {
    font-size: 18px;
  }
  #indicators {
    grid-column: 2;
    grid-row: 1/3;
    margin: 8px;
    align-self: start;
    padding: 8px 0;
  }
  #indicators small {
    font-size: 7px;
  }
  #indicators strong {
    font-size: 13px;
  }
  #main {
    grid-column: 1;
    grid-row: 2/4;
    padding: 0 15px;
  }
  #boardPage {
    gap: 3px;
    position: relative;
    justify-content: start;
  }
  #board {
    width: min(calc(var(--app-height, 100dvh) - 92px), 370px);
    min-width: 140px;
  }
  .board-heading {
    position: absolute;
    left: 0;
    top: 10px;
    max-width: 100px;
  }
  .board-heading h2 {
    font-size: 13px;
  }
  .board-heading .chip {
    display: none;
  }
  .board-caption {
    max-width: 340px;
    font-size: 9px;
  }
  .market-ticker {
    display: none;
  }
  .eyebrow {
    font-size: 8px;
  }
  #controls {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    border-radius: 15px 0 0 0;
    padding: 10px 10px calc(5px + var(--safe-bottom));
    height: auto;
  }
  .action-bar {
    gap: 7px;
    flex-wrap: wrap;
  }
  .roll-area {
    min-width: 130px;
  }
  .roll-area > button {
    font-size: 10px;
    padding: 9px;
  }
  #die {
    font-size: 32px;
    width: 39px;
    height: 42px;
  }
  nav {
    flex-wrap: wrap;
  }
  nav button {
    min-width: 55px;
    min-height: 42px;
    font-size: 9px;
  }
  nav button > span {
    font-size: 17px;
    line-height: 18px;
  }
  .modal {
    width: min(95%, 700px);
  }
  .modal-art {
    float: right;
    width: 35%;
    height: 140px;
    margin-left: 12px;
  }
  .modal-foot {
    max-height: calc(var(--app-height, 100dvh) * 0.4);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .choice {
    font-size: 12px;
    padding: 7px 9px;
  }
  .choice small {
    font-size: 9px;
  }
  .modal-head {
    padding: 8px 16px 2px;
  }
}

.tile.inner {
  width: 7.1%;
  height: 7.1%;
  font-size: 3cqw;
}
.tile.inner small {
  font-size: 1.6cqw;
}

#board {
  width: var(--board-size, 300px) !important;
  max-width: 100%;
  flex-shrink: 0;
}
header {
  padding-top: calc(7px + var(--safe-top));
  padding-bottom: 7px;
}
.brandmark {
  font-size: 23px;
}
#indicators {
  padding-top: 9px;
  padding-bottom: 9px;
}
