/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
@layer theme {
  :root, :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}

@layer components;

@layer utilities {
  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .table {
    display: table;
  }
}

:root {
  color: #202124;
  font-synthesis: none;
  text-rendering: optimizelegibility;
  background: #f7f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
}

button, input, textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.page {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 24px 0 40px;
}

.home-layout, .session-page {
  gap: 18px;
  display: grid;
}

.page-heading, .session-header, .turn-input-actions, .dialog-actions, .dev-user-banner {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}

.page-heading, .session-header {
  justify-content: space-between;
}

.join-session {
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  display: flex;
}

.join-session label {
  gap: 6px;
  min-width: min(260px, 100%);
  display: grid;
}

.join-session input {
  text-transform: uppercase;
  border: 1px solid #dadce0;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 10px;
}

h1 {
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.dev-user-banner {
  color: #3c4043;
  border-bottom: 1px solid #dadce0;
  justify-content: flex-start;
  padding: 12px 0;
}

.dev-user-banner code, .session-row span {
  overflow-wrap: anywhere;
  min-width: 0;
}

.primary-button, .secondary-button, .link-button {
  cursor: pointer;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 12px;
}

.primary-button {
  color: #fff;
  background: #1a73e8;
  border: 1px solid #185abc;
}

.secondary-button, .link-button {
  color: #202124;
  background: #fff;
  border: 1px solid #dadce0;
}

.link-button {
  align-items: center;
  text-decoration: none;
  display: inline-flex;
}

button:disabled, textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.session-list, .turn-list {
  gap: 10px;
  display: grid;
}

.session-content {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 400px);
  align-items: stretch;
  gap: 20px;
  min-height: 0;
  display: grid;
}

.session-main {
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  height: min(760px, max(420px, 100dvh - 220px));
  min-height: 0;
  display: flex;
}

.turn-list {
  overscroll-behavior: contain;
  flex: auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding-right: 2px;
  overflow-y: auto;
}

.dm-picker, .story-picker, .world-picker {
  gap: 10px;
  display: grid;
}

.dm-picker-options, .story-picker-options, .world-picker-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  display: grid;
}

.dm-option, .story-option, .world-option {
  cursor: pointer;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 6px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 120px;
  padding: 14px;
  display: grid;
}

.world-option {
  grid-template-columns: 22px 96px minmax(0, 1fr);
  align-items: center;
}

.dm-option:has(.dm-radio[data-checked]), .story-option:has(.dm-radio[data-checked]), .world-option:has(.dm-radio[data-checked]) {
  background: #f8fbff;
  border-color: #185abc;
}

.dm-radio {
  background: #fff;
  border: 1px solid #80868b;
  border-radius: 999px;
  place-items: center;
  width: 20px;
  height: 20px;
  display: inline-grid;
}

.dm-radio[data-checked] {
  border-color: #185abc;
}

.dm-radio-indicator {
  background: #185abc;
  border-radius: 999px;
  width: 10px;
  height: 10px;
}

.dm-option-copy, .story-option-copy, .world-option-copy {
  gap: 6px;
  min-width: 0;
  display: grid;
}

.dm-option-copy strong, .story-option-copy strong, .world-option-copy strong {
  overflow-wrap: anywhere;
}

.dm-option-copy small, .story-option-copy small, .world-option-copy small {
  color: #5f6368;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
}

.world-cover-image {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #edf0f2;
  border-radius: 4px;
  width: 96px;
}

.session-row, .opening-scene, .character-creator, .character-sheet, .chat-sidebar, .chat-message, .journal-sidebar, .party-member, .turn-player-action, .turn-event-card {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 6px;
}

.session-row {
  gap: 6px;
  padding: 14px;
  text-decoration: none;
  display: grid;
}

.session-title {
  gap: 4px;
  min-width: 0;
  display: grid;
}

.scene-breadcrumb {
  color: #5f6368;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: .9rem;
  line-height: 1.35;
}

.opening-scene {
  background: #fffaf0;
  gap: 8px;
  padding: 14px;
  display: grid;
  overflow: hidden;
}

.scene-image {
  object-fit: cover;
  background: #edf0f2;
  width: 100%;
}

.opening-scene-image {
  aspect-ratio: 16 / 7;
  border-radius: 4px;
  max-height: 320px;
}

.opening-scene p {
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.55;
}

.character-creator, .character-sheet, .chat-sidebar, .journal-sidebar {
  gap: 14px;
  padding: 14px;
  display: grid;
}

.creator-heading, .sheet-heading, .party-member {
  align-items: center;
  gap: 10px;
  display: flex;
}

.creator-form, .trait-picker, .trait-category, .trait-options, .form-field, .character-sheet section, .sheet-list {
  gap: 10px;
  display: grid;
}

.creator-preview {
  align-items: center;
  display: flex;
}

.creator-preview-image {
  object-fit: cover;
  background: #edf0f2;
  border: 1px solid #dadce0;
  border-radius: 6px;
  width: 96px;
  height: 96px;
}

.form-field span, .trait-category legend {
  color: #3c4043;
  font-size: .86rem;
  font-weight: 700;
}

.trait-category {
  border: 1px solid #dadce0;
  border-radius: 6px;
  min-width: 0;
  padding: 12px;
}

.trait-category legend {
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0 4px;
  display: flex;
}

.trait-category legend small {
  color: #5f6368;
  font-weight: 600;
}

.trait-option {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  display: grid;
}

.trait-option span, .sheet-heading span, .party-member span {
  gap: 3px;
  min-width: 0;
  display: grid;
}

.trait-option small, .sheet-heading small, .party-member small {
  color: #5f6368;
  line-height: 1.35;
}

.party-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}

.party-member {
  min-width: 180px;
  padding: 10px;
}

.party-round-summary {
  color: #5f6368;
  margin: 0;
  font-size: .88rem;
  line-height: 1.35;
}

.character-portrait, .character-portrait-fallback {
  border-radius: 999px;
  flex: none;
  width: 42px;
  height: 42px;
}

.character-portrait {
  object-fit: cover;
}

.character-portrait-fallback {
  color: #185abc;
  background: #e8f0fe;
  place-items: center;
  font-weight: 800;
  display: inline-grid;
}

.session-sidebar {
  gap: 12px;
  display: grid;
  position: sticky;
  top: 12px;
}

.character-sheet, .journal-sidebar, .chat-sidebar {
  min-width: 0;
}

.chat-sidebar-heading, .chat-persona-heading, .chat-tabs, .chat-message-author, .chat-directive-actions, .chat-input {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.chat-sidebar-heading {
  justify-content: space-between;
}

.chat-persona-heading {
  min-width: 0;
}

.chat-persona-heading h2 {
  gap: 2px;
  min-width: 0;
  margin: 0;
  display: grid;
}

.chat-persona-heading h2 small {
  color: #5f6368;
  font-size: .76rem;
  line-height: 1.25;
}

.chat-persona-heading h2 span {
  overflow-wrap: anywhere;
}

.chat-tabs {
  border: 1px solid #dadce0;
  border-radius: 6px;
  overflow: hidden;
}

.chat-tab {
  color: #3c4043;
  cursor: pointer;
  background: #fff;
  border: 0;
  border-right: 1px solid #dadce0;
  min-height: 30px;
  padding: 0 10px;
}

.chat-tab:last-child {
  border-right: 0;
}

.chat-tab[aria-selected="true"] {
  color: #185abc;
  background: #f8fbff;
  font-weight: 700;
}

.chat-message-list {
  gap: 8px;
  max-height: 320px;
  padding-right: 2px;
  display: grid;
  overflow-y: auto;
}

.chat-message {
  background: #f8fbff;
  justify-self: end;
  gap: 6px;
  width: 92%;
  padding: 10px;
  display: grid;
}

.chat-message-dm {
  background: #fff;
  justify-self: start;
}

.chat-message-author {
  min-width: 0;
}

.chat-message:not(.chat-message-dm) .chat-message-author {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.chat-message:not(.chat-message-dm) > p {
  text-align: right;
}

.chat-author-name, .chat-directive-state {
  color: #5f6368;
  font-size: .78rem;
  font-weight: 700;
}

.chat-author-name {
  overflow-wrap: anywhere;
  min-width: 0;
}

.chat-message p, .chat-directive p {
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.45;
}

.chat-directive {
  border-top: 1px solid #edf0f2;
  gap: 6px;
  padding-top: 8px;
  display: grid;
}

.chat-directive-actions {
  justify-content: flex-start;
}

.chat-input {
  align-items: stretch;
}

.chat-input textarea {
  flex: 160px;
  min-width: min(100%, 160px);
}

.journal-sidebar section, .journal-list, .journal-entry {
  gap: 8px;
  display: grid;
}

.journal-sidebar h3 {
  color: #3c4043;
  margin: 0;
  font-size: .86rem;
  line-height: 1.3;
}

.journal-entry {
  border-top: 1px solid #edf0f2;
  padding-top: 8px;
}

.journal-entry ul, .turn-event-quest ul, .turn-event-quest-update ul {
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
}

.journal-entry li, .turn-event-quest li, .turn-event-quest-update li {
  line-height: 1.4;
}

.sheet-row {
  border-top: 1px solid #edf0f2;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  display: flex;
}

.sheet-row span {
  overflow-wrap: anywhere;
  min-width: 0;
}

.sheet-row span small {
  color: #5f6368;
  margin-top: 2px;
  font-size: .78rem;
  line-height: 1.3;
  display: block;
}

.sheet-action-button {
  align-self: center;
  min-height: 30px;
  padding: 0 10px;
}

.turn-card {
  gap: 8px;
  display: grid;
}

.turn-player-action, .turn-event-card {
  padding: 14px;
}

.turn-player-action {
  background: #f8fbff;
  border-color: #c6dafc;
}

.turn-dm-attribution {
  color: #5f6368;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
}

.turn-dm-attribution span {
  overflow-wrap: anywhere;
  min-width: 0;
}

.turn-player-action span, .turn-dialogue-heading span, .turn-event-discovery span, .turn-event-location span, .turn-event-npc span, .turn-event-quest span, .turn-event-quest-update span, .turn-event-relationship span, .turn-event-time span {
  color: #5f6368;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 700;
}

.turn-player-action p, .turn-event-card p {
  white-space: pre-wrap;
  margin: 6px 0 0;
  line-height: 1.55;
}

.turn-narrator-events, .turn-player-actions {
  gap: 8px;
  display: grid;
}

.turn-player-actions .turn-player-action {
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  display: grid;
}

.turn-event-with-media {
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  display: grid;
}

.turn-event-copy {
  min-width: 0;
}

.event-portrait {
  object-fit: cover;
  background: #edf0f2;
  border-radius: 999px;
  width: 56px;
  height: 56px;
}

.event-scene-image {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #edf0f2;
  border-radius: 4px;
  width: 88px;
}

.turn-event-dialogue {
  border-left: 4px solid #188038;
}

.turn-event-discovery {
  background: #fff8ee;
  border-left: 4px solid #b06000;
}

.turn-event-location {
  background: #f8fbff;
  border-left: 4px solid #185abc;
}

.turn-event-npc {
  background: #fbf6ff;
  border-left: 4px solid #7b1fa2;
}

.turn-event-time {
  background: #f8f9fa;
  border-left: 4px solid #5f6368;
}

.turn-event-resource {
  background: #fff7f6;
  border-left: 4px solid #c5221f;
}

.turn-event-directive, .turn-event-relationship {
  background: #f8f9fa;
  border-left: 4px solid #5f6368;
}

.turn-event-relationship-positive {
  background: #f4fbf6;
  border-left-color: #188038;
}

.turn-event-relationship-negative {
  background: #fff7f6;
  border-left-color: #c5221f;
}

.turn-event-quest, .turn-event-quest-update {
  background: #fff8ee;
  border-left: 4px solid #8f5b00;
}

.turn-event-quest h3 {
  margin: 6px 0 0;
  font-size: 1rem;
  line-height: 1.3;
}

.quest-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  display: flex;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
}

.turn-event-skillcheck {
  background: #f8fbff;
  border-left: 4px solid #185abc;
  gap: 8px;
  display: grid;
}

.turn-event-skillcheck-critical-success {
  background: #f4fbf6;
  border-left-color: #188038;
}

.turn-event-skillcheck-success {
  border-left-color: #188038;
}

.turn-event-skillcheck-mixed {
  background: #fff8ee;
  border-left-color: #b06000;
}

.turn-event-skillcheck-failure, .turn-event-skillcheck-critical-failure {
  background: #fff7f6;
  border-left-color: #c5221f;
}

.skillcheck-row {
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.4;
}

.skillcheck-row span, .turn-event-ability-discovered span {
  color: #5f6368;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 700;
}

.skillcheck-outcome {
  color: #202124;
}

.skillcheck-modifiers {
  color: #3c4043;
  font-size: .9rem;
}

.turn-event-ability-discovered {
  background: #fbf6ff;
  border-left: 4px solid #7b1fa2;
}

.turn-dialogue-heading {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.turn-dialogue-heading small {
  color: #5f6368;
}

.turn-input {
  background: #f7f7f5;
  border-top: 1px solid #dadce0;
  flex: none;
  gap: 10px;
  padding: 14px 0 0;
  display: grid;
}

.turn-input textarea, .text-input {
  color: #202124;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 6px;
  width: 100%;
  padding: 10px;
}

@media (max-width: 760px) {
  .session-content {
    grid-template-columns: 1fr;
  }

  .session-main {
    height: min(700px, max(420px, 100dvh - 180px));
  }

  .character-sheet, .session-sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .world-option {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .world-cover-image {
    grid-column: 1 / -1;
    width: 100%;
  }

  .turn-event-with-media {
    grid-template-columns: 1fr;
  }

  .event-scene-image {
    width: 100%;
  }
}

.muted {
  color: #5f6368;
  margin: 0;
}

.error-copy {
  color: #b3261e;
  margin: 0;
}

.dialog-backdrop {
  background: #2021247a;
  position: fixed;
  inset: 0;
}

.dialog-popup {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  gap: 14px;
  width: min(480px, 100% - 32px);
  padding: 18px;
  display: grid;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dialog-title {
  margin: 0;
  font-size: 1.1rem;
}

.dialog-actions {
  justify-content: flex-end;
}
