* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.32), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.30), transparent 34%),
    radial-gradient(circle at 50% 88%, rgba(20, 184, 166, 0.25), transparent 30%),
    linear-gradient(135deg, #071226 0%, #0a1022 45%, #160b22 100%);
}

button,
input {
  font-family: inherit;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px 20px;
}

.tool-card {
  width: min(820px, 100%);
  padding: 42px 40px 38px;
  border-radius: 30px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.74)),
    rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.18);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  margin-bottom: 18px;
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.95);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.18);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.byline {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.70);
  font-size: 14px;
  font-weight: 800;
}

.desc {
  max-width: 760px;
  margin: 28px auto 34px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.8;
  text-align: center;
  letter-spacing: 0.02em;
}

.panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 100%;
  margin: 0 auto 26px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(7, 16, 38, 0.90), rgba(10, 25, 52, 0.96));
  border: 1px solid rgba(226, 232, 240, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 48px rgba(0, 0, 0, 0.24);
}

.upload-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 13px 24px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6, #fb7185);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.22);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.upload-box:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#previewCanvas {
  display: block;
  width: min(280px, 100%);
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(226, 232, 240, 0.16);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}

.primary-btn,
.secondary-btn {
  min-width: 120px;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6, #fb7185);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.34);
}

.secondary-btn {
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.20);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.status-text {
  margin: 0 0 18px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.note {
  margin: 0;
  color: rgba(226, 232, 240, 0.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .page {
    padding: 18px 12px;
    align-items: start;
  }

  .tool-card {
    width: 100%;
    padding: 26px 16px 24px;
    border-radius: 24px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.15;
  }

  .byline {
    font-size: 13px;
  }

  .desc {
    max-width: 100%;
    margin: 18px auto 22px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.8;
    letter-spacing: 0;
  }

  .desc br {
    display: none;
  }

  .panel {
    padding: 14px;
  }

  #previewCanvas {
    width: min(230px, 100%);
  }
}

@media (max-width: 640px) {
  .desc {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.75;
    margin: 16px auto 20px;
  }

  .badge {
    font-size: 12px;
    padding: 7px 14px;
  }

  h1 {
    font-size: 32px;
  }

  .upload-box {
    min-width: 170px;
    padding: 12px 22px;
  }
}

.motion-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.motion-tab {
  border: 1px solid rgba(226, 232, 240, 0.20);
  border-radius: 999px;
  padding: 10px 18px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.motion-tab:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.motion-tab.active {
  color: #ffffff;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6, #fb7185);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.28);
}

@media (max-width: 640px) {
  .motion-tabs {
    gap: 8px;
  }

  .motion-tab {
    padding: 9px 14px;
    font-size: 13px;
  }
}
