@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Marcellus&display=swap');

:root {
  --cream: #f5f1e5;
  --ink: #253b38;
  --muted: #7a8880;
  --gold: #dcc391;
  --line: #ffffff19;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #123d43;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #edc77d;
  outline-offset: 4px;
}

#scene {
  position: fixed;
  inset: 0;
}

#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 52% 47%, transparent 24%, #082e3540
    65%, #08292eaa 100%);
}

header {
  position: relative;
  height: 100px;
  margin: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.brand {
  color: var(--cream);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Marcellus, Georgia, serif;
  font-size: 32px;
  letter-spacing: 5px;
}

.brand-mark {
  color: #dfc492;
  font-size: 47px;
}

.brand small {
  display: block;
  font: 8px 'DM Sans', sans-serif;
  letter-spacing: 3.5px;
  margin-top: 3px;
}

.session {
  font-size: 10px;
  letter-spacing: 2px;
  color: #c1cfca;
}

.session i {
  font-style: normal;
  margin: 0 18px;
  opacity: .4;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #bccb9c;
  border-radius: 50%;
  margin-right: 9px;
}

nav {
  display: flex;
  gap: 20px;
}

.quiet {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 0;
  font-size: 11px;
}

nav span {
  border: 1px solid #ffffff50;
  border-radius: 50%;
  padding: 1px 5px;
  margin-left: 7px;
}

.left,
.right {
  position: absolute;
  top: 132px;
  bottom: 143px;
  z-index: 2;
  width: 252px;
}

.left {
  left: 38px;
}

.right {
  right: 38px;
  width: 246px;
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: #d9c89e;
  font-weight: 600;
}

h1 {
  font: 44px/1.08 Marcellus, Georgia, serif;
  margin: 17px 0;
  color: #f6f1e3;
  letter-spacing: -1px;
}

.intro {
  font-size: 12px;
  line-height: 1.8;
  color: #b0c7c3;
  margin: 0 0 26px;
}

.panel {
  border: 1px solid #d4e0cc24;
  border-radius: 9px;
  background: #10363bcd;
  backdrop-filter: blur(12px);
}

.panel-heading {
  font-size: 9px;
  letter-spacing: 1.5px;
  display: flex;
  justify-content: space-between;
  color: #c1cdc2;
  margin-bottom: 17px;
}

.panel-heading > span {
  font-size: 8px;
  color: #789b96;
  letter-spacing: 1px;
}

.standings {
  padding: 18px;
}

.game-meter {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding: 9px 13px;
  border: 1px solid #d4e0cc1c;
  border-radius: 7px;
  background: linear-gradient(90deg, #ffffff0d, #ffffff05);
}

.game-meter span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.game-meter small {
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #789b96;
}

.game-meter b {
  font: 17px Marcellus, Georgia, serif;
  color: #f4f0e4;
  font-variant-numeric: tabular-nums;
}

@media (max-width:760px) {
  .game-meter {
    margin: 0 4px 8px;
    padding: 4px 10px;
  }

  .game-meter b {
    font-size: 14px;
  }
}

.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #ffffff0a;
}

.avatar {
  height: 32px;
  width: 32px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Marcellus;
  font-size: 16px;
  background: #ffffff08;
}

.player-name {
  flex: 1;
  font-size: 12px;
}

.player-name small {
  display: block;
  font-size: 9px;
  color: #85a5a0;
  margin-top: 3px;
}

.score {
  font: 24px Marcellus;
}

.score small {
  font: 8px 'DM Sans';
  color: #88a49d;
  margin-left: 3px;
}

.player.active .player-name {
  color: #e6c795;
}

.difficulty {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  font-size: 10px;
  color: #d9cbab;
}

.difficulty > span {
  font-size: 24px;
}

.difficulty small {
  display: block;
  color: #88a6a0;
  font-size: 8px;
  margin-top: 4px;
}

.journal {
  margin-top: 15px;
  padding: 17px;
}

.journal .panel-heading {
  margin-bottom: 10px;
}

#log {
  max-height: 114px;
  overflow: auto;
  scrollbar-width: thin;
  font-size: 10px;
  line-height: 1.7;
  color: #9bb8b1;
}

#log p {
  margin: 6px 0;
}

#log p:first-child {
  color: #e6dfc6;
}

.turn {
  background: #f4f0e4;
  color: var(--ink);
  padding: 23px;
}

.turn .eyebrow {
  color: #8a8062;
}

h2 {
  font: 27px/1.15 Marcellus, Georgia, serif;
  margin: 13px 0;
}

.turn p {
  font-size: 11px;
  line-height: 1.7;
  color: #7a8070;
  min-height: 38px;
}

#dice {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

#dice div {
  font-family: Georgia;
  font-size: 44px;
  line-height: 52px;
  width: 54px;
  height: 54px;
  text-align: center;
  background: #fffdf7;
  border-radius: 9px;
  box-shadow: 0 4px 0 #ded8c8, 0 7px 10px #253b3810;
  color: #344740;
}

.primary {
  width: 100%;
  background: #244f46;
  color: #fbf7e9;
  border: 0;
  border-radius: 4px;
  padding: 13px 15px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .3px;
}

.primary span {
  float: right;
}

.primary:hover {
  background: #356a5a;
}

.build {
  margin-top: 16px;
  padding: 19px;
}

.build-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  color: #efeddf;
  text-align: left;
}

.build-icon {
  font-size: 25px;
  width: 26px;
  color: #d8c79f;
}

.build-info {
  flex: 1;
}

.build-info strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}

.build-info small {
  display: block;
  font-size: 8px;
  color: #91ada1;
  margin-top: 5px;
}

.build-row > b {
  font-size: 16px;
  font-weight: 400;
  color: #a3b6a9;
}

.trade-button {
  width: 100%;
  background: none;
  border: 0;
  color: #d4d9c8;
  font-size: 10px;
  text-align: left;
  padding: 14px 0 0;
}

.trade-button span {
  float: right;
  color: #a3b6a9;
}

.award {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 17px 12px 0;
  color: #c1c8b7;
  font-size: 11px;
}

.award > span {
  font-size: 26px;
  color: #d2bc8d;
}

.award small {
  display: block;
  margin-top: 4px;
  color: #729890;
  font-size: 8px;
}

#board-label {
  position: absolute;
  top: 125px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

#board-label span {
  font-size: 9px;
  letter-spacing: 3px;
  color: #d4d7bd;
}

#board-label small {
  display: block;
  font-family: Marcellus;
  font-size: 12px;
  color: #7fa6a0;
  margin-top: 8px;
}

#notice {
  position: absolute;
  bottom: 190px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  background: #123c3dde;
  border: 1px solid #b4c9a43b;
  border-radius: 30px;
  padding: 12px 22px;
  color: #ece5c6;
  text-align: center;
  max-width: 420px;
  pointer-events: none;
}

.camera-tools {
  position: absolute;
  bottom: 143px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.camera-tools button {
  border: 1px solid #ffffff20;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: #17494c;
  color: #c8d4bc;
  font-size: 17px;
}

.camera-tools span {
  font-size: 9px;
  color: #8bb0a8;
  margin-left: 8px;
}

footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 112px;
  background: #0c3036e8;
  border-top: 1px solid #ffffff15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 35px;
  padding: 18px 32px;
  z-index: 3;
}

.hand-title > span {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #c4cdb8;
}

.hand-title small,
.stock small {
  display: block;
  font-size: 9px;
  color: #799d95;
  margin-top: 9px;
}

#hand {
  display: flex;
  gap: 10px;
}

.resource {
  width: 103px;
  height: 72px;
  border: 1px solid #ffffff22;
  border-radius: 6px;
  background: linear-gradient(125deg, #ffffff0c, #ffffff03);
  padding: 12px;
  position: relative;
}

.resource .symbol {
  font-size: 25px;
  color: var(--resource);
}

.resource .count {
  position: absolute;
  right: 12px;
  top: 12px;
  font: 27px Marcellus;
}

.resource .name {
  display: block;
  text-transform: uppercase;
  font-size: 8px;
  letter-spacing: 1.4px;
  margin-top: 6px;
  color: #b5c7b8;
}

.stock {
  font-size: 9px;
  color: #b3c1b2;
}

.stock small {
  font-family: Marcellus;
  font-style: italic;
}

dialog {
  width: min(480px, 92vw);
  border: 1px solid #d6c7a0;
  background: #f4f0e4;
  border-radius: 12px;
  color: #253b38;
  padding: 32px;
  box-shadow: 0 25px 100px #001f29aa;
}

dialog::backdrop {
  background: #052a34b0;
  backdrop-filter: blur(5px);
}

dialog h2 {
  font-size: 30px;
}

dialog p,
dialog li {
  font-size: 12px;
  line-height: 1.8;
}

dialog .close {
  position: absolute;
  right: 14px;
  top: 10px;
  border: 0;
  background: transparent;
  font-size: 25px;
  color: #65776b;
}

dialog label {
  display: block;
  font-size: 11px;
  margin: 15px 0 6px;
}

dialog select,
dialog input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cec9b7;
  background: #fffcf2;
  border-radius: 4px;
  color: #253b38;
}

dialog .primary {
  margin-top: 18px;
}

dialog .card-action {
  padding: 13px;
  border: 1px solid #d7d1be;
  border-radius: 5px;
  background: #fffcf2;
  width: 100%;
  text-align: left;
  margin: 5px 0;
  color: #344d43;
}

#cancel {
  color: #476553;
  width: 100%;
  padding-bottom: 0;
}

#modal-message {
  color: #9c562f;
}

.win {
  font-size: 65px;
  color: #aa8a43;
  text-align: center;
}

@media (min-width:1500px) {
  .left {
    left: 55px;
    width: 270px;
  }

  .right {
    right: 55px;
    width: 260px;
  }

  h1 {
    font-size: 52px;
  }

  .left,
  .right {
    top: 150px;
  }
}

@media (max-height:820px) {
  header {
    height: 78px;
  }

  .left,
  .right {
    top: 98px;
  }

  .intro {
    margin-bottom: 15px;
  }

  h1 {
    font-size: 36px;
    margin: 12px 0;
  }

  .standings {
    padding: 13px;
  }

  .player {
    padding: 7px 0;
  }

  .journal {
    margin-top: 10px;
  }

  .turn {
    padding: 17px;
  }

  .build {
    margin-top: 10px;
    padding: 15px;
  }

  #dice {
    margin: 12px 0;
  }

  .award {
    padding-top: 11px;
  }

  #board-label {
    top: 94px;
  }

  .journal #log {
    max-height: 65px;
  }
}

@media (max-width:1100px) {
  .left {
    width: 200px;
    left: 20px;
  }

  .right {
    width: 210px;
    right: 20px;
  }

  header {
    margin: 0 20px;
  }

  h1 {
    font-size: 34px;
  }

  .session {
    display: none;
  }

  .resource {
    width: 80px;
  }

  .stock {
    display: none;
  }

  footer {
    gap: 20px;
  }

  .award small {
    font-size: 7px;
  }

  .intro {
    font-size: 11px;
  }
}

@media (max-width:760px) {
  body {
    overflow: auto;
  }

  header {
    height: 74px;
  }

  .brand {
    font-size: 24px;
  }

  .brand-mark {
    font-size: 32px;
  }

  nav {
    gap: 14px;
  }

  nav .quiet {
    font-size: 9px;
  }

  .left {
    top: 94px;
    width: 146px;
    left: 14px;
  }

  .left .eyebrow,
  .left h1,
  .intro,
  .journal,
  .difficulty {
    display: none;
  }

  .standings {
    padding: 10px;
  }

  .panel-heading {
    font-size: 8px;
    margin-bottom: 6px;
  }

  .panel-heading > span {
    display: none;
  }

  .player {
    gap: 6px;
  }

  .avatar {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .player-name {
    font-size: 10px;
  }

  .player-name small {
    font-size: 7px;
  }

  .score {
    font-size: 19px;
  }

  .right {
    top: 94px;
    width: 168px;
    right: 14px;
  }

  .turn {
    padding: 13px;
  }

  .turn h2 {
    font-size: 21px;
  }

  .turn p {
    font-size: 10px;
  }

  #dice div {
    width: 39px;
    height: 39px;
    font-size: 34px;
    line-height: 38px;
  }

  #dice {
    margin: 12px 0;
  }

  .build {
    padding: 12px;
  }

  .build-row {
    padding: 9px 0;
    gap: 7px;
  }

  .build-info small {
    font-size: 7px;
  }

  .award {
    display: none;
  }

  #board-label {
    top: 340px;
    left: 25%;
  }

  #board-label span {
    font-size: 7px;
    letter-spacing: 1px;
  }

  #board-label small {
    font-size: 10px;
  }

  .camera-tools {
    bottom: 153px;
  }

  .camera-tools span {
    display: none;
  }

  #notice {
    bottom: 193px;
    font-size: 10px;
    width: 240px;
    left: 44%;
    padding: 9px 12px;
  }

  footer {
    padding: 12px 10px;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 131px;
  }

  .hand-title {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .hand-title small {
    margin: 0;
  }

  .resource {
    width: calc((100vw - 60px)/5);
    height: 67px;
    padding: 9px;
  }

  #hand {
    gap: 7px;
  }

  .resource .count {
    right: 8px;
  }

  .resource .name {
    font-size: 7px;
    letter-spacing: 1px;
  }
}

.symbol svg {
  width: 25px;
  height: 25px;
}

.build-icon svg {
  width: 25px;
  height: 25px;
}

#dice .die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 11px;
  gap: 4px;
}

#dice .die i {
  border-radius: 50%;
  display: block;
}

#dice .die .pip {
  background: #344740;
}

.brand-mark {
  font-family: Georgia;
  font-variant-emoji: text;
}

.build-row {
  padding: 10px 0;
}

.turn p {
  margin-bottom: 10px;
}

.award {
  padding-top: 12px;
}

.award > span {
  font-family: Georgia;
}

.right {
  overflow-y: auto;
  scrollbar-width: none;
}

.right::-webkit-scrollbar {
  display: none;
}

@media (max-width:760px) {
  #dice .die {
    padding: 8px;
    gap: 3px;
  }
}

.brand-mark svg {
  width: 39px;
  height: 44px;
}

.player-name small {
  font-size: 8px;
}

.right {
  bottom: 120px;
}

.build .panel-heading {
  margin-bottom: 6px;
}

.build-row {
  padding: 9px 0;
}

.trade-button {
  padding-top: 12px;
}

.award > span {
  width: 25px;
}

.award small {
  font-size: 8px;
}

@media (max-width:760px) {
  .left {
    top: 85px;
    left: 12px;
    right: 12px;
    width: auto;
    bottom: auto;
  }

  .standings {
    padding: 9px 6px;
  }

  .standings > .panel-heading {
    display: none;
  }

  #players {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .player {
    padding: 0 5px;
    gap: 5px;
    border-bottom: 0;
    border-right: 1px solid #ffffff18;
  }

  .player:last-child {
    border: 0;
  }

  .avatar {
    display: none;
  }

  .player-name {
    font-size: 10px;
  }

  .player-name small,
  .player-name > span {
    display: none;
  }

  .score {
    font-size: 20px;
  }

  .score small {
    font-size: 6px;
    margin-left: 2px;
  }

  .right {
    top: auto;
    bottom: 130px;
    left: 12px;
    right: 12px;
    width: auto;
    height: 178px;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 8px;
  }

  .turn {
    padding: 12px;
  }

  .turn .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }

  .turn h2 {
    font-size: 20px;
    margin: 8px 0;
  }

  .turn p {
    display: none;
  }

  #dice {
    margin: 8px 0;
    gap: 8px;
  }

  #dice .die {
    height: 29px;
    width: 29px;
    padding: 6px;
    gap: 2px;
  }

  .primary {
    padding: 9px;
    font-size: 10px;
  }

  .build {
    margin: 0;
    padding: 10px;
  }

  .build .panel-heading {
    font-size: 7px;
    margin-bottom: 7px;
  }

  #builds {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .build-row {
    border: 1px solid #ffffff15;
    border-radius: 3px;
    padding: 6px 3px;
    gap: 4px;
    display: block;
    text-align: center;
  }

  .build-icon {
    display: block;
    height: 19px;
    width: auto;
  }

  .build-icon svg {
    width: 19px;
    height: 19px;
  }

  .build-info strong {
    font-size: 8px;
  }

  .build-info small,
  .build-row > b {
    display: none;
  }

  .trade-button {
    font-size: 8px;
    padding-top: 9px;
  }

  .trade-button span {
    font-size: 9px;
  }

  #cancel {
    font-size: 9px;
    padding-top: 4px;
  }

  .turn:has(#cancel:not([hidden])) #dice {
    display: none;
  }

  #board-label {
    top: 144px;
    left: 50%;
    width: 100%;
  }

  #board-label span {
    font-size: 8px;
    letter-spacing: 2px;
  }

  #board-label small {
    margin-top: 5px;
  }

  .camera-tools {
    bottom: 320px;
    left: 85%;
    gap: 4px;
  }

  .camera-tools button {
    height: 24px;
    width: 24px;
  }

  #notice {
    bottom: 325px;
    left: 39%;
    width: 245px;
    font-size: 9px;
    padding: 8px 10px;
  }

  footer {
    min-height: 118px;
    padding: 10px;
  }

  .resource {
    height: 64px;
  }

  .hand-title > span {
    font-size: 8px;
  }

  .hand-title small {
    font-size: 8px;
  }
}

.arrow {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: middle;
}

.primary .arrow {
  width: 11px;
  height: 11px;
}

nav .arrow {
  margin-left: 5px;
}

.camera-tools .arrow {
  width: 15px;
  height: 15px;
}

.award > span svg {
  width: 25px;
  height: 25px;
}

.difficulty > span .arrow {
  width: 20px;
  height: 24px;
}

.audio-setting {
  margin: 24px 0;
}

.audio-setting label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.audio-setting output {
  font-variant-numeric: tabular-nums;
  color: #768471;
}

.audio-setting input[type=range] {
  padding: 0;
  margin: 7px 0;
  height: 24px;
  accent-color: #315d4e;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.audio-mix {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  margin: 0 0 20px;
  font-size: 12px;
  cursor: pointer;
}

.audio-mix input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #315d4e;
}

.audio-mix small {
  grid-column: 2;
  color: #788373;
  font-size: 10px;
}

.audio-note {
  color: #788373;
  font-size: 10px !important;
}

@media (max-width:760px) {
  nav {
    gap: 10px;
  }

  header .brand {
    gap: 8px;
    font-size: 22px;
    letter-spacing: 3px;
  }

  .brand small {
    letter-spacing: 2px;
  }

  .brand-mark svg {
    width: 30px;
    height: 36px;
  }
}

.mobile-build-toggle {
  display: none;
}

#build-toggle[hidden] {
  display: none !important;
}

#audio-status {
  color: #526e60;
  font-size: 11px;
}

@media (max-width:760px) and (pointer:coarse) {
  body {
    overflow: hidden;
  }

  .right {
    bottom: 83px;
    height: 58px;
    grid-template-columns: 1fr 104px;
    gap: 7px;
  }

  .turn {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px;
    padding: 9px;
  }

  .turn .eyebrow,
  .turn h2,
  .turn p {
    display: none;
  }

  #dice {
    margin: 0;
    gap: 5px;
  }

  #dice .die {
    width: 24px;
    height: 24px;
    padding: 5px;
    gap: 2px;
    box-shadow: 0 2px 0 #ded8c8;
  }

  .turn .primary {
    min-height: 38px;
    padding: 7px;
    font-size: 10px;
  }

  .turn .primary span {
    display: none;
  }

  .turn:has(#cancel:not([hidden])) #primary {
    display: none;
  }

  #cancel:not([hidden]) {
    grid-column: 1 / -1;
    min-height: 38px;
    padding: 6px;
    font-size: 12px;
  }

  .mobile-build-toggle {
    display: block;
    border: 1px solid #d6c7a050;
    border-radius: 7px;
    background: #1b4945;
    color: #f5edda;
    font-size: 11px;
    min-height: 44px;
    padding: 9px;
  }

  .right .build {
    display: none;
  }

  .right.tray-open .build {
    display: block;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 15px;
    max-height: 48vh;
    max-height: 48dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #113c3e;
    box-shadow: 0 -12px 35px #062a3266;
  }

  .build .panel-heading {
    font-size: 9px;
    margin-bottom: 10px;
  }

  #builds {
    gap: 7px;
  }

  .build-row {
    min-height: 64px;
    padding: 9px 6px;
  }

  .build-info strong {
    font-size: 11px;
    margin-top: 3px;
  }

  .build-info small {
    display: block;
    font-size: 8px;
    line-height: 1.4;
  }

  .trade-button {
    min-height: 40px;
    font-size: 11px;
    padding-top: 12px;
  }

  #board-label {
    display: none;
  }

  #notice {
    bottom: 154px;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 8px 14px;
  }

  .camera-tools {
    top: 139px;
    bottom: auto;
    left: auto;
    right: 12px;
    transform: none;
    gap: 4px;
  }

  .camera-tools button {
    width: 36px;
    height: 40px;
  }

  footer {
    min-height: 74px;
    padding: 7px 10px;
    gap: 5px;
  }

  .resource {
    height: 43px;
    padding: 4px 7px;
  }

  .resource .symbol svg {
    width: 18px;
    height: 18px;
  }

  .resource .count {
    font-size: 22px;
    top: 3px;
  }

  .resource .name {
    font-size: 6px;
    margin-top: 2px;
  }
}
/* Player colors carry from the pieces to the turn indicator. */
.player {
  border-radius: 5px;
  box-shadow: inset 3px 0 var(--player-color);
  padding-left: 9px;
}
.player.active {
  background: color-mix(in srgb, var(--player-color) 22%, #103b3e);
  outline: 2px solid var(--player-color);
}
.player.active .player-name {
  color: #fff;
  font-weight: 700;
}
.player.active .score {
  color: var(--player-color);
}
.turn {
  border-top: 3px solid var(--active-color);
}
#turn-label {
  color: var(--active-color);
  font-weight: 700;
}
.board-status {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(440px, calc(100vw - 24px));
  text-align: center;
  pointer-events: none;
  background: #103638ed;
  border: 1px solid var(--active-color);
  border-radius: 12px;
  padding: 10px 16px;
}
.board-status #notice {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--active-color);
  font-weight: 700;
}
#latest-action {
  color: #fff5de;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}
.trade-partners {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 18px;
}
.trade-partners button {
  min-height: 44px;
  padding: 6px;
  border: 1px solid #b6bdac;
  border-radius: 6px;
  background: #fffcf2;
  color: #253b38;
  font-size: 11px;
}
.trade-partners button[aria-pressed=true] {
  background: #214f48;
  color: white;
  border-color: #214f48;
}
.trade-side h3 {
  font-size: 13px;
  margin: 14px 0 8px;
}
.trade-resources {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.trade-resource > button:first-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  width: 100%;
  border: 1px solid #bcc5b5;
  border-radius: 6px;
  background: #fffdf5;
  color: #253b38;
}
.trade-resource > button[aria-pressed=true] {
  background: #e3ead9;
  border: 2px solid #346951;
  padding: 7px 1px;
}
.trade-resource .symbol {
  color: color-mix(in srgb, var(--resource) 70%, #253b38);
}
.trade-resource svg {
  width: 24px;
  height: 24px;
}
.trade-resource strong {
  font-size: 10px;
  text-transform: capitalize;
}
.trade-resource b {
  font-size: 18px;
}
.trade-resource small {
  font-size: 8px;
}
.trade-minus {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #253b38;
  font-size: 20px;
}
.trade-resource button:disabled {
  opacity: .45;
}
#modal-message {
  min-height: 22px;
  font-weight: 600;
}
dialog {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
@media (max-width:760px) {
  .player {
    padding-left: 6px;
  }
  .board-status {
    bottom: 315px;
    padding: 8px 12px;
  }
  dialog {
    padding: 24px 16px;
  }
}
@media (max-width:760px) and (pointer:coarse) {
  .board-status {
    bottom: 151px;
  }
  .board-status #notice {
    width: auto;
    padding: 0;
  }
  #latest-action {
    font-size: 11px;
  }
  .camera-tools::after {
    content: '1 finger: pan · 2: orbit / pinch';
    position: absolute;
    right: 0;
    top: 44px;
    width: max-content;
    font-size: 9px;
    color: #f4edda;
    background: #103638dd;
    border-radius: 4px;
    padding: 5px 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
  }
}

/* Fast card taps should not trigger Safari's double-tap zoom. Pinch stays available. */
button,
input,
select,
label {
  touch-action: manipulation;
}
input,
select {
  font-size: 16px;
}
#view-mode {
  width: 48px;
  font-size: 11px;
}
body.top-down .camera-tools::after {
  content: 'Drag: pan · Pinch: zoom';
}
body.dusk footer {
  background: #172638ed;
}
body.dusk header {
  background: #1c293c;
}
@media (max-width:760px) and (pointer:coarse) {
  footer {
    position: fixed;
    min-height: 86px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .resource {
    height: 50px;
  }
  .resource .symbol {
    display: block;
    height: 23px;
    line-height: 23px;
  }
  .resource .name {
    font-size: 8px;
    line-height: 12px;
    letter-spacing: .5px;
    margin-top: 2px;
  }
  .right {
    bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  }
  .board-status {
    bottom: calc(163px + env(safe-area-inset-bottom, 0px));
  }
  header {
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }
}

/* Public records stay visible even when the mobile build tray is closed. */
button.player {
  width: 100%;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}
button.player:focus-visible {
  outline: 2px solid #f4d47b;
  outline-offset: 2px;
}
.public-counts {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  color: #c4d4c8;
  font-size: 10px;
  font-weight: 400;
}
#public-awards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #ffffff20;
  margin-top: 8px;
  font-size: 10px;
  color: #c4d4c8;
}
#public-awards strong {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.played-card-list {
  list-style: none;
  padding: 0;
}
.played-card-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #253b3822;
}
@media (max-width:760px) {
  button.player {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px;
    padding: 5px;
    align-items: start;
  }
  .player-name .public-counts {
    display: grid;
    font-size: 8px;
    line-height: 1.35;
    letter-spacing: 0;
  }
  .player .score {
    font-size: 16px;
  }
  .player .score small {
    display: block;
    margin: 0;
  }
  #public-awards {
    padding-top: 7px;
    margin-top: 6px;
    font-size: 9px;
  }
  #public-awards strong {
    font-size: 10px;
  }
}
@media (max-width:760px) and (pointer:coarse) {
  .camera-tools {
    top: 235px;
  }
}
