:root {
  --sea: #173f49;
  --paper: #f7f1e5;
  --terra: #a9422b;
  --line: #d5cbb8;
  --muted: #4e6768;
  color: var(--sea);
  background: var(--paper);
  font:
    16px/1.55 system-ui,
    "Microsoft YaHei",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  color: var(--sea);
  background: #fcf8ed;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55em 0.95em;
  cursor: pointer;
  font-weight: 650;
}
button:hover,
button:focus-visible {
  border-color: #357784;
  box-shadow: 0 2px 7px #163c4324;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff6e2;
}
header {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 max(5vw, 18px);
  background: #fcf8ee;
}
.brand {
  font:
    800 22px Georgia,
    serif;
  color: var(--sea);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.brand i {
  font-style: normal;
  color: var(--terra);
  font-size: 30px;
  vertical-align: middle;
}
nav {
  display: flex;
  gap: 12px;
}
nav button,
.link {
  background: transparent;
  border: 0;
  padding: 0.4em;
}
.hero {
  margin: 20px auto 0;
  width: min(94%, 1440px);
  min-height: clamp(340px, 32vw, 500px);
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(90deg, #163d43e8, #163d4275 39%, transparent 68%),
    url(/art/coast.webp) center/cover;
  display: flex;
  align-items: center;
}
.hero-copy {
  padding: 3.5% 6%;
  color: #fff6dd;
}
.hero h1,
.lobby h1,
.result h1 {
  font:
    800 clamp(42px, 6.2vw, 95px) / 1.05 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  letter-spacing: 0.065em;
  margin: 0.25em 0;
}
.hero p {
  font-size: clamp(16px, 1.3vw, 21px);
  line-height: 1.7;
}
.kicker,
small {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.065em;
}
.hero .kicker {
  border-block: 1px solid #fae3b68a;
  padding: 5px 0;
}
.actions,
.moves {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.actions {
  margin-top: 1.2em;
}
.actions button {
  padding: 0.65em 1.3em;
}
.cream {
  background: #f8eacb;
}
.landing,
.lobby,
.match {
  max-width: 1450px;
  margin: auto;
  padding: 24px max(4vw, 16px) 48px;
}
.landing {
  padding-top: 30px;
}
.sectiontitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sectiontitle h2,
h3 {
  margin: 0.14em 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
}
.sectiontitle h2 {
  font-size: 2rem;
}
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 12px;
}
.features[hidden] {
  display: none;
}
.role-showcase-heading {
  flex-wrap: wrap;
}
.role-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}
.role-pager button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.15rem;
}
.feature,
.rolecard {
  background: #fffbf0;
  text-align: left;
  overflow: hidden;
  padding: 0 0 0.65em;
  border-radius: 8px;
}
.feature > strong,
.feature > small,
.feature p,
.rolecard > strong,
.rolecard > small {
  margin-left: 10px;
}
.feature p {
  color: var(--muted);
  margin-block: 3px;
  margin-right: 10px;
  font-size: 0.84em;
}
.portrait,
.picture {
  position: relative;
}
.portrait img,
.picture img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.feature img {
  height: clamp(90px, 12vw, 195px);
  object-position: center 32%;
}
.portrait b,
.picture b {
  position: absolute;
  top: 6px;
  left: 7px;
  border-radius: 50%;
  background: #fcf1d6;
  color: #513d25;
  min-width: 24px;
  text-align: center;
}
.feature strong,
.rolecard strong {
  font-size: 1.15em;
}
.feature small,
.rolecard small {
  color: var(--terra);
}
dialog {
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  width: min(560px, 94vw);
  max-height: 87dvh;
  overflow: auto;
  box-shadow: 0 20px 100px #0c242f55;
}
dialog:has(.city-profile) {
  width: min(620px, 94vw);
  max-height: 92dvh;
  padding: clamp(14px, 4vw, 28px);
}
dialog::backdrop {
  background: #13333dc7;
}
dialog h2 {
  margin: 0.25em 0 0.6em;
}
#close {
  position: sticky;
  float: right;
  top: 0;
  border-radius: 50%;
  padding: 0;
  width: 34px;
  height: 34px;
  z-index: 2;
}
form label {
  display: block;
  margin: 12px 0;
}
input:not([type="checkbox"]),
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.6em;
  background: #fffdf6;
  color: inherit;
}
form button {
  margin-block: 10px;
}
.manual article,
.result article {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.manual img {
  width: 55px;
  border-radius: 4px;
}
.manual p {
  margin: 0;
  font-size: 0.9em;
}
.bigportrait {
  width: 120px;
  float: left;
  margin-right: 18px;
  border-radius: 6px;
}
.mini {
  font-size: 0.81rem;
  padding: 0.35em 0.7em;
  margin-right: 4px;
}
.lobbycard,
.result {
  max-width: 780px;
  margin: 24px auto;
  border: 1px solid var(--line);
  background: #fffbf2;
  border-radius: 12px;
  overflow: hidden;
  padding: 0 25px 24px;
}
.lobbycard .banner {
  height: 125px;
  object-fit: cover;
  width: calc(100% + 50px);
  margin: 0 -25px 17px;
}
.lobbycard h1,
.result h1 {
  font-size: 2.5rem;
}
.roster > div {
  display: flex;
  align-items: center;
  gap: 12px;
  border-block-end: 1px solid var(--line);
  padding: 10px 0;
  flex-wrap: wrap;
}
.roster > div > span {
  margin-left: auto;
}
.roster select {
  width: auto;
  padding: 4px;
}
.seatno {
  border-radius: 50%;
  background: #e9dfc8;
  padding: 4px 11px;
}
.public-screen {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  align-items: center;
  gap: clamp(6px, 2vw, 16px);
  margin: 6px 0 10px;
  min-height: 44px;
  padding: 6px clamp(8px, 2vw, 14px);
  border: 1px solid #d5b780;
  border-radius: 8px;
  background: #fff0cd;
  color: #593e24;
  font-size: 0.9rem;
  cursor: pointer;
}
.public-screen:hover,
.public-screen:focus-within {
  border-color: #a77538;
  background: #ffe9b8;
}
.public-screen .role-announcement {
  font-weight: 750;
  overflow-wrap: anywhere;
  text-align: center;
}
.public-screen button {
  justify-self: end;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.83em;
  white-space: nowrap;
}
.public-screen button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}
.public-screen button:hover,
.public-screen button:focus-visible {
  box-shadow: none;
}
.public-screen button:focus-visible::after {
  outline: 2px solid #895f36;
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .public-screen {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}
.playgrid {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(260px, 1fr);
  gap: 15px;
}
.tablepanel,
.actionpanel,
.hand,
.result {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf0;
  overflow: hidden;
}
.harbor {
  height: clamp(360px, 39vw, 530px);
  overflow: hidden;
  position: relative;
  background: #a7dfe9;
}
.harbor canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.harbor label {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  padding: 2px 7px;
  background: #163e47db;
  color: #fff8e8;
  font-size: 0.74em;
  max-width: 32%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.harbor .pawn-heading {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.harbor .pawn-buildings {
  flex: none;
  color: #f0e6cc;
  font-size: 0.88em;
}
.harbor .pawn-roles {
  display: block;
  color: #ffe1a0;
  font-size: 0.9em;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.harbor .pawn-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.harbor .pawn-resources {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 58px;
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
.harbor .pawn-gold {
  color: #ffdf89;
}
.harbor label.active {
  background: #9e4027;
}
.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 5px;
  padding: 6px 8px;
}
.seat {
  min-width: 0;
  min-height: 44px;
  padding: 3px 7px;
  font-size: 0.74rem;
  line-height: 1.3;
  text-align: left;
}
.seat-heading,
.seat-stats {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.seat-name {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-heading .ping,
.seat-managed {
  margin: 0;
  font-size: 0.65rem;
}
.seat-managed {
  color: var(--terra);
}
.seat-stats {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 4px;
  margin-top: 2px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.actionpanel,
.hand,
.result {
  padding: 17px;
}
.actionpanel h3 {
  font-size: 1.55em;
}
.actionpanel p {
  font-size: 0.86em;
  margin: 0.45em 0;
}
.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 7px;
}
.actionpanel .rolecard {
  container-type: inline-size;
}
.actionpanel .rolecard > .long-role-name {
  margin-inline: 5px;
  font-size: 0.75em;
  font-size: min(1em, calc((100cqi - 10px) / var(--name-length)));
  white-space: nowrap;
}
.rolecard img {
  aspect-ratio: 1.15;
}
.rolecard small,
.rolecard strong {
  display: block;
  line-height: 1.35;
}
.rolecard small {
  font-size: 0.7em;
}
.rolecard b {
  font-size: 0.75em;
  min-width: 19px;
}
.revealed,
.accent {
  background: #e2eee5;
}
.moves {
  margin-top: 12px;
}
.moves button {
  font-size: 0.85em;
}
.hand {
  margin-top: 14px;
}
.table-supply {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 12px;
  margin: 0;
  padding: 0 9px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.hand-balances {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.cards {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 7px 0;
}
.district {
  width: 144px;
  flex: none;
  background: #f7f1e4;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
}
.district .picture b {
  background: #f4cc74;
}
.district > small,
.district > strong,
.district > p {
  display: block;
  margin: 3px 8px;
}
.district > small {
  color: var(--ink);
  font-size: 0.7em;
}
.district p {
  font-size: 0.72em;
  color: #465b5d;
}
.result-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-left: auto;
  letter-spacing: normal;
}
.result-breakdown > span {
  white-space: nowrap;
}
.score-bonus {
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--muted);
}
.score-bonus.five-colors {
  color: #5b3a79;
  background: #eaddf6;
}
.score-bonus.completion {
  color: #784119;
  background: #f6dcb2;
}
.record,
details {
  margin: 12px 0;
}
.record summary,
summary {
  cursor: pointer;
  font-weight: 700;
}
.record ol {
  max-height: 230px;
  overflow: auto;
}
#notice:not(:empty) {
  position: fixed;
  z-index: 20;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.7em 1.2em;
  background: var(--sea);
  color: white;
  border-radius: 8px;
}
dialog:has(+ #notice:not(:empty)) {
  outline: 2px solid #b09354;
}
#inside .district-term,
.atlas .district > small,
.atlas .district > strong {
  color: color-mix(in srgb, var(--ink) 75%, #172d31);
  font-weight: 700;
}
.atlas .district .picture b {
  color: #684602;
}
.atlas .copies {
  color: #465b5d;
  white-space: nowrap;
}
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr));
  gap: 8px;
}
.atlas-grid .district {
  width: auto;
  min-width: 0;
}
.district .picture img {
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
.district:has(.ability) .picture img { aspect-ratio: 1; }
.district strong, .district p {
  overflow-wrap: anywhere;
}
.district .picture b {
  border-radius: 12px;
  padding: 0 6px;
}
.district .family { color: var(--muted); }
.district .ability {
  margin: 6px 8px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}
.district .ability > b {
  display: block;
  color: #675276;
}
.check input {
  margin-right: 8px;
}
@media (max-width: 760px) {
  header {
    height: 53px;
  }
  nav {
    gap: 4px;
  }
  nav button {
    font-size: 0.82em;
  }
  .hero {
    margin: 10px auto 0;
    min-height: 310px;
    background-position: 62% center;
  }
  .hero-copy {
    padding: 22px;
  }
  .hero h1 {
    font-size: 48px;
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }
  .feature img {
    height: 115px;
  }
  .landing,
  .match,
  .lobby {
    padding: 12px 12px 32px;
  }
  .playgrid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .harbor {
    height: clamp(345px, 105vw, 460px);
  }
  .seats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 4px;
    padding: 4px;
  }
  .actionpanel,
  .hand {
    padding: 11px;
  }
  .roles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .actionpanel h3 {
    font-size: 1.17em;
  }
  .hand {
    margin-top: 8px;
  }
  .district {
    width: 117px;
  }
  .roster > div {
    gap: 5px;
  }
  .lobbycard {
    padding-inline: 12px;
  }
  .result article {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .result-breakdown {
    flex-basis: 100%;
    margin-left: 0;
  }
}
@media (max-width: 360px) {
  .seat-stats {
    font-size: 0.69rem;
    column-gap: 2px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .revealed,
  .result {
    animation: reveal 0.4s ease-out;
  }
  @keyframes reveal {
    from {
      opacity: 0.3;
      transform: translateY(5px);
    }
  }
}
.harbor.flat {
  background:
    radial-gradient(ellipse at 32% 36%, #dcf5ee85, transparent 40%) 0 0 / 140% 130%,
    radial-gradient(ellipse at 72% 70%, #408caa80, transparent 52%) 0 0 / 160% 150%,
    linear-gradient(145deg,#b5e5e6,#7fc2d2 54%,#a6dadb);
}
.harbor.flat::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dock-w);
  height: var(--dock-h);
  transform: translate(-50%, -50%);
  background: repeating-linear-gradient(#966b50 0 6px,#75513e 7px 8px);
  border-radius: 3px;
  box-shadow: 0 2px 0 #664638;
}
@media (prefers-reduced-motion: no-preference) {
  .harbor.flat { animation: harbor-water 12s ease-in-out infinite alternate; }
  .harbor.flat::before, .harbor .flat-stock, .harbor .flat-pawn { animation: harbor-bob 5s ease-in-out infinite alternate; }
  .harbor.flat::before, .harbor .flat-stock { --bob-distance: 1px; --bob-angle: 1deg; }
  @keyframes harbor-water { to { background-position: 85% 40%, 30% 90%, 0 0; } }
  @keyframes harbor-bob { from { translate: 0 calc(-1 * var(--bob-distance, 2px)); rotate: calc(-1 * var(--bob-angle, 2deg)); } to { translate: 0 var(--bob-distance, 2px); rotate: var(--bob-angle, 2deg); } }
}
.revealed {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  padding: 4px 7px;
}
.revealed img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
}
.ping {
  font-size: 10px;
  color: #4d675d;
}
.ping.warm {
  color: #985513;
}
.ping.hot {
  color: #af3328;
}
.city-profile h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35em;
}
.city-player-name {
  margin-bottom: 0.2em;
  overflow-wrap: anywhere;
}
.city-status,
.city-profile section p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 4px 0;
}
.city-stats,
.city-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0;
  padding: 0;
}
.city-stats > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.city-stats dt,
.city-roles span {
  color: var(--muted);
  font-size: 0.78rem;
}
.city-stats dd {
  margin: 0;
  font-weight: 700;
}
.city-profile > section {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 10px;
}
.city-roles li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
}
.city-roles li p {
  flex-basis: 100%;
}
.city-districts {
  flex-wrap: wrap;
  overflow: visible;
}
.city-districts .district {
  width: min(144px, calc((100% - 9px) / 2));
}
.pickhand {
  display: flex;
  gap: 8px;
  overflow: auto;
}
.pickhand button {
  padding: 0;
  overflow: hidden;
  border-width: 2px;
}
.pickhand .district {
  border: 0;
  white-space: normal;
  text-align: left;
}
.district.can-build {
  cursor: pointer;
  outline: 2px solid #477968;
  outline-offset: -2px;
}
.district.can-build:focus-visible {
  outline: 3px solid #a83c25;
}
.district .buildhint {
  font-size: 0.68em;
  color: #345f4b;
  margin: 2px 8px;
}
.district .build-blocked {
  margin: 4px 8px 7px;
  color: #79452e;
  font-size: .75em;
}
.turntime {
  float: right;
  font-size: 0.74rem;
  color: #6c6759;
}
.roster .ping {
  margin: 0;
}
.result {
  border-top: 5px solid #b98036;
  background: linear-gradient(115deg, #fff9e9, #efe5cc);
}
.record output {
  display: block;
  padding: 14px;
  background: #e6ebdf;
  margin-block: 10px;
  border-radius: 6px;
}

.role-strip {
  margin: 12px 0 5px;
}
.role-strip h3 {
  font-weight: 700;
  font-family: inherit;
  font-size: 0.8rem;
  margin: 0 0 5px;
}
.role-strip ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  gap: clamp(2px, 0.65vw, 9px);
}
.role-strip li {
  position: relative;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fffaf0;
}
.role-strip li > div {
  position: relative;
}
.role-strip img {
  display: block;
  width: 100%;
  height: clamp(39px, 5.7vw, 78px);
  object-fit: cover;
  object-position: 50% 33%;
}
.role-strip li b {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 1.4em;
  border-radius: 50%;
  background: #fcf1d6;
  color: #513d25;
  font: 700 0.7rem/1.4 system-ui;
}
.role-strip strong,
.role-strip li span {
  display: block;
  padding: 0 2px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.role-strip strong {
  font-size: clamp(10px, 1.1vw, 15px);
  margin-top: 2px;
}
.role-strip li span {
  font-size: clamp(10px, 0.95vw, 13px);
  color: var(--muted);
  margin-bottom: 3px;
}
.role-strip li[aria-current] {
  outline: 2px solid var(--terra);
  outline-offset: -1px;
  background: #99452f;
}
.role-strip li[aria-current] strong,
.role-strip li[aria-current] span {
  color: #fff7df;
}
.role-strip li:not(.called) img {
  opacity: 0.72;
}

.role-strip li.face-up {
  background: #e9ebdf;
  border-color: #a7ad93;
}
.role-strip li.face-up img {
  filter: grayscale(1);
  opacity: 0.62;
}
.role-strip li.face-up span {
  color: #44523c;
  font-weight: 700;
}

.quantity {
  color: #654027;
  font-weight: 700;
  white-space: nowrap;
}
.quantity-buildings {
  color: #858e98;
}
.money {
  color: #8c6109;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.piece-controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.live-record {
  border-top: 1px solid var(--line);
  margin-top: 0.65rem;
  padding-top: 0.4rem;
}
.live-record h4 {
  font-size: 0.85rem;
  margin: 0.2rem 0;
}
.live-record ol {
  margin: 0;
  padding-left: 1.45em;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.harbor .transfer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 3;
  will-change: transform;
  box-shadow: 0 2px 4px #33251666;
}
.harbor .transfer.card {
  width: clamp(16px, 2vw, 26px);
  height: clamp(22px, 2.8vw, 36px);
  background: #943f31 url(/art/card-back.webp) center/cover;
  border: 1px solid #f5dcad;
  border-radius: 3px;
}
.harbor .transfer.gold {
  width: clamp(14px, 1.5vw, 20px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ffe99c, #e6b448 50%, #b47b26);
  border: 2px ridge #edbd59;
}
.harbor label {
  z-index: 2;
  line-height: 1.25;
}
.harbor .winner-halo {
  position: absolute;
  width: clamp(34px, 5vw, 74px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #ffedac40 18%, #ffd768bd 56%, #fff0ae 84%);
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 70% 58%, 80% 94%, 50% 73%, 20% 94%, 30% 58%, 2% 35%, 38% 34%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
.harbor label.winner {
  outline: 2px solid #f9d478;
  box-shadow: 0 0 12px #ffe7a2b0;
}
@media (prefers-reduced-motion: no-preference) {
  .harbor .winner-halo {
    animation: winner-shine 1.45s ease-in-out infinite alternate;
  }
  @keyframes winner-shine {
    from { opacity: 0.68; }
    to { opacity: 1; }
  }
}
.harbor .flat-pawn,
.harbor .flat-stock {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 2px 4px;
  line-height: 1.2;
}
.harbor .flat-stock.card {
  width: 16px;
  height: 22px;
  background: url(/art/card-back.webp) center/cover;
  border-radius: 2px;
}
.harbor .flat-stock.gold {
  color: #ffe498;
  background: #946a20;
}

.role-strip li.assassinated {
  background: #e9e6e1;
  border-color: #b7b4ac;
}
.role-strip li.assassinated strong {
  color: #464440;
}
.role-strip li.assassinated img {
  filter: grayscale(1);
}
.role-strip li.assassinated > div::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background:
    linear-gradient(45deg, transparent 44%, #c72a22 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #c72a22 44% 56%, transparent 56%);
}
.role-strip li.assassinated span,
.role-strip li.assassination-miss span {
  color: #9b241b;
  font-weight: 750;
}
.assassination-notice {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 6px 14px;
  border-radius: 16px;
  background: #592721;
  color: #fff4df;
  text-align: center;
  font-weight: 750;
  pointer-events: none;
}
.round-notice {
  background: #244b4d;
}
.flat-crown {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -55%);
  color: #c94632;
  text-shadow: 0 0 2px #ffd272, 0 1px 1px #a57422;
  font-style: normal;
  font-size: 20px;
  pointer-events: none;
}

.flat-crown.spinning { animation: spin-flat-crown 5s linear infinite; }
@keyframes spin-flat-crown { to { transform: translate(-50%, -55%) rotateY(1turn); } }

.table-round {
  position: absolute;
  z-index: 3;
  bottom: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #163e47;
  color: #fff8e8;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
}

.harbor .city-target {
  position: absolute;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.harbor.flat .city-target {
  background: #b8c49e;
}
.harbor .city-target:hover,
.harbor .city-target:focus-visible {
  background: #f4db905a;
  box-shadow: inset 0 0 0 2px #f6d78b;
}

.music-volume {
  position: relative;
  align-self: center;
  margin: 0;
}
.music-volume summary {
  padding: 0.4em;
  list-style: none;
  font-weight: 650;
  white-space: nowrap;
}
.music-volume summary::-webkit-details-marker {
  display: none;
}
.music-volume[open] label,
.music-volume[open] input {
  position: absolute;
  z-index: 5;
  right: 0;
  width: 174px;
  margin: 0;
}
.music-volume label {
  top: 100%;
  padding: 9px 10px 23px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  font-size: 0.84rem;
}
.music-volume output {
  float: right;
}
.music-volume[open] input {
  top: calc(100% + 29px);
  right: 10px;
  width: 154px;
  accent-color: var(--sea);
}
@media (max-width: 760px) {
  .music-volume summary {
    font-size: 0.82em;
  }
}
.flat-demolition {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  font-style: normal;
  pointer-events: none;
}

.city-raze {
  display: block;
  margin: 7px 8px;
  width: calc(100% - 16px);
  padding: 4px;
  color: #8d3425;
  border-color: #bf775f;
  background: #f7e7d9;
  font-size: 0.8em;
}

.turn-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 12px;
  font-size: 0.9rem;
}
.turn-setting label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.turn-setting input {
  width: 4em;
  margin: 0;
  padding: 4px 6px;
}
.turn-setting button {
  margin: 0;
  white-space: nowrap;
}
.turn-setting .add-bot { margin-inline-start: auto; }
@media (max-width: 370px) {
  .turn-setting {
    font-size: 0.78rem;
    gap: 4px;
  }
  .turn-setting input {
    width: 3.25em;
  }
  .turn-setting button {
    padding-inline: 5px;
  }
}
.piece-controls .piece-colors {
  align-self: center;
  margin: 0;
}
.piece-colors > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-block: 4px;
}
.piece-swatch {
  display: inline-block;
  width: 0.85em;
  aspect-ratio: 1;
  margin-inline-end: 0.35em;
  border: 1px solid #0003;
  border-radius: 3px;
  background: var(--swatch);
}
.role-strip .role-image,
.revealed .role-peek {
  padding: 0;
  border: 0;
  background: transparent;
}
.role-strip .role-image {
  display: block;
  width: 100%;
}
.revealed .role-peek {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.role-detail img {
  display: block;
  width: min(100%, 250px);
  max-height: 44dvh;
  object-fit: contain;
  margin-inline: auto;
  border-radius: 10px;
}
.confirm-detail {
  margin-block: 1em;
}
.harbor label[role="button"],
.harbor .flat-pawn {
  cursor: pointer;
}
.demolition-countdown {
  position: absolute;
  z-index: 3;
  width: 44px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid #f14338;
  border-radius: 50%;
  background: #971d2166;
  color: #fff;
  font: 800 22px / 38px system-ui, sans-serif;
  text-align: center;
  text-shadow: 0 1px 3px #351713;
  pointer-events: none;
}

.restart-vote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff0cd;
}

.role-strip-heading {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.role-strip-heading h3 {
  margin: 0;
}
.role-strip-heading button {
  padding: 0 8px;
  min-height: 26px;
}
.role-strip li.theft-target {
  box-shadow: inset 0 0 0 2px #ba8028;
}
.role-strip .theft-result {
  display: block;
  color: #855613;
  font-size: 0.95em;
}
.role-strip li[aria-current] .theft-result {
  color: #ffe1a0;
}


.room-directory {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.room-directory button {
  margin: 0;
  text-align: left;
}

.harbor.aiming, .harbor.aiming canvas, .harbor.aiming .city-target { cursor: crosshair }
.harbor.aiming::after {
  content: attr(data-aim);
  position: absolute; bottom: .45rem; right: .5rem; z-index: 3;
  background: #143f49ec; color: #fff4d7; padding: .25em .6em; border-radius: .45em;
  font-size: .8rem; pointer-events: none;
}

.role-strip-controls,
.table-footer-controls,
.lobby-room-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.role-strip-controls {
  margin-inline-start: auto;
}
.table-footer-controls,
.lobby-room-controls {
  margin-block: 6px;
}
@media (max-width: 480px) {
  .role-strip-heading { column-gap: 4px; }
  .role-strip-heading button { padding-inline: 4px; }
  .role-strip-controls button { font-size: .75rem; }
}
