:root {
  color-scheme: dark;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Inter", "Segoe UI", sans-serif;
  background: #06101f;
  color: #f8fbff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
::before,
::after {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 10%, rgba(86, 145, 205, 0.2), transparent 28rem),
    linear-gradient(180deg, #020915 0%, #06101f 58%, #020915 100%);
  transition: background-color 180ms ease;
}

body.is-standby {
  background:
    radial-gradient(circle at 50% 16%, rgba(78, 170, 230, 0.28), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(190, 74, 70, 0.1), transparent 22rem),
    linear-gradient(180deg, #06182c 0%, #071322 58%, #020915 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.landing-page {
  min-height: 100vh;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: 88vh;
  overflow: hidden;
  background-image: url("https://images.unsplash.com/photo-1679352223229-bb5dcdf240c6?auto=format&fit=crop&fm=jpg&q=72&w=2200");
  background-position: center;
  background-size: cover;
}

.landing-hero::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 76% 34%, rgba(109, 167, 230, 0.18), transparent 30%),
    linear-gradient(90deg, rgba(3, 8, 18, 0.98) 0%, rgba(3, 8, 18, 0.82) 34%, rgba(3, 8, 18, 0.42) 64%, rgba(3, 8, 18, 0.84) 100%);
  content: "";
}

.landing-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 9, 21, 0.34);
}

.landing-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 1120px);
  min-height: 88vh;
  flex-direction: column;
  margin: 0 auto;
  padding: 20px 20px 28px;
}

.landing-header {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 3.9rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

.landing-header::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  background: #030d24;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  content: "";
  transform: translateX(-50%);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  transition: opacity 160ms ease;
}

.landing-brand:hover,
.landing-brand:focus-visible {
  opacity: 0.86;
}

.landing-brand img {
  display: block;
  width: clamp(4.2rem, 7.4vw, 6.4rem);
  height: auto;
}

.brand-mark {
  display: inline-flex;
  width: 2.65rem;
  height: 2.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 251, 255, 0.28);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2vw, 2rem);
}

.landing-nav a,
.landing-nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0 0.15rem;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.landing-nav a::after,
.landing-nav-button::after {
  position: absolute;
  right: 0;
  bottom: 0.12rem;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
  content: "";
}

.landing-nav a:hover,
.landing-nav a:focus-visible,
.landing-nav-button:hover,
.landing-nav-button:focus-visible {
  color: #fff;
}

.landing-nav a:hover::after,
.landing-nav a:focus-visible::after,
.landing-nav-button:hover::after,
.landing-nav-button:focus-visible::after {
  opacity: 0.7;
  transform: scaleX(1);
}

.landing-copy {
  display: grid;
  width: min(100%, 46rem);
  gap: 1rem;
  margin: auto 0;
  padding: 5rem 0;
}

.landing-eyebrow,
.landing-section-label {
  margin: 0;
  color: rgba(218, 234, 255, 0.76);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.landing-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(4rem, 14vw, 8.4rem);
  font-weight: 900;
  line-height: 0.9;
}

.landing-lead {
  max-width: 41rem;
  margin: 0;
  color: rgba(248, 251, 255, 0.86);
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  font-weight: 700;
  line-height: 1.85;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.landing-primary-button,
.landing-secondary-button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 1.1rem;
  font-size: 0.9rem;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.landing-primary-button {
  color: #06101f;
  background: #f8fbff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.landing-secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.landing-primary-button:hover,
.landing-secondary-button:hover,
.landing-primary-button:focus-visible,
.landing-secondary-button:focus-visible {
  transform: translateY(-1px);
}

.landing-metrics,
.feature-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-metrics > div,
.feature-card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.landing-metrics > div {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 0.95rem 1rem;
}

.landing-metrics span,
.feature-number {
  color: rgba(218, 234, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.landing-metrics strong {
  display: block;
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.55;
}

.landing-section {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 38px 20px 64px;
}

.section-heading {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 900;
  line-height: 1;
}

.feature-card {
  padding: 1.25rem;
}

.feature-card h3 {
  margin: 0.7rem 0 0;
  color: #fff;
  font-size: 1.2rem;
}

.feature-card p {
  margin: 0.75rem 0 0;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.75;
}

.app-shell,
.remote-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 18px 36px;
}

.hero,
.remote-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(210, 228, 255, 0.1);
  border-radius: 8px;
  background: rgba(1, 10, 20, 0.92);
  padding: 0.95rem 1rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.hero {
  align-items: stretch;
  flex-direction: column;
  gap: 0.6rem;
}

.home-hero {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.home-hero .hero-topline {
  padding-top: 1.15rem;
}

.app-shell.is-standby .hero {
  border-color: rgba(116, 203, 255, 0.28);
  background: rgba(4, 20, 36, 0.94);
}

.home-header {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 3.9rem;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.55rem 0;
}

.home-header::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  background: #030d24;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  content: "";
  transform: translateX(-50%);
}

.home-header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.home-header-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(218, 234, 255, 0.16);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.08);
  padding: 0 0.8rem;
  color: rgba(248, 251, 255, 0.86);
  font-size: 0.86rem;
  font-weight: 900;
}

.home-header-links a:hover,
.home-header-links a:focus-visible {
  background: rgba(248, 251, 255, 0.14);
  color: #fff;
}

.hero-topline,
.hero-mainline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-mainline {
  align-items: flex-end;
}

.hero h1,
.remote-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 5vw, 3.1rem);
  font-weight: 900;
  line-height: 1;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 9px 12px;
  border: 1px solid rgba(218, 234, 255, 0.18);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.1);
  color: rgba(248, 251, 255, 0.82);
  text-align: center;
  font-size: 0.88rem;
  font-weight: 900;
}

.header-status-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.eyebrow {
  margin: 0;
  color: rgba(218, 234, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.home-menu {
  position: relative;
}

.icon-menu-button {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(210, 228, 255, 0.18);
  border-radius: 6px;
  background: rgba(248, 251, 255, 0.04);
  padding: 0;
  color: rgba(248, 251, 255, 0.76);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-menu-button:hover,
.icon-menu-button:focus-visible {
  border-color: rgba(248, 251, 255, 0.36);
  background: rgba(248, 251, 255, 0.1);
  color: #fff;
}

.icon-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #f8fbff;
}

.home-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 176px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
}

.home-menu-panel[hidden] {
  display: none;
}

.home-menu-panel a {
  min-height: 44px;
  padding: 0.75rem 1rem;
  color: #17212b;
  font-weight: 900;
}

.home-menu-panel a:hover,
.home-menu-panel a:focus-visible {
  background: #f8fafc;
  color: #030d24;
}

.home-menu-divider {
  height: 1px;
  background: #e2e8f0;
}

.secondary-link-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(218, 234, 255, 0.18);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.1);
  padding: 0 0.9rem;
  color: rgba(248, 251, 255, 0.88);
  font-weight: 900;
}

.secondary-link-button:hover,
.secondary-link-button:focus-visible {
  background: rgba(248, 251, 255, 0.16);
  color: #fff;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 18px;
}

.playback-panel,
.qr-panel,
.remote-panel {
  padding: 18px;
}

.app-shell.is-standby .playback-panel {
  border-color: rgba(116, 203, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(46, 143, 194, 0.28), rgba(161, 61, 53, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 26px 76px rgba(15, 92, 140, 0.22);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(248, 251, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 900;
}

.sound-select,
.url-input,
.file-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
  color: #17212b;
}

.sound-select {
  padding: 0 12px;
}

.file-input {
  padding: 11px 12px;
}

.url-input {
  padding: 0 10px;
  font-size: 0.9rem;
}

.sound-select:focus,
.url-input:focus,
.file-input:focus {
  border-color: #1d5f7a;
  outline: 3px solid rgba(109, 167, 230, 0.18);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.single-action-row {
  grid-template-columns: minmax(0, 1fr);
}

.is-hidden {
  display: none !important;
}

.primary-button,
.secondary-button,
.danger-button,
.remote-play-button,
.remote-stop-button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button,
.remote-play-button {
  background: #1d5f7a;
}

.secondary-button {
  background: #526173;
}

.danger-button,
.remote-stop-button {
  background: #a13d35;
}

.app-shell.is-standby #standby-button {
  background: #2e8fc2;
  box-shadow:
    inset 0 0 0 1px rgba(248, 251, 255, 0.18),
    0 10px 28px rgba(46, 143, 194, 0.24);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.remote-play-button:active,
.remote-stop-button:active,
.qr-button:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: default;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.message {
  min-height: 24px;
  margin-top: 14px;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.92rem;
}

.standby-status {
  display: none;
  min-height: 40px;
  align-items: center;
  gap: 0.6rem;
  margin-top: 12px;
  border: 1px solid rgba(116, 203, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 31, 50, 0.72);
  padding: 0.65rem 0.75rem;
  color: #d8f0ff;
  font-size: 0.88rem;
  font-weight: 900;
}

.app-shell.is-standby .standby-status {
  display: flex;
}

.standby-status-dot {
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #74cbff;
  box-shadow: 0 0 0 4px rgba(116, 203, 255, 0.16);
}

.app-shell.is-standby .playback-panel .message {
  color: rgba(216, 240, 255, 0.9);
}

.sound-upload-grid {
  align-items: start;
}

.sound-upload-panel,
.sound-list-panel {
  padding: 18px;
}

.sound-preview {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.sound-list-panel h2 {
  margin: 0 0 1rem;
  color: #fff;
  font-size: 1.25rem;
}

.user-sound-list {
  display: grid;
  gap: 0.85rem;
}

.user-sound-item {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(218, 234, 255, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.06);
  padding: 0.85rem;
}

.user-sound-item span {
  overflow-wrap: anywhere;
  color: rgba(248, 251, 255, 0.88);
  font-weight: 900;
}

.user-sound-item audio {
  width: 100%;
}

.empty-state {
  margin: 0;
  color: rgba(248, 251, 255, 0.72);
}

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.qr-button {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid rgba(218, 234, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.qr-button img {
  display: block;
  width: 100%;
  height: 100%;
}

.remote-shell {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.remote-panel {
  display: grid;
  width: 100%;
  min-height: 100vh;
  padding: clamp(1rem, 5vw, 2rem);
  background:
    radial-gradient(circle at 78% 12%, rgba(86, 145, 205, 0.18), transparent 28rem),
    linear-gradient(180deg, #020915 0%, #06101f 58%, #020915 100%);
}

.remote-play-button {
  min-height: calc(100vh - clamp(2rem, 10vw, 4rem));
  border: 1px solid rgba(218, 234, 255, 0.18);
  background: #1d5f7a;
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.34);
  font-size: clamp(4rem, 24vw, 10rem);
  letter-spacing: 0;
}

.remote-stop-button {
  min-height: calc(100vh - clamp(2rem, 10vw, 4rem));
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #a13d35;
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.34);
  font-size: clamp(4rem, 24vw, 10rem);
  letter-spacing: 0;
}

.remote-play-button.is-disconnected {
  background: #526173;
}

.remote-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.remote-modal-panel {
  width: min(100%, 25rem);
  border: 1px solid rgba(218, 234, 255, 0.2);
  border-radius: 8px;
  background: #06101f;
  padding: 1.4rem;
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.42);
}

.remote-modal-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
}

.remote-modal-panel p {
  margin: 0.75rem 0 1.2rem;
  color: rgba(248, 251, 255, 0.76);
  line-height: 1.7;
}

.remote-modal-button {
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 8px;
  color: #06101f;
  background: #f8fbff;
  font-weight: 900;
}

.remote-modal-button + .remote-modal-button {
  margin-top: 0.7rem;
}

.remote-modal-spinner {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0.9rem auto 0;
  border: 4px solid rgba(248, 251, 255, 0.22);
  border-top-color: #f8fbff;
  border-radius: 50%;
  animation: remote-spin 0.8s linear infinite;
}

.remote-play-button:disabled,
.remote-stop-button:disabled {
  cursor: default;
  opacity: 0.78;
}

@keyframes remote-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .landing-header,
  .remote-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-mainline {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-status-group {
    width: 100%;
    justify-content: flex-start;
  }

  .home-menu-panel {
    right: auto;
    left: 0;
  }

  .home-header .home-menu-panel {
    right: 0;
    left: auto;
  }

  .landing-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .landing-copy {
    padding: 3rem 0;
  }

  .landing-actions,
  .landing-actions a {
    width: 100%;
  }

  .landing-metrics,
  .feature-grid,
  .control-grid,
  .button-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 58px;
  }
}
