html {
  color-scheme: dark;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

html body * {
  touch-action: pan-y;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

html[data-theme="light"] {
  color-scheme: light;
  --black: #f4f1ea;
  --card: #ffffff;
  --line: #e3ddd3;
  --white: #1c1b19;
  --dim: #514c46;
  --muted: #726c64;
  --field: #ffffff;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
}

.theme-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

html[data-theme="dark"] .icon-moon,
html:not([data-theme="light"]) .icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

html body .logo-light {
  display: none;
}

html[data-paper="light"] body .logo-dark {
  display: none;
}

html[data-paper="light"] body .logo-light {
  display: block;
}

html[data-theme="light"] .bar {
  background: rgba(244, 241, 234, 0.9);
}

html[data-theme="light"] .composer,
html[data-theme="light"] .post,
html[data-theme="light"] .card,
html[data-theme="light"] .finder-panel,
html[data-theme="light"] .person {
  background-color: #ffffff;
}

html[data-theme="light"] .player,
html[data-theme="light"] .rooms li,
html[data-theme="light"] .switch {
  background: #f7f4ee;
}

html[data-theme="light"] .rooms li:hover {
  background: #efeae2;
}

html[data-theme="light"] .tile,
html[data-theme="light"] .status {
  background: #efeae2;
}

html[data-theme="light"] .status {
  color: #1c1b19;
}

html[data-theme="light"] .gate {
  color-scheme: light;
}

html[data-theme="light"] .presence-word {
  background-image: linear-gradient(100deg, #1c1b19 0%, #1c1b19 42%, #8a6414 58%, #14596f 74%, #1c1b19 100%);
}

html[data-theme="light"] .portrait {
  box-shadow: 0 0 0 1px rgba(28, 27, 25, 0.28);
}

html[data-theme="light"] .progress {
  background: #e3ddd3;
}

html[data-theme="light"] .finder-panel a:hover,
html[data-theme="light"] .finder-panel a:focus-visible,
html[data-theme="light"] .results a:hover,
html[data-theme="light"] .results a:focus-visible {
  background: #f7f4ee;
}

html[data-theme="light"] .button-ghost {
  border-color: #c9c2b6;
}

html[data-theme="architecture"] {
  color-scheme: light;
  --black: #e6dfd4;
  --card: rgba(247, 243, 236, 0.94);
  --line: #d5cbbd;
  --white: #2c2823;
  --dim: #5e574e;
  --muted: #7d756b;
  --field: #f7f3ec;
}

html[data-theme="sculpture"] {
  color-scheme: light;
  --black: #e7e3de;
  --card: rgba(246, 243, 240, 0.94);
  --line: #d5d0ca;
  --white: #2c2927;
  --dim: #5e5955;
  --muted: #7c7671;
  --field: #f6f3f0;
}

html[data-theme="painting"] {
  color-scheme: light;
  --black: #f4ebdd;
  --card: rgba(255, 250, 242, 0.94);
  --line: #e4d3bc;
  --white: #3a2e24;
  --dim: #6b5846;
  --muted: #8a7360;
  --field: #fffaf2;
}

html[data-theme="dance"] {
  color-scheme: light;
  --black: #f7e7ec;
  --card: rgba(255, 245, 247, 0.94);
  --line: #efd0da;
  --white: #3a2430;
  --dim: #6e4d5a;
  --muted: #8d6a76;
  --field: #fff5f7;
}

html[data-theme="literature"] {
  color-scheme: light;
  --black: #f2ece3;
  --card: rgba(251, 247, 239, 0.94);
  --line: #e3d8c8;
  --white: #2b261f;
  --dim: #5e564a;
  --muted: #7c7366;
  --field: #fbf7ef;
}

html[data-theme="music"] {
  color-scheme: dark;
  --black: #171922;
  --card: rgba(32, 35, 48, 0.92);
  --line: #323648;
  --white: #f3f1ea;
  --dim: #c5c8d4;
  --muted: #9aa0b3;
  --field: #242838;
}

html[data-theme="cinema"] {
  color-scheme: dark;
  --black: #14110e;
  --card: rgba(32, 27, 22, 0.92);
  --line: #3a322a;
  --white: #f6f1e8;
  --dim: #d2c6b6;
  --muted: #a89884;
  --field: #241f1a;
}

html[data-theme="architecture"] body,
html[data-theme="sculpture"] body,
html[data-theme="painting"] body,
html[data-theme="music"] body,
html[data-theme="dance"] body,
html[data-theme="literature"] body,
html[data-theme="cinema"] body {
  background-color: var(--black);
  background-repeat: repeat;
  background-size: 520px 520px;
}

html[data-theme="architecture"] body { background-image: url("/assets/img/themes/architecture.svg"); }
html[data-theme="sculpture"] body { background-image: url("/assets/img/themes/sculpture.svg"); }
html[data-theme="painting"] body { background-image: url("/assets/img/themes/painting.svg"); }
html[data-theme="music"] body { background-image: url("/assets/img/themes/music.svg"); }
html[data-theme="dance"] body { background-image: url("/assets/img/themes/dance.svg"); }
html[data-theme="literature"] body { background-image: url("/assets/img/themes/literature.svg"); }
html[data-theme="cinema"] body { background-image: url("/assets/img/themes/cinema.svg"); }

html[data-theme="architecture"] body::before,
html[data-theme="sculpture"] body::before,
html[data-theme="painting"] body::before,
html[data-theme="music"] body::before,
html[data-theme="dance"] body::before,
html[data-theme="literature"] body::before,
html[data-theme="cinema"] body::before {
  display: none;
}

html[data-paper="light"] .bar,
html[data-theme="music"] .bar,
html[data-theme="cinema"] .bar {
  background: color-mix(in srgb, var(--black) 86%, transparent);
}

html[data-paper="light"] .composer,
html[data-paper="light"] .post,
html[data-paper="light"] .card,
html[data-paper="light"] .finder-panel,
html[data-paper="light"] .person,
html[data-theme="music"] .composer,
html[data-theme="music"] .post,
html[data-theme="music"] .card,
html[data-theme="music"] .finder-panel,
html[data-theme="music"] .person,
html[data-theme="cinema"] .composer,
html[data-theme="cinema"] .post,
html[data-theme="cinema"] .card,
html[data-theme="cinema"] .finder-panel,
html[data-theme="cinema"] .person {
  background-color: var(--card);
}

html[data-paper="light"] .player,
html[data-paper="light"] .rooms li,
html[data-paper="light"] .switch,
html[data-theme="music"] .player,
html[data-theme="cinema"] .player {
  background: var(--field);
}

html[data-paper="light"] .presence-word {
  background-image: none;
  color: var(--white);
}

html[data-paper="light"] .portrait {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--white) 28%, transparent);
}

html[data-paper="light"] .progress,
html[data-theme="music"] .progress,
html[data-theme="cinema"] .progress {
  background: var(--line);
}

html[data-paper="light"] .button-ghost,
html[data-theme="music"] .button-ghost,
html[data-theme="cinema"] .button-ghost {
  border-color: var(--line);
}

html[data-paper="light"] .finder-panel a:hover,
html[data-paper="light"] .finder-panel a:focus-visible,
html[data-paper="light"] .results a:hover,
html[data-paper="light"] .results a:focus-visible {
  background: var(--field);
}

html[data-paper="light"] .gate,
html[data-theme="music"] .gate,
html[data-theme="cinema"] .gate {
  color-scheme: light;
}

html[data-theme="music"] .gate,
html[data-theme="cinema"] .gate {
  color-scheme: dark;
}

html[data-paper="light"] .stage,
html[data-theme="music"] .stage,
html[data-theme="cinema"] .stage {
  background-color: transparent;
}

html[data-paper="light"] .brand,
html[data-theme="music"] .brand,
html[data-theme="cinema"] .brand,
html[data-paper="light"] .gate,
html[data-theme="music"] .gate,
html[data-theme="cinema"] .gate {
  background-color: color-mix(in srgb, var(--card) 92%, transparent);
}
