/* Union — 白・青・紫を基調にした E ARK-apps 共通トーン(WordOrbit に合わせる) */

:root {
  --blue: #2563eb;
  --purple: #7c3aed;
  --gradient: linear-gradient(135deg, var(--blue), var(--purple));
  --ink: #1e1b3a;
  --muted: #6b6a85;
  --line: #dfe3f5;
  --tint: #f5f7ff;
  --danger: #c2255c;
  --radius: 20px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(50rem 26rem at -10% 0%, rgba(37, 99, 235, .10), transparent 60%),
    #fff;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ヘッダー */
.site-header { padding: 14px 0; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 18px;
}
.brand__name { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.site-header__link { color: var(--muted); font-size: 13px; text-decoration: none; }
.site-header__link:hover { color: var(--blue); }

/* ヒーロー */
#app { flex: 1; padding-bottom: 32px; }
.hero { text-align: center; padding: 28px 0 22px; }
.hero__title { margin: 0; font-size: clamp(26px, 6vw, 38px); line-height: 1.35; letter-spacing: .01em; }
.hero__lead { margin: 10px 0 0; color: var(--muted); font-size: clamp(14px, 3.6vw, 16px); }
.sp-only { display: none; }
@media (max-width: 520px) { .sp-only { display: inline; } }

/* ドロップゾーン */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 300px; padding: 28px 20px; text-align: center; cursor: pointer;
  border: 2px dashed #b9c4f5; border-radius: var(--radius);
  background: var(--tint); color: var(--blue);
  transition: border-color .15s, background-color .15s, transform .15s;
}
.dropzone:hover { border-color: var(--purple); background: #f1eeff; }
.dropzone.is-dragover { border-color: var(--purple); background: #ece7ff; transform: scale(1.01); }
input:focus-visible + .dropzone { outline: 3px solid rgba(124, 58, 237, .45); outline-offset: 3px; }
.dropzone__icon { margin-bottom: 6px; }
.dropzone__title { color: var(--ink); font-size: clamp(18px, 4.6vw, 22px); font-weight: 700; }
.dropzone__sub { color: var(--muted); font-size: 15px; }
.dropzone__hint { color: var(--muted); font-size: 12.5px; opacity: .85; }
@media (hover: none) { .dropzone__hint { display: none; } }

/* パネル(変換中・完了・エラー) */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: 0 10px 30px rgba(60, 50, 140, .07); padding: 24px;
}
.panel:focus { outline: none; }
.panel--center {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px;
}
.panel__title { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.panel__title--error { color: var(--danger); }
.panel__sub { margin: 4px 0 14px; color: var(--muted); font-size: 14px; max-width: 34em; overflow-wrap: anywhere; }
#busy-name:empty { display: none; }

.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #e4e7fb; border-top-color: var(--purple);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .dropzone, .btn { transition: none; }
}

/* 結果 */
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.result__preview {
  margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  /* 透過 PNG が分かるよう市松模様の背景にする */
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eceffb 25%, transparent 25%, transparent 75%, #eceffb 75%),
    linear-gradient(45deg, #eceffb 25%, transparent 25%, transparent 75%, #eceffb 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  display: grid; place-items: center; min-height: 160px;
}
.result__preview img { display: block; max-width: 100%; max-height: 360px; height: auto; width: auto; }
.result__done { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.result__facts { margin: 0 0 12px; display: grid; gap: 4px; }
.result__facts > div { display: flex; gap: 12px; font-size: 15px; }
.result__facts dt { flex: 0 0 4.2em; color: var(--muted); }
.result__facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.result__note {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f3dc9b; color: #6b4e00; font-size: 13.5px;
}
@media (max-width: 620px) { .result { grid-template-columns: 1fr; } }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 30px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn--primary { color: #fff; background: var(--gradient); box-shadow: 0 8px 20px rgba(91, 70, 220, .30); }
.btn--primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn--primary:focus-visible { outline: 3px solid rgba(124, 58, 237, .5); outline-offset: 3px; }
.result .btn { width: 100%; }
.link-button {
  display: block; margin: 14px auto 0; padding: 6px; border: 0; background: none;
  color: var(--blue); font: inherit; font-size: 14.5px; text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: var(--purple); }

/* 特長・注記 */
.features { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.feature__k {
  display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 999px;
  background: var(--tint); color: var(--purple); font-weight: 700; font-size: 12px;
}
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.privacy { margin: 18px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* フッター */
.site-footer { padding: 18px 0 26px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--blue); }

[hidden] { display: none !important; }
