/* Approved low-poly direction. Presentation only; existing controls and state stay native. */
:root {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  color: #382252;
  --purple: #8154a1;
  --blue: #087f79;
  --line: #e2cfb9;
  --muted: #796982;
  --paper: #fff5e6;
  --mint: #c6eee1;
  --bevel: inset 0 2px 0 #ffffffd9, inset 0 -3px 0 #b79e8238;
  --paper-shadow: 0 3px 0 #b3a089, 0 10px 24px #173f4c35;
}
body,
body[data-screen="lobby"],
body:not([data-screen]) {
  background: #368e9e;
}
body[data-screen="lobby"],
body:not([data-screen]) {
  background-image:
    linear-gradient(155deg, #90d2d033 25%, transparent 25%),
    linear-gradient(25deg, #185c7a33 30%, transparent 30%),
    linear-gradient(115deg, #4fa7b5, #2b788e);
  background-attachment: fixed;
}
button,
input,
textarea,
select {
  font-family: inherit;
}
button,
.lobby-button {
  border: 1px solid #d8c4ae;
  border-radius: 8px 4px;
  background: linear-gradient(155deg, #fffaf1, #f0e0cc);
  color: #382252;
  font-weight: 700;
  box-shadow:
    var(--bevel),
    0 3px 0 #b8a18a;
  transition:
    background-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s,
    filter 0.15s;
}
button:hover:not(:disabled),
.lobby-button:hover {
  background: linear-gradient(155deg, #fffdf7, #f8e7d3);
  box-shadow:
    var(--bevel),
    0 4px 0 #b8a18a,
    0 5px 12px #462b6220;
  transform: translateY(-1px);
}
button:active:not(:disabled),
.lobby-button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px #47315630,
    0 1px 0 #b8a18a;
}
button:disabled {
  background: #ded7d5;
  color: #8b7f8f;
  border-color: #cfc4c3;
  box-shadow:
    inset 0 1px 0 #ffffff70,
    0 2px 0 #bdb1b2;
  opacity: 0.75;
  cursor: not-allowed;
}
button.primary,
.lobby-button,
.outline-send,
.dock button.active,
.country-picker button.selected,
.search-results button.selected {
  background: linear-gradient(150deg, #24c6b2, #05978e);
  border-color: #40b6a5;
  color: #fff;
  text-shadow: 0 1px 1px #06534e55;
  box-shadow:
    inset 0 2px 0 #b8fff09c,
    inset 0 -3px 0 #087c7880,
    0 3px 0 #087c78;
}
button.primary:hover:not(:disabled),
.lobby-button:hover,
.outline-send:hover {
  background: linear-gradient(150deg, #42d5bd, #0da79b);
  box-shadow:
    inset 0 2px 0 #c7fff4,
    inset 0 -3px 0 #087c7855,
    0 4px 0 #087c78;
}
button.purple {
  background: linear-gradient(145deg, #aa7ac1, #79519c);
  border-color: #8c61a8;
  box-shadow:
    inset 0 2px 0 #e3c1ed99,
    inset 0 -3px 0 #593d7a55,
    0 3px 0 #5f437d;
  color: #fff9f1;
}
button.purple:hover:not(:disabled) {
  background: linear-gradient(145deg, #b98bd0, #8b60ab);
}
button.quiet,
.quiet:hover:not(:disabled) {
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #8b55ad;
  outline-offset: 3px;
}
header {
  height: 72px;
  padding: 0 26px;
  gap: 20px;
  background: linear-gradient(166deg, #fff9ec 40%, #f0deca 40%, #fff3e1 80%);
  border-bottom: 3px solid #cfb899;
  box-shadow:
    inset 0 2px 0 #fffaf3,
    0 4px 12px #23435635;
  z-index: 10;
}
.brand {
  gap: 9px;
}
.brand-emblem {
  display: block;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 11px 4px;
  box-shadow: 0 2px 3px #2c1d4f30;
}
.brand strong {
  font-family: inherit;
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -0.9px;
  color: #382252;
}
.brand > [data-icon] .icon {
  width: 43px;
  height: 43px;
}
.brand small {
  display: none;
}
header nav {
  gap: 10px;
}
header nav a {
  border-radius: 7px 3px;
  padding: 10px 16px;
  color: #4c335e;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid transparent;
}
header nav .icon {
  width: 25px;
  height: 25px;
}
header nav a:hover {
  background: #f1e2d2;
}
header nav a[aria-current="page"] {
  background: linear-gradient(150deg, #c5f1df, #9ddbc9);
  color: #3e295a;
  border-color: #7fbfae;
  box-shadow:
    inset 0 2px 0 #effff3,
    0 3px 0 #73af9f;
}
.connection {
  color: #6b5b76;
  background: #ecdfd5;
  font-weight: 700;
  border-radius: 6px;
  padding: 7px 10px;
}
.connection.connected {
  background: #c9ead9;
  color: #24694f;
}
#settings {
  width: 40px;
  height: 40px;
  background: #f9eddc;
  box-shadow:
    var(--bevel),
    0 2px 0 #b8a18a;
  border: 1px solid #d8c4ae;
}
main {
  height: calc(100dvh - 72px);
}
#lobby {
  height: calc(100dvh - 72px);
}
.poly-icon {
  stroke: none !important;
  fill: none !important;
  filter: drop-shadow(0 1px 1px #39284a30);
}
.panel,
dialog,
#game-setup,
#loading {
  background: linear-gradient(140deg, #fff9ee 0%, #fff3e3 66%, #efddc9 100%);
  color: #382252;
}
.panel,
dialog {
  border: 2px solid #f9e9d7;
  border-radius: 14px 5px;
  box-shadow:
    inset 0 0 0 1px #dac4aa,
    var(--paper-shadow);
}
.panel {
  width: 380px;
  bottom: 86px;
  max-height: calc(100% - 170px);
}
.right {
  width: 400px;
}
.panel-head,
.modal-head {
  padding: 14px 16px;
  min-height: 76px;
  gap: 10px;
  border-bottom: 1px solid #dac4aa;
  background: linear-gradient(155deg, #fff8eb, #f3e3cf);
}
.panel-head h2,
.modal-head h2 {
  background: linear-gradient(160deg, #a578bb 50%, #855b9d 50%);
  color: #fffaf0;
  padding: 8px 22px 9px 12px;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 0 #5e377755;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 50%,
    calc(100% - 10px) 100%,
    0 100%
  );
}
.panel-head h2 .icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}
.panel-head button,
.modal-head button {
  width: 32px;
  height: 32px;
  border-radius: 6px 3px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #ffad93, #ea7a6b);
  border: 1px solid #d67567;
  color: #fff;
  box-shadow:
    inset 0 2px 0 #ffe2c7,
    0 2px 0 #bf675f;
}
.panel-head button:hover,
.modal-head button:hover {
  background: #f69b83;
}
.panel-body {
  padding: 18px;
}
.panel-foot,
.modal-foot {
  background: #f9eddd;
  border-color: #e3cfb7;
  padding: 14px 16px;
}
.panel p {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
}
.panel h3,
h3,
h4,
strong {
  font-weight: 800;
}
.panel h3 {
  font-size: 18px;
}
.panel .muted,
.muted {
  color: #7b6b82;
}
.panel .muted {
  font-size: 14px;
  font-weight: 600;
}
.panel .empty {
  font-weight: 600;
}
input,
select,
textarea {
  background: linear-gradient(155deg, #faf5f0, #eee6ee);
  border: 1px solid #ccbdc8;
  border-radius: 7px 3px;
  box-shadow:
    inset 0 2px 4px #65436b0e,
    0 1px 0 #fff;
  color: #443057;
  font-weight: 600;
  accent-color: #078d83;
}
input::placeholder,
textarea::placeholder {
  color: #8a7893;
  opacity: 1;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  box-shadow: none;
}
select {
  cursor: pointer;
}
.composer-field {
  border-radius: 8px 3px;
  border: 1px solid #cfc0cc;
  background: linear-gradient(135deg, #fbf5ef, #ede5ec);
  box-shadow:
    inset 0 2px 3px #69496a12,
    0 1px 0 white;
}
.composer-field:focus-within {
  box-shadow: 0 0 0 2px #9880b3;
}
.composer textarea {
  background: transparent;
  color: #443057;
  font-weight: 600;
}
.composer textarea::placeholder {
  color: #8a7893;
}
.composer button {
  border-radius: 7px 3px;
}
.composer-field button {
  box-shadow: none;
  background: transparent;
  border: 0;
}
.composer .outline-send,
.left[data-panel="chat"] .outline-send {
  background: linear-gradient(145deg, #42cebd, #12988f);
  border-color: #4fb8a8;
  color: #fff;
}
.composer > button .poly-icon {
  width: 27px;
  height: 27px;
}
.action,
.card,
.event,
.chat-card,
.preset-text {
  border: 1px solid #dfccb6;
  background: linear-gradient(145deg, #fffaf0, #f6e9d8);
  border-radius: 10px 4px;
  box-shadow:
    inset 0 2px 0 #fffefa,
    0 3px 0 #d9c5ac;
}
.action {
  padding: 14px;
  margin-bottom: 14px;
}
.action .actions {
  opacity: 1;
}
.action .actions button {
  border: 1px solid #e1d0bf;
  background: #fff4e6;
  box-shadow: 0 1px 0 #d5bea5;
  color: #755c86;
  padding: 5px 9px;
}
.suggestion {
  background: #e6d8ed;
  color: #69427f;
  border-color: #d5bddf;
  font-weight: 700;
}
.chat-card {
  margin: 12px 0;
  padding: 14px;
  gap: 12px;
}
.chat-card strong {
  font-weight: 800;
}
.chat-card .preview {
  color: #786782;
}
.chat-card .flag {
  border-radius: 3px;
  width: 38px;
  height: 27px;
  outline: 0;
  box-shadow: 0 2px 0 #d7bd98;
}
.message {
  background: #eaddf0;
  border: 1px solid #d1bedb;
  border-radius: 10px 4px;
  padding: 13px 14px;
  box-shadow:
    inset 0 2px 0 #fbf3ff,
    0 2px 0 #d1bfd9;
  margin: 14px 0;
}
.message.mine {
  background: #cef0e1;
  border: 1px solid #a4d8c4;
  box-shadow:
    inset 0 2px 0 #f2fff7,
    0 2px 0 #a5cab9;
}
.message:before {
  display: none;
}
.message .sender {
  color: #795788;
  font-size: 13px;
  font-weight: 800;
}
.message.mine .sender {
  color: #387362;
}
.message p {
  margin-bottom: 0;
}
.date-divider {
  color: #937b97;
  font-weight: 700;
}
.date-divider:before,
.date-divider:after {
  background: #decbdb;
}
.date-pill,
.dock,
.map-zoom,
#country,
.bottom-left > .square,
.top-left .square {
  background: linear-gradient(150deg, #fff7e9, #f2e1cb);
  border: 1px solid #e0c9ae;
  border-radius: 10px 4px;
  box-shadow:
    var(--bevel),
    0 3px 0 #b5a18a,
    0 5px 12px #213b5025;
}
.date-pill {
  min-width: 0;
  width: 300px;
  height: 60px;
  padding: 8px 10px;
}
.date-pill #date {
  font-weight: 800;
  color: #49305e;
  font-size: 16px;
  box-shadow: none;
  border: 0;
}
.date-pill > button:first-child {
  background: #ead9c5;
  color: #92799d;
  border-radius: 6px 3px;
}
.date-pill > button:last-child {
  background: linear-gradient(145deg, #37c5b3, #0b978f);
  color: white;
  border-radius: 6px 3px;
}
.date-pill > button {
  box-shadow:
    inset 0 2px 0 #ffffff80,
    0 2px 0 #b7a28c;
  border: 1px solid #d2c1a8;
}
.dock {
  padding: 9px;
  gap: 8px;
}
.dock button {
  width: 46px;
  height: 44px;
  border-radius: 7px 3px;
  background: #f4e7d6;
}
.dock button .icon {
  width: 29px;
  height: 29px;
}
.dock button.active {
  border-color: #34b6a4;
  background: #b2e7d5;
}
.bottom-left > .square {
  height: 44px;
  width: 44px;
}
.map-zoom {
  opacity: 1;
  pointer-events: auto;
}
.map-zoom button {
  border: 0;
  box-shadow: none;
  color: #654974;
}
#country {
  width: 50px;
  height: 48px;
}
.has-sidebar {
  --sidebar-width: 400px;
}
.has-sidebar #right {
  background: linear-gradient(140deg, #fff9ee, #f6e8d7);
  border-radius: 0;
  border: 0;
  border-left: 2px solid #ead8c0;
  box-shadow: -4px 0 18px #142b4820;
}
.has-sidebar #right .panel-head {
  height: auto;
  min-height: 76px;
  text-align: left;
}
.has-sidebar #right .panel-body {
  padding: 16px;
}
.has-sidebar #right .empty {
  font-style: normal;
  font-size: 16px;
  color: var(--muted);
}
#sidebar-tabs {
  right: 352px;
}
#sidebar-tabs button {
  background: #edddcb;
  color: #795f89;
  border: 1px solid #d8c2aa;
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 #bca68d;
}
#sidebar-tabs button.active {
  background: #bde7d5;
  color: #297a65;
  box-shadow:
    inset 0 1px 0 #effff6,
    0 2px 0 #80b9a6;
}
.advisor-suggestions button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 5px;
}
#left[data-panel="menu"] {
  width: 310px;
  background: linear-gradient(145deg, #fff8eb, #f2e1cc);
  border-radius: 10px 4px;
}
#left[data-panel="menu"] .panel-body {
  padding: 12px;
}
.game-menu-title {
  padding: 8px 6px 16px;
}
.game-menu-title strong {
  white-space: normal;
  font-weight: 800;
  color: #513269;
}
.game-menu-title small {
  color: #87708d;
  font-weight: 600;
}
.menu-btn {
  border-color: #dcc5aa;
  background: #fff5e6;
  border-radius: 7px 3px;
  box-shadow:
    inset 0 2px 0 #fff,
    0 2px 0 #d0b79a;
  font-weight: 700;
}
.menu-btn .icon {
  width: 25px;
  height: 25px;
  color: #826195;
}
#left[data-panel="search"] {
  width: 320px;
}
.search-results button {
  border-radius: 5px;
  box-shadow: none;
  border-color: #e8d7c4;
  min-height: 48px;
  margin-bottom: 3px;
}
.search-results button:hover {
  background: #e4f0e5;
}
.search-results small {
  color: var(--muted);
}
#left[data-panel="jump"] {
  width: 420px;
  background: linear-gradient(140deg, #fff9ee, #f2e2cf);
  backdrop-filter: none;
}
#left[data-panel="jump"] .panel-body {
  padding: 24px 20px;
}
.jump-origin {
  color: #f4dfef;
  font-weight: 600;
  margin-top: 3px;
  font-size: 12px;
}
#auto-jump {
  font-size: 16px;
}
#auto-jump + button {
  margin-top: 10px;
}
.timeline:before {
  background: #b89cc7;
  width: 3px;
}
.timeline button:nth-child(n) {
  width: 150px;
  border-color: #d6c2ad;
  border-radius: 7px 3px;
  background: linear-gradient(145deg, #fff9ef, #f1dfc8);
  color: #4d305e;
  padding: 7px 12px;
  box-shadow:
    inset 0 2px 0 white,
    0 3px 0 #baa187;
  font-weight: 700;
}
.timeline button:hover:not(:disabled) {
  background: #c0ecda;
}
.timeline .now:nth-child(n) {
  width: 96px;
  height: 72px;
  border: 2px solid #70baa4;
  background: #d7f2e5;
  color: #3c7b67;
  box-shadow: 0 3px 0 #9dcab5;
  opacity: 1;
}
.timeline .now small {
  color: #658572;
}
.event.selected {
  border-color: #7fbaab;
  box-shadow: 0 0 0 2px #69bfa355;
}
.event h3 {
  font-weight: 800;
  color: #513469;
}
.event-date {
  color: #937c9a;
  font-weight: 700;
}
#playback,
#generating {
  border: 2px solid #f8e8d5;
  background: linear-gradient(145deg, #fff8e9, #f4e3cc);
  border-radius: 12px 4px;
  color: #49325c;
  box-shadow: var(--paper-shadow);
}
#playback-status {
  font-weight: 800;
  margin-bottom: 12px;
}
#next-event {
  background: linear-gradient(145deg, #ffaf92, #ef826e);
  border-color: #dc8a72;
  color: #fff;
  box-shadow:
    inset 0 2px 0 #ffe1ba,
    0 3px 0 #c96c60;
}
.verified-outcome {
  background: #e1f1de;
  border-color: #78aa82;
  color: #426c52;
}
#notice {
  background: #fff4df;
  border: 1px solid #d6bfa2;
  border-radius: 10px 4px;
  color: #593b68;
  font-weight: 700;
  box-shadow: var(--paper-shadow);
}
#map-tip {
  background: #fff3def2;
  border: 1px solid #dcc09d;
  border-radius: 6px 2px;
  color: #52375f;
  font-weight: 700;
  box-shadow: 0 3px 10px #18364930;
}
dialog::backdrop {
  background: #203b526b;
  backdrop-filter: blur(4px);
}
.modal-body {
  padding: 22px 24px;
}
.modal-head h2 {
  font-size: 22px;
}
.modal-head {
  padding: 16px;
}
.panel-body,
.modal-body,
#game-setup,
.country-picker,
#lobby {
  scrollbar-color: #a68ab3 #eedfce;
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #eedfce;
}
::-webkit-scrollbar-thumb {
  background: #ac91b7;
  border: 2px solid #eedfce;
  border-radius: 6px;
}
#loading {
  background: #fff4e3;
  color: #76558b;
}
.spinner {
  border-color: #dfcde6;
  border-top-color: #0f9f92;
}
/* Lobby and actual navigation, rather than a decorative menu screenshot. */
.lobby-inner {
  padding-top: 30px;
  max-width: 1260px;
}
.lobby-heading {
  background: linear-gradient(145deg, #fff7e8, #f2e0ca);
  border: 1px solid #ead9c2;
  padding: 16px 20px;
  border-radius: 10px 4px;
  box-shadow: var(--paper-shadow);
}
.lobby-heading h1,
.lobby-heading h2 {
  color: #4b2f61;
  font-weight: 800;
}
.lobby-heading h1 {
  font-size: 29px;
}
.lobby-heading h2 {
  font-size: 25px;
}
.lobby-grid {
  gap: 22px;
}
.preset-card {
  border: 2px solid #faebd9;
  border-radius: 12px 4px;
  background: linear-gradient(145deg, #fff9ee, #f3e2cb);
  box-shadow: var(--bevel), var(--paper-shadow);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
a.preset-card:hover {
  transform: translateY(-3px);
  border-color: #98d2ba;
  box-shadow:
    0 3px 0 #6fb097,
    0 12px 20px #173f4c40;
}
.preset-card-text {
  padding: 17px;
  gap: 9px;
}
.preset-card-text strong {
  font-weight: 800;
  font-size: 19px;
  color: #4f3063;
}
.preset-card-text small {
  color: #8a7191;
  font-weight: 600;
}
.preset-cover {
  background: #5e98ac;
  border-bottom: 3px solid #dfc5a3;
}
.preset-cover img {
  filter: saturate(0.7) contrast(0.85);
}
.preset-hero {
  border: 3px solid #fff0dc;
  border-radius: 14px 4px;
  min-height: 300px;
  box-shadow: var(--paper-shadow);
}
.preset-hero-content h1 {
  font-family: inherit;
  font-weight: 800;
}
.preset-hero::after {
  background: linear-gradient(0deg, #332349eb, #415b7040 90%);
}
.preset-text {
  padding: 18px;
  margin-bottom: 15px;
}
.preset-text summary {
  font-weight: 800;
  color: #6b4882;
}
.lobby-button.light {
  background: linear-gradient(145deg, #35c7b2, #0c998e);
  color: #fff;
}
.lobby-back {
  color: #fff2df;
  padding: 8px 0;
  text-shadow: 0 1px 2px #33415d66;
}
#game-setup {
  border-left: 3px solid #ead7bc;
}
#game-setup .lobby-back {
  color: #79518d;
  text-shadow: none;
}
#game-setup h1 {
  font-weight: 800;
}
.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 310px;
  margin: 0 0 28px;
  overflow: hidden;
  border: 3px solid #faead5;
  border-radius: 18px 5px;
  background: #fff2df;
  box-shadow: var(--paper-shadow);
}
.home-art {
  position: relative;
  background: radial-gradient(ellipse at 50% 35%, #316f7e, #3f285a 60%, #171c3b);
  min-height: 280px;
}
.home-art::after {
  content: "";
  position: absolute;
  inset: 16px;
  background: url("/art/remap-emblem-v1-1024.webp") center/contain no-repeat;
  border-radius: 12px;
}
.home-menu {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 28px 38px;
  background: linear-gradient(145deg, #fff9ef, #f3e1ca);
}
.home-menu h1 {
  margin: 0 0 4px;
  font-size: 35px;
  font-weight: 800;
  letter-spacing: -1px;
}
.home-menu > p {
  margin: 0 0 8px;
  color: #8e7495;
  font-size: 14px;
}
.home-menu .lobby-button,
.home-menu > button {
  min-height: 48px;
  gap: 12px;
  font-size: 17px;
  justify-content: flex-start;
  padding: 10px 22px;
}
.home-menu .icon {
  width: 27px;
  height: 27px;
}
.home-menu .secondary {
  background: linear-gradient(145deg, #fffbef, #f5e5cf);
  color: #573365;
  border-color: #dfc4a4;
  box-shadow:
    var(--bevel),
    0 3px 0 #b8a18a;
  text-shadow: none;
}
.lobby-status {
  color: #fff2dc;
  font-weight: 700;
}
@media (max-width: 1100px) and (min-width: 761px) and (min-height: 501px) {
  header {
    padding-inline: 16px;
    gap: 12px;
  }
  .brand strong {
    font-size: 23px;
  }
  header nav {
    gap: 4px;
  }
  header nav a {
    padding: 8px 10px;
    font-size: 14px;
  }
  .connection {
    font-size: 10px;
  }
  .panel {
    width: 340px;
  }
  .has-sidebar {
    --sidebar-width: 360px;
  }
  #sidebar-tabs {
    right: 312px;
  }
}
@media (max-width: 760px), (max-width: 1100px) and (max-height: 500px) {
  header {
    height: var(--mobile-header);
    padding-inline: 10px;
    gap: 6px;
  }
  .brand > [data-icon] .icon {
    width: 30px;
    height: 30px;
  }
  header nav {
    gap: 3px;
  }
  header nav a {
    padding: 8px 9px;
    font-size: 13px;
  }
  #settings {
    width: 36px;
    height: 36px;
    padding: 7px;
  }
  main,
  #lobby {
    height: calc(var(--app-height, 100dvh) - var(--mobile-header));
  }
  .panel,
  .right,
  #left[data-panel="jump"],
  #left[data-panel="search"],
  .has-sidebar #right {
    width: auto;
    max-width: none;
    border-radius: 12px 4px;
    max-height: calc(100% - 72px);
  }
  .panel-head,
  .has-sidebar #right .panel-head {
    min-height: 64px;
    padding: 10px 12px;
  }
  .panel-head h2 {
    font-size: 21px;
    padding: 7px 16px 8px 10px;
  }
  .panel-head h2 .icon {
    width: 24px;
    height: 24px;
    margin-right: 5px;
  }
  .panel-head button {
    width: 36px;
    height: 36px;
  }
  .panel-body,
  .has-sidebar #right .panel-body {
    padding: 14px;
  }
  .panel-foot,
  .has-sidebar #right .panel-foot {
    padding: 12px;
  }
  .has-sidebar #right {
    padding-left: 44px;
    border: 2px solid #faebdb;
  }
  #sidebar-tabs {
    right: auto;
  }
  .date-pill,
  .has-sidebar .date-pill {
    height: 52px;
    max-width: 300px;
    width: calc(100% - 72px);
    padding: 6px 8px;
  }
  .date-pill #date {
    font-size: 14px;
  }
  .dock {
    padding: 8px;
  }
  .dock button {
    width: 44px;
    height: 44px;
  }
  .composer-field button {
    width: 30px;
  }
  .composer > button {
    width: 44px;
    height: 44px;
  }
  .message {
    padding: 12px;
  }
  #left[data-panel="menu"] {
    width: min(320px, calc(100% - 16px));
    max-height: calc(100% - 135px);
  }
  #left[data-panel="search"] {
    width: auto;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-head h2 {
    font-size: 19px;
  }
  .home-hero {
    grid-template-columns: 1fr;
    border-radius: 12px 4px;
  }
  .home-art {
    min-height: 160px;
    max-height: 180px;
    background-position: center 46%;
  }
  .home-menu {
    padding: 22px;
    gap: 11px;
  }
  .home-menu h1 {
    font-size: 28px;
  }
  .lobby-inner {
    padding: 18px 12px 28px;
  }
  .lobby-heading {
    padding: 15px;
    gap: 14px;
  }
  .lobby-heading h1 {
    font-size: 25px;
  }
  .lobby-grid {
    gap: 12px;
  }
  .preset-card-text {
    padding: 12px;
  }
  .preset-card-text strong {
    font-size: 17px;
  }
  .preset-hero {
    min-height: 250px;
  }
  #game-setup {
    border: 0;
    border-top: 3px solid #e2cfb7;
  }
  .keyboard-open .panel,
  .keyboard-open .has-sidebar #right {
    max-height: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .lobby-button,
  .preset-card {
    transition: none;
  }
  .panel,
  .message {
    animation: none;
  }
  button:hover:not(:disabled),
  a.preset-card:hover {
    transform: none;
  }
}

/* Native bevels retain shadows, focus rings and hit targets. Older browsers use the small-radius fallback. */
@supports (corner-shape: bevel) {
  button,
  .lobby-button,
  .panel,
  dialog,
  .preset-card,
  .home-hero,
  .composer-field,
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .action,
  .message,
  .date-pill,
  .dock,
  .menu-btn,
  .lobby-heading {
    corner-shape: bevel;
    border-radius: 10px;
  }
  .home-hero {
    border-radius: 20px;
  }
  .panel-head button,
  .modal-head button,
  .composer button,
  .dock button {
    border-radius: 7px;
  }
}

.panel-head h2,
.modal-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.preset-card .preset-cover {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #5e98ac url("/art/low-poly-world.svg") center/cover;
}
.preset-card .preset-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 760px) {
  .action .actions button {
    min-height: 40px;
  }
}

@media (min-width: 761px) and (min-height: 501px) {
  .home-hero {
    min-height: 400px;
    grid-template-columns: 1fr 1fr;
  }
  .home-art {
    background-position: center 20%;
  }
}

button.primary:disabled,
button.purple:disabled,
.composer button:disabled {
  background: #ded7d5;
  color: #85758a;
  border-color: #c9bdc5;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 #ffffff80,
    0 2px 0 #b8abb4;
  transform: none;
  filter: none;
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Long group names and country labels must shrink inside flex rows. */
.chat-card .grow {
  flex: 1;
  min-width: 0;
}
.chat-card strong {
  display: block;
  overflow-wrap: anywhere;
}
.chat-card .preview {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chat-card > span {
  min-width: 0;
}
.chat-card .flag,
.chat-card > .icon {
  flex-shrink: 0;
}
.country-picker button,
.search-results button {
  overflow-wrap: anywhere;
}
.country-picker .grow,
.search-results .grow {
  min-width: 0;
}

@media (max-width: 1100px) and (max-height: 500px) {
  .panel-head,
  .has-sidebar #right .panel-head {
    min-height: 50px;
    padding: 6px 10px;
  }
  .panel-head h2 {
    font-size: 19px;
    padding: 5px 14px 6px 8px;
  }
  .panel-foot,
  .has-sidebar #right .panel-foot {
    padding: 6px 10px;
  }
  .composer textarea {
    max-height: 72px;
    overflow-y: auto !important;
  }
  .speaker-options {
    margin-top: 6px;
  }
}
@media (min-width: 1101px) and (max-height: 600px) {
  .panel {
    top: 76px;
    bottom: 72px;
    height: auto;
    max-height: none;
  }
  .panel-head,
  .has-sidebar #right .panel-head {
    min-height: 50px;
    padding: 6px 10px;
  }
  .panel-head h2 {
    font-size: 19px;
    padding: 5px 14px 6px 8px;
  }
  .panel-foot,
  .has-sidebar #right .panel-foot {
    padding: 6px 10px;
  }
  .composer textarea {
    max-height: 72px;
    overflow-y: auto !important;
  }
  #left[data-panel="menu"] {
    top: 54px;
    bottom: 72px;
    height: auto;
    max-height: none;
  }
}

.composer .outline-send:disabled,
.left[data-panel="chat"] .outline-send:disabled {
  background: #ded7d5;
  color: #85758a;
  border-color: #c9bdc5;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 #ffffff80,
    0 2px 0 #b8abb4;
  transform: none;
  filter: none;
}
:root .map-object-card .object-art {
  display: block;
  width: min(100%, 180px);
  aspect-ratio: 1262 / 1246;
  box-sizing: border-box;
  margin: 0 auto 14px;
  background-size: 400% 400%;
  background-repeat: no-repeat;
}
#right[data-panel="region"] .panel-body {
  background: #fff5e6;
}
.map-object-card {
  background: #fff9ef;
}
.map-object-card.object-group .object-art {
  width: min(100%, 96px);
}

/* A small living paper world; animation conveys activity, never a fake percentage. */
#generating {
  width: min(490px, calc(100% - 32px));
  min-width: 0;
  max-width: 490px;
  padding: 18px 20px 14px;
  border: 1px solid #d8c3a5;
  border-top: 3px solid #fff9e9;
  border-radius: 18px 5px 18px 5px;
  background: linear-gradient(135deg, #fffbef, #f7e9d3);
  box-shadow:
    0 5px 0 #b79b7940,
    0 14px 35px #0a24353b,
    inset 0 0 0 3px #fff8e4;
  pointer-events: auto;
}
.wait-body {
  display: flex;
  align-items: center;
  gap: 15px;
}
.wait-art {
  width: 100px;
  height: 104px;
  flex: 0 0 100px;
  position: relative;
}
.wait-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wait-world {
  transform-origin: 56px 56px;
  animation: wait-world 5s ease-in-out infinite;
}
.wait-route {
  animation: wait-route 3.2s linear infinite;
}
.wait-spark {
  transform-origin: 90px 23px;
  animation: wait-spark 2.8s ease-in-out infinite;
}
.wait-copy {
  min-width: 0;
}
.wait-copy small {
  color: #87718d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.wait-copy h3 {
  font-size: 19px;
  line-height: 1.2;
  color: #513469;
  margin: 5px 0 7px;
}
#generating #generation-status {
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  color: #776580;
}
.wait-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 11px;
  color: #807186;
}
.wait-clock [data-wait-time] {
  font-variant-numeric: tabular-nums;
  color: #59476a;
  font-weight: 800;
}
.wait-clock i {
  width: 6px;
  height: 6px;
  background: #32a99d;
  border-radius: 1px;
  transform: rotate(45deg);
  animation: wait-pulse 2s ease-in-out infinite;
}
.wait-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #dbc8b36b;
}
#generating .wait-actions:has(> #resume-generation[hidden]):has(> #cancel-generation[hidden]) {
  display: none;
}
#generating .wait-actions button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
#generating #cancel-generation {
  color: #8a6d84;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
#generating #cancel-generation:hover {
  background: #ead9d0;
}
#generating[data-running="false"] .wait-art *,
#generating[data-running="false"] .wait-clock i {
  animation-play-state: paused;
}
@keyframes wait-world {
  0%,
  100% {
    transform: translateY(1px) rotate(-5deg);
  }
  50% {
    transform: translateY(-3px) rotate(4deg);
  }
}
@keyframes wait-route {
  to {
    stroke-dashoffset: -196;
  }
}
@keyframes wait-spark {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}
@keyframes wait-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (max-width: 760px) {
  #generating {
    width: auto;
    max-width: none;
    padding: 12px 13px 10px;
  }
  .wait-body {
    gap: 10px;
  }
  .wait-art {
    width: 72px;
    height: 82px;
    flex-basis: 72px;
  }
  .wait-copy h3 {
    font-size: 17px;
  }
  #generating #generation-status {
    font-size: 11px;
  }
  #generating .wait-actions button {
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wait-art *,
  .wait-clock i {
    animation: none !important;
  }
}
