:root {
  --bg: #291c29;
  --paper: #432d40;
  --ink: #fff0f7;
  --muted: #dec1d1;
  --line: #80526f;
  --blue: #ffadd2;
  --soft: #583750;
  --btn: #f0a0c8;
  --btntext: #321c2a;
  --shadow: #150b1940;
  color-scheme: dark;
}
html #app #oshi-manual {
  --om-button: var(--btn);
  --om-button-text: var(--btntext);
}
#app :is(#oshi-flick, #oshi-manual, #oshi-senbatsu) {
  border-radius: 20px;
}
#app .oa-card .app-info {
  overflow-wrap: anywhere;
}
:root[data-theme="dark"] {
  --bg: #191e26;
  --paper: #262e39;
  --ink: #edf2f8;
  --muted: #bdc9d7;
  --line: #465466;
  --blue: #b6d7f6;
  --soft: #32485e;
  --btn: #bfdcf6;
  --btntext: #203549;
  --shadow: #00000030;
  color-scheme: dark;
}
:root[data-theme="cream"] {
  --bg: #f3efe7;
  --paper: #fffdf8;
  --ink: #332b27;
  --muted: #726257;
  --line: #d4c7b7;
  --blue: #795639;
  --soft: #ece0ce;
  --btn: #765237;
  --btntext: #fffaf2;
  --shadow: #62432915;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 24px;
  background: var(--bg) !important;
  color: var(--ink);
  font:
    14px/1.5 Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select,
input {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
#app {
  max-width: 1080px;
  margin: auto;
  --op-blue: var(--blue);
  --op-muted: var(--muted);
  --op-soft: var(--soft);
  --op-ink: var(--ink);
  --op-paper: var(--paper);
  --op-line: var(--line);
}
html #app :is(#oshi-tutorial, #oshi-flick, #oshi-manual, #oshi-senbatsu) {
  --os-bg: var(--bg);
  --os-paper: var(--paper);
  --os-ink: var(--ink);
  --os-muted: var(--muted);
  --os-line: var(--line);
  --os-blue: var(--blue);
  --os-soft: var(--soft);
  --os-btn: var(--btn);
  --os-btntext: var(--btntext);
  --om-bg: var(--bg);
  --om-paper: var(--paper);
  --om-ink: var(--ink);
  --om-muted: var(--muted);
  --om-line: var(--line);
  --om-blue: var(--blue);
  --om-soft: var(--soft);
  --om-btn: var(--btn);
  --om-btntext: var(--btntext);
  --om-shadow: var(--shadow);
  --oa-bg: var(--bg);
  --oa-paper: var(--paper);
  --oa-ink: var(--ink);
  --oa-muted: var(--muted);
  --oa-line: var(--line);
  --oa-blue: var(--blue);
  --oa-soft: var(--soft);
  --oa-btn: var(--btn);
  --oa-btntext: var(--btntext);
  --oa-shadow: var(--shadow);
  --op-bg: var(--bg);
  --op-paper: var(--paper);
  --op-ink: var(--ink);
  --op-muted: var(--muted);
  --op-line: var(--line);
  --op-blue: var(--blue);
  --op-soft: var(--soft);
  --op-btn: var(--btn);
  --op-btntext: var(--btntext);
  --op-shadow: var(--shadow);
  color-scheme: inherit;
  width: 100%;
  max-width: none;
  border: 1px solid var(--line);
}
.app-toolbar,
.app-preferences,
.app-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-toolbar {
  padding: 0 4px 12px;
  font-size: 12px;
  color: var(--muted);
}
.app-preferences {
  gap: 14px;
  flex-wrap: wrap;
}
.app-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.app-toolbar button,
.app-toolbar select,
.app-resume-bar button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
}
.app-resume-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
#app-save-status:empty {
  display: none;
}
#app input {
  accent-color: var(--blue);
}
.member-photo {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--soft);
  color: var(--blue);
  font:
    24px Georgia,
    serif;
}
.member-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: var(--soft);
}
#app .os-photo,
#app .om-picture,
#app .oa-portrait,
#app .op-portrait {
  overflow: hidden;
}
#app .os-slot > span {
  display: block;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#app .os-photo > .member-photo,
#app .om-picture > .member-photo,
#app .oa-portrait > .member-photo,
#app .op-portrait > .member-photo {
  position: absolute;
  inset: 0;
}
#app .os-photo,
#app .oa-portrait {
  position: relative;
}
#app .op-photocard {
  position: relative;
}
#app .op-card-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  z-index: 1;
}
#app .mi-info {
  position: relative;
  z-index: 2;
}
#app .op-card-select:hover {
  background: transparent;
}
#app .op-card-select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
#app .app-info {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: inherit;
  text-align: inherit;
  cursor: pointer;
  font-weight: 600;
}
#app .app-info:hover {
  text-decoration: underline;
}
#app .oa-card .app-info {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.35;
}
#app .oa-stage-row {
  flex-wrap: wrap;
}
#app .oa-card {
  min-width: 110px;
}
#app .oa-mini {
  min-width: 0;
  position: relative;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  text-align: center;
}
#app .oa-mini > .member-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
}
#app .oa-mini .oa-mini-rank {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  border-radius: 999px;
  background: var(--oa-paper);
  padding: 3px 7px;
}
#app .oa-mini .app-info {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.app-downloads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.app-downloads a {
  color: var(--blue);
}
#app .app-companion {
  margin-bottom: 20px;
}
#app .app-companion .op-guide {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 0 auto;
  max-width: 650px;
}
#app .app-companion .op-dialogue {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 18px;
  padding: 18px 20px 28px;
  color: var(--ink);
  line-height: 1.5;
  max-width: none;
}
#app .app-companion .op-dialogue strong {
  display: block;
  color: var(--blue);
  font-size: 12px;
  margin-bottom: 6px;
}
#app .app-companion .op-dialogue p {
  margin: 0;
  font-size: 15px;
}
#app .oc-controls,
#app .oc-rig-panel {
  display: none;
}
#app .app-staff-placeholder {
  width: 105px;
  min-height: 130px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  text-align: center;
  flex-shrink: 0;
}
#app .app-staff-placeholder strong {
  font-size: 28px;
}
#app .app-staff-placeholder small {
  font-size: 10px;
  color: var(--muted);
}
#app .app-staff-illustrated {
  padding: 0;
  border: 0;
  background: transparent;
  height: 160px;
}
#app .app-staff-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#app .os-welcome {
  row-gap: 0;
}
#app .os-welcome .app-companion,
#app .os-welcome .op-guide,
#app .os-right {
  display: contents;
}
#app .os-welcome .oc-stage,
#app .os-welcome .app-staff-placeholder {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 190px;
  height: 270px;
  align-self: center;
}
#app .os-welcome .oc-actor,
#app .os-welcome .op-ami {
  width: 190px;
  height: 264px;
}
#app .os-welcome .oc-shadow {
  left: 75px;
}
#app .os-welcome .op-dialogue {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 24px;
  min-height: 158px;
}
#app .os-welcome .op-dialogue p {
  font-size: 19px;
}
#app .os-picker {
  grid-column: 2;
  grid-row: 2;
}
#app .ot-highlight {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
  border-radius: 12px;
}
#app .op-header {
  background: var(--bg);
}
@media (max-width: 740px) {
  body {
    padding: 10px;
  }
  .app-toolbar {
    flex-wrap: wrap;
    gap: 9px;
  }
  .app-preferences {
    gap: 9px;
  }
  #app .app-companion .op-guide {
    gap: 10px;
  }
  #app .app-companion .op-dialogue {
    padding: 12px 12px 28px;
  }
  #app .app-companion .op-dialogue p {
    font-size: 14px;
  }
}
@media (max-width: 540px) {
  #app .os-welcome .oc-stage,
  #app .os-welcome .app-staff-placeholder {
    width: 100px;
    height: 180px;
    grid-row: 1;
  }
  #app .os-welcome .oc-actor,
  #app .os-welcome .op-ami {
    width: 110px;
    height: 160px;
  }
  #app .os-welcome .oc-shadow {
    left: 35px;
  }
  #app .os-picker {
    grid-column: 1/-1;
  }
  #app .os-welcome .op-dialogue p {
    font-size: 16px;
  }
  #app .os-welcome .op-dialogue {
    margin-bottom: 20px;
  }
  #app .oa-layout {
    display: block;
  }
  #app .oa-save {
    margin-top: 20px;
  }
  #app .oa-card {
    min-width: 90px;
  }
  #app .oa-row-3 .oa-card {
    width: calc(50% - 8px);
  }
  #app .op-pair {
    gap: 12px;
  }
  #app .app-companion .oc-stage:has(.oc-live2d) {
    width: 90px;
    flex-basis: 90px;
    height: 125px;
  }
  #app .app-companion .oc-stage:has(.oc-live2d) .oc-actor {
    width: 90px;
    height: 125px;
  }
}
#app .os-welcome .oc-stage:has(.oc-live2d) .oc-actor {
  width: 190px;
  height: 264px;
}
@media (max-width: 540px) {
  #app .os-welcome .oc-stage:has(.oc-live2d) .oc-actor {
    width: 110px;
    height: 160px;
  }
}
#app .oa-rank {
  z-index: 2;
}
#app :is(.os-brand, .op-brand, .om-brand, .oa-brand) svg {
  display: block;
  width: 164px;
  height: 42px;
  color: var(--blue);
}
@media (max-width: 540px) {
  #app :is(.os-brand, .op-brand, .om-brand, .oa-brand) svg {
    width: 140px;
    height: 36px;
  }
}
#app .oa-portrait {
  position: relative;
}
#app .oa-rank-badge {
  top: -12px;
  bottom: auto;
  left: -9px;
  height: auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px #39203030);
}
#app .oa-card {
  overflow: visible;
  isolation: isolate;
}
#app .oa-rank-badge[data-rank="1"] {
  top: -26px;
  left: -28px;
}
#app .oa-rank-badge:is([data-rank="2"], [data-rank="3"]) {
  top: -20px;
  left: -18px;
}
#app .oa-formation,
#app .oa-stage-row {
  row-gap: 28px;
}
#app .oa-rank-badge svg {
  display: block;
  width: 100%;
  height: auto;
}
#app .os-teams {
  margin: 12px 0;
}
#app .os-teams summary {
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 13px;
}
#app .os-teams summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}
#app .os-team-fields {
  padding: 0 0 8px;
}
#app .os-team-fields .os-field:first-child {
  margin-top: 4px;
}
html[data-theme="cream"]
  :is(.mi-birthday, .mi-native, .mi-details dt, .mi-membership p, .mi-close) {
  color: var(--muted);
}
html[data-theme="cream"] :is(.mi-nickname, .mi-eyebrow, .mi-source) {
  color: var(--blue);
}
/* Welcome is deliberately larger than Ami's later companion appearances. */
#app .os-landing {
  max-width: 1000px;
  padding-top: 26px;
}
#app .os-welcome {
  max-width: 860px;
  grid-template-columns: 320px minmax(0, 1fr);
  column-gap: 35px;
  min-height: 420px;
}
#app .os-welcome .oc-stage,
#app .os-welcome .app-staff-placeholder {
  width: 320px;
  height: 430px;
}
#app .os-welcome .oc-actor,
#app .os-welcome .op-ami,
#app .os-welcome .oc-stage:has(.oc-live2d) .oc-actor {
  width: 320px;
  height: 430px;
}
#app .os-welcome .oc-shadow {
  left: 125px;
  width: 70px;
}
#app .app-ami-head {
  display: block;
  object-fit: contain;
  width: 112px;
  height: 140px;
  flex: 0 0 112px;
}
#app .ot-art {
  width: 90px;
  height: 110px;
  object-fit: contain;
}
#app .ot-guide {
  grid-template-columns: 124px minmax(0, 1fr);
}
#app .ot-character {
  display: grid;
  place-items: center;
}
#app .os-sheet > .os-kicker {
  margin-bottom: 16px;
}
#app .ot-highlight {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--blue) 18%, transparent),
    0 0 24px color-mix(in srgb, var(--blue) 35%, transparent);
}
#app[data-motion="on"] .ot-highlight {
  animation: tip-glow 1.6s ease-in-out infinite;
}
@keyframes tip-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 6px color-mix(in srgb, var(--blue) 12%, transparent),
      0 0 14px color-mix(in srgb, var(--blue) 22%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 10px color-mix(in srgb, var(--blue) 25%, transparent),
      0 0 32px color-mix(in srgb, var(--blue) 55%, transparent);
  }
}
/* Departure copies must sit above the next pair, not in normal card flow. */
#app #oshi-flick .op-departure {
  position: absolute;
}
#app .os-welcome .oc-stage:has(.oc-live2d) {
  width: 320px;
  height: 430px;
}
@media (max-width: 740px) {
  #app .os-welcome .oc-stage:has(.oc-live2d) {
    width: 230px;
    height: 320px;
  }
}
@media (max-width: 540px) {
  #app .os-welcome .oc-stage:has(.oc-live2d) {
    width: 150px;
    height: 230px;
  }
}
#oshi-flick[data-motion="on"] .op-pair article.op-photocard:hover {
  transform: translateY(-6px);
  border-color: var(--op-blue);
  box-shadow: 0 12px 22px var(--op-shadow);
}
@media (max-width: 740px) {
  #app .os-welcome {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    min-height: 330px;
  }
  #app .os-welcome .oc-stage,
  #app .os-welcome .app-staff-placeholder,
  #app .os-welcome .oc-actor,
  #app .os-welcome .op-ami,
  #app .os-welcome .oc-stage:has(.oc-live2d) .oc-actor {
    width: 230px;
    height: 320px;
  }
  #app .os-welcome .oc-shadow {
    left: 85px;
    width: 60px;
  }
}
@media (max-width: 540px) {
  #app .os-welcome {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
  }
  #app .os-welcome .oc-stage,
  #app .os-welcome .app-staff-placeholder,
  #app .os-welcome .oc-actor,
  #app .os-welcome .op-ami,
  #app .os-welcome .oc-stage:has(.oc-live2d) .oc-actor {
    width: 150px;
    height: 230px;
  }
  #app .os-welcome .oc-shadow {
    left: 52px;
    width: 46px;
  }
  #app .os-welcome .op-dialogue {
    padding: 12px 12px 28px;
  }
  #app .os-welcome .op-dialogue p {
    font-size: 15px;
  }
  #app .app-ami-head {
    width: 80px;
    height: 100px;
    flex-basis: 80px;
  }
  #app .ot-guide {
    grid-template-columns: 90px minmax(0, 1fr);
  }
  #app .ot-character .oc-stage:has(.oc-live2d),
  #app .ot-character .oc-stage:has(.oc-live2d) .oc-actor,
  #app .ot-character .app-staff-placeholder {
    width: 90px;
    height: 125px;
    min-height: 0;
  }
  #app .ot-art {
    width: 64px;
    height: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #app[data-motion="on"] .ot-highlight {
    animation: none;
  }
  #oshi-flick[data-motion="on"] .op-pair article.op-photocard:hover {
    transform: none;
  }
}
