@charset "UTF-8";

/*
 * アプリ全体の見た目を管理する。演出の時刻計算はanimation.js、
 * 画面比率とレスポンシブな寸法はこのファイルで管理する。
 */

/* Design tokens and browser defaults */
:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --panel: #12171e;
  --line: #29313c;
  --muted: #a1adbb;
  --text: #f3f6fa;
  --accent: #28e4d3;
  --team: #f9d616;
  --team-ink: #131500;
  --difficulty: #ff3048;
  font-family: Arial, "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.app-header {
  height: 90px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.1vw;
}
.brand {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.05em;
}
.brand small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.brand-symbol {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 34px;
  font-style: italic;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  padding-right: 4px;
}
.brand-symbol span {
  color: white;
}
/* Page layout */
main {
  max-width: 1660px;
  margin: auto;
  padding: 32px 3.1vw 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 32px;
}
.section-heading,
.settings-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 23px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.19em;
  color: var(--accent);
}
h2 {
  margin: 6px 0 0;
  font-size: 22px;
}
.icon-button {
  font-size: 14px;
  color: #c5ced8;
  background: none;
  padding: 10px 0 10px 12px;
  white-space: nowrap;
}
.icon-button span {
  font-size: 22px;
  vertical-align: -2px;
  margin-right: 7px;
}
/* Reveal stage */
.stage-shell {
  background: #000;
  border: 1px solid #35414b;
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.stage {
  aspect-ratio: 16/9;
  width: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #03080c;
  container-type: inline-size;
}
.grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(#0b376455 1px, transparent 1px),
    linear-gradient(90deg, #0b376455 1px, transparent 1px),
    radial-gradient(ellipse at 50% 50%, #0d2a4080, transparent 75%);
  background-size:
    11% 16%,
    11% 16%,
    100% 100%;
  transform: perspective(700px) rotateX(6deg) scale(1.08);
}
.grid:after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 33%, #2278d6 0 2px, transparent 4px),
    radial-gradient(circle at 66% 66%, #2278d6 0 2px, transparent 4px),
    radial-gradient(circle at 78% 16%, #2278d6 0 2px, transparent 4px);
}
.diagonals {
  position: absolute;
  inset: -45%;
  transform: rotate(32deg);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 13%,
    #758c981c 13% 24%,
    #879baa18 24% 24.2%,
    transparent 24.2% 32%
  );
  filter: drop-shadow(0 0 8px #00677735);
}
.beam {
  position: absolute;
  width: 2px;
  height: 45%;
  background: linear-gradient(transparent, #50dbec77, transparent);
  transform: rotate(32deg);
}
.beam-one {
  left: 24%;
  top: -15%;
}
.beam-two {
  right: 19%;
  bottom: -17%;
  background: linear-gradient(transparent, #ed253d99, transparent);
}
.corner {
  position: absolute;
  width: 38px;
  height: 14px;
  z-index: 2;
  border-top: 1px solid #88c7cd66;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 5px,
    #aacbcd66 5px 6px,
    transparent 6px 8px
  );
}
.top-corner {
  top: 18%;
  left: 5%;
}
.bottom-corner {
  bottom: 18%;
  right: 5%;
  transform: rotate(180deg);
}
.stage-caption,
.stage-number {
  position: absolute;
  top: 6%;
  font-size: 1.35cqw;
  letter-spacing: 0.24em;
  color: #9ab8c2;
}
.stage-caption {
  left: 5%;
}
.stage-number {
  right: 5%;
  font-family: monospace;
  color: #47a2a4;
}
.intro {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.15s;
}
.intro p {
  font-family: Impact, "Arial Narrow", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 12.5cqw;
  line-height: 1.02;
  letter-spacing: 0.045em;
  color: var(--accent);
  margin: 0;
  text-shadow:
    1px 0 #bdfafa,
    -1px 0 #083136;
  transform: none;
}
.intro p span {
  color: white;
}
.intro-rule {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.intro-rule i {
  position: absolute;
  left: 0;
  top: 21%;
  height: 1.5px;
  width: 28%;
  background: #ec0058;
  opacity: 0.55;
  will-change: transform;
}
.intro-rule i:nth-child(2) {
  top: 80%;
  width: 20%;
  opacity: 0.4;
}
.intro-small {
  font-size: 1.05cqw;
  color: #75969b;
  letter-spacing: 0.32em;
  margin-top: 4.3%;
}
.stage-bottom {
  position: absolute;
  bottom: 5%;
  left: 5%;
  right: 5%;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 1.15cqw;
  letter-spacing: 0.13em;
  color: #728894;
}
.stage-bottom i {
  height: 1px;
  flex: 1;
  background: #41637144;
}
.reveal {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9% 6% 7%;
}
.performer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5cqw;
  width: 100%;
  position: absolute;
  top: 17%;
  padding: 0 7%;
}
.team-badge {
  background: var(--team);
  color: var(--team-ink);
  padding: 1.1cqw 1.4cqw;
  max-width: 39%;
  font-size: 2.6cqw;
  line-height: 1.12;
  font-weight: 900;
  overflow-wrap: anywhere;
  box-shadow: 0 0 15px #0008;
  text-align: center;
}
.player {
  font-size: 4.8cqw;
  max-width: 54%;
  line-height: 1.12;
  overflow-wrap: anywhere;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.song {
  width: 100%;
  text-align: center;
  margin-top: 2%;
}
.song h2 {
  font-family: Impact, "Arial Narrow", "Arial Black", "Yu Gothic", sans-serif;
  font-size: clamp(20px, 10cqw, 140px);
  line-height: 1.12;
  letter-spacing: 0.04em;
  margin: 0;
  overflow-wrap: anywhere;
  background: linear-gradient(white 25%, #eee 42%, #b8bfc2 65%, #8a959d);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 3px 0 #000);
  font-weight: 900;
}
.song p {
  font-size: 3.1cqw;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 2.4% 0 0;
  overflow-wrap: anywhere;
}
.difficulty {
  position: absolute;
  bottom: 19%;
  display: flex;
  gap: 2.5cqw;
  align-items: center;
  font-family: Impact, "Arial Narrow", sans-serif;
  color: var(--difficulty);
  font-size: 3.7cqw;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px color-mix(in srgb, var(--difficulty), transparent 65%);
}
.difficulty b {
  font-weight: inherit;
}
.wipe {
  position: absolute;
  z-index: 5;
  inset: -40%;
  background: linear-gradient(
    90deg,
    transparent 10%,
    #28e4d3 11% 12%,
    #dfffff 12% 14%,
    #122e32 14% 39%,
    transparent 40%
  );
  transform: translateX(-150%) skewX(-27deg);
  opacity: 0;
}
.stage[data-phase="result"] .intro {
  opacity: 0;
}
.stage[data-phase="result"] .reveal {
  opacity: 1;
}
.stage-shell.original .stage {
  aspect-ratio: 8/9;
  width: min(100%, 480px);
}
.stage-shell.original .intro p {
  font-size: 19cqw;
}
.stage-shell.original .intro-rule i:first-child {
  top: 24%;
}
.stage-shell.original .stage-caption,
.stage-shell.original .stage-number {
  font-size: 1.8cqw;
}
.stage-shell.original .performer {
  top: 20%;
}
.stage-shell.original .team-badge {
  font-size: 3.2cqw;
}
.stage-shell.original .player {
  font-size: 7cqw;
}
.stage-shell.original .song h2 {
  font-size: 16cqw;
}
.stage-shell.original .song p {
  font-size: 5cqw;
  margin-top: 4%;
}
.stage-shell.original .difficulty {
  font-size: 5.8cqw;
  bottom: 25%;
}
.stage-shell.original .intro-small {
  font-size: 1.7cqw;
}
.stage-shell.original .stage-bottom {
  font-size: 1.7cqw;
}
/* Playback controls */
.transport {
  padding: 20px 0 0;
}
.transport-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.playback-state {
  display: flex;
  gap: 9px;
  align-items: center;
}
.playback-state > span:first-child {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #71818e;
}
.playback-state > span:first-child.active {
  background: var(--accent);
  box-shadow: 0 0 9px #28e4d355;
}
.time {
  font-family: monospace;
}
.time b {
  color: #e4eaf1;
  font-weight: 400;
}
.timeline {
  appearance: none;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--accent) var(--progress, 0%),
    #2c3540 var(--progress, 0%)
  );
  margin: 19px 0 23px;
  display: block;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.timeline::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  background: var(--accent);
  border-radius: 50%;
}
.play-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.primary {
  background: var(--accent);
  color: #041c1b;
  font-weight: 800;
  font-size: 15px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 216px;
}
.primary:hover {
  background: #69f4e7;
}
.primary span:first-child {
  font-size: 14px;
}
.secondary {
  background: #19212a;
  border: 1px solid #323e4b;
  color: #d8e1e9;
  padding: 14px 17px;
  font-size: 16px;
}
.secondary span {
  font-size: 14px;
  margin-left: 4px;
}
.secondary:hover {
  background: #242f39;
}
.text-button {
  color: #a3b0bd;
  background: transparent;
  font-size: 14px;
  padding: 8px 0;
}
.text-button:hover {
  color: var(--accent);
}
.play-actions .text-button {
  margin-left: auto;
}
.text-button span {
  margin-left: 6px;
}
.keyboard-hint {
  display: flex;
  gap: 20px;
  margin-top: 25px;
  color: #7f8b99;
  font-size: 12px;
}
kbd {
  border: 1px solid #34414f;
  border-radius: 3px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 12px;
  margin-right: 4px;
}
/* Settings form */
.settings {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.settings-title {
  margin-bottom: 24px;
}
.settings-title h2 {
  font-size: 20px;
}
.small {
  font-size: 12px;
}
.settings .eyebrow {
  color: #8896a5;
}
fieldset {
  padding: 0 0 23px;
  margin: 0 0 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
legend {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 19px;
  padding: 0;
  display: block;
  width: 100%;
}
legend span {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent);
  margin-right: 10px;
}
label {
  display: block;
  font-size: 14px;
  color: #b8c3ce;
  margin-bottom: 8px;
}
.required {
  font-size: 12px;
  color: #74828f;
  margin-left: 5px;
}
input:not([type="range"]):not([type="checkbox"]):not([type="color"]),
select {
  background: #0d1219;
  border: 1px solid #303b48;
  border-radius: 3px;
  color: #eef3f8;
  width: 100%;
  padding: 11px 12px;
  height: 43px;
  font-size: 16px;
}
input:not([type="range"]):not([type="checkbox"]):not([type="color"]) {
  margin-bottom: 17px;
}
input:invalid {
  border-color: #fd6c80 !important;
}
select {
  padding-right: 26px;
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row > div:first-child {
  flex: 1;
  min-width: 0;
}
.level-field {
  width: 96px;
  flex-shrink: 0;
}
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
}
.color-row label {
  margin: 0;
}
.color-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 12px monospace;
  color: #9baab6;
}
input[type="color"] {
  appearance: none;
  border: 1px solid #52606c;
  background: transparent;
  width: 24px;
  height: 24px;
  padding: 3px;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 0;
}
.production {
  border: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.option-row label {
  margin: 0;
  font-size: 14px;
}
.option-row select {
  width: 143px;
  font-size: 14px;
  height: 36px;
  padding: 7px 9px;
}
.option-row small {
  font-size: 12px;
  display: block;
  color: #748392;
  margin-top: 5px;
}
/* Fullscreen stage */
.exit-fullscreen {
  display: none;
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 10;
  background: #0a151ecc;
  color: white;
  border: 1px solid #596674;
  padding: 10px 16px;
  font-size: 14px;
}
.stage-shell:fullscreen,
.stage-shell.fallback-fullscreen {
  background: #000;
  border: 0;
  align-items: center;
  height: 100vh;
  width: 100vw;
}
.stage-shell:fullscreen .stage,
.stage-shell.fallback-fullscreen .stage {
  width: min(100vw, 177.777vh);
  max-height: 100vh;
}
.stage-shell.original:fullscreen .stage,
.stage-shell.original.fallback-fullscreen .stage {
  width: min(100vw, 88.889vh);
}
.stage-shell:fullscreen .exit-fullscreen,
.fallback-fullscreen .exit-fullscreen {
  display: block;
}
.fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.stage-shell:fullscreen .exit-fullscreen:not(:hover) {
  opacity: 0.35;
}
/* Responsive layout */
@media (min-width: 1450px) {
  main {
    grid-template-columns: minmax(0, 1fr) 365px;
    gap: 40px;
  }
  .settings {
    padding-left: 35px;
  }
}
@media (max-width: 1080px) {
  main {
    grid-template-columns: minmax(0, 1fr) 295px;
    gap: 24px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .settings {
    padding-left: 22px;
  }
  .play-actions {
    flex-wrap: wrap;
  }
  .play-actions .text-button {
    margin-left: 0;
  }
  .primary {
    min-width: 200px;
  }
  .keyboard-hint {
    gap: 12px;
    flex-wrap: wrap;
  }
}
@media (max-width: 800px) {
  .app-header {
    height: 78px;
    padding: 0 20px;
  }
  main {
    grid-template-columns: 1fr;
    padding: 25px 20px;
    gap: 34px;
  }
  .settings {
    border-left: 0;
    padding: 25px 0 0;
    border-top: 1px solid var(--line);
  }
  .settings-title {
    margin-bottom: 24px;
  }
  #settingsForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  fieldset {
    margin-bottom: 0;
  }
  .production {
    grid-column: 1/-1;
  }
  .production .option-row {
    max-width: 400px;
  }
  .section-heading {
    margin-bottom: 20px;
  }
  .stage-caption,
  .stage-number {
    font-size: 1.7cqw;
  }
  .intro-small {
    font-size: 1.5cqw;
  }
  .stage-bottom {
    font-size: 1.5cqw;
  }
  .play-actions .text-button {
    margin-left: auto;
  }
}
@media (max-width: 480px) {
  main {
    padding: 23px 16px;
  }
  h1 {
    font-size: 19px;
  }
  .section-heading {
    gap: 5px;
  }
  .icon-button {
    font-size: 12px;
  }
  .icon-button span {
    margin-right: 3px;
  }
  .brand {
    font-size: 15px;
  }
  .brand small {
    font-size: 12px;
  }
  .primary {
    flex: 1;
    min-width: 190px;
    font-size: 14px;
    padding: 15px 14px;
  }
  .secondary {
    padding: 13px 12px;
  }
  .play-actions .text-button {
    margin-left: 0;
    font-size: 14px;
  }
  .keyboard-hint {
    display: none;
  }
  #settingsForm {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .production {
    grid-column: auto;
  }
  .stage-shell.original .stage {
    width: 100%;
  }
  .stage-shell.original .stage-caption,
  .stage-shell.original .stage-number {
    font-size: 2cqw;
  }
}
/* Long content variants */
.player.long {
  font-size: 2.7cqw;
}
.team-badge.long {
  font-size: 1.8cqw;
}
.song p.long {
  font-size: 2cqw;
}
.stage-shell.original .player.long {
  font-size: 4.2cqw;
}
.stage-shell.original .team-badge.long {
  font-size: 2.5cqw;
}
.stage-shell.original .song p.long {
  font-size: 3cqw;
}
[hidden] {
  display: none !important;
}
/* Elements animated by public/js/animation.js */
.intro {
  transition: none;
  z-index: 3;
}
.intro p .word {
  display: block;
  white-space: nowrap;
}
.intro .letter {
  display: inline-block;
  transform-origin: 50% 70%;
  will-change: transform, opacity;
}
.intro-echo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  font-family: Impact, "Arial Narrow", "Arial Black", sans-serif;
  font-size: 14cqw;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.025em;
  color: transparent;
  -webkit-text-stroke: 1px #95bfcb;
}
.intro-echo span {
  position: relative;
  left: -18cqw;
  display: block;
  flex-shrink: 0;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}
.intro-echo span:nth-child(even) {
  left: -40cqw;
}
.reveal {
  z-index: 3;
  pointer-events: none;
}
.song h2 {
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.song p,
.performer,
.difficulty {
  will-change: transform, opacity;
}
.wipe {
  z-index: 2;
  background: linear-gradient(
    90deg,
    transparent 0 18%,
    var(--team) 18% 48%,
    transparent 48% 52%,
    var(--team) 52% 54%,
    transparent 54%
  );
}
.stage-shell.original .intro-echo {
  font-size: 24cqw;
  inset: 0;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Clean first frame, including before JavaScript has initialized. */
.stage[data-phase="black"] {
  background: #000;
}
.stage[data-phase="black"] > * {
  visibility: hidden !important;
}
.stage-shell[data-black="true"] {
  background: #000;
}
.stage-shell[data-black="true"] .exit-fullscreen {
  visibility: hidden;
  pointer-events: none;
}
.intro p,
.song h2 {
  font-weight: 400;
  font-kerning: normal;
}
.intro p .word {
  text-align: center;
}
.stage-shell:fullscreen .exit-fullscreen:not(:hover):not(:focus-visible),
.fallback-fullscreen .exit-fullscreen:not(:hover):not(:focus-visible) {
  opacity: 0;
}

.song h2 {
  display: inline-block;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.workspace > .section-heading {
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* X sharing and PNG export */
.share-panel[hidden] {
  display: none;
}
.share-panel {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #29313c;
  background: #12171e;
  border-radius: 8px;
}
.share-panel h2 {
  font-size: 18px;
  margin: 0 0 10px;
}
.share-panel p {
  color: #a1adbb;
  font-size: 13px;
  line-height: 1.7;
  margin: 8px 0;
}
.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.share-actions button {
  padding: 12px 18px;
}
.share-panel label {
  display: block;
  color: #a1adbb;
  font-size: 12px;
  margin-bottom: 8px;
}
.share-panel textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  background: #0b0e13;
  border: 1px solid #35414b;
  color: #e1e8ee;
  border-radius: 4px;
  padding: 12px;
  font:
    14px/1.6 Arial,
    "Yu Gothic",
    sans-serif;
}
.share-panel #shareStatus:empty {
  display: none;
}
.share-panel #shareStatus {
  color: #28e4d3;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.difficulty {
  white-space: nowrap;
}
