:root {
  color-scheme: dark;
  --ink: #f7f2df;
  --muted: #b9c8b8;
  --paper: #f7f2df;
  --night: #102c26;
  --night-soft: #173c32;
  --board: #1c6449;
  --line: rgba(247, 242, 223, .16);
  --terracotta: #e97858;
  --mustard: #f4c95d;
  --wood: #a86545;
  --danger: #ff9b85;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; min-width: 0; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 88% 8%, #245b49 0, transparent 28rem), var(--night); line-height: 1.5; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, svg:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

.site-header { position: relative; isolation: isolate; min-height: 300px; padding: 54px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.header-art { position: absolute; z-index: -1; inset: 0 0 0 42%; overflow: hidden; opacity: .44; mix-blend-mode: screen; }
.header-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--night) 0%, rgba(16, 44, 38, .75) 28%, rgba(16, 44, 38, .14) 100%), linear-gradient(0deg, var(--night) 0%, transparent 34%); }
.header-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.72) contrast(1.1); }
.header-content { max-width: 680px; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--mustard); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; max-width: 700px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 72px); line-height: .98; letter-spacing: -.055em; font-weight: 700; }
h1 span { color: var(--mustard); }
.lead { max-width: 560px; margin-bottom: 24px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.privacy-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 13px; border: 1px solid rgba(247, 242, 223, .25); border-radius: 999px; color: var(--paper); background: rgba(16, 44, 38, .68); font-size: 13px; }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee0af; box-shadow: 0 0 0 4px rgba(126, 224, 175, .13); }

.app-shell { width: min(1240px, calc(100% - 48px)); margin: 28px auto 58px; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-areas: "controls board" "frames board"; gap: 18px; align-items: start; }
.panel { min-width: 0; border: 1px solid rgba(247, 242, 223, .14); border-radius: 18px; background: rgba(23, 60, 50, .78); box-shadow: 0 18px 50px rgba(0, 0, 0, .17); }
.control-panel { grid-area: controls; padding: 22px; }
.board-panel { grid-area: board; padding: 22px; }
.frames-panel { grid-area: frames; padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; letter-spacing: -.03em; }
.limit-note { flex: none; padding-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.tool-group { padding: 16px 0; border-top: 1px solid var(--line); }
.tool-label { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
button { border: 0; cursor: pointer; }
.tool-button, .action-button { min-height: 44px; border-radius: 10px; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.tool-button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid transparent; background: rgba(247, 242, 223, .08); text-align: left; font-size: 13px; font-weight: 700; }
.tool-button:hover, .action-button:hover:not(:disabled) { transform: translateY(-1px); background: rgba(247, 242, 223, .15); }
.tool-button.home { border-color: rgba(233, 120, 88, .5); }
.tool-button.away { border-color: rgba(244, 201, 93, .5); }
.tool-button.ball { border-color: rgba(247, 242, 223, .3); }
.tool-button.cone { border-color: rgba(225, 166, 75, .5); }
.tool-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; color: var(--night-soft); background: var(--paper); font-size: 12px; font-weight: 900; }
.home .tool-icon { background: var(--terracotta); }
.away .tool-icon { background: var(--mustard); }
.cone .tool-icon { border-radius: 7px; background: var(--wood); color: var(--paper); }
.inline-buttons { display: flex; gap: 8px; align-items: center; }
.wrap-buttons { flex-wrap: wrap; }
.action-button { padding: 9px 12px; border: 1px solid rgba(247, 242, 223, .22); background: rgba(247, 242, 223, .08); font-size: 12px; font-weight: 750; }
.action-button span { color: var(--mustard); font-size: 18px; vertical-align: -1px; }
.action-button.primary { border-color: var(--mustard); color: var(--night); background: var(--mustard); }
.action-button.subtle { color: var(--muted); }
.action-button.danger, .action-button.danger-outline { color: var(--danger); }
.action-button.danger-outline { border-color: rgba(255, 155, 133, .4); }
.action-button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.microcopy { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.status { min-height: 46px; margin: 14px 0 0; padding: 11px 12px; border-radius: 10px; color: var(--paper); background: rgba(16, 44, 38, .72); font-size: 12px; }
.status[data-state="error"] { color: #ffd1c7; border: 1px solid rgba(255, 155, 133, .36); }
.status[data-state="success"] { color: #c4f4d9; border: 1px solid rgba(126, 224, 175, .3); }

.board-heading { align-items: flex-end; }
.frame-name-label { display: flex; flex-direction: column; gap: 6px; min-width: min(220px, 48%); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.frame-name-label input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(247, 242, 223, .25); border-radius: 9px; color: var(--paper); background: rgba(16, 44, 38, .84); font-size: 16px; }
.board-wrap { width: 100%; overflow: hidden; border: 1px solid rgba(247, 242, 223, .18); border-radius: 14px; background: var(--board); box-shadow: inset 0 0 0 8px rgba(16, 44, 38, .17); }
#board { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 650; touch-action: none; user-select: none; }
#board .marker { cursor: grab; transition: filter .12s ease; }
#board .marker:active { cursor: grabbing; }
#board .marker-hit { pointer-events: all; touch-action: none; }
#board .marker:hover, #board .marker.is-selected { filter: drop-shadow(0 0 8px rgba(247, 242, 223, .8)); }
#board .marker.is-selected circle, #board .marker.is-selected path { stroke-width: 6; }
#board .tactic-arrow { pointer-events: none; }
#board .pending-arrow { opacity: .75; }
#board .pending-point { fill: var(--paper); stroke: var(--mustard); stroke-width: 4; }
.board-hint { display: flex; gap: 10px; align-items: center; margin-top: 13px; color: var(--muted); font-size: 12px; }
.hint-key { flex: none; padding: 3px 6px; border: 1px solid rgba(244, 201, 93, .5); border-radius: 4px; color: var(--mustard); font-size: 10px; font-weight: 800; letter-spacing: .1em; }

.frame-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.frame-item { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid rgba(247, 242, 223, .16); border-radius: 9px; color: var(--muted); background: rgba(247, 242, 223, .04); text-align: left; }
.frame-item:hover, .frame-item.active { color: var(--paper); border-color: var(--mustard); background: rgba(244, 201, 93, .12); }
.frame-number { display: grid; place-items: center; width: 23px; height: 23px; flex: none; border-radius: 50%; color: var(--night); background: var(--paper); font-size: 11px; font-weight: 900; }
.frame-item.active .frame-number { background: var(--mustard); }
.frame-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.frame-meta { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.frame-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.site-footer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 52px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer div { display: flex; flex-direction: column; gap: 3px; color: var(--paper); }
.site-footer strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.site-footer p { margin: 0; }

@media (max-width: 940px) {
  .site-header { min-height: 270px; padding-top: 42px; padding-bottom: 42px; }
  .header-art { inset: 0; opacity: .26; }
  .app-shell { grid-template-columns: 1fr; grid-template-areas: "controls" "board" "frames"; }
  .control-panel, .frames-panel { padding: 20px; }
}

@media (max-width: 520px) {
  .site-header { min-height: 250px; padding: 32px 20px; }
  .header-content { max-width: none; }
  h1 { font-size: clamp(37px, 12vw, 58px); }
  .app-shell, .site-footer { width: min(100% - 24px, 500px); }
  .app-shell { margin-top: 12px; margin-bottom: 36px; gap: 12px; }
  .panel { border-radius: 14px; }
  .board-panel { padding: 14px; }
  .board-heading { align-items: flex-start; flex-direction: column; }
  .frame-name-label { width: 100%; max-width: none; }
  .control-panel, .frames-panel { padding: 16px; }
  .inline-buttons { align-items: stretch; flex-wrap: wrap; }
  .inline-buttons .action-button { flex: 1 1 auto; }
  .file-tools .action-button { min-width: calc(50% - 5px); }
  .frame-list { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; gap: 12px; padding-bottom: 32px; }
}

@media (max-width: 340px) {
  .site-header { padding-left: 14px; padding-right: 14px; }
  .app-shell, .site-footer { width: calc(100% - 16px); }
  h1 { font-size: 36px; }
  .lead { font-size: 15px; }
  .control-panel, .frames-panel { padding: 12px; }
  .board-panel { padding: 10px; }
  .tool-button { padding-left: 7px; padding-right: 7px; font-size: 12px; }
  .tool-icon { width: 23px; height: 23px; }
  .frame-actions .action-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* SOU100 Stage A batch-06 */
.hero-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: .85rem 0 .7rem; padding-left: 1.25rem; }
.hero-steps li { min-width: 0; padding-left: .08rem; font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.hero-cta { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin: .1rem 0 .55rem; padding: .55rem .9rem; border: 1px solid var(--mustard); border-radius: 999px; color: var(--night); background: var(--mustard); font-weight: 800; text-decoration: none; }
a.hero-cta:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
.hero-cta span { font-size: 1.05rem; line-height: 1; }
.site-header { min-height: 0; padding-block: 30px; }
@media (max-width: 640px) {
  .site-header { min-height: 0; padding: 20px 18px; }
  .header-art { display: none; }
  h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .lead { margin-bottom: .7rem; font-size: .94rem; line-height: 1.55; }
  .hero-steps { gap: .25rem; margin: .6rem 0; }
  .hero-steps li { font-size: .74rem; }
  .privacy-chip { min-height: 28px; padding: 4px 9px; font-size: .72rem; }
  .control-panel .section-kicker { display: none; }
  .control-panel .panel-heading { margin-bottom: .65rem; }
  .control-panel .panel-heading h2 { font-size: 1.25rem; }
  .app-shell { margin-top: 8px; }
}
