/* カスタムフォントをブラウザに読み込ませる */
@font-face { font-family: 'NotoSansJP-Bold'; src: url('../fonts/NotoSansJP-Bold.ttf'); }
@font-face { font-family: 'NotoSerifJP-Bold'; src: url('../fonts/NotoSerifJP-Bold.ttf'); }
@font-face { font-family: 'MPLUSRounded1c-Bold'; src: url('../fonts/MPLUSRounded1c-Bold.ttf'); }
@font-face { font-family: 'DelaGothicOne-Regular'; src: url('../fonts/DelaGothicOne-Regular.ttf'); }
@font-face { font-family: 'DotGothic16-Regular'; src: url('../fonts/DotGothic16-Regular.ttf'); }
@font-face { font-family: 'Roboto-Bold'; src: url('../fonts/Roboto-Bold.ttf'); }

/* モダンなCSSリセットと変数定義 */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --ring: rgba(16, 185, 129, 0.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  padding: 40px 20px;
  line-height: 1.6;
  margin: 0;
}

.app-container {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  padding: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-top: 0;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 32px 0 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.form-label {
  width: 140px;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  color: var(--text-main);
}

.form-control {
  flex-grow: 1;
  background: var(--bg-color);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
  outline: none;
}

.form-control:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

input[type="file"].form-control {
  border: 1px dashed #cbd5e1;
  background: transparent;
  cursor: pointer;
  padding: 16px;
}
input[type="file"].form-control:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

input[type="color"] {
  padding: 2px;
  height: 42px;
  cursor: pointer;
}

.radio-group {
  display: flex;
  gap: 24px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.range-wrapper {
  display: flex;
  flex-grow: 1;
  align-items: center;
  gap: 16px;
}
input[type="range"] {
  flex-grow: 1;
  -webkit-appearance: none;
  background: transparent;
}
input[type="range"]:focus {
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border);
  border-radius: 2px;
}
.number-input-small {
  width: 80px;
  text-align: center;
}

.btn-submit {
  width: 100%;
  background: var(--text-main);
  color: var(--surface);
  border: none;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  margin-top: 48px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  letter-spacing: 0.05em;
}
.btn-submit:hover {
  background: #1e293b;
}
.btn-submit:active {
  transform: translateY(1px);
}

/* ==========================================
   ローディング画面のスタイル
   ========================================== */
   #loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7); /* ダークな半透明背景 */
    backdrop-filter: blur(8px); /* 背景をすりガラスのようにぼかすプロの技！ */
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999; /* 画面の一番手前に持ってくる */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* クルクル回るスピナー */
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary); /* エメラルドグリーン */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.05em;
}