@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,wght@0,400;0,500;1,400&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #111;
  --text: #f4f3f0;
  --muted: #a4a3a0;
  --line: #333;
  --accent: #d74646;
  --paper: #f4f4f1;
  --serif: "Bodoni Moda", "Times New Roman", serif;
  font-family: Manrope, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:hover:not(:disabled) {
  filter: brightness(1.1);
}
[hidden] {
  display: none !important;
}
.app {
  max-width: 1240px;
  margin: auto;
  padding: 0 52px;
}
.masthead {
  height: 98px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 32px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}
.brand-dot {
  width: 7px;
  height: 7px;
  margin: 17px 0 0 7px;
  background: var(--accent);
}
.header-actions {
  display: flex;
  gap: 26px;
  align-items: center;
}
.preview-label {
  font-size: 10px;
  color: #999;
}
.quiet {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  color: #d6d5d2;
  padding: 10px 0;
}
svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
  flex-shrink: 0;
}
.navigation {
  display: flex;
  gap: 32px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  height: 62px;
}
.navigation button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
}
.navigation button.active {
  color: var(--text);
}
.navigation button.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
.nav-caption {
  margin-left: auto;
  color: #858582;
  font-size: 9px;
}
.unread {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 35px 0 24px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}
h1 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  margin: 9px 0 0;
}
.progress {
  font-size: 28px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.progress span {
  color: #777;
  font-size: 15px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
}
.map-column,
.game-aside {
  min-width: 0;
}
.board-topline {
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--muted);
  font-size: 9px;
}
.board-topline > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}
.board-topline strong {
  font-weight: 500;
  color: var(--text);
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.board-wrap {
  padding: 12px;
  border: 1px solid #626260;
  border-radius: 3px;
  background: #0c0c0c;
  box-shadow:
    0 0 0 4px #1c1c1b,
    0 20px 32px #0005;
}
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  background: #42423f;
}
.cell {
  position: relative;
  aspect-ratio: 1.42;
  min-width: 0;
  padding: 8px;
  text-align: left;
  background: linear-gradient(145deg, #232323, #151515);
  overflow: hidden;
  transition:
    background 0.25s,
    box-shadow 0.25s;
}
.cell:hover {
  box-shadow: inset 0 0 0 1px #a7a6a0;
  z-index: 1;
}
.cell .number {
  display: block;
  font-size: 10px;
  color: #8b8b88;
  font-variant-numeric: tabular-nums;
}
.cell .name {
  display: block;
  font-size: 9px;
  color: #cececa;
  margin-top: 7px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cell.visited {
  background: #343431;
}
.cell.current {
  background: #e8e8e1;
  box-shadow: inset 0 0 0 1px #fff;
}
.cell.current .number,
.cell.current .name {
  color: #161616;
}
.cell.current .name {
  font-weight: 700;
  padding-right: 13px;
}
.token {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 17px;
  height: 17px;
  border-radius: 0;
  clip-path: polygon(50% 0, 95% 35%, 75% 85%, 50% 100%, 25% 85%, 5% 35%);
  background: radial-gradient(
    circle at 30% 23%,
    #fff 0,
    #e9e8e3 25%,
    #91928d 65%,
    #deded8 78%,
    #4d4e4b
  );
  border: 1px solid #f5f5ee;
  box-shadow: 2px 4px 5px #0007;
}
.live-message {
  white-space: pre-wrap;
}
.live-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.live-controls .primary {
  font-size: 14px;
}
#voice-review {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
}
#voice-review audio {
  max-width: 100%;
}
#voice-record,
#voice-review button {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
#connection-status {
  padding: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.cell.landing {
  animation: landing 0.6s ease-out;
}
@keyframes landing {
  50% {
    box-shadow: inset 0 0 0 3px var(--accent);
  }
}
.board-bottomline {
  height: 46px;
  display: flex;
  gap: 17px;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
}
.board-bottomline > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-current,
.legend-visited {
  width: 6px;
  height: 6px;
  background: #e8e8e1;
}
.legend-visited {
  background: #4b4b46;
}
.board-bottomline button {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  padding: 10px 0;
}
.board-bottomline svg {
  width: 13px;
  height: 13px;
}
.turn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.throws-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#throws {
  font-size: 14px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--text);
  color: #171717;
  min-height: 50px;
  padding: 13px 22px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 12px;
}
.primary > svg:last-child {
  margin-left: 16px;
}
.die {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
}
.die svg {
  width: 22px;
  height: 22px;
}
.die.rolling {
  animation: roll 0.18s linear infinite;
}
@keyframes roll {
  50% {
    transform: rotate(35deg) translateY(-3px);
  }
}
.portrait {
  width: 100%;
  aspect-ratio: 1;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.position {
  padding: 24px 0 20px;
}
.position-title {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.position h2 {
  font-family: var(--serif);
  font-size: 47px;
  font-weight: 400;
  line-height: 1.12;
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
.icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid #494949;
  border-radius: 50%;
}
#state-excerpt {
  margin: 0;
  color: #b3b3af;
  font-size: 12px;
  line-height: 1.8;
}
.conversation-link {
  display: block;
  width: 100%;
  background: var(--paper);
  color: #222;
  padding: 18px;
  border-top: 2px solid var(--accent);
  border-radius: 2px;
  text-align: left;
}
.link-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #777;
  font-size: 9px;
}
#preview {
  display: none;
}
.link-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
}
.link-bottom svg {
  width: 23px;
  height: 23px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: #8a8a86;
  font-size: 9px;
}
.page-footer span:first-child {
  font-weight: 800;
  color: #afafaa;
}
.dialogue-view {
  max-width: 850px;
  margin: 0 auto;
  padding-bottom: 40px;
}
.dialogue-heading {
  padding: 30px 0 22px;
}
.dialogue-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.dialogue-heading .quiet {
  border-bottom: 1px solid #666;
}
.reading-surface {
  background: var(--paper);
  color: #222;
  padding: 36px 54px 25px;
  color-scheme: light;
}
.query-band {
  position: relative;
  padding-right: 35px;
  padding-bottom: 22px;
  border-bottom: 1px solid #cdcdc7;
}
.query-band .eyebrow {
  color: #71716c;
}
.query-band p {
  font-size: 13px;
  line-height: 1.8;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.query-band button {
  position: absolute;
  right: 0;
  top: 0;
  padding: 8px;
  color: #666;
}
.messages {
  padding-top: 20px;
}
.message {
  font-size: 14px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  margin: 20px 0 34px;
}
.message .caption {
  display: block;
  font-size: 9px;
  color: #7c7c74;
  font-weight: 700;
  margin-bottom: 12px;
}
.message.user {
  margin-left: 50px;
  padding: 18px 20px;
  background: #e5e5de;
  border-radius: 2px;
  white-space: pre-wrap;
}
.message p {
  margin: 14px 0;
}
.message blockquote {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.65;
  margin: 24px 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
}
.message h2 {
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 400;
  line-height: 1.25;
  margin: 8px 0 22px;
}
.message h3 {
  font-size: 11px;
  margin: 22px 0 8px;
  font-weight: 700;
}
.state-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid #cdcdc7;
  color: #73736a;
  font-size: 10px;
}
.answer-form {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #c8c8c1;
  padding: 14px 0 0;
}
textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.8;
}
textarea::placeholder {
  color: #8a8a83;
}
.send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #252525;
  color: #fff;
}
dialog {
  width: calc(100% - 32px);
  max-width: 550px;
  max-height: 85dvh;
  overflow: auto;
  background: var(--paper);
  color: #252525;
  border: none;
  border-radius: 4px;
  padding: 42px 35px 32px;
  color-scheme: light;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(8px);
}
dialog h2 {
  font-family: var(--serif);
  font-size: 43px;
  line-height: 1.2;
  font-weight: 400;
  margin: 12px 0 24px;
  overflow-wrap: anywhere;
}
dialog .eyebrow {
  color: #6c6c65;
}
dialog h3 {
  font-size: 12px;
  margin: 26px 0 7px;
}
dialog p {
  font-size: 14px;
  line-height: 1.85;
}
dialog .close {
  display: flex;
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 8px;
  color: #777;
}
dialog .primary {
  width: 100%;
  background: #222;
  color: var(--paper);
  margin-top: 26px;
}
.modal-rule {
  width: 34px;
  height: 2px;
  background: var(--accent);
}
#request-form label {
  display: block;
  color: #68685f;
  margin: 26px 0 10px;
  font-size: 12px;
}
#request-form textarea {
  padding: 14px;
  border: 1px solid #c5c5ba;
  border-radius: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #f4f4f1;
  color: #222;
  padding: 14px 22px;
  border: 1px solid #cecec4;
  border-radius: 3px;
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 32px);
  font-size: 12px;
  box-shadow: 0 5px 30px #0003;
}
@media (min-width: 1350px) {
  .cell {
    aspect-ratio: 1.9;
  }
  .cell .name {
    font-size: 11px;
  }
}
@media (max-width: 1000px) {
  .app {
    padding: 0 30px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
  }
  .cell {
    padding: 6px;
    aspect-ratio: 1.18;
  }
  .cell .name {
    font-size: 8px;
    margin-top: 5px;
  }
  .position h2 {
    font-size: 40px;
  }
}
@media (max-width: 700px) {
  .app {
    padding: 0 22px calc(82px + env(safe-area-inset-bottom));
  }
  .masthead {
    height: 75px;
  }
  .wordmark {
    font-size: 25px;
  }
  .brand-dot {
    width: 5px;
    height: 5px;
    margin-top: 13px;
  }
  .preview-label {
    display: none;
  }
  .header-actions .quiet {
    font-size: 10px;
  }
  .navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    gap: 0;
    justify-content: center;
    padding: 0 22px env(safe-area-inset-bottom);
    height: calc(66px + env(safe-area-inset-bottom));
    background: #111111f2;
    backdrop-filter: blur(20px);
    border-top: 1px solid #333;
    border-bottom: 0;
    z-index: 10;
  }
  .navigation button {
    width: 50%;
    justify-content: center;
    height: 66px;
    font-size: 11px;
  }
  .navigation button.active::after {
    bottom: auto;
    top: 0;
    left: 35%;
    right: 35%;
  }
  .nav-caption {
    display: none;
  }
  .page-heading {
    padding: 20px 0 18px;
  }
  h1 {
    font-size: 25px;
  }
  .progress {
    font-size: 25px;
  }
  .progress span {
    font-size: 13px;
  }
  .map-layout {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas: "portrait position" "continue continue" "board board";
    gap: 20px 16px;
  }
  .map-column {
    grid-area: board;
  }
  .board-topline {
    height: 26px;
    font-size: 8px;
  }
  .board-wrap {
    padding: 7px;
  }
  .board {
    gap: 1px;
  }
  .cell {
    padding: 5px;
    aspect-ratio: 1.35;
  }
  .cell .number {
    font-size: 8px;
  }
  .cell .name {
    font-size: 7px;
    margin-top: 5px;
  }
  .cell.current .name {
    padding-right: 0;
  }
  .token {
    width: 12px;
    height: 12px;
    right: 4px;
    bottom: 4px;
  }
  .board-bottomline {
    font-size: 8px;
    height: 42px;
  }
  .board-bottomline button {
    font-size: 8px;
  }
  .turn-bar {
    padding-top: 10px;
    gap: 12px;
  }
  .primary {
    min-height: 48px;
    font-size: 11px;
    padding: 12px 16px;
  }
  .primary > svg:last-child {
    margin-left: 5px;
  }
  .game-aside {
    display: contents;
  }
  .portrait {
    grid-area: portrait;
  }
  .position {
    grid-area: position;
    padding: 0;
  }
  .position h2 {
    font-size: 33px;
    margin: 5px 0 8px;
  }
  .position-title {
    gap: 6px;
  }
  .icon-button {
    width: 29px;
    height: 29px;
  }
  .icon-button svg {
    width: 16px;
    height: 16px;
  }
  #state-excerpt {
    display: none;
  }
  .position .eyebrow {
    font-size: 8px;
  }
  .conversation-link {
    grid-area: continue;
    padding: 15px 18px;
  }
  .link-bottom {
    font-size: 14px;
    margin-top: 10px;
  }
  .page-footer {
    margin-top: 20px;
    padding: 20px 0 0;
    font-size: 8px;
  }
  .reading-surface {
    margin: 0 -22px;
    padding: 26px 22px;
  }
  .dialogue-heading {
    padding: 24px 0 20px;
  }
  .dialogue-heading .quiet {
    font-size: 10px;
  }
  .message {
    font-size: 13px;
    line-height: 1.9;
  }
  .message h2 {
    font-size: 34px;
  }
  .message blockquote {
    font-size: 23px;
    padding-left: 17px;
    line-height: 1.6;
  }
  .message.user {
    margin-left: 22px;
    padding: 15px;
  }
  dialog {
    padding: 38px 25px 28px;
  }
  dialog h2 {
    font-size: 37px;
  }
  #toast {
    bottom: calc(85px + env(safe-area-inset-bottom));
    font-size: 11px;
  }
}
@media (max-width: 360px) {
  .app {
    padding-left: 16px;
    padding-right: 16px;
  }
  .reading-surface {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .cell {
    padding: 4px;
    aspect-ratio: 1.1;
  }
  .cell .name {
    font-size: 7px;
  }
  .map-layout {
    grid-template-columns: 68px minmax(0, 1fr);
  }
  .position h2 {
    font-size: 29px;
  }
  .header-actions .quiet svg {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
