:root { color-scheme: dark; color:#fff; font:16px/1.4 ui-monospace,Menlo,Consolas,monospace; }
* { box-sizing:border-box; }
body { margin:0; background:#151918; }
main { overflow:hidden; position:fixed; inset:0; }
html { touch-action:pan-x pan-y; }
canvas { display:block; width:100%; height:100%; image-rendering:pixelated; touch-action:manipulation; }
/* One CSS pixel per corner step matches native-resolution game art. */
nav, .drawer, .vitals, #quest-tracker, #combat-target, #world-menu, dialog, button,
.game-notice, #shop-notice, #craft-feedback, #combat-result, #save-warning {
  --corner:3px;
  --far:calc(100% - var(--corner));
  --inset:calc(100% - 1px);
  border-radius:0;
  clip-path:polygon(
    var(--corner) 0, var(--far) 0,
    var(--far) 1px, var(--inset) 1px, var(--inset) var(--corner), 100% var(--corner),
    100% var(--far), var(--inset) var(--far), var(--inset) var(--inset), var(--far) var(--inset),
    var(--far) 100%, var(--corner) 100%,
    var(--corner) var(--inset), 1px var(--inset), 1px var(--far), 0 var(--far),
    0 var(--corner), 1px var(--corner), 1px 1px, var(--corner) 1px
  );
}
button { --corner:2px; }
nav,.drawer { position:absolute; }
nav,.drawer,.vitals,#quest-tracker,#combat-target { background:var(--ui-panel,rgb(0 0 0 / 76%)); }
nav { top:12px; left:12px; display:grid; padding:4px; gap:4px; }
button { border:0; color:var(--ui-normal-ink,white); cursor:pointer; font:inherit; background:var(--ui-button,#0005); padding:7px 10px; }
button:enabled:hover,button[aria-expanded=true] { background:var(--ui-hover,#ffffff28); }
canvas:focus { outline:none; }
button:focus-visible { outline:2px solid var(--ui-accent,white); outline-offset:-3px; }
button:disabled { opacity:.55; cursor:default; }
img { image-rendering:pixelated; }
nav button,.clock-toggle[aria-expanded=false] { width:44px; height:44px; display:grid; place-content:center; }
.drawer { top:12px; left:76px; width:min(280px,calc(100% - 88px)); max-height:calc(100% - 24px); overflow:auto; padding:12px; z-index:2; }
header,.row,.buttons,.meter-row { display:flex; align-items:center; gap:8px; }
header { justify-content:space-between; margin-bottom:12px; padding-bottom:8px; }
h2,p { margin:0; } h2 { font-size:18px; }
.close { line-height:1; font:24px/28px DawnLarge,monospace; }
#skill-level { margin-left:auto; }
p,output { font:16px/20px DawnPixel,monospace; } p { margin-top:6px; }
#slots .slot:has(img:not([hidden])) { cursor:grab; touch-action:none; user-select:none; }
:is(#slots,#player-goods,#bank-bag) .inventory-drop { outline:2px solid var(--ui-accent,#30677f); outline-offset:-2px; }
.inventory-drag-icon { position:fixed; pointer-events:none; z-index:2147483647; transform:translate(-50%,-50%); image-rendering:pixelated; opacity:.85; }
#slots { display:grid; grid-template-columns:repeat(4,1fr); gap:3px; }
.slot { position:relative; display:grid; place-items:center; height:clamp(27px,5.5dvh,50px); background:var(--ui-slot,#ffffff12); }

.quantity { position:absolute; top:0; right:2px; font:bold 12px monospace; }
.buttons { margin-top:8px; flex-wrap:wrap; }
.player-hud { position:absolute; top:12px; right:12px; max-width:calc(100% - 88px); pointer-events:none; }
.hud-row { display:flex; align-items:flex-start; justify-content:flex-end; gap:8px; }
.vitals { flex:none; width:calc(clamp(96px,22vw,200px) + 44px); padding:8px; display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:4px; }
.vitals .run-toggle { grid-area:1 / 2 / span 3 / 3; align-self:center; }
.world-clock { display:flex; align-items:center; gap:4px; width:max-content; margin:4px 0 0 auto; padding:6px 8px; background:var(--ui-clock-panel,#171b1bea); font:16px/20px DawnPixel,monospace; }
#clock-details { display:grid; grid-template-columns:auto 1fr; align-items:center; column-gap:8px; }
#clock-details[hidden],.clock-toggle[aria-expanded=true] img,.clock-toggle[aria-expanded=false] span { display:none; }
.clock-toggle { pointer-events:auto; padding:0; }
.clock-toggle[aria-expanded=true] { width:24px; height:24px; align-self:flex-start; }
.world-clock .time-dial { grid-area:2 / 1 / span 2; }
.clock-week { grid-column:1 / -1; display:flex; gap:2px; list-style:none; margin:0 0 4px; padding:0; }
.clock-week li { box-sizing:border-box; min-width:16px; text-align:center; padding:1px 2px; border:1px solid var(--ui-day-border,#665f54); background:var(--ui-day-box,#302f2e); }
.clock-week li[aria-current=date] { flex:1; padding-inline:4px; color:var(--ui-selected-ink,#fff3d5); border-color:var(--ui-active-border,#c7ab78); background:var(--ui-day-active,#594634); }
#combat-target { position:absolute; top:6px; left:50%; transform:translateX(-50%); width:320px; max-width:calc(100% - 12px); padding:6px; }
#game-ui > #combat-target, #combat-target { pointer-events:none; }
#combat-target .row { flex-wrap:wrap; justify-content:space-between; row-gap:0; margin-bottom:4px; }
#combat-target .target-name[data-difficulty="easy"] { color:#83df92; }
#combat-target .target-name[data-difficulty="hard"] { color:#ffda64; }
#combat-target .target-name[data-difficulty="deadly"] { color:#ff7272; }
#combat-target .target-name { color:white; max-width:100%; overflow-wrap:normal; }
#combat-target .target-level { margin-left:auto; white-space:nowrap; }
#combat-target canvas { width:100%; height:7px; }
#game-ui .world-clock { margin:0; }
.run-toggle {pointer-events:auto;padding:2px;font:16px/20px DawnPixel,monospace;background:var(--ui-control,#413d39);}
.run-toggle[aria-pressed=true] {background:#30677f;color:white;}
.time-dial { pointer-events:auto; padding:0; background:transparent;  align-self:start; display:grid; justify-items:center; font:16px/20px DawnPixel,monospace; color:var(--ui-clock-ink,#fff4db); }
.time-dial svg { width:32px; height:32px; display:block; }
.conditions {display:flex;gap:3px;width:max-content;margin:4px 0 0 auto;padding:4px;background:var(--ui-clock-panel,#171b1bea);pointer-events:auto;}
.condition-icon {position:relative;display:block;width:32px;height:32px;background:#303637;}
.condition-icon img {display:block;width:32px;height:32px;image-rendering:pixelated;}
.condition-time {position:absolute;left:1px;bottom:0;color:white;font:12px/12px DawnSmall,monospace;text-shadow:-1px 0 #171819,1px 0 #171819,0 -1px #171819,0 1px #171819;}

#combat-result,#save-warning { width:fit-content; margin-left:auto; padding:4px 8px; background:var(--ui-badge,#000b); }

.meter-row { margin-top:8px; } output { min-width:4ch; text-align:right; }

@font-face { font-family:DawnSmall; src:url('game-art/ui/fonts/dawn-body-12.ttf') format('truetype'); font-display:swap; }
@font-face { font-family:DawnPixel; src:url('game-art/ui/fonts/dawn-body-16.ttf') format('truetype'); font-display:swap; }
@font-face { font-family:DawnLarge; src:url('game-art/ui/fonts/dawn-pixel-large.ttf') format('truetype'); font-display:swap; }
:root,button,h2,p,output,.quantity { font:16px/20px DawnPixel,monospace; font-synthesis:none; }
h1,h3 { font:24px/28px DawnLarge,monospace; }
/* Temporarily cover the attached page without closing it or losing its selection. */
body:has(:is(#forge,#fire-options,#conversation,#market,#bank)[open]) .drawer:not([data-detached]) { visibility:hidden; }
.drawer header h2,dialog header h2 { font:24px/28px DawnLarge,monospace; }
small { font:inherit; }
.quantity { font:12px/16px DawnSmall,monospace; }
strong { font-weight:normal; }
[hidden] { display:none !important; }
.drawer { width:304px; max-width:calc(100% - 88px); }
#slots { grid-template-columns:repeat(4,66px); gap:2px; }
.slot { width:66px; height:66px; padding:0; display:block; overflow:hidden; }
.slot img { display:block; margin:auto; }
.slot[aria-pressed=true] { box-shadow:inset 0 0 0 2px var(--ui-accent,#30677f); }
.slot:disabled { opacity:1; }
#details { margin-top:10px; padding-top:8px; }
#description { overflow-wrap:anywhere; }
.quantity {
  color:var(--stack-ink,white); background:transparent;
  --edge:var(--stack-outline,black);
  text-shadow:-1px -1px var(--edge),0 -1px var(--edge),1px -1px var(--edge),
              -1px 0 var(--edge),1px 0 var(--edge),
              -1px 1px var(--edge),0 1px var(--edge),1px 1px var(--edge);
}
#rest { margin-top:8px; }
@media(max-width:386px) { .drawer { left:6px; top:212px; max-width:calc(100% - 12px); max-height:calc(100% - 218px); } }
:root { -webkit-font-smoothing:none; font-kerning:none; font-variant-ligatures:none; }
#role-list { display:grid; gap:5px; }
.role-summary { width:100%; text-align:left; }
.role-summary .row { justify-content:space-between; margin-bottom:4px; }
.role-summary .pixel-meter { display:block; }
:is(#skills,#skill-popup) .pixel-meter { --ink:var(--ui-accent,#30677f); }
#role-bonus { color:var(--ui-secondary,#c2cfbd); }
#skills hr { border:0; height:1px; background:var(--ui-line,#ffffff40); margin:10px 0; }
#roles-back { margin-right:6px; }
#skills header .close { margin-left:auto; }
#skill-list.role-filtered hr { display:none; }
.skill-group { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
#skill-list button { display:grid; grid-template-columns:auto 32px; align-items:center; justify-content:center; gap:2px; padding:2px; }
#skill-list .skill-mini { grid-column:1 / -1; justify-self:center; }
.skill-mini { width:min(100%,38px); height:4px; }
#ability-tip { width:min(330px,calc(100% - 24px)); }
#ability-tip p { margin:8px 0; }
#skill-popup { width:min(360px,calc(100% - 24px)); max-height:80vh; overflow:auto; }
:is(#skill-unlocks,#role-unlocks) { list-style:none; margin:0; padding:0; }
:is(#skill-unlocks,#role-unlocks) li { display:flex; align-items:center; gap:8px; padding:4px 0; }
:is(#skill-unlocks,#role-unlocks) img { flex:none; object-fit:contain; image-rendering:pixelated; }
:is(#skill-unlocks,#role-unlocks) .locked { color:var(--ui-locked,#aaa); }
:is(#skill-unlocks,#role-unlocks) .locked img { filter:grayscale(1) brightness(.7); }
#skill-popup header { margin:0 0 8px; padding:0; }
#skill-popup .close { width:24px; height:24px; padding:0; }
.meter-row .pixel-meter { flex:1; min-width:2px; }
/* Axis-aligned steps round both the track and its moving fill. */
.pixel-meter, .pixel-meter::before {
  clip-path:polygon(1px 0,calc(100% - 1px) 0,calc(100% - 1px) 1px,100% 1px,
    100% calc(100% - 1px),calc(100% - 1px) calc(100% - 1px),calc(100% - 1px) 100%,
    1px 100%,1px calc(100% - 1px),0 calc(100% - 1px),0 1px,1px 1px);
}
.pixel-meter { height:8px; position:relative; background:var(--ui-track,#ffffff35); }
.pixel-meter::before { content:""; position:absolute; inset:0 auto 0 0;
  width:round(down,var(--fill,0%),1px); background:var(--ink,white); }
#skill-list .skill-mini { height:4px; }
.vital { height:20px; text-align:center; }
.vital span { position:relative; }
#health { --ink:#ac4145; }
#aerfyr { --ink:#346eac; }
#stamina { --ink:#947535; }
#world-menu { position:fixed; z-index:4; padding:4px; background:var(--ui-menu,#000d); }

dialog { border:0; color:var(--ui-normal-ink,white); background:var(--ui-dialog,rgb(0 0 0 / 88%)); padding:14px; }
dialog::backdrop { background:rgb(0 0 0 / 28%); }
#conversation { margin:auto auto 20px; width:min(480px,94vw); cursor:pointer; }
#speech { display:flex; align-items:center; gap:14px; min-height:76px; }
#portrait { flex:none; width:72px; height:70px; image-rendering:pixelated; background-repeat:no-repeat; }
#speech > div:nth-child(2) { flex:1; min-width:0; }
#portrait.player-head { order:1; }
#advance { margin-left:auto; }
.dialogue-options { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; margin-top:8px; }
.dialogue-options button { text-align:left; overflow-wrap:anywhere; }
.dialogue-options:empty { display:none; }
#bank, #market { width:min(722px,96vw); max-height:92dvh; overflow:auto; }
.market-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.market-columns section { min-width:0; }
.market-columns button[aria-pressed=true]:is(#show-shop-stock,#show-sold-stock) { box-shadow:inset 0 -2px var(--ui-accent,#30677f); }
.market-columns header { min-height:36px; }
.goods { display:grid; grid-template-columns:repeat(4,66px); gap:2px; }
#deal { margin-top:12px; padding-top:10px; }
#merchant-goods .sold-out img { filter:grayscale(1); opacity:.45; }
#merchant-goods .sold-out { background-color:var(--ui-sold,#514e4c); }
/* A single purchase, a recipe or a confirmation commits the chosen action. */
main :is(.primary-action,#forge-recipes button,#dye-form button[type=submit],#character-appearance button[value=save]) {
  background-color:#00869c; color:white;
}
main :is(.primary-action,#forge-recipes button,#dye-form button[type=submit],#character-appearance button[value=save]):enabled:hover {
  background-color:#007a90;
}
#forge-recipes button small { color:white; }
main :is(select,input):focus-visible { outline:2px solid var(--ui-accent,#30677f); }

#receipt { min-height:20px; }
@media(max-width:660px) {
  #market { padding:8px; }
  .market-columns { gap:8px; }
  .goods { grid-template-columns:repeat(auto-fit,66px); }
}

#forge { width:min(370px,94vw); }
#forge-recipes { display:grid; gap:6px; }
#forge-recipes button { display:flex; align-items:center; text-align:left; gap:8px; }
#forge-recipes small { display:block; color:var(--ui-hint,#deccaf); font:inherit; }

#gear-details { margin-top:12px; }
#gear-slots { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
#gear-slots .slot { height:58px; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; padding:3px 1px; }
#gear-slots .slot img { width:32px; height:32px; }
#gear-slots .slot span { font:12px/16px DawnSmall,monospace; }
#gear-slots .slot[aria-expanded=true] { outline:2px solid var(--ui-accent,#30677f); outline-offset:-2px; }
#remove-gear { margin:6px 0; }

#network-panel { position:absolute; left:12px; bottom:12px; max-width:calc(100% - 84px); background:var(--ui-chat,#101614e8); padding:4px; z-index:2; }
#harbour-chat { width:min(280px,100%); padding:6px; }
#player-log { width:min(280px,100%); padding:6px; }
#log-lines { max-height:128px; overflow:auto; overflow-wrap:anywhere; }
#log-lines:empty::before { content:'No activity yet.'; }
#unread-chat { font:16px/20px DawnPixel,monospace; background:#365747; padding:1px 4px; }
.session-tools #presence { align-self:center; white-space:nowrap; background:var(--ui-badge,#000b); padding:1px 4px; }
#network-panel .row { justify-content:space-between; }
#join-error,#confirmation-error { color:#f4d6a5; }
#messages { max-height:128px; overflow:auto; overflow-wrap:anywhere; }
#messages p { margin:3px 0; }
#chat-form { display:flex; gap:4px; margin-top:6px; }
#chat-form input { flex:1; min-width:0; }
#connect-dialog { width:min(340px,94vw); }
#connect-dialog fieldset { border:0; margin:0; padding:0; }
#connect-dialog label { display:grid; gap:3px; margin-bottom:8px; }
#chat-form input,#connect-dialog input { background:var(--ui-field,#293030); color:var(--ui-normal-ink,white); font:inherit; border:0; padding:6px; }


#journal h3 { color:var(--ui-secondary,#c2cfbd); margin:12px 0 5px; }
#journal-active {display:grid;gap:4px}
#journal-active button {text-align:left}
#journal-active [aria-expanded=true] {background:var(--ui-hover,#ffffff28)}
#journal-task {padding:0 8px 6px}
#journal-task p {margin:4px 0}

#quest-tracker { width:250px; max-width:100%; margin:6px 0 0 auto; padding:8px 10px; overflow-wrap:anywhere; }
#quest-tracker p { margin:2px 0 0; }
#tracked-progress,#tracked-contact { color:var(--ui-secondary,#c2cfbd); }
#journal:not([hidden]) ~ .player-hud #quest-tracker { display:none; }

.harbour-wordmark { display:block; margin:0 auto 12px; image-rendering:pixelated; }

#register-form p { margin:8px 0 12px; }
#connect-dialog label[hidden] { display:none; }

.online-game { background:#131517; overflow-x:clip; }
#game-entry:not([hidden]) {
  min-height:100svh; display:grid; grid-template-columns:minmax(0,1fr);
  align-content:center; justify-items:center; gap:18px; padding:10px;
  color:white; font:16px/20px DawnPixel,monospace;
}
#game-entry h1 { margin:0; max-width:100%; line-height:0; text-align:center; }
#game-entry h1 img { display:block; width:422px; max-width:100%; height:auto; image-rendering:pixelated; }
#entry-status { margin:0; font:inherit; }
#game-entry #connect-dialog {
  position:static; width:min(320px,100%); max-width:none;
  max-height:none; padding:0; margin:0; background:transparent; clip-path:none;
  font:inherit; overflow:visible;
}
#game-entry h2 { text-align:center; margin:0 0 14px; font:24px/24px DawnLarge,monospace; }
#game-entry label { font-size:16px; }
#game-entry input { min-width:0; width:100%; min-height:36px; }
#game-entry button { display:block; width:100%; clip-path:none; }
#game-entry button[type=button] { background:transparent; color:#dcdfdd; padding:10px; }
#game-entry button[type=button]:hover { text-decoration:underline; }
#game-entry button:not([type]) { background:#276647; min-height:48px; font:24px/24px DawnLarge,monospace; }
#game-entry button:not([type]):hover:enabled { background:#308050; }
#game-entry button:focus-visible { outline:3px solid #ffe7a2; outline-offset:-6px; }
#game-entry #join-error { overflow-wrap:anywhere; }
#game-entry #join-error:empty { display:none; }

.session-tools { display:flex; justify-content:flex-end; gap:2px; margin-bottom:4px; }
.session-tools button { width:24px; height:24px; padding:4px; pointer-events:auto; background:var(--ui-feedback,#000c); display:grid; place-items:center; --corner:1px; }
.session-tools button:hover { background:#36413c; }
.session-tools svg { width:16px; height:16px; shape-rendering:crispEdges; }
#game-settings[open] { display:flex; flex-direction:column; }
.settings-options { overflow:auto; }
@container (max-width: 220px) {
  #game-settings { padding:5px; max-width:100%; max-height:100%; }
  #game-settings header { flex-wrap:wrap; gap:2px; }
  #game-settings footer { overflow-wrap:anywhere; }
}
.profile-choice { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.profile-choice select { max-width:100%; font:inherit; color:var(--ui-normal-ink,white); background:var(--ui-field,#293030); border:0; padding:3px 5px; }
#game-settings footer { margin-top:10px; flex:none; }
#dye-form, #dye-colours { display:grid; gap:6px; }
#dye-form label { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
#dye-status:empty { display:none; }
.hud-dialog header { margin-bottom:10px; }
.hud-dialog .buttons { justify-content:flex-end; margin-top:12px; }
#leave-harbour { background:#883f39; }
#game-entry #local-play { width:144px; min-height:48px; padding:0; color:white; font:24px/24px DawnLarge,monospace; background:#276647; }

#game-ui { position:absolute; inset:0; pointer-events:none; container-type:inline-size; }
#game-ui > :not(.player-hud, #game-notices, #shop-notice, #combat-target) { pointer-events:auto; }
@container (max-width:386px) {
  #game-ui .drawer { left:4px; right:4px; top:4px; width:auto; max-width:none; max-height:calc(100% - 8px); z-index:3; }
  #game-ui .vitals { width:140px; }
  #game-ui .hud-row { flex-direction:column-reverse; align-items:flex-end; }
}

#game-ui [data-toolbar] {
  position:absolute;
  right:auto;
  bottom:auto;
  margin:0;
  max-width:100%;
  max-height:100%;
  overflow:auto;
  padding:14px 6px 6px;
}
#game-ui [data-toolbar], #game-ui #combat-target {
  background:var(--ui-panel,rgb(0 0 0 / 76%));
  --tl:2px;
  --tr:2px;
  --bl:2px;
  --br:2px;
  clip-path:polygon(
    var(--tl) 0, calc(100% - var(--tr)) 0,
    calc(100% - var(--tr)) min(1px,var(--tr)), calc(100% - min(1px,var(--tr))) min(1px,var(--tr)),
    calc(100% - min(1px,var(--tr))) var(--tr), 100% var(--tr),
    100% calc(100% - var(--br)), calc(100% - min(1px,var(--br))) calc(100% - var(--br)),
    calc(100% - min(1px,var(--br))) calc(100% - min(1px,var(--br))), calc(100% - var(--br)) calc(100% - min(1px,var(--br))),
    calc(100% - var(--br)) 100%, var(--bl) 100%,
    var(--bl) calc(100% - min(1px,var(--bl))), min(1px,var(--bl)) calc(100% - min(1px,var(--bl))),
    min(1px,var(--bl)) calc(100% - var(--bl)), 0 calc(100% - var(--bl)),
    0 var(--tl), min(1px,var(--tl)) var(--tl), min(1px,var(--tl)) min(1px,var(--tl)), var(--tl) min(1px,var(--tl))
  );
}
#game-ui .session-tools { width:max-content; }
#game-ui #network-panel { width:max-content; }
#game-ui .toolbar-handle {
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:14px;
  padding:0;
  display:grid;
  place-items:center;
  background:transparent;
  clip-path:none;
  pointer-events:auto;
  touch-action:none;
  user-select:none;
  cursor:grab;
}
#game-ui .toolbar-handle::after {
  content:'';
  width:12px;
  height:2px;
  background:var(--ui-handle,#a9aaa7);
}
#game-ui .toolbar-handle:active { cursor:grabbing; }
#game-ui .toolbar-handle:focus-visible::after { background:var(--ui-accent,white); }
#game-ui #journal:not([hidden]):not([data-minimized]) ~ #quest-tracker { display:none; }

#game-ui [data-docked~="tl"] { --tl:0px; }
#game-ui [data-docked~="tr"] { --tr:0px; }
#game-ui [data-docked~="bl"] { --bl:0px; }
#game-ui [data-docked~="br"] { --br:0px; }
#reset-toolbars { display:block; margin-top:8px; }

#game-ui #craft-feedback { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); width:max-content; max-width:90%; margin:0; padding:4px 8px; text-align:center; color:var(--ui-normal-ink,white); background:var(--ui-feedback,#000c); pointer-events:none; z-index:3; }

#reconnect-overlay[open] {
  position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none;
  margin:0; padding:0; border:0; clip-path:none; display:grid; place-items:center;
  background:rgb(19 21 23 / 95%); color:white; font:inherit; outline:0; touch-action:none;
}
#reconnect-overlay::backdrop { background:transparent; }

#game-ui .drawer[data-toolbar] {
  display:flex; flex-direction:column; width:min(304px,100%); max-height:100%;
  overflow:hidden; z-index:3;
}
#game-ui .drawer[data-front] { z-index:4; }
#game-ui .drawer:not([data-detached]) { max-width:var(--attached-width,calc(100% - 60px)); }
#game-ui .drawer > header { flex:none; justify-content:flex-start; gap:3px; margin:0; padding:3px 0 5px; }
#game-ui .drawer > header h2 { flex:1; min-width:0; }
#game-ui .drawer > header .close,#game-ui .page-minimize {
  margin:0; width:24px; height:24px; padding:0; flex:none;
}
#game-ui .page-content { overflow:auto; min-height:0; overscroll-behavior:contain; }
#game-ui .drawer .page-icon { width:44px; height:44px; padding:0; display:grid; place-items:center; }
#game-ui .drawer:not([data-minimized]) > .page-icon,
#game-ui .drawer:not([data-detached]) > header :is(.close,.page-minimize),
#game-ui .drawer[data-minimized] > :is(header,.page-content) { display:none; }
#game-ui .drawer[data-minimized] { width:max-content; }

#game-ui nav button[aria-controls],#game-ui .page-icon,#game-ui .clock-toggle[aria-expanded=false] { touch-action:none; user-select:none; }
#game-ui nav[data-drop-target] { min-width:56px; min-height:64px; z-index:6; }
#game-ui nav[data-drop-target="insert"]::after {
  content:""; position:absolute; left:6px; right:6px; top:var(--insert-y);
  height:2px; background:white; pointer-events:none;
}
#game-ui > .page-drag-icon {
  position:absolute; z-index:7; width:32px; height:32px; pointer-events:none; opacity:.8;
}

#world-calendar { width:min(350px,94vw); }
#world-calendar .calendar-navigation { margin:12px 0 6px; padding:0; }
#world-calendar h3 { margin:0; text-align:center; }
#world-calendar table { width:100%; border-collapse:collapse; table-layout:fixed; text-align:center; }
#world-calendar th { color:var(--ui-heading-muted,#b5c7b6); font-weight:normal; }
#world-calendar td { padding:4px 0; }
#world-calendar [aria-current=date] { background:#30677f; color:white; outline:1px solid var(--ui-accent,#93c9e1); outline-offset:-1px; }
#world-calendar .calendar-today { margin-top:8px; }

#presence:not(:empty)::before { content:''; display:inline-block; width:8px; height:8px; margin-right:5px; vertical-align:1px;
  background:#70d98a; clip-path:polygon(2px 0px,2px 1px,1px 1px,1px 2px,0px 2px,0px 6px,1px 6px,1px 7px,2px 7px,2px 8px,6px 8px,6px 7px,7px 7px,7px 6px,8px 6px,8px 2px,7px 2px,7px 1px,6px 1px,6px 0px); }

#shop-notice { position:absolute; bottom:12%; left:50%; transform:translateX(-50%); z-index:10; pointer-events:none; margin:0; padding:5px 9px; max-width:90%; text-align:center; background:var(--ui-notice,#101614ed); color:var(--ui-normal-ink,#fff); }
#shop-notice:empty { padding:0; }

.weapon-detail { display:block; }
.stat-gain { color:var(--ui-gain,#88de8b); }
.stat-loss { color:var(--ui-loss,#ff9992); }
.slot[data-rarity=Rare] { background-color:#244b83; }
.slot[data-rarity=Epic] { background-color:#5f397d; }
.slot[data-rarity=Legendary] { background-color:#995322; }
.slot[data-rarity=Flawless] { isolation:isolate; }
.slot[data-rarity=Flawless]::before {
  content:""; position:absolute; inset:-48%; z-index:-1; pointer-events:none;
  background:radial-gradient(ellipse at 30% 31%,#ed869d88,transparent 48%),
    radial-gradient(ellipse at 70% 35%,#f1c46e88,transparent 48%),
    radial-gradient(ellipse at 68% 72%,#75d4a988,transparent 48%),
    radial-gradient(ellipse at 27% 67%,#a495ec99,transparent 48%);
  animation:flawless-turn 9s linear infinite;
}
@keyframes flawless-turn { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .slot[data-rarity=Flawless]::before { animation:none; } }

.market-columns .slot[draggable=true], :is(#player-goods,#bank-bag) .slot:has(img) { cursor:grab; touch-action:none; user-select:none; }
#bank-bag .deposit-blocked { filter:grayscale(1); opacity:.55; }
#bank-count.at-capacity { color:var(--ui-capacity,#ffe197); }
.market-columns .slot:disabled { pointer-events:none; }
.market-columns .transfer-target { outline:2px dashed var(--ui-accent,#30677f); outline-offset:2px; }
.transfer-prompt[open] { display:grid; height:fit-content; align-content:start; gap:6px; min-width:min(240px,90vw); }
.transfer-prompt input { font:inherit; padding:6px; }

#game-notices {
  position:fixed; inset:auto max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) auto;
  margin:0; padding:0; border:0; background:transparent; color:var(--ui-normal-ink,#fff); pointer-events:none; z-index:12;
  width:min(320px,calc(100% - max(10px,env(safe-area-inset-right)) - 10px)); max-height:85%; overflow:hidden; overflow-wrap:anywhere;
}
.game-notice {
  display:flex; align-items:center; gap:8px; margin-top:4px; padding:6px 9px;
  background:var(--ui-toast,#171b19f2); border:0; font:16px/20px DawnPixel,monospace;
  animation:notice-fade var(--notice-duration,2600ms) linear both;
}
.game-notice img { width:32px; height:32px; flex:none; object-fit:contain; image-rendering:pixelated; }
.notice-skill-icons { display:flex; flex-wrap:wrap; flex:none; max-width:66px; gap:2px; }
.game-notice span { display:block; margin-top:3px; color:var(--ui-toast-text,#e0d4ae); }
@keyframes notice-fade { 0%,85% {opacity:1} 100% {opacity:0} }
@media(prefers-reduced-motion:reduce){ .game-notice { animation:none; } }


#customise-character { margin-top:10px; }
#character-appearance { width:min(272px,92vw); max-height:90dvh; overflow-y:auto; }
.cc-clothes { display:grid; grid-template-columns:1fr auto; gap:4px; align-items:center; margin-top:8px; }
.cc-clothes label { grid-column:1; display:flex; justify-content:space-between; align-items:center; }
.cc-clothes input { grid-column:2; }
#appearance-preview { width:100%; height:auto; background:#263530; }
#character-appearance fieldset { display:flex; gap:20px; margin:10px 0; }
#character-appearance label { cursor:pointer; }

/* Modal percentages use the viewport in the HUD's zoomed coordinate space. */
#game-ui dialog {
  --dialog-gap:4px;
  min-width:0;
  max-width:calc(100% - 2 * var(--dialog-gap));
  max-height:calc(100% - 2 * var(--dialog-gap));
  overflow:auto;
  overscroll-behavior:contain;
  overflow-wrap:anywhere;
}
#game-ui #conversation {
  max-height:calc(100% - 20px - var(--dialog-gap));
}
#game-ui .transfer-prompt { width:240px; grid-template-columns:minmax(0,1fr); }
#game-world :is(input,select,textarea) { font:inherit; }
#game-world :is(h1,h2,h3,h4) { font:24px/28px DawnLarge,monospace; }
#game-ui dialog :is(input,select,button) { max-width:100%; }
#game-ui #game-settings[open] { display:block; }
#game-ui .settings-options { overflow:visible; }
@container (max-width:620px) {
  #game-ui .goods { grid-template-columns:repeat(auto-fit,66px); }
}
@container (max-width:320px) {
  #game-ui .market-columns { grid-template-columns:minmax(0,1fr); }
  #game-ui dialog { padding:6px; }
  #game-ui dialog header, #game-ui #character-appearance fieldset { flex-wrap:wrap; gap:4px; }
  #game-ui .cc-clothes { grid-template-columns:minmax(0,1fr); }
  #game-ui .cc-clothes :is(label,input) { grid-column:1; flex-wrap:wrap; }
}
@container (max-width:180px) {
  #game-ui #speech { flex-wrap:wrap; gap:4px; }
  #game-ui #speech > div:nth-child(2) { flex-basis:100%; }
}

:is(#abilities,#spellbook).drawer:not([data-minimized]) { width:min(430px,100%); }
:is(#abilities,#spellbook) h3 { margin:6px 0; }
.ability-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; }
.ability-grid button { position:relative; min-width:0; padding:3px; background:var(--ui-ability,#34413b); }
.ability-grid img { display:block; width:min(32px,100%); height:auto; margin:auto; }
.ability-grid img[hidden] { display:none; }
.ability-grid [data-locked=true] img { filter:grayscale(1); opacity:.45; }
#ability-stamina { color:var(--ui-capacity,#ffe197); margin:0 0 8px; }
.ability-grid [data-waiting]::after { content:''; position:absolute; right:3px; top:3px; width:5px; height:5px; background:#ffe197; }
.ability-grid :is([data-cooling],[data-waiting]) img { filter:grayscale(1); opacity:.6; }
.ability-cooldown { position:absolute; inset:0; display:grid; place-items:center; color:white; font:12px/16px DawnSmall,monospace; text-shadow:1px 1px black,-1px -1px black; pointer-events:none; }
.ability-grid [aria-pressed=true] { box-shadow:inset 0 0 0 2px var(--ui-accent,#30677f); }
:is(#ability-slots,#spell-slots) { max-width:220px; margin-bottom:10px; }
:is(#ability-slots,#spell-slots) button { min-height:36px; }
:is(#ability-slots,#spell-slots) .ability-priority { position:absolute; bottom:0; left:3px; font:12px/16px DawnSmall,monospace; text-shadow:1px 1px black; }
.ability-browser { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:8px; height:230px; }
#ability-list,#ability-detail,#learned-spells,#spell-detail { overflow:auto; min-width:0; overscroll-behavior:contain; }
:is(#ability-detail,#spell-detail) { padding-left:8px; border-left:1px solid var(--ui-line,#ffffff40); overflow-wrap:anywhere; }
#ability-detail select,#ability-detail button { margin:6px 2px 0 0; max-width:100%; }
nav [aria-controls=abilities] img { width:32px; height:32px; object-fit:contain; }

canvas[data-world-cursor="attack"] { cursor:url('game-art/ui/cursors/attack.png') 12 12, pointer; }
canvas[data-world-cursor="talk"] { cursor:url('game-art/ui/cursors/talk.png') 12 12, pointer; }

canvas[data-world-cursor="blocked"] { cursor:url('game-art/ui/cursors/blocked.png') 12 12, pointer; }

html, button:disabled { cursor:var(--pixel-arrow,default); }
input:is([type=text],[type=password],[type=email],[type=number]), input:not([type]), textarea { cursor:text; }
:root {
  --pixel-arrow:url('game-art/ui/cursors/arrow.png') 0 0, default;
  --hand-up:url('game-art/ui/cursors/hand-up.png') 5 0, pointer;
  --hand-down:url('game-art/ui/cursors/hand-down.png') 5 0, pointer;
  --action-hand:var(--hand-up);
}
@media (prefers-reduced-motion:no-preference) {
  :root.cursor-pressed { --action-hand:var(--hand-down); }
}
:is(button:enabled,a[href],select:enabled,summary,[role=button]:not([aria-disabled=true]),
    label:has(:is(input,select):enabled),input:enabled:is([type=checkbox],[type=radio],[type=color],[type=submit],[type=button]),
    #conversation,canvas[data-world-cursor="interact"]):hover {
  cursor:var(--action-hand,pointer);
}

canvas[data-world-cursor="choice"] { cursor:url('game-art/ui/cursors/choice.png') 12 12, pointer; }
#target-menu { max-height:80%; max-width:calc(100% - 24px); overflow:auto; }
#target-menu > div { display:grid; gap:3px; }
#target-menu > div button { display:grid; grid-template-columns:24px 1fr; align-items:center; gap:6px; text-align:left; }
#target-menu > div button img { justify-self:center; image-rendering:pixelated; }


:is(#learned-spells,#spell-slots) [data-channelable]::before { content:''; position:absolute; bottom:1px; right:1px; width:12px; height:12px; background:#26342d url('game-art/ui/skills/channeling.png') center/contain no-repeat; image-rendering:pixelated; }
#learned-spells [hidden] { display:none; }

/* The renderer supplies the same night percentage as the terrain lighting.
   Switch ink polarity at twilight to keep lettering legible on the blended panels. */
main[data-ui-ink] {
  color:var(--ui-normal-ink);
  --ui-panel:color-mix(in srgb, #f3e4c2c2, rgb(0 0 0 / 76%) var(--ui-night));
  --ui-button:color-mix(in srgb, #74593255, #0005 var(--ui-night));
  --ui-hover:color-mix(in srgb, #513c2628, #ffffff28 var(--ui-night));
  --ui-slot:color-mix(in srgb, #513c2612, #ffffff12 var(--ui-night));
  --ui-dialog:color-mix(in srgb, #f3e4c2e0, rgb(0 0 0 / 88%) var(--ui-night));
  --ui-menu:color-mix(in srgb, #f3e4c2dd, #000d var(--ui-night));
  --ui-feedback:color-mix(in srgb, #f3e4c2cc, #000c var(--ui-night));
  --ui-badge:color-mix(in srgb, #f3e4c2bb, #000b var(--ui-night));
  --ui-clock-panel:color-mix(in srgb, #f3e4c2c2, #171b1bea var(--ui-night));
  --ui-day-box:color-mix(in srgb, #e4d4b5, #302f2e var(--ui-night));
  --ui-day-active:color-mix(in srgb, #cbb591, #594634 var(--ui-night));
  --ui-day-border:color-mix(in srgb, #b09974, #665f54 var(--ui-night));
  --ui-active-border:color-mix(in srgb, #816742, #c7ab78 var(--ui-night));
  --ui-control:color-mix(in srgb, #ded0b3, #413d39 var(--ui-night));
  --ui-field:color-mix(in srgb, #e5d5b5, #293030 var(--ui-night));
  --ui-track:color-mix(in srgb, #513c2635, #ffffff35 var(--ui-night));
  --ui-secondary:color-mix(in srgb, #4c5240, #c2cfbd var(--ui-ink-night));
  --ui-hint:color-mix(in srgb, #56432e, #deccaf var(--ui-ink-night));
  --ui-normal-ink:color-mix(in srgb, #382d25, white var(--ui-ink-night));
  --ui-clock-ink:color-mix(in srgb, #382d25, #fff4db var(--ui-ink-night));
  --ui-selected-ink:color-mix(in srgb, #382d25, #fff3d5 var(--ui-ink-night));
  --ui-ability:color-mix(in srgb, #d4c7a8, #34413b var(--ui-night));
  --ui-toast:color-mix(in srgb, #f3e4c2f2, #171b19f2 var(--ui-night));
  --ui-toast-text:color-mix(in srgb, #56432e, #e0d4ae var(--ui-ink-night));
  --ui-notice:color-mix(in srgb, #f3e4c2ed, #101614ed var(--ui-night));
  --ui-chat:color-mix(in srgb, #f3e4c2e8, #101614e8 var(--ui-night));
  --ui-locked:color-mix(in srgb, #575247, #aaa var(--ui-ink-night));
  --ui-line:color-mix(in srgb, #513c2640, #ffffff40 var(--ui-night));
  --ui-capacity:color-mix(in srgb, #674c10, #ffe197 var(--ui-ink-night));
  --ui-gain:color-mix(in srgb, #265d31, #88de8b var(--ui-ink-night));
  --ui-loss:color-mix(in srgb, #832d26, #ff9992 var(--ui-ink-night));
  --ui-sold:color-mix(in srgb, #cbbea6, #514e4c var(--ui-night));
  --ui-heading-muted:color-mix(in srgb, #4c5240, #b5c7b6 var(--ui-ink-night));
  --ui-handle:color-mix(in srgb, #71624b, #a9aaa7 var(--ui-night));
  --ui-accent:color-mix(in srgb, #30677f, #93c9e1 var(--ui-ink-night));
}
main[data-ui-ink=dark] { color-scheme:light; --ui-ink-night:0%; --stack-ink:black; --stack-outline:white; }
main[data-ui-ink=light] { color-scheme:dark; --ui-ink-night:100%; --stack-ink:white; --stack-outline:black; }
.vital, .run-toggle[aria-pressed=true], #unread-chat, #leave-harbour { color:white; }
main[data-ui-ink=dark] #combat-target .target-name { text-shadow:-1px 0 #493d32,1px 0 #493d32,0 -1px #493d32,0 1px #493d32; }
main[data-ui-ink] .time-dial svg circle:first-child { fill:color-mix(in srgb,#e4d4b5,#222a30 var(--ui-night)); }
main[data-ui-ink] .time-dial svg .hour-hand { stroke:color-mix(in srgb,#76562e,#e7ba78 var(--ui-ink-night)); }
main[data-ui-ink] .time-dial svg .minute-hand { stroke:var(--ui-clock-ink); }

@font-face{font-family:Jua;src:url('game-art/ui/fonts/jua.ttf');font-display:swap}
#game-entry:not([hidden]){
  box-sizing:border-box;padding:24px 16px;min-height:100svh;height:100dvh;overflow:auto;
  --menu-art:linear-gradient(#102a3378,#102a338c),url('landing/adventure.webp');
  --menu-art-size:auto,cover; --menu-art-position:center,79% center;
  align-content:safe center;background-image:var(--menu-art);background-size:var(--menu-art-size);background-position:var(--menu-art-position);
  font:17px/1.3 Jua,system-ui,sans-serif;-webkit-font-smoothing:antialiased;color-scheme:light
}
#game-entry h1 img{width:min(330px,78vw);image-rendering:auto;filter:drop-shadow(0 2px 4px #102d3a)}
#game-entry #connect-dialog{box-sizing:border-box;width:min(360px,100%);border:0;border-radius:18px;padding:22px 25px;background:#f6edd8;color:#293e4b;box-shadow:0 6px #645f52}
#game-entry h2{font:30px/1.1 Jua,system-ui,sans-serif}
#game-entry p,#game-entry button,#game-entry label{font-family:inherit;line-height:1.3}
#game-entry label{margin-bottom:10px}
#game-entry input{background:#fffaf0;color:#213b46;border-radius:8px;padding:8px 10px;box-shadow:inset 0 -2px #c7c6b6}
#game-entry button:not([type]),#game-entry #local-play{border:0;border-radius:20px;background:#007e94;box-shadow:0 3px #075369;color:white;font:20px Jua,system-ui,sans-serif;text-transform:uppercase;margin:8px 0}
#game-entry button:not([type]):hover:enabled{background:#006f85}
#game-entry button[type=button]{color:#285b70;font-size:16px;padding:6px}
#game-entry .stay-signed-in{display:flex;align-items:center;gap:8px}
#game-entry .stay-signed-in input{width:1em;height:1em;min-height:0;margin:0;padding:0;box-shadow:none;accent-color:#285b70}
#game-entry #join-error{margin-bottom:0}
#game-entry [hidden]{display:none!important}

#field-guide.drawer:not([data-minimized]) { width:min(360px,100%); }
#field-guide input,#field-guide select { max-width:100%; font:inherit; margin-bottom:4px; }
#guide-entries { max-height:min(48vh,360px); overflow:auto; }
#guide-entries button { display:block; width:100%; margin-bottom:3px; text-align:left; }
#guide-title { margin:6px 0; }
#guide-entries p { margin:3px 0; }

.guide-navigation {display:flex;align-items:center;gap:6px}
.guide-navigation #guide-back {flex:none}
.guide-navigation #guide-search {min-width:0;flex:1;margin:0}
#music.drawer:not([data-minimized]) {width:min(320px,100%)}
#music-list {display:grid;gap:3px;max-height:min(45vh,340px);overflow:auto}
#music-list button {text-align:left}
#music-list button:disabled {opacity:.45}
#music-list button[aria-pressed=true]::before {content:'✓ '}
#music-now {font-weight:bold}

.volume-settings { min-width:0; margin:0; padding:0; border:0; }
.volume-settings > div { display:grid; grid-template-columns:6ch minmax(4ch,1fr) 4ch; gap:.5em; align-items:center; }
.volume-settings input[type="range"] { width:100%; min-width:0; margin:0; }
.volume-settings output { text-align:right; }

#game-ui .session-tools, #game-ui .vitals[data-toolbar] { width:clamp(96px,22vw,200px); width:round(down,clamp(96px,22vw,200px),1px); }
@container (max-width:386px) {
  #game-ui .session-tools, #game-ui .vitals[data-toolbar] { width:96px; }
}
#game-ui .vitals[data-toolbar] { grid-template-columns:1fr; }
#game-ui .session-tools { display:block; }
.minimap-face { position:relative; }
.minimap-face .pbe-label { position:absolute; top:0; left:50%; transform:translateX(-50%); z-index:1; padding:1px 4px; background:var(--ui-badge,#000b); color:var(--ui-text,white); pointer-events:none; }
#minimap { position:relative; width:100%; height:auto; aspect-ratio:1; clip-path:inset(50%); }
.minimap-face button { position:absolute; }
.minimap-face #open-settings { left:0; top:0; }
.minimap-face #open-logout { right:0; top:0; }
.minimap-face #expand-map { right:0; bottom:0; }
.minimap-face .run-toggle { left:0; bottom:0; width:auto; min-width:28px; padding:2px; }
.minimap-face .run-toggle[aria-pressed=true] { background:#30677f; }
.minimap-face #presence { position:absolute; bottom:0; left:0; right:0; width:max-content; margin-inline:auto; }
#world-map-window { max-width:95%; max-height:95%; overflow:auto; }
#map-viewport { width:min(65vw,480px); height:min(52vh,320px); overflow:auto; touch-action:none; cursor:grab; background:#365b79; }
.map-sheet { position:relative; width:max-content; margin:0 auto }
#map-names { position:absolute; inset:0; pointer-events:none; overflow:hidden }
#map-names span { position:absolute; white-space:nowrap; color:#fff8dd; text-shadow:1px 0 #293947,-1px 0 #293947,0 1px #293947,0 -1px #293947; font:16px/20px DawnPixel,monospace }
#map-key { margin:4px 0; padding-left:30px }
#map-viewport:active { cursor:grabbing; }
#full-map { width:auto; max-width:none; height:auto; margin:0 auto; touch-action:none; }
#world-map-window .map-zoom-controls { justify-content:center; align-items:center; margin:4px 0; }

/* One CSS pixel is one HUD art pixel at the game's native scale. */
.pixel-game select, .pixel-game input, .pixel-game textarea {
  border-radius:0; font:16px/20px DawnPixel,monospace; font-synthesis:none;
}
.pixel-game :is(input:not([type]),input:is([type=text],[type=password],[type=email],[type=url],[type=number],[type=search]),textarea) {
  appearance:none; background:var(--ui-field,#293030); color:var(--ui-normal-ink,white);
  border:1px solid var(--ui-active-border,#817769); padding:4px 6px;
}
.pixel-game input[type=number] {appearance:textfield}
.pixel-game input::-webkit-inner-spin-button,.pixel-game input::-webkit-outer-spin-button {appearance:none}
.pixel-game input:is([type=checkbox],[type=radio]),.pixel-game #game-entry .stay-signed-in input {
  appearance:none; box-sizing:border-box; display:inline-grid; place-content:center;
  width:16px;height:16px;min-height:16px;padding:0;border:1px solid currentColor;
  vertical-align:-2px;background:var(--ui-field,#293030);color:var(--ui-normal-ink,white);box-shadow:none;
}
.pixel-game input[type=checkbox]:checked::after {
  content:'';width:10px;height:8px;background:currentColor;
  clip-path:polygon(0 3px,1px 3px,1px 4px,2px 4px,2px 5px,3px 5px,3px 4px,4px 4px,4px 3px,5px 3px,5px 2px,6px 2px,6px 1px,7px 1px,7px 0,10px 0,10px 1px,9px 1px,9px 2px,8px 2px,8px 3px,7px 3px,7px 4px,6px 4px,6px 5px,5px 5px,5px 6px,4px 6px,4px 7px,3px 7px,3px 8px,2px 8px,2px 7px,1px 7px,1px 6px,0 6px);
}
.pixel-game input[type=radio] {position:relative;border:0;background:currentColor;clip-path:polygon(5px 0px,5px 1px,3px 1px,3px 2px,2px 2px,2px 3px,1px 3px,1px 5px,0px 5px,0px 11px,1px 11px,1px 13px,2px 13px,2px 14px,3px 14px,3px 15px,5px 15px,5px 16px,11px 16px,11px 15px,13px 15px,13px 14px,14px 14px,14px 13px,15px 13px,15px 11px,16px 11px,16px 5px,15px 5px,15px 3px,14px 3px,14px 2px,13px 2px,13px 1px,11px 1px,11px 0px)}
.pixel-game input[type=radio]::before {content:"";position:absolute;inset:1px;background:var(--ui-field,#293030);clip-path:polygon(4px 0px,4px 1px,3px 1px,3px 2px,2px 2px,2px 3px,1px 3px,1px 4px,0px 4px,0px 10px,1px 10px,1px 11px,2px 11px,2px 12px,3px 12px,3px 13px,4px 13px,4px 14px,10px 14px,10px 13px,11px 13px,11px 12px,12px 12px,12px 11px,13px 11px,13px 10px,14px 10px,14px 4px,13px 4px,13px 3px,12px 3px,12px 2px,11px 2px,11px 1px,10px 1px,10px 0px)}
.pixel-game input[type=radio]:checked::after {content:"";position:relative;width:6px;height:6px;background:currentColor;clip-path:polygon(1px 0px,1px 1px,0px 1px,0px 5px,1px 5px,1px 6px,5px 6px,5px 5px,6px 5px,6px 1px,5px 1px,5px 0px)}
.pixel-game input[type=range] {appearance:none;background:transparent;height:20px;padding:0;border:0;vertical-align:middle}
.pixel-game input[type=range]::-webkit-slider-runnable-track {height:4px;background:var(--ui-handle,#a9aaa7)}
.pixel-game input[type=range]::-moz-range-track {height:4px;background:var(--ui-handle,#a9aaa7)}
.pixel-game input[type=range]::-webkit-slider-thumb {appearance:none;margin-top:-5px;width:10px;height:14px;border:1px solid currentColor;border-radius:0;background:var(--ui-accent,#93c9e1)}
.pixel-game input[type=range]::-moz-range-thumb {box-sizing:border-box;width:10px;height:14px;border:1px solid currentColor;border-radius:0;background:var(--ui-accent,#93c9e1)}
.pixel-game input[type=color] {appearance:none;width:30px;height:22px;padding:2px;border:1px solid currentColor;background:var(--ui-field,#293030);vertical-align:middle}
.pixel-game input[type=color]::-webkit-color-swatch-wrapper {padding:0}
.pixel-game input[type=color]::-webkit-color-swatch {border:0;border-radius:0}
.pixel-game input[type=color]::-moz-color-swatch {border:0;border-radius:0}
.pixel-game #game-entry {font:16px/20px DawnPixel,monospace;-webkit-font-smoothing:none}
.pixel-game #game-entry :is(input,button,#connect-dialog) {border-radius:0}
.pixel-game #game-entry h2,.pixel-game #game-entry button:not([type]),.pixel-game #game-entry #local-play {font:24px/28px DawnLarge,monospace}
.pixel-game #game-entry :is(label,p,button[type=button],input) {font:16px/20px DawnPixel,monospace}
.pixel-game #game-entry input:not([type=checkbox]) {background:#fffaf0;color:#213b46}
.pixel-game #game-entry .stay-signed-in input {background:#fffaf0;color:#285b70}
.pixel-game #appearance-preview {width:240px;height:304px;margin-inline:auto}
@media (max-width:290px) {
  .pixel-game #appearance-preview {width:120px;height:152px}
}
