:root {
  --ink: #243e40;
  --muted: #596b65;
  --paper: #faf8f1;
  --line: #dcded1;
  --teal: #24715f;
  --yellow: #ffcf59;
  font-family:
    "Nunito", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: weight;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-image: radial-gradient(#c9c9b94d 0.8px, transparent 0.9px);
  background-size: 8px 8px;
}
button,
a {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #3188cf;
  outline-offset: 3px;
}
button {
  border: 0;
}
a {
  text-decoration: none;
}
i,
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}
svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.wrap {
  width: min(1296px, calc(100% - 8vw));
  margin: auto;
}
header {
  background: #fffdf6;
  border-bottom: 1px solid #d6dbce;
}
.top {
  display: flex;
  align-items: center;
  height: 72px;
  gap: 50px;
}
.brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1.25px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #244839;
  white-space: nowrap;
}
.brandmark {
  background: #235d49;
  color: #fff2bf;
  border-radius: 11px;
  width: 38px;
  height: 38px;
  transform: rotate(-5deg);
  box-shadow: inset 0 -3px #164835;
}
.brandmark svg {
  width: 26px;
  height: 26px;
}
.top nav,
.tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav,
.help,
.iconbtn {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 750;
  font-size: 14px;
}
.nav {
  padding: 10px 15px;
  border-radius: 8px;
  color: #617069;
}
.nav.active {
  background: #e7efdf;
  color: #30624b;
}
.tools {
  margin-left: auto;
}
.iconbtn,
.help {
  border: 1px solid var(--line);
  height: 36px;
  border-radius: 9px;
  background: #fffdf8;
}
.iconbtn {
  width: 37px;
}
.help {
  padding: 0 12px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 29px 0 22px;
  gap: 10px;
}
.grade {
  color: #52745a;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}
.heading h1 {
  font-size: clamp(29px, 3.1vw, 43px);
  line-height: 1.15;
  letter-spacing: -2.4px;
  margin: 7px 0;
  color: #223d36;
}
.heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  word-break: keep-all;
}
.round {
  border: 1px solid #d9dac7;
  background: #fffdf4;
  border-radius: 30px;
  font-size: 13px;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  align-self: flex-end;
  color: #5c695e;
}
.round strong {
  font-size: 16px;
  color: #283e35;
}
.round svg {
  color: #748958;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 29%);
  gap: 23px;
  align-items: start;
}
.frame {
  padding: 8px;
  background: #36544c;
  border: 2px solid #223e38;
  border-radius: 18px;
  box-shadow:
    0 6px 0 #233d37,
    0 10px 15px #273c2b18;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(5, clamp(75px, 7.05vw, 100px));
  background: #576959;
  gap: 2px;
  overflow: hidden;
  border: 2px solid #304a40;
  border-radius: 9px;
  isolation: isolate;
}
.mapart {
  position: relative;
  grid-area: 2/2/5/7;
  background: #a9c795 url("assets/village.jpg") center 51% / cover;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.maptype {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(-5deg);
  margin-top: -4px;
}
.mapstar {
  font-size: 23px;
  color: #edb640;
  text-shadow:
    1px 1px #fff8db,
    -1px -1px #fff8db;
}
.maptype strong {
  font-weight: 1000;
  font-size: clamp(29px, 3.5vw, 55px);
  line-height: 1.02;
  color: #244b40;
  letter-spacing: -3px;
  paint-order: stroke fill;
  -webkit-text-stroke: 6px #fff5d5;
  filter: drop-shadow(2px 4px 0 #61714988);
}
.ribbon {
  background: #216854;
  color: #fff9df;
  clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%, 5% 50%);
  margin-top: 8px;
  letter-spacing: 2px;
  padding: 4px 20px;
  font-size: 12px;
  font-weight: 800;
}
.north {
  position: absolute;
  bottom: 9px;
  right: 10px;
  color: #324e48;
  font: bold 12px Georgia;
  line-height: 0.95;
  text-shadow: 0 1px 3px white;
}
.north:first-line {
  font-size: 9px;
}
.tile {
  position: relative;
  background: #fff8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 1px 2px;
  font-weight: 800;
  color: #374a41;
  font-size: clamp(10px, 1.05vw, 15px);
  line-height: 1.1;
  min-width: 0;
  box-shadow: inset 0 5px var(--tile);
}
.green {
  --tile: #79b39a;
}
.blue {
  --tile: #89b3d4;
}
.purple {
  --tile: #b59ac7;
}
.coral {
  --tile: #dd9a81;
}
.special {
  --tile: #dfba57;
  background: #fff0bc;
}
.tile.start {
  background: #dcebd7;
  --tile: #6aa385;
}
.tile:hover {
  filter: brightness(0.97);
}
.placeicon {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: clamp(23px, 2.45vw, 36px);
  line-height: 1.14;
  filter: drop-shadow(0 2px 0 #866d4629);
}
.tileno {
  position: absolute;
  top: 9px;
  left: 6px;
  font:
    700 9px ui-rounded,
    system-ui;
  color: #7a8170;
}
.tokens {
  position: absolute;
  bottom: 3px;
  right: 2px;
  display: flex;
  gap: 1px;
  pointer-events: none;
}
.token {
  background: #f9b66b;
  border-radius: 50% 50% 40% 40%;
  border: 1px solid #8c5b39;
  padding: 1px;
  font-size: 13px;
  line-height: 1.1;
  box-shadow: 0 1px 1px #56604b;
}
.token.ai {
  background: #c3dcf3;
  border-color: #668aa8;
}
.owned {
  position: absolute;
  top: 6px;
  right: 2px;
  font-size: 11px;
}
.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 19px 0 20px;
  color: #5d685c;
  font-size: 12px;
  font-weight: 650;
}
.legend span,
.statusline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend b {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--tile);
}
aside {
  display: grid;
  gap: 15px;
}
.turncard {
  background: #254d43;
  overflow: hidden;
  color: #fffcf2;
  border-radius: 16px;
  position: relative;
  padding: 22px 22px 18px;
  box-shadow: inset 0 0 0 1px #214b3c;
}
.turnmeta {
  font-size: 12px;
  color: #e5efbf;
  display: flex;
  align-items: center;
  gap: 7px;
}
.dot {
  width: 8px;
  height: 8px;
  background: #bed77f;
  border-radius: 50%;
}
.turncard h2 {
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -1.5px;
  margin: 18px 0 5px;
  position: relative;
  z-index: 1;
}
.turncard p {
  color: #dce7dc;
  font-size: 13px;
  letter-spacing: -0.45px;
  margin: 0;
  position: relative;
  z-index: 1;
}
.turncard canvas {
  position: absolute;
  right: 3px;
  top: 5px;
  width: clamp(64px, 7.3vw, 110px);
  height: auto;
}
.roll {
  width: 100%;
  border: 1px solid #e8af38;
  border-bottom: 4px solid #d8a236;
  border-radius: 10px;
  background: var(--yellow);
  color: #39351d;
  margin-top: 22px;
  min-height: 46px;
  font-weight: 880;
  font-size: 17px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.roll:hover,
.primary:hover {
  filter: brightness(1.04);
}
.roll:active {
  transform: translateY(1px);
}
.panel,
.feed {
  background: #fffdf7;
  border: 1px solid #d4d8c9;
  border-radius: 15px;
}
.players {
  padding: 19px 18px 17px;
}
.sectionTitle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sectionTitle > i {
  color: #5f715b;
}
.sectionTitle h2 {
  font-size: 17px;
  letter-spacing: -0.8px;
  margin: 0;
}
.player {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid #e1e1d6;
  margin-top: 10px;
  background: #faf9f2;
}
.player.current {
  border-color: #c3d7ad;
  background: #f0f5e6;
}
.avatar {
  border-radius: 50%;
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
  background: #ffe0a4;
  font-size: 26px;
  border: 1px solid #dfbe7a;
}
.avatar.ai {
  background: #dce6f0;
  border-color: #c4d3df;
}
.player strong {
  font-size: 15px;
}
.player small {
  font-size: 11px;
  color: #657265;
  display: block;
  margin-top: 3px;
}
.points {
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.coin {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1.6px solid #c49832;
  border-radius: 50%;
  background: #ffdc79;
  color: #98691d;
  font-size: 10px;
  box-shadow: inset 0 0 0 2px #ffeab1;
}
.guide {
  padding: 17px 18px;
  background: #edf3e5;
  border: 1px solid #cfdcc1;
  border-radius: 14px;
}
.guideicon {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: #d9e6c9;
  color: #496c47;
}
.guide p {
  font-size: 14px;
  line-height: 1.55;
  color: #465c49;
  margin: 9px 0;
  word-break: keep-all;
}
.guideLink {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  color: #3e6346;
  padding: 2px 0;
}
.feed {
  padding: 17px 21px;
  margin-bottom: 32px;
}
.feed .sectionTitle h2 {
  font-size: 16px;
}
#events {
  font-size: 13px;
  color: #58685d;
  margin-top: 9px;
}
.event {
  display: flex;
  align-items: baseline;
  gap: 9px;
  line-height: 1.6;
}
.event b {
  color: #697d61;
  font-size: 11px;
  white-space: nowrap;
}
.event + .event {
  margin-top: 5px;
}
.layout[hidden],
[hidden] {
  display: none !important;
}
dialog {
  border: 1px solid #c7cebb;
  color: var(--ink);
  background: #fffdf6;
  border-radius: 19px;
  padding: 0;
  width: min(492px, calc(100% - 24px));
  max-height: 90dvh;
  box-shadow: 0 20px 85px #102b2f52;
}
dialog::backdrop {
  background: #112f2dd0;
  opacity: 0.7;
}
#dialogBody {
  padding: 26px;
  position: relative;
}
.x {
  float: right;
  border-radius: 50%;
  background: #edf1e7;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.category {
  font-size: 12px;
  border-radius: 15px;
  background: #e6efdf;
  color: #416b48;
  display: inline-flex;
  padding: 5px 10px;
  font-weight: 800;
}
.modalicon {
  font-size: 36px;
  margin: 12px 0 4px;
}
dialog h2,
#recordview h2 {
  font-size: 25px;
  line-height: 1.4;
  letter-spacing: -1.2px;
  margin: 13px 0 9px;
  word-break: keep-all;
}
dialog p,
dialog li,
#recordview p {
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
}
dialog ol {
  padding-left: 23px;
}
.choices {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.choice,
.secondary,
.primary {
  border-radius: 9px;
  padding: 11px 15px;
  min-height: 44px;
  font-weight: 750;
}
.choice {
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: baseline;
  background: #fbfaf3;
  border: 1px solid #d9ddce;
  line-height: 1.55;
  font-size: 15px;
}
.choice:hover,
.secondary:hover {
  background: #edf2e5;
}
.choice:disabled {
  opacity: 0.58;
}
.primary {
  background: var(--yellow);
  color: #433717;
  border: 1px solid #e4b248;
}
.secondary {
  background: #f4f5eb;
  border: 1px solid #d5dccb;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
}
.hint,
.note {
  padding: 12px;
  background: #eaf1e4;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}
.hintbtn {
  background: transparent;
  color: #38684e;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 6px 0;
}
.records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.rec {
  padding: 18px;
  border: 1px solid #d5dbcc;
  border-top: 5px solid var(--tile);
  background: #fffdf6;
  border-radius: 12px;
}
.rec h3 {
  margin: 0 0 6px;
}
.rec small {
  color: var(--muted);
}
#recordview {
  margin-bottom: 36px;
}
#recordview .panel {
  padding: 20px;
  margin-bottom: 16px;
}
#recordview button {
  margin-top: 6px;
}
.reportrow {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.empty {
  color: var(--muted);
}
.recent {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.recent small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
@media (min-width: 1550px) {
  .board {
    grid-template-rows: repeat(5, 101px);
  }
}
@media (max-width: 1000px) {
  .wrap {
    width: 95%;
  }
  .layout {
    gap: 15px;
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .top {
    gap: 20px;
  }
  .turncard {
    padding: 17px;
  }
  .turncard canvas {
    width: 68px;
  }
  .player {
    padding: 10px 7px;
    grid-template-columns: 36px 1fr auto;
  }
  .avatar {
    width: 34px;
    height: 34px;
    font-size: 23px;
  }
  .players {
    padding: 15px 12px;
  }
  .legend {
    gap: 8px;
    font-size: 11px;
  }
  .board {
    grid-template-rows: repeat(5, 74px);
  }
}
@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 28px);
  }
  .top {
    height: 58px;
    gap: 12px;
  }
  .brand {
    font-size: 17px;
    gap: 6px;
  }
  .brandmark {
    width: 30px;
    height: 30px;
  }
  .brandmark svg {
    width: 21px;
  }
  .nav {
    padding: 8px 7px;
    font-size: 12px;
    gap: 4px;
  }
  .top nav,
  .tools {
    gap: 4px;
  }
  .tools .help span {
    display: none;
  }
  .help,
  .iconbtn {
    width: 31px;
    height: 32px;
    padding: 0;
  }
  .heading {
    margin: 20px 0 14px;
    align-items: flex-start;
  }
  .heading p {
    font-size: 13px;
  }
  .heading h1 {
    font-size: 30px;
  }
  .round {
    padding: 5px 8px;
    font-size: 11px;
    align-self: flex-start;
  }
  .round strong {
    font-size: 13px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .boardarea,
  aside {
    display: contents;
  }
  .frame {
    order: 0;
    padding: 5px;
    border-radius: 13px;
  }
  .board {
    grid-template-rows: repeat(5, clamp(49px, 10.8vw, 79px));
    gap: 1px;
  }
  .tile {
    font-size: clamp(9px, 2.3vw, 13px);
    gap: 0;
    padding-top: 7px;
    box-shadow: inset 0 4px var(--tile);
  }
  .tileno {
    font-size: 7px;
    top: 6px;
    left: 3px;
  }
  .placeicon {
    font-size: clamp(18px, 4.7vw, 30px);
  }
  .tokens {
    bottom: 0;
    right: 0;
  }
  .token {
    font-size: 9px;
  }
  .maptype strong {
    font-size: clamp(25px, 6.4vw, 42px);
  }
  .mapstar {
    font-size: 15px;
  }
  .ribbon {
    font-size: 10px;
  }
  .legend {
    order: 1;
    margin: 13px 0;
  }
  .turncard {
    order: 2;
    margin-bottom: 12px;
  }
  .turncard h2 {
    margin-top: 9px;
  }
  .turncard canvas {
    width: 91px;
    right: 20px;
  }
  .roll {
    margin-top: 14px;
  }
  .players {
    order: 3;
    margin-bottom: 12px;
  }
  .guide {
    order: 4;
    margin-bottom: 12px;
  }
  .feed {
    order: 5;
  }
  .records {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 445px) {
  .top {
    gap: 6px;
  }
  .brand {
    font-size: 16px;
  }
  .nav i {
    display: none;
  }
  .nav {
    padding: 7px 6px;
  }
  .wrap {
    width: calc(100% - 20px);
  }
  .legend {
    font-size: 10px;
    gap: 7px;
  }
  .round {
    gap: 4px;
  }
  .heading {
    position: relative;
    display: block;
  }
  .round {
    position: absolute;
    right: 0;
    top: 0;
  }
  .heading p {
    font-size: 12px;
  }
  .brandmark {
    width: 27px;
    height: 27px;
  }
  .tile {
    letter-spacing: -0.8px;
  }
  .tileno {
    opacity: 0.75;
  }
  .tokens:has(.token:nth-child(2)) {
    left: 0;
    right: auto;
  }
  .tokens {
    opacity: 0.95;
  }
  .maptype strong {
    -webkit-text-stroke: 4px #fff5d5;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
.owned {
  color: #ae580d;
}
.owned.aiflag {
  color: #327496;
}
.owned svg {
  height: 14px;
  width: 14px;
  fill: #ffc77f;
  stroke-width: 2;
}
.owned.aiflag svg {
  fill: #a9d8eb;
}
@media (max-width: 760px) {
  .tokens,
  .tokens:has(.token:nth-child(2)) {
    bottom: auto;
    left: auto;
    right: 1px;
    top: 4px;
  }
  .token {
    font-size: 8px;
    padding: 0;
  }
  .tile:has(.token) .owned {
    right: auto;
    left: 2px;
    top: 12px;
  }
  .owned svg {
    width: 10px;
    height: 10px;
  }
}

.modeActions,
.roomStrip {
  display: flex;
  gap: 12px;
  align-items: center;
}
.modeActions {
  align-self: flex-end;
}
.modeActions .round {
  align-self: center;
}
.roomEntry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 10px;
  background: #256752;
  color: white;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 14px;
}
.roomWelcome {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  max-width: 900px;
  background: #fffdf6;
  border: 2px solid #36544c;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px #36544c;
}
.postcard {
  background: #c4dcb1 url("assets/village.jpg") center/cover;
}
.roomForm {
  padding: 26px;
  display: grid;
  gap: 15px;
}
.roomForm h2 {
  margin: 0;
}
.roomForm label {
  display: grid;
  gap: 5px;
  font-weight: 750;
}
.roomForm small {
  font-weight: 500;
  color: #576d5d;
}
.roomForm input {
  font: inherit;
  padding: 11px;
  border-radius: 8px;
  border: 1px solid #abb8a9;
  background: white;
  color: var(--ink);
  width: 100%;
}
.roomForm form {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: grid;
  gap: 9px;
}
.roomStrip {
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid #cdd9c3;
  background: #eef4e5;
  border-radius: 12px;
  padding: 9px 15px;
  margin-bottom: 16px;
  font-size: 14px;
}
.roomStrip strong {
  font:
    800 22px ui-rounded,
    system-ui;
  letter-spacing: 3px;
  color: #244f42;
}
.roomStrip .secondary {
  min-height: 36px;
  padding: 6px 12px;
}
.roomFeed {
  margin-top: 18px;
}
.roomFeed p {
  margin: 5px 0;
}
.roomToken {
  border-radius: 50%;
  background: white;
  border: 1px solid #9a9f87;
  font-size: 12px;
  line-height: 1.2;
}
.roomFlag {
  font-size: 12px;
  line-height: 1;
}
.roll:disabled,
.primary:disabled,
.secondary:disabled {
  opacity: 0.65;
}
.turncard #skip {
  margin-top: 8px;
}
.roomStatus {
  font-weight: 800;
}
.player.left {
  opacity: 0.55;
}
@media (max-width: 760px) {
  .modeActions {
    flex-wrap: wrap;
    gap: 5px;
  }
  .roomEntry {
    font-size: 12px;
    padding: 7px 9px;
  }
  .roomWelcome {
    grid-template-columns: 1fr;
  }
  .postcard {
    height: 140px;
  }
  .roomForm {
    padding: 18px;
  }
  .roomStrip {
    gap: 7px;
  }
  .roomFeed {
    order: 5;
  }
  .roomToken {
    font-size: 9px;
  }
  #session .turncard {
    margin-top: 14px;
  }
}
@media (max-width: 445px) {
  .modeActions {
    margin-top: 10px;
  }
  .modeActions .round {
    top: 0;
  }
  .roomStrip strong {
    font-size: 19px;
  }
  .roomStrip {
    font-size: 12px;
  }
  .roomFlag {
    font-size: 9px;
  }
}
