:root {
  --paper: #f6f1e5;
  --card: #fffdfa;
  --ink: #17231e;
  --muted: #657068;
  --green: #2e7058;
  --green-dark: #245a47;
  --cream: #efe7d6;
  --line: #ddd3c0;
  --danger-bg: #fde8e2;
  --danger: #8b2e24;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(255,255,255,.7), transparent 26rem),
    var(--paper);
}
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { width: min(980px, 100%); margin: 0 auto; min-height: 100vh; background: rgba(255,253,250,.78); }
.simple-header { padding: clamp(30px, 6vw, 64px) clamp(22px, 6vw, 64px) 30px; border-bottom: 1px solid var(--line); }
.kicker { margin: 0 0 10px; color: var(--green); font-size: .85rem; font-weight: 900; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(2.6rem, 8vw, 5.4rem); line-height: .98; letter-spacing: -.04em; }
.subtitle { margin: 22px 0 0; font-size: clamp(1.05rem, 2.5vw, 1.35rem); font-weight: 700; line-height: 1.7; }
.mobile-break { display: none; }

.main-area { padding: clamp(22px, 5vw, 52px); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 5vw, 46px); box-shadow: 0 14px 40px rgba(49, 42, 27, .06); }
.step-label { display: flex; align-items: center; gap: 12px; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; }
.step-label span { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: var(--ink); color: #fff; }
.instruction { margin: 18px 0 26px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

#drawing { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.camera-button {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 110px; border: 3px dashed #c9bda6; border-radius: 24px;
  background: #fffaf0; cursor: pointer; font-size: clamp(1.25rem, 3vw, 1.65rem); font-weight: 900;
}
.camera-button:active { transform: scale(.99); }
.camera-icon { font-size: 2rem; }

.preview-frame { margin-top: 24px; padding: 12px; border-radius: 22px; background: #f1eadc; }
.preview-frame img { display: block; width: 100%; max-height: 620px; object-fit: contain; border-radius: 15px; background: #fff; }

.button-row { display: flex; gap: 14px; margin-top: 24px; }
.button {
  flex: 1 1 0; min-height: 62px; padding: 16px 22px; border: 0; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  cursor: pointer; font-weight: 900; font-size: 1.08rem;
}
.button.primary { background: var(--green); color: #fff; box-shadow: 0 7px 0 var(--green-dark); }
.button.primary:active { transform: translateY(3px); box-shadow: 0 4px 0 var(--green-dark); }
.button.secondary { background: var(--cream); color: var(--ink); }
.button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.progress-panel { text-align: center; }
.progress-panel h2 { margin: 0 0 8px; font-size: clamp(1.45rem, 4vw, 2rem); }
.progress-panel p { margin: 0; color: var(--muted); }
.spinner { width: 72px; height: 72px; margin: 0 auto 24px; border: 8px solid #e7ddca; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.done-mark { margin-bottom: 26px; font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; }
.compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 12px; }
figure { min-width: 0; margin: 0; }
figcaption { margin-bottom: 10px; text-align: center; font-weight: 900; font-size: 1.05rem; }
.image-card { aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.image-card img { width: 100%; height: 100%; object-fit: contain; }
.arrow { text-align: center; font-size: 2.2rem; font-weight: 900; color: var(--green); }
.next-message { margin: 30px 0 0; padding: 20px 22px; border-radius: 18px; background: #eaf3ed; text-align: center; font-size: clamp(1.05rem, 2.6vw, 1.3rem); font-weight: 900; line-height: 1.65; }

.message { display: none; margin-bottom: 18px; padding: 17px 20px; border-radius: 16px; background: var(--danger-bg); color: var(--danger); font-weight: 800; line-height: 1.6; }
.message.show { display: block; }
.closed-panel { margin-top: 18px; background: #f1eee7; color: #5f625e; text-align: center; font-weight: 800; }
.simple-footer { padding: 22px 30px 34px; color: #737871; text-align: center; font-size: .8rem; line-height: 1.6; }
.hidden { display: none !important; }

/* admin.php also uses these */
.hero { padding: 38px; border-bottom: 1px solid var(--line); }
.hero .eyebrow { color: var(--green); font-weight: 900; }
.hero h1 { font-size: 2.4rem; line-height: 1.1; }
main { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { min-height: 48px; padding: 12px 18px; border: 0; border-radius: 14px; text-decoration: none; cursor: pointer; font-weight: 800; }
.btn.primary { background: var(--green); color: white; }
.btn.secondary { background: var(--ink); color: white; }
.btn.ghost { background: var(--cream); color: var(--ink); }
input[type="password"] { width: 100%; max-width: 520px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; }

@media (max-width: 720px) {
  .mobile-break { display: block; }
  .main-area { padding: 16px; }
  .simple-header { padding: 28px 20px 24px; }
  .panel { border-radius: 22px; padding: 24px 18px; }
  .button-row { flex-direction: column; }
  .compare-grid { grid-template-columns: 1fr; gap: 12px; }
  .arrow { transform: rotate(90deg); line-height: 1; }
  .image-card { aspect-ratio: 4 / 3; }
  .result-actions .primary { order: -1; }
}

.hint-field{margin-top:18px;margin-bottom:18px;text-align:left;}
.hint-field label{display:block;font-weight:700;margin-bottom:8px;font-size:1rem;}
.hint-field .optional{font-weight:400;color:#666;font-size:.92rem;}
.hint-field input{width:100%;padding:14px 16px;border:2px solid #d9d0be;border-radius:12px;font-size:1rem;background:#fff;box-sizing:border-box;}
