/* Website chrome only. Native story geometry, fonts and artwork keep their own rules. */
:root {
  color-scheme: dark;
  --ui-bg: #14192f;
  --ui-sidebar: #1b223b;
  --ui-surface: #252e4a;
  --ui-hover: #303b59;
  --ui-text: #f2f4fa;
  --ui-muted: #a9b6d0;
  --ui-accent: #f080ae;
  --ui-accent-hover: #ff9bc3;
  --ui-selection: #f080ae;
  --ui-on-accent: #25152b;
  --ui-gold: #d9bf87;
  --ui-border: #36415e;
  --ui-track: #647394;
  --ui-font:
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui,
    sans-serif;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-radius: 8px;
  --ui-panel-radius: 12px;
  --ui-control: 44px;
  --ui-icon: 20px;
  --ui-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
  --ui-duration: 160ms;
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --ui-duration: 0ms;
  }
}

/* The original archive light palette, with stronger pink for small selected labels. */
:root[data-theme="light"] {
  color-scheme: light;
  --ui-bg: #faf6ec;
  --ui-sidebar: #f1ead9;
  --ui-surface: #ffffff;
  --ui-hover: #faf6ec;
  --ui-text: #26305f;
  --ui-muted: #5d6286;
  --ui-accent: #3e6fc8;
  --ui-accent-hover: #345fac;
  --ui-selection: #b92c62;
  --ui-on-accent: #ffffff;
  --ui-gold: #c4a165;
  --ui-border: #d5c8ac;
  --ui-track: #858baa;
  --ui-shadow: 0 8px 24px rgb(38 48 95 / 0.08);
}

/* Native NGUI controls. The small frame alone has horizontal slice borders. */
:root {
  --game-small-frame: url("assets/ui/common_btn_s_sub_8.png");
  --game-small-selected: url("assets/ui/common_btn_s_sub_8_selected.png");
  --game-tile-frame: url("assets/ui/common_btn_l_sub_8.png");
  --game-tile-selected: url("assets/ui/common_btn_l_sub_8_selected.png");
  --game-tool-frame: url("assets/ui/common_btn_icon_bg_sub.png");
  --game-tool-selected: url("assets/ui/common_btn_icon_bg_sub_yellow.png");
  --game-ink: #2e3d78;
  --game-selected-ink: #a82657;
  --game-gold: #d7b98a;
  --game-font:
    "Nunito", "UD Marugo", "PriconnePrein", "Noto Sans JP", system-ui,
    sans-serif;
}
.game-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 80px;
  min-height: 44px;
  padding: 8px 20px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--game-ink);
  text-decoration: none;
  font: 700 14px/1.4 var(--game-font);
  cursor: pointer;
}
.game-button::after {
  content: "";
  position: absolute;
  inset: 1px 0;
  z-index: -1;
  pointer-events: none;
  border-style: solid;
  border-width: 0 33px 0 39px;
  border-image: var(--game-small-frame) 0 33 0 39 fill stretch;
}
.game-button:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--game-selected-ink);
}
.game-button:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}
.game-button:is(
  [aria-pressed="true"],
  [aria-expanded="true"],
  [aria-current="page"]
) {
  color: var(--game-selected-ink);
}
.game-button:is(:disabled, [aria-disabled="true"]) {
  opacity: 0.55;
  cursor: default;
}
.game-button:focus-visible {
  outline: 3px solid var(--ui-accent);
  outline-offset: 3px;
}
.game-button.game-tile {
  flex: 0 0 130px;
  width: 130px;
  min-width: 130px;
  height: 70px;
  min-height: 70px;
  flex-direction: column;
  gap: 0;
  padding: 6px 8px 10px;
  font-size: 16px;
}
.game-button.game-tile::after {
  inset: 0;
  border: 0;
  background: var(--game-tile-frame) center / contain no-repeat;
}
/* A state that holds until the button or a sibling option changes it sits on the yellow plate. */
.game-button:is(
    [aria-pressed="true"],
    [aria-expanded="true"],
    [aria-selected="true"],
    [aria-current="page"]
  )::after {
  border-image-source: var(--game-small-selected);
}
.game-button.game-tile:is(
    [aria-pressed="true"],
    [aria-expanded="true"]
  )::after {
  background-image: var(--game-tile-selected);
}
.game-button.game-tool {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: calc(44px * 92 / 90);
  min-height: 0;
  padding: 0;
}
.game-button.game-tool::after {
  inset: 0;
  border: 0;
  background: var(--game-tool-frame) center / contain no-repeat;
}
/* The game's yellow fill is 79 x 83 pixels inside the 90 x 92 ring. */
.game-button.game-tool:is(
    [aria-pressed="true"],
    [aria-expanded="true"]
  )::after {
  background:
    var(--game-tool-selected) center / 87.78% 90.22% no-repeat,
    var(--game-tool-frame) center / contain no-repeat;
}
.game-checkbox {
  appearance: none;
  flex: 0 0 28px;
  width: 28px;
  height: calc(28px * 64 / 61);
  margin: 0;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: url("assets/ui/common_bg_checkbox.png") center / contain no-repeat;
}
.game-checkbox:checked {
  background-image:
    url("assets/ui/common_icon_checkbox.png"),
    url("assets/ui/common_bg_checkbox.png");
  background-size:
    calc(100% * 58 / 61) auto,
    contain;
}
.game-checkbox:focus-visible {
  outline: 3px solid var(--ui-accent);
  outline-offset: 3px;
}
.game-checkbox:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (forced-colors: active) {
  .game-button {
    border: 1px solid ButtonText;
    color: ButtonText;
  }
  .game-checkbox {
    appearance: auto;
  }
}

.game-button:is(:hover, [aria-pressed="true"], [aria-expanded="true"]) {
  background: transparent;
  border: 0;
}
