:root {
  --ink: #15231d;
  --muted: #647169;
  --green: #153c2d;
  --green-2: #226344;
  --lime: #d9f26a;
  --paper: #f6f3ea;
  --surface: #fffef9;
  --line: #d8ddd5;
  --danger: #b83b32;
  --shadow: 0 18px 60px rgba(21, 60, 45, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; width: 100%; }

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(217, 242, 106, .32), transparent 28rem),
    var(--paper);
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--lime);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(21, 60, 45, .15);
}

.privacy-chip, .local-badge {
  margin: 0;
  border: 1px solid rgba(21, 60, 45, .18);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--green);
  background: rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

main { max-width: 1320px; margin: 0 auto; padding: 22px 28px 60px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 72px;
  align-items: end;
  padding: 60px 0 76px;
}

.eyebrow, .kicker {
  margin: 0 0 12px;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 24px;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: clamp(44px, 7vw, 88px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 500;
}

h1 em { color: var(--green-2); font-style: italic; }

.lead {
  max-width: 700px;
  margin-bottom: 0;
  color: #536159;
  font-size: 16px;
  line-height: 1.9;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps li {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 17px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.steps span { color: var(--green-2); font-family: Georgia, serif; font-style: italic; }

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, .7fr) minmax(560px, 1.3fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(21, 60, 45, .13);
  border-radius: 20px;
  background: rgba(255, 254, 249, .88);
  box-shadow: var(--shadow);
}

.upload-panel, .round-panel { padding: 26px; }

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2, .handoff h2 {
  margin-bottom: 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.drop-zone {
  position: relative;
  min-height: 248px;
  border: 1.5px dashed #9aab9f;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: #f2f5ed;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--green-2);
  background: #ecf3e7;
  transform: translateY(-1px);
}

.drop-zone span { padding: 30px; text-align: center; }
.drop-zone strong { display: block; margin-bottom: 8px; color: var(--green); font-size: 18px; }
.drop-zone small { display: block; max-width: 280px; color: var(--muted); line-height: 1.6; }
.drop-zone img { width: 100%; height: 280px; object-fit: contain; background: #e7ebe4; }

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: transform .15s, opacity .15s, background .15s;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { width: 100%; margin-top: 12px; color: white; background: var(--green); }
.button.primary:hover:not(:disabled) { background: #0c3021; }
.button.secondary { border-color: #b9c6bc; color: var(--green); background: white; }
.button.ghost { border-color: transparent; color: var(--green); background: #eef2eb; }

.progress { margin-top: 14px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #dce4dc; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green-2); transition: width .2s; }
.progress p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { cursor: pointer; color: var(--green); font-size: 13px; font-weight: 800; }
.advanced textarea { width: 100%; margin: 12px 0 8px; resize: vertical; }
.divider { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: #89968d; font-size: 11px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

label { color: #37453d; font-size: 12px; font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid #bdc8c0;
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(34, 99, 68, .12); }
.player-target { display: grid; gap: 7px; margin-bottom: 14px; }
.player-target small { color: var(--muted); font-weight: 500; line-height: 1.5; }
.url-import > label, #playerChooser > label { display: block; margin-bottom: 7px; }
.inline-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#playerChooser { margin-top: 12px; }

.text-button {
  border: 0;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metadata-grid label { display: grid; gap: 6px; }

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.totals div { border-radius: 12px; padding: 13px 15px; color: white; background: var(--green); }
.totals div:last-child { color: var(--green); background: var(--lime); }
.totals span { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 900; letter-spacing: .1em; opacity: .8; }
.totals strong { font-family: Georgia, serif; font-size: 25px; font-weight: 500; }

.score-tables { display: grid; gap: 14px; }
.nine-card { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.nine-card h3 { margin: 0; padding: 10px 12px 7px; color: var(--green-2); font-size: 10px; letter-spacing: .12em; }
.nine-card table { width: 100%; min-width: 580px; border-collapse: collapse; table-layout: fixed; }
.nine-card th, .nine-card td { border-top: 1px solid #e4e8e2; border-right: 1px solid #e4e8e2; padding: 5px; text-align: center; }
.nine-card th:last-child, .nine-card td:last-child { border-right: 0; }
.nine-card th { width: 10%; color: #59675f; background: #f4f6f1; font-size: 10px; }
.nine-card th:first-child { width: 68px; color: var(--green); }
.nine-card input { min-width: 42px; border: 1px solid transparent; border-radius: 7px; padding: 8px 3px; text-align: center; font-weight: 800; background: #fbfcf9; }
.nine-card input.invalid { border-color: var(--danger); background: #fff0ee; }
.validation { margin: 14px 0 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.validation.valid { color: var(--green-2); }

.handoff {
  margin-top: 20px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  background: var(--green);
  color: white;
}

.handoff .kicker { color: var(--lime); }
.handoff p:last-child { max-width: 720px; margin: 12px 0 0; color: #cbd9d1; font-size: 13px; line-height: 1.7; }
.handoff-actions { min-width: 260px; display: grid; gap: 8px; }
.bookmarklet { min-height: 48px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--lime); text-decoration: none; font-size: 13px; font-weight: 900; }
.bookmarklet.disabled { pointer-events: none; filter: grayscale(1); opacity: .42; }
.handoff .button.secondary { color: white; border-color: #618071; background: transparent; }
.handoff .button.ghost { color: white; background: #274d3d; }

.status {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  max-width: 820px;
  margin: 18px auto 0;
  border: 1px solid rgba(21, 60, 45, .14);
  border-radius: 999px;
  padding: 11px 18px;
  color: var(--green);
  background: rgba(255, 254, 249, .94);
  box-shadow: 0 8px 30px rgba(21, 60, 45, .13);
  backdrop-filter: blur(12px);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.status.error { color: var(--danger); }

footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}
footer p { margin: 0; }
footer a { color: var(--green); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 38px; padding: 42px 0 54px; }
  .workspace { grid-template-columns: 1fr; }
  .handoff { grid-template-columns: 1fr; gap: 24px; }
  .handoff-actions { min-width: 0; }
}

@media (max-width: 620px) {
  .site-header, main, footer { padding-left: 16px; padding-right: 16px; }
  .privacy-chip { display: none; }
  h1 { font-size: 47px; }
  .hero { padding-top: 28px; }
  .upload-panel, .round-panel { padding: 18px; }
  .metadata-grid { grid-template-columns: 1fr; }
  .totals { grid-template-columns: repeat(3, 1fr); }
  .totals div { padding: 11px; }
  .totals strong { font-size: 20px; }
  .handoff { padding: 22px; }
  .inline-action { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Keep the introduction compact and the two title lines intentional. */
.hero { grid-template-columns: minmax(0, 1.7fr) minmax(220px, .8fr); gap: 48px; align-items: center; padding: 36px 0 48px; }
.hero h1 { font-size: clamp(32px, 4.1vw, 56px); line-height: 1.35; letter-spacing: -.04em; margin-bottom: 22px; }
.hero h1 em { white-space: nowrap; font-style: normal; }
.hero .lead { max-width: 640px; font-size: 14px; line-height: 1.9; }
.hero .steps { align-self: center; }

.workspace > *, .handoff > *, .inline-action > * { min-width: 0; }
#phone-notice { display: none; }
.phone-device body > :not(#phone-notice) { display: none !important; }
.phone-device #phone-notice { display: block; max-width: 560px; padding: 48px 24px; margin: auto; }
.phone-device #phone-notice h1 { font-size: 32px; line-height: 1.4; }
.phone-device #phone-notice p { line-height: 1.8; }
main, .site-header, footer { width: 100%; }
.hero > *, .metadata-grid > *, .totals > * { min-width: 0; }
.hero h1 { overflow-wrap: anywhere; line-height: 1.12; }
.nine-card input { width: 100%; }
@media (min-width: 621px) and (max-width: 1400px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(200px, .45fr); gap: 28px; padding: 28px 0 36px; }
  .hero h1 { font-size: clamp(38px, 4.5vw, 62px); }
  .workspace { grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 16px; }
  .upload-panel, .round-panel { padding: 18px; }
  .nine-card table { min-width: 0; }
  .nine-card th:first-child { width: 52px; }
  .nine-card th, .nine-card td { padding: 3px 1px; }
  .nine-card input { min-width: 0; padding: 8px 0; font-size: 16px; }
}
@media (min-width: 621px) and (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
.help-text, .mobile-table-hint { color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.handoff-guide { padding-left: 22px; font-size: 14px; line-height: 1.9; }
.handoff-actions { max-width: 420px; }
.handoff-actions small { line-height: 1.7; color: #cbd9d1; }
.handoff-actions summary { cursor: pointer; padding: 12px 0; }
.handoff-actions details .button { width: 100%; margin-top: 8px; }
.nine-card { overscroll-behavior-x: contain; }
.nine-card th:first-child { position: sticky; left: 0; z-index: 1; }
@media (max-width: 620px) {
  input, select, textarea { font-size: 16px; max-width: 100%; }
  .panel { min-width: 0; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { font-size: 24px; }
  .steps { flex-wrap: wrap; gap: 16px; }
  .drop-zone { min-height: 180px; }
  .button, .bookmarklet { min-height: 48px; }
  .handoff-actions { max-width: none; }
  .status { position: static; border-radius: 12px; overflow-wrap: anywhere; text-align: left; }
  .hero h1 { font-size: clamp(26px, 6vw, 38px); }
  .nine-card input { min-height: 44px; }
}

.hero h1 { font-size: clamp(30px, 4vw, 54px); line-height: 1.35; overflow-wrap: normal; }
@media (max-width: 1400px) {
  .hero { grid-template-columns: minmax(0, 1.8fr) minmax(200px, 1fr); gap: 24px; }
  .hero h1 { font-size: clamp(28px, 3.3vw, 46px); }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero h1 { font-size: clamp(26px, 4.8vw, 44px); }
}
