:root {
    --ink: #12231f;
    --ink-soft: #576762;
    --paper: #f5f3ed;
    --surface: #fffefa;
    --line: #dfe3dc;
    --forest: #123b32;
    --forest-2: #1c5547;
    --grass: #35755d;
    --grass-dark: #28634e;
    --lime: #d8f06b;
    --blue: #1677df;
    --blue-dark: #0c4f9e;
    --coral: #f06452;
    --coral-dark: #a93329;
    --amber: #f1b543;
    --danger: #b63b35;
    --shadow: 0 18px 50px rgba(20, 45, 38, .09);
    --radius: 18px;
    --focus: 0 0 0 3px rgba(35, 120, 230, .25);
    color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(216, 240, 107, .13), transparent 28rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

button, input, textarea, select { font: inherit; }

button { color: inherit; }

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

[hidden] { display: none !important; }

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: white;
    background: var(--forest);
    border-radius: 8px;
    transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.app-header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 12px clamp(16px, 4vw, 56px);
    color: white;
    background: rgba(18, 59, 50, .97);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand-symbol {
    position: relative;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    background: var(--lime);
    border-radius: 12px 12px 12px 4px;
    transform: rotate(-5deg);
}

.brand-symbol::before,
.brand-symbol::after {
    position: absolute;
    width: 17px;
    height: 3px;
    content: "";
    background: var(--forest);
    border-radius: 2px;
}

.brand-symbol::before { transform: rotate(40deg) translateY(-3px); }
.brand-symbol::after { transform: rotate(-40deg) translateY(3px); }

.brand-symbol i {
    width: 5px;
    height: 29px;
    background: var(--forest);
    border-radius: 4px;
    transform: rotate(45deg);
}

.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 1.1rem; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: var(--lime); font-size: .64rem; font-weight: 800; letter-spacing: .22em; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.app-status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 7px 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: .8rem;
    white-space: nowrap;
}

.app-status > span {
    width: 7px;
    height: 7px;
    background: #f4c85c;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(244, 200, 92, .12);
}

.app-status.success > span,
.status.success > span { background: #8fdb7a; }
.app-status.error > span,
.status.error > span { background: #ff796c; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 750;
    font-size: .87rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .43; cursor: not-allowed; }
.button-primary { color: var(--forest); background: var(--lime); border-color: var(--lime); }
.button-primary:hover:not(:disabled) { background: #e4f78f; }
.button-secondary { color: var(--forest); background: white; border-color: #ccd4ce; }
.button-secondary:hover:not(:disabled) { border-color: var(--forest-2); background: #f9fbf7; }
.button-quiet { color: inherit; background: transparent; border-color: currentColor; }
.app-header .button-quiet { color: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .24); }
.button-accent { color: white; background: var(--forest-2); }
.button-accent:hover:not(:disabled) { background: var(--forest); }
.button-danger { color: var(--danger); background: #fff8f6; border-color: #f0d2cd; }
.button-danger:hover:not(:disabled) { background: #ffebe7; border-color: #e5aaa2; }
.button-ball { color: #6b4700; background: #fff5d8; border-color: #e8ca7e; }
.button-wide { width: 100%; margin-top: 8px; }

.page-shell {
    width: min(1540px, 100%);
    margin-inline: auto;
    padding: clamp(24px, 4vw, 56px);
}

.welcome-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
    gap: 32px;
    align-items: end;
    margin-bottom: clamp(26px, 4vw, 44px);
}

.welcome-copy { max-width: 760px; }
.eyebrow { margin: 0 0 5px; color: #587168; font-size: .69rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.welcome-copy h1 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.02; letter-spacing: -.055em; }
.welcome-copy h1 em { color: var(--forest-2); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.welcome-copy > p:last-child { max-width: 620px; margin: 16px 0 0; color: var(--ink-soft); font-size: 1rem; }

.share-panel {
    padding: 18px;
    background: rgba(255, 255, 255, .77);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(20, 45, 38, .06);
}

.share-panel p { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; }
.share-panel label { display: block; margin-bottom: 10px; color: var(--ink-soft); font-size: .78rem; }
.success-pip { display: grid; width: 23px; height: 23px; place-items: center; color: var(--forest); background: #dff1c2; border-radius: 50%; }
.share-control { display: flex; gap: 8px; }
.share-control input { min-width: 0; flex: 1; }

.editor-layout {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.tools-panel,
.board-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tools-panel { overflow: hidden; }
.board-panel { min-width: 0; padding: clamp(16px, 2.4vw, 28px); }

.tool-section { padding: 21px; border-bottom: 1px solid var(--line); }
.tool-section:last-child { border-bottom: 0; }
.player-editor { background: #f8faf6; box-shadow: inset 3px 0 0 var(--blue); }

.section-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
}

.section-title > span {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--forest);
    background: #edf1e8;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 900;
}

.section-title h2,
.board-heading h2,
.playback-copy h2,
.timeline-panel h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.section-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: .73rem; }
.section-title.compact { margin-bottom: 15px; }
.selection-pip { width: 12px; height: 12px; flex: 0 0 auto; background: var(--blue); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 2px var(--blue); }

.field-group { margin-top: 12px; }
.field-group label { display: block; margin: 0 0 6px; color: #41524d; font-size: .76rem; font-weight: 750; }
.field-group label b { color: var(--coral); }

input, textarea, select {
    width: 100%;
    color: var(--ink);
    background: #fff;
    border: 1px solid #ced6d0;
    border-radius: 9px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input, select { min-height: 42px; padding: 9px 11px; }
textarea { min-height: 82px; padding: 10px 11px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9ba6a1; }
input:hover, textarea:hover, select:hover { border-color: #a9b6ae; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }

.add-player-actions { display: grid; gap: 9px; }
.team-button {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 11px;
    text-align: left;
    background: white;
    border: 1px solid #d8ded9;
    border-radius: 11px;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.team-button:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(18, 45, 38, .07); }
.team-button.attack:hover { border-color: rgba(22, 119, 223, .55); }
.team-button.defense:hover { border-color: rgba(240, 100, 82, .62); }
.team-button > span { display: flex; min-width: 0; flex-direction: column; }
.team-button strong { font-size: .84rem; }
.team-button small { color: var(--ink-soft); font-size: .68rem; }
.team-button > b { color: #697771; font-size: 1.2rem; }

.team-token {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: white;
    border: 3px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    font-size: .72rem;
    font-style: normal;
    font-weight: 900;
}

.team-button.attack .team-token { background: var(--blue); }
.team-button.defense .team-token { background: var(--coral); }
.micro-help { margin: 10px 0 0; color: #76837e; font-size: .69rem; line-height: 1.45; }

.player-fields { display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.player-fields .field-group { margin-top: 0; }
.player-actions, .frame-actions { display: flex; gap: 8px; margin-top: 12px; }
.player-actions .button { flex: 1; padding-inline: 8px; }
.frame-actions .button { min-width: 0; flex: 1; padding-inline: 7px; font-size: .76rem; }

.step-form { display: grid; grid-template-columns: minmax(0, 1fr) 78px; gap: 9px; }
.duration-field > span { position: relative; display: block; }
.duration-field input { padding-right: 25px; }
.duration-field small { position: absolute; top: 50%; right: 9px; color: var(--ink-soft); transform: translateY(-50%); }

.board-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); font-size: .71rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.legend-dot.attack { color: var(--blue); }
.legend-dot.defense { color: var(--coral); }
.legend-ball { width: 11px; height: 7px; background: var(--amber); border: 1px solid #825a05; border-radius: 50%; transform: rotate(-28deg); }

.field-wrap {
    width: 100%;
    padding: 9px;
    background: #e3e5db;
    border: 1px solid #d4d8cd;
    border-radius: 15px;
}

.rugby-field {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 100 / 100;
    color: white;
    background: var(--grass);
    border-radius: 9px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, .12);
    user-select: none;
    touch-action: pan-y;
}

.grass-stripes {
    position: absolute;
    inset: 0;
    opacity: .45;
    background: repeating-linear-gradient(90deg, transparent 0 10%, rgba(255, 255, 255, .045) 10% 20%);
}

.field-border { position: absolute; z-index: 1; inset: 4.5%; border: 2px solid rgba(255, 255, 255, .84); pointer-events: none; }
.pitch-line { position: absolute; z-index: 1; top: 4.5%; bottom: 4.5%; width: 2px; background: rgba(255, 255, 255, .75); pointer-events: none; }
.pitch-line.try-line.left { left: 10%; }
.pitch-line.twenty-two.left { left: 27%; }
.pitch-line.ten-metre.left { left: 40%; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.8) 0 7px, transparent 7px 13px); }
.pitch-line.halfway { left: 50%; }
.pitch-line.ten-metre.right { right: 40%; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.8) 0 7px, transparent 7px 13px); }
.pitch-line.twenty-two.right { right: 27%; }
.pitch-line.try-line.right { right: 10%; }

.pitch-label { position: absolute; z-index: 1; top: 9%; color: rgba(255,255,255,.44); font-size: clamp(.55rem, 1.2vw, .84rem); font-weight: 900; letter-spacing: .08em; pointer-events: none; }
.pitch-label.left { left: 28.5%; }
.pitch-label.centre { left: 50%; transform: translateX(-50%); }
.pitch-label.right { right: 28.5%; }

.goal-post { position: absolute; z-index: 2; top: 50%; width: 4.5%; height: 15%; border: 2px solid rgba(255,255,255,.85); border-left: 0; border-radius: 0 4px 4px 0; transform: translateY(-50%); pointer-events: none; }
.goal-post.left { left: 5.5%; transform: translateY(-50%) rotate(180deg); }
.goal-post.right { right: 5.5%; }
.goal-post i, .goal-post b { position: absolute; right: -2px; width: 2px; height: 35%; content: ""; background: rgba(255,255,255,.85); }
.goal-post i { top: -35%; }
.goal-post b { bottom: -35%; }

.field-players { position: absolute; z-index: 8; inset: 0; pointer-events: none; }

.player-marker {
    position: absolute;
    z-index: 10;
    display: grid;
    width: clamp(30px, 3.5vw, 43px);
    height: clamp(30px, 3.5vw, 43px);
    place-items: center;
    padding: 0;
    color: white;
    background: var(--blue);
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(4, 30, 23, .3), inset 0 -4px 8px rgba(0, 0, 0, .12);
    font-size: clamp(.67rem, 1.1vw, .82rem);
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}

.player-marker.attack { background: var(--blue); }
.player-marker.defense { background: var(--coral); }
.player-marker:hover { filter: brightness(1.06); }
.player-marker:active { cursor: grabbing; }
.player-marker.selected { z-index: 14; box-shadow: 0 0 0 4px var(--lime), 0 7px 18px rgba(4, 30, 23, .4); }
.player-marker .player-name {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    max-width: 92px;
    overflow: hidden;
    padding: 3px 6px;
    color: white;
    background: rgba(12, 37, 31, .82);
    border-radius: 4px;
    font-size: .58rem;
    font-weight: 750;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.ball {
    position: absolute;
    z-index: 18;
    width: clamp(13px, 1.6vw, 20px);
    height: clamp(8px, 1vw, 12px);
    background: #f4c65b;
    border: 2px solid #674907;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,.3);
    transform: translate(-50%, -50%) rotate(-28deg);
    pointer-events: none;
}

.ball::after { position: absolute; top: 50%; left: 23%; width: 54%; height: 1px; content: ""; background: rgba(77,50,0,.65); transform: translateY(-50%); }
.ball.is-passing { animation: ball-spin .34s linear infinite; }
@keyframes ball-spin { to { transform: translate(-50%, -50%) rotate(332deg); } }

.pass-trail { position: absolute; z-index: 7; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pass-trail path,
.pass-trail line { fill: none; stroke: rgba(255, 231, 154, .8); stroke-width: .45; stroke-dasharray: 1.5 1.25; stroke-linecap: round; }

.empty-field {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    display: flex;
    width: min(270px, 65%);
    flex-direction: column;
    align-items: center;
    padding: 18px;
    text-align: center;
    color: rgba(255,255,255,.9);
    background: rgba(13, 59, 45, .42);
    border: 1px dashed rgba(255,255,255,.5);
    border-radius: 13px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.empty-field > span { display: grid; width: 34px; height: 34px; margin-bottom: 6px; place-items: center; background: rgba(255,255,255,.13); border-radius: 50%; font-size: 1.4rem; }
.empty-field strong { font-size: clamp(.72rem, 1.5vw, .92rem); }
.empty-field small { margin-top: 3px; color: rgba(255,255,255,.65); font-size: clamp(.56rem, 1.1vw, .7rem); }

.field-help { margin: 9px 2px 0; color: #7a8782; font-size: .7rem; text-align: center; }

.playback-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 22px;
    padding: 16px 18px;
    background: #f1f4ed;
    border: 1px solid #dce2da;
    border-radius: 13px;
}

.playback-copy > span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .72rem; }
.playback-controls { display: flex; align-items: center; gap: 7px; }
.round-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--forest);
    background: white;
    border: 1px solid #ccd5cd;
    border-radius: 50%;
    font-weight: 850;
    cursor: pointer;
}
.round-button:hover:not(:disabled) { background: #fafcf7; border-color: var(--forest); }
.round-button:disabled { opacity: .4; cursor: not-allowed; }
.play-pause { min-width: 126px; color: white; background: var(--forest); }
.play-all { min-width: 112px; }
body.is-playing .play-pause { color: var(--forest); background: var(--lime); }
body.is-playing .player-marker { cursor: default; }

.timeline-panel { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.timeline-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.timeline-panel > header > p { margin: 0; color: var(--ink-soft); font-size: .72rem; }
.timeline-list {
    display: flex;
    gap: 10px;
    min-height: 92px;
    margin: 14px 0 0;
    padding: 4px 2px 10px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}

.timeline-item {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 145px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 3px 8px;
    align-items: center;
    padding: 12px;
    color: inherit;
    text-align: left;
    background: #f9faf7;
    border: 1px solid #dce2dc;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.timeline-entry { min-width: 145px; flex: 0 0 auto; }
.timeline-order {
    display: grid;
    width: 24px;
    height: 24px;
    grid-row: 1 / span 2;
    place-items: center;
    color: var(--forest);
    background: #e7ede2;
    border-radius: 50%;
    font-size: .66rem;
    font-weight: 900;
}
.timeline-name {
    overflow: hidden;
    font-size: .78rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.timeline-duration { color: var(--ink-soft); font-size: .64rem; }
.timeline-item:hover { transform: translateY(-1px); border-color: #aab9af; }
.timeline-item.active { background: #f2f8dd; border-color: #91a84e; box-shadow: inset 0 0 0 1px #91a84e; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item small { margin-top: 5px; color: var(--ink-soft); font-size: .64rem; }
.timeline-item::after { position: absolute; top: 50%; right: -9px; z-index: 2; color: #87928d; content: "›"; transform: translateY(-50%); }
.timeline-item:last-child::after { display: none; }
.timeline-empty { display: grid; width: 100%; min-height: 78px; place-items: center; padding: 15px; color: #87938e; background: #fafbf8; border: 1px dashed #ccd4ce; border-radius: 10px; font-size: .74rem; text-align: center; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; width: min(360px, calc(100vw - 36px)); gap: 8px; pointer-events: none; }
.toast,
.status {
    padding: 12px 15px;
    color: white;
    background: #263b35;
    border-left: 4px solid #9fb0a9;
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
    font-size: .82rem;
    animation: toast-in .2s ease-out;
}
.toast.success, .status.success { border-left-color: #9be56f; }
.toast.error, .status.error { border-left-color: #ff786a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
    .page-shell { padding-inline: 22px; }
    .editor-layout { grid-template-columns: 280px minmax(0, 1fr); }
    .board-panel { padding: 17px; }
    .legend { gap: 7px; }
    .playback-panel { align-items: flex-start; flex-direction: column; }
    .playback-controls { width: 100%; }
    .play-all { margin-left: auto; }
}

@media (max-width: 800px) {
    .app-header { position: relative; padding-inline: 18px; }
    .app-status { display: none; }
    .page-shell { padding: 26px 16px 38px; }
    .welcome-row { grid-template-columns: 1fr; gap: 18px; }
    .welcome-copy h1 { font-size: clamp(2rem, 9vw, 3.2rem); }
    .editor-layout { grid-template-columns: 1fr; }
    .tools-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-section { border-right: 1px solid var(--line); }
    .tool-section:nth-child(even) { border-right: 0; }
    .tool-section:nth-last-child(-n+2) { border-bottom: 0; }
    .player-editor { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line) !important; }
    .board-panel { grid-row: 1; }
}

@media (max-width: 580px) {
    .app-header { min-height: 64px; }
    .brand-copy small { display: none; }
    .brand-symbol { width: 34px; height: 34px; }
    .header-actions { gap: 6px; }
    .header-actions .button { min-height: 38px; padding: 8px 10px; font-size: .76rem; }
    .welcome-copy > p:last-child { font-size: .9rem; }
    .share-control { align-items: stretch; flex-direction: column; }
    .editor-layout { gap: 12px; }
    .tools-panel { display: block; }
    .tool-section { border-right: 0; border-bottom: 1px solid var(--line) !important; }
    .tool-section:last-child { border-bottom: 0 !important; }
    .board-panel { padding: 12px; border-radius: 14px; }
    .board-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .field-wrap { padding: 5px; border-radius: 11px; }
    .rugby-field { border-radius: 7px; }
    .field-border { border-width: 1px; }
    .pitch-line { width: 1px; }
    .player-marker { border-width: 2px; }
    .player-marker .player-name { display: none; }
    .field-help { font-size: .61rem; }
    .playback-panel { margin-top: 15px; padding: 13px; }
    .playback-controls { display: grid; grid-template-columns: 38px 38px 1fr 38px; }
    .round-button { width: 38px; height: 38px; }
    .play-pause { min-width: 0; padding-inline: 8px; }
    .play-all { grid-column: 1 / -1; width: 100%; margin-left: 0; }
    .timeline-panel > header { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 360px) {
    .brand-copy { display: none; }
    .header-actions .button { padding-inline: 8px; }
    .welcome-copy h1 { font-size: 1.8rem; }
    .page-shell { padding-inline: 10px; }
    .player-fields, .step-form { grid-template-columns: 1fr; }
    .player-actions, .frame-actions { flex-direction: column; }
    .legend { font-size: .62rem; }
    .empty-field { padding: 10px; }
}

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