:root {
  color-scheme:dark;
  --bg:#040c18;
  --panel:#06192d;
  --border:#1b2b3d;
  --gold:#f5cc66;
  --text:#d5e0ee;
  --muted:#8397ac;
  --cyan:#55cec8;
  --danger:#d77b8b;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:12px
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  height:100dvh;
  overflow:hidden;
  display:flex;
  flex-direction:column
}
button,input,select,textarea {
  font:inherit
}
button,a {
  touch-action:manipulation
}
button {
  height:32px;
  background:#071526;
  color:#b5c4d4;
  border:1px solid #182a3c;
  border-radius:7px;
  padding:0 10px;
  cursor:pointer;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  transition:border-color .15s,background .15s
}
button:hover {
  background:#12263b;
  border-color:#51606c
}
button:disabled {
  opacity:.35;
  cursor:default
}
button.active,button.gold {
  color:var(--gold);
  border-color:#817442;
  background:#141b23
}
button.active {
  box-shadow:0 0 0 1px #a48c46,0 0 15px #e8c44b30;
  background:#292b24
}
button.teal {
  color:#a1e7ce;
  border:1px solid #247b70;
  background:#052b2b;
  box-shadow:inset 0 0 14px #13c2aa08
}
button.danger,.danger {
  color:var(--danger)
}
button.quiet {
  background:transparent
}
button.text-button {
  background:transparent;
  border:0;
  color:var(--gold);
  padding:0 5px
}
input,select,textarea {
  border:1px solid #273548;
  background:#020b17;
  color:#e0e9f2;
  border-radius:5px;
  padding:8px;
  max-width:100%;
  outline:none
}
input:focus,select:focus,textarea:focus {
  border-color:var(--gold);
  box-shadow:0 0 0 1px #e9c56c40
}
button:focus-visible,a:focus-visible,canvas:focus-visible {
  outline:2px solid var(--cyan);
  outline-offset:2px
}
input[type=color] {
  padding:3px;
  min-width:40px;
  width:44px;
  height:34px
}
input[type=checkbox] {
  accent-color:var(--gold)
}
textarea {
  resize:vertical;
  width:100%;
  line-height:1.6
}
h2,h3,p {
  margin:0
}
h2 {
  font-size:12px;
  letter-spacing:1.5px;
  color:var(--gold);
  font-family:"Arial Narrow",sans-serif
}
h3 {
  font-size:10px;
  color:var(--muted);
  letter-spacing:1px
}
label {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin:14px 0 6px
}
a {
  color:var(--cyan)
}
[hidden] {
  display:none!important
}
.toolbar {
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 14px;
  background:linear-gradient(110deg,#061525,#050d1b 80%);
  flex-shrink:0;
  z-index:10;
  white-space:nowrap
}
.main-toolbar {
  height:52px
}
.palette-toolbar {
  height:61px;
  border-bottom:1px solid #344052;
  gap:9px
}
.brand {
  display:flex;
  align-items:center;
  gap:4px;
  margin-right:8px;
  font-family:Impact,"Arial Narrow",sans-serif;
  letter-spacing:.9px;
  font-size:18px;
  color:#f5f5f5
}
.brand em {
  font-style:normal;
  color:var(--gold)
}
.brand small {
  font:7px sans-serif;
  color:var(--cyan);
  align-self:flex-start;
  margin-top:2px
}
#plan-title {
  width:195px;
  height:30px;
  border-color:#514c3a
}
.tool-modes {
  display:flex;
  gap:5px
}
.toolbar-spacer {
  flex:1
}
.count {
  font-size:10px;
  color:#849db2
}
.micro {
  font-size:9px;
  color:var(--muted);
  letter-spacing:1px
}
.sprite-button {
  width:44px;
  height:44px;
  padding:3px;
  border-radius:12px
}
.sprite-button img {
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 3px 3px #0007)
}
#skin-picker {
  height:42px;
  min-width:112px;
  font-size:10px;
  justify-content:space-between
}
#frankie-tool,#state-map,#seasonal {
  height:43px;
  font-size:11px;
  font-weight:700;
  padding:0 13px
}
#frankie-tool img {
  width:34px;
  height:36px;
  object-fit:contain
}
.level-group {
  display:flex;
  gap:4px
}
.level-group button {
  width:29px;
  height:30px;
  padding:0;
  color:#14222d;
  border:1px solid #52616b;
  border-radius:4px;
  font-weight:bold
}
.level-group button.active {
  border-color:#f8dc7a;
  box-shadow:0 0 0 2px #c6ac5c;
  font-weight:800
}
.separator {
  height:30px;
  border-left:1px solid #22344a;
  margin:0 4px
}
.all-toggle {
  display:flex;
  gap:4px;
  align-items:center;
  font-size:10px;
  white-space:nowrap;
  margin:0;
  color:#9bb2c5
}
#active-alliance {
  height:33px;
  color:var(--gold);
  min-width:80px;
  max-width:120px
}
#map-area {
  position:relative;
  flex:1;
  min-height:0;
  overflow:hidden;
  background:#08101d
}
#map {
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
  cursor:grab
}
#map[data-mode=place],#map[data-mode=pin] {
  cursor:crosshair
}
#map[data-mode=erase] {
  cursor:not-allowed
}
#map.dragging {
  cursor:grabbing
}
.coordinate-badge {
  position:absolute;
  left:12px;
  top:24px;
  pointer-events:none;
  padding:4px 7px;
  border:1px solid #2c5364;
  border-radius:3px;
  background:#051321dd;
  color:#99e5da;
  font:10px ui-monospace,monospace
}
.map-snapshot {
  position:absolute;
  right:13px;
  top:12px;
  background:#070c18df!important;
  height:30px;
  font-size:10px
}
.start-card {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:320px;
  padding:18px;
  text-align:center;
  background:#050c1def;
  border:1px solid #665c39;
  border-radius:13px;
  box-shadow:0 8px 32px #0004;
  pointer-events:none
}
.start-card span {
  display:block;
  font-family:Impact,"Arial Narrow",sans-serif;
  letter-spacing:3px;
  font-size:11px;
  color:var(--gold)
}
.start-card strong {
  display:block;
  font-size:12px;
  margin:12px 0 8px
}
.start-card p {
  font-size:11px;
  line-height:1.9;
  color:#a4b2c4
}
.start-card button {
  pointer-events:auto;
  margin-top:12px
}
.zoom-bar {
  position:absolute;
  bottom:12px;
  right:12px;
  display:flex;
  align-items:center;
  gap:2px;
  background:#030a17ed;
  border:1px solid #50515b;
  border-radius:30px;
  height:30px;
  padding:2px 6px;
  box-shadow:0 3px 8px #0008
}
.zoom-bar button {
  background:transparent;
  border:0;
  height:22px;
  padding:0 8px;
  font-size:10px
}
.zoom-bar span {
  color:var(--gold);
  min-width:42px;
  text-align:center;
  font:11px ui-monospace,monospace
}
.cyan {
  color:var(--cyan)
}
.status {
  position:absolute;
  bottom:14px;
  left:12px;
  max-width:min(620px,calc(100% - 320px));
  font-size:10px;
  line-height:1.6;
  padding:5px 9px;
  background:#03101bd9;
  color:#95b5c8;
  border:1px solid #1b3345;
  border-radius:5px;
  pointer-events:none
}
.status.error {
  background:#351d2b;
  color:#ffc4ca;
  border-color:#9e5864
}
.shared-banner {
  position:absolute;
  left:50%;
  top:12px;
  transform:translateX(-50%);
  background:#132a3a;
  border:1px solid var(--gold);
  border-radius:7px;
  padding:6px 10px;
  font-size:11px;
  display:flex;
  gap:8px;
  align-items:center
}
.shared-banner button {
  height:25px
}
.drawer {
  position:absolute;
  inset:0 auto 0 0;
  width:288px;
  padding:12px;
  background:linear-gradient(140deg,#041b30,#031426);
  border-right:1px solid #26364b;
  z-index:5;
  overflow:auto;
  box-shadow:10px 0 40px #0002
}
.drawer-heading,.dialog-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px
}
.drawer-heading h2 {
  font-size:11px;
  color:#c8dbe9
}
.drawer-heading h2 span {
  color:var(--gold);
  margin-left:8px
}
.drawer-heading button,.dialog-heading button {
  background:transparent;
  border:0;
  font-size:21px;
  color:#9eafc4;
  width:26px;
  padding:0
}
.help {
  font-size:10px;
  line-height:1.8;
  color:#8ba4ba;
  margin:10px 0
}
.help b {
  color:var(--gold);
  font-weight:500
}
.row {
  display:flex;
  align-items:center;
  gap:7px;
  margin:10px 0
}
.grow {
  flex:1
}
.wide {
  width:100%;
  margin-top:10px
}
.drawer button {
  font-size:10px
}
.drawer input:not([type=color]),.drawer select {
  width:100%
}
.roster-list {
  margin:10px 0
}
.roster-item {
  display:flex;
  align-items:center;
  gap:6px;
  border-bottom:1px solid #173046;
  padding:8px 0;
  cursor:grab
}
.roster-item .level-dot {
  width:22px;
  height:23px;
  border-radius:4px;
  color:#17212c;
  display:grid;
  place-items:center;
  font-size:10px;
  font-weight:bold
}
.roster-item .member-name {
  flex:1;
  background:none;
  border:0;
  justify-content:flex-start;
  padding:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
  color:#d7e4ef
}
.roster-item button:last-child {
  height:26px;
  padding:0 7px
}
.lineup-section {
  margin-top:23px;
  padding-top:18px;
  border-top:1px solid #153349
}
.lineup-section h3 {
  display:flex;
  justify-content:space-between;
  color:#e3d59c
}
.saved-entry {
  border:1px solid #1e3a50;
  border-radius:6px;
  padding:9px;
  margin:10px 0
}
.saved-entry strong {
  font-size:11px;
  display:block;
  overflow-wrap:anywhere
}
.saved-entry .row {
  margin:8px 0 0
}
.saved-entry button {
  height:26px;
  flex:1;
  padding:0 4px
}
.alliance-entry {
  border-bottom:1px solid #234057;
  padding:14px 0
}
.alliance-entry .row {
  margin:4px 0
}
.alliance-entry input[type=text] {
  min-width:0
}
.alliance-entry small {
  font-size:10px;
  color:var(--muted)
}
.popover {
  position:fixed;
  z-index:30;
  top:47px;
  min-width:185px;
  padding:7px;
  background:#061729;
  border:1px solid #3c4855;
  border-radius:9px;
  box-shadow:0 12px 30px #0008
}
.popover button {
  display:flex;
  width:100%;
  border:0;
  background:transparent;
  justify-content:flex-start
}
.popover button:hover {
  background:#102b42
}
#more-menu {
  right:12px
}
#panels-menu {
  left:650px
}
dialog {
  background:linear-gradient(130deg,#062037,#041528);
  color:var(--text);
  border:1px solid #686443;
  border-radius:17px;
  padding:20px;
  width:390px;
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - 36px);
  box-shadow:0 30px 120px #0008;
  overflow:auto
}
dialog::backdrop {
  background:#020815b8;
  backdrop-filter:blur(6px)
}
dialog input:not([type=checkbox]):not([type=color]),dialog select {
  width:100%
}
.dialog-heading h2 {
  letter-spacing:2.3px
}
.dialog-heading {
  margin-bottom:20px
}
.skin-dialog {
  width:520px;
  background:#030d1b
}
.skin-filters {
  display:flex;
  gap:5px;
  margin:10px 0
}
.skin-filters button {
  height:24px;
  font-size:9px;
  padding:0 10px;
  border-radius:10px
}
.skin-gallery {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:8px
}
.skin-card {
  height:90px;
  min-width:0;
  display:flex;
  flex-direction:column;
  padding:4px;
  border:1px solid #1b2b40;
  border-radius:11px;
  white-space:normal;
  font-size:9px;
  gap:3px;
  background:#06101e
}
.skin-card img {
  width:100%;
  height:63px;
  object-fit:contain;
  pointer-events:none;
  filter:drop-shadow(0 4px 4px #0009)
}
.skin-card.active {
  background:#172229
}
.skin-group-title {
  grid-column:1/-1;
  margin-top:10px;
  font-size:9px;
  letter-spacing:1px;
  color:#889cae;
  text-transform:uppercase
}
.edit-summary {
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:20px
}
.edit-summary>img {
  width:58px;
  height:62px;
  object-fit:contain;
  background:#020b17;
  border:1px solid #40505b;
  border-radius:10px;
  padding:5px
}
.edit-summary small {
  font-size:10px;
  color:var(--muted);
  display:block;
  margin-bottom:4px
}
.edit-summary strong {
  font-size:13px
}
.edit-summary .row {
  margin:6px 0 0
}
.edit-summary code {
  font-size:9px;
  color:#9de6e0;
  border:1px solid #175668;
  padding:4px;
  border-radius:4px
}
.edit-summary button {
  font-size:9px;
  height:23px;
  padding:0 5px
}
.mini-gallery {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:5px;
  max-height:195px;
  overflow:auto;
  padding:3px
}
.mini-gallery button {
  height:41px;
  min-width:0;
  padding:2px;
  border-radius:5px
}
.mini-gallery img {
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none
}
.edit-levels {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px
}
.edit-levels button {
  width:auto;
  height:31px
}
.two-columns {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px
}
.three-columns {
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px
}
.dialog-error {
  font-size:11px;
  color:#f3a4ae;
  line-height:1.6
}
.checkbox-label {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--text);
  font-size:12px
}
#edit-dialog {
  width:390px
}
#edit-form .row:last-of-type {
  margin-top:17px
}
#share-output {
  margin-top:14px;
  font-size:10px
}
#pin-color {
  width:100%
}
.mobile-only {
  display:none
}
@media(max-width:1400px) {
  .toolbar {
    gap:5px;
    padding-left:9px;
    padding-right:9px
  }
  .brand {
    font-size:13px;
    margin-right:1px
  }
  #plan-title {
    width:145px
  }
  .main-toolbar button {
    padding:0 7px
  }
  .palette-toolbar {
    gap:7px
  }
  #frankie-tool,#state-map,#seasonal {
    padding:0 9px
  }
  .level-group button {
    width:25px
  }
  #active-alliance {
    min-width:65px
  }
  .count {
    display:none
  }
}
@media(max-width:1100px) {
  .toolbar {
    overflow-x:auto;
    scrollbar-width:none
  }
  .toolbar::-webkit-scrollbar {
    display:none
  }
  .toolbar>* {
    flex-shrink:0
  }
  .toolbar-spacer {
    display:none
  }
  .main-toolbar #plan-title {
    width:150px
  }
  .level-label {
    margin-left:5px
  }
  .status {
    max-width:calc(100% - 24px);
    bottom:52px
  }
  .brand {
    font-size:12px
  }
  .start-card {
    width:290px
  }
  .all-toggle {
    padding-right:15px
  }
}
@media(max-width:600px) {
  .main-toolbar {
    height:48px
  }
  .palette-toolbar {
    height:58px
  }
  .brand {
    font-size:12px
  }
  .brand small {
    display:none
  }
  #plan-title {
    width:116px!important
  }
  .main-toolbar #home {
    display:none
  }
  .tool-modes button {
    font-size:11px
  }
  .palette-toolbar {
    padding-left:9px
  }
  .drawer {
    width:288px;
    max-width:calc(100% - 44px)
  }
  .coordinate-badge {
    top:17px;
    left:8px;
    font-size:8px;
    max-width:220px
  }
  .map-snapshot {
    right:8px;
    top:8px;
    padding:0 7px;
    font-size:9px
  }
  .zoom-bar {
    bottom:10px;
    right:8px
  }
  .zoom-bar button {
    padding:0 6px;
    font-size:9px
  }
  .status {
    font-size:9px;
    left:8px;
    bottom:49px
  }
  .start-card {
    width:275px;
    padding:15px
  }
  .skin-gallery {
    grid-template-columns:repeat(4,1fr);
    gap:6px
  }
  .skin-card {
    height:83px
  }
  .skin-card img {
    height:55px
  }
  .skin-filters {
    flex-wrap:wrap
  }
  .shared-banner {
    top:50px;
    max-width:95%;
    white-space:nowrap;
    font-size:9px
  }
  .shared-banner button {
    font-size:9px
  }
  dialog {
    padding:17px
  }
  .mini-gallery {
    grid-template-columns:repeat(7,1fr)
  }
  #panels-menu {
    left:auto;
    right:12px
  }
}
.skin-dialog {
  position:fixed;
  left:16px;
  top:96px;
  margin:0;
  z-index:40;
  max-height:calc(100dvh - 112px)
}
@media(max-width:600px) {
  .skin-dialog {
    left:8px;
    top:105px;
    max-width:calc(100vw - 16px);
    max-height:calc(100dvh - 120px)
  }
}

.brand b {
  font-weight:400;
}

.room-status {
  color:var(--cyan);
  border-color:#27675e;
  font-size:10px;
}
.room-status[data-state="saving"], .room-status[data-state="connecting"] {
  color:var(--gold);
  border-color:#817442;
}
.room-status[data-state="offline"], .room-status[data-state="error"] {
  color:#ffc4ca;
  border-color:#9e5864;
}
.live-section {
  border:1px solid #27675e;
  border-radius:9px;
  padding:14px;
  margin-bottom:20px;
}
.live-section h3 {color:var(--cyan)}
.live-section textarea {font-size:10px;margin-top:5px}
.live-recovery {
  position:absolute;
  bottom:85px;
  left:50%;
  transform:translateX(-50%);
  width:max-content;
  max-width:calc(100% - 24px);
  padding:10px;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  border:1px solid #9e5864;
  border-radius:8px;
  background:#351d2bf2;
  font-size:11px;
  z-index:8;
}

.room-gate {position:absolute;z-index:9;left:50%;top:50%;transform:translate(-50%,-50%);width:360px;max-width:calc(100% - 24px);padding:22px;border:1px solid var(--gold);border-radius:14px;background:#051526f5;box-shadow:0 15px 60px #0008}
.room-gate a {display:block;margin-top:16px;text-align:center;font-size:11px}
#account-message.error,#members-message.error {color:#ffc4ca}
.member-permission {border-bottom:1px solid #274057;padding:12px 0}
.member-permission strong,.member-permission small {display:block;overflow-wrap:anywhere}
.member-permission small {color:var(--muted);margin-top:4px}
#account-button {font-size:10px}
@media(max-width:600px){#account-button{position:fixed;top:8px;right:8px;height:30px;z-index:25;background:#073334}.main-toolbar{padding-right:100px}}
