@import url("tactical-tools.css");
/* Human-edited source. Only the pitch viewport scrolls horizontally on mobile. */
/* M4.1: viewport workspace; sidebar and stage scroll independently at short heights. */
body[data-page=match-studio]{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
body[data-page=match-studio]>.route-header{flex:none;min-height:58px;padding:8px 20px;gap:12px}
body[data-page=match-studio] .match-studio-shell{display:flex;flex-direction:column;flex:1;min-height:0;max-width:none;padding:0;margin:0}
#matchStudioContent{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.match-studio-topbar{display:flex;align-items:center;gap:18px;flex:none;min-height:62px;padding:8px 18px;border-bottom:1px solid var(--line);background:var(--bg-surface)}
.match-studio-topbar .match-studio-back{margin:0;font-size:12px;flex:none}
.match-workspace-identity{min-width:0;margin-right:auto}.match-workspace-identity h1{font-size:15px;letter-spacing:-.3px}.match-workspace-identity p{font-size:12px;margin:4px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-secondary)}
.match-studio-topbar>button{flex:none;font-family:inherit;font-size:12px;font-weight:600;border:1px solid var(--line);border-radius:7px;background:var(--control-bg);color:var(--ink);padding:10px;min-height:40px}
.match-editor-workspace{display:grid;grid-template-columns:204px minmax(0,1fr);flex:1;min-height:0;min-width:0}
.match-editor-workspace>.match-tactical-host{min-height:0;overflow-y:auto;border-right:1px solid var(--line);background:var(--bg-surface);padding:12px}
.match-workspace-stage{min-width:0;min-height:0;overflow-y:auto;padding:14px 12px;background:var(--bg-page)}
.match-workspace-stage .match-pitch{width:min(calc(100% - 24px),calc((100dvh - 225px)*1.6))}
.match-workspace-help{font-size:12px;color:var(--text-secondary);margin:8px 0}.match-workspace-help summary{cursor:pointer;width:fit-content}.match-workspace-help p{line-height:1.5}
.match-studio-shell>.matches-source{flex:none;margin:0;padding:5px 18px;font-size:10px}
.match-studio-status:not(:empty){margin:0;padding:6px 18px;flex:none;font-size:12px}
.match-pitch-lines{z-index:0}.match-drawings{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none;overflow:hidden}.match-pitch-players{z-index:2}
.match-drawing-input{position:absolute;inset:0;z-index:4;pointer-events:none;touch-action:auto}
.match-pitch.is-drawing .match-drawing-input{pointer-events:auto;touch-action:none;cursor:crosshair}.match-pitch.is-drawing .match-player{pointer-events:none}
.match-drawing-input:focus-visible{outline:3px solid var(--lime);outline-offset:-4px}
@media(min-width:701px) and (max-width:1100px){.match-editor-workspace{grid-template-columns:176px minmax(0,1fr)}.match-editor-workspace>.match-tactical-host{padding:9px}.match-studio-topbar{gap:12px;padding-inline:12px}}
@media(max-width:700px){body[data-page=match-studio]>.route-header{padding:8px 12px}.match-studio-topbar{flex-wrap:wrap;gap:8px;padding:8px 12px}.match-studio-topbar .match-studio-back{width:100%}.match-workspace-identity{flex:1}.match-studio-topbar>button{max-width:155px}.match-editor-workspace{display:flex;flex-direction:column}.match-workspace-stage{flex:1;padding:10px 0}.match-workspace-stage .match-pitch{width:800px}.match-workspace-help,.match-drawing-notice{padding-inline:12px}.match-editor-workspace>.match-tactical-host{order:2;flex:none;max-height:160px;overflow:auto;border-right:0;border-top:1px solid var(--line);padding:8px 10px max(8px,env(safe-area-inset-bottom))}.match-tactical-tray{display:flex;gap:14px;width:max-content;max-width:none}.match-tool-group{flex:none;margin:0;width:150px}.match-tools-group{width:260px}.match-tools-group .match-tool-grid{grid-template-columns:repeat(4,1fr)}.match-pitch-group{width:165px}.match-tactical-tray::before{content:attr(data-active-label);align-self:stretch;display:flex;align-items:center;flex:none;padding:0 7px;background:var(--bg-surface);color:var(--text-primary);border-right:2px solid var(--focus);font-size:12px;font-weight:700}}
.match-studio-shell{width:100%;max-width:1560px;margin:0 auto;padding:22px 28px;min-width:0}
.match-studio-back{display:inline-block;color:var(--ink);font-size:14px;font-weight:600;text-decoration:none;margin-bottom:12px}
.match-studio-back:hover{text-decoration:underline}.match-studio-status:empty{display:none}
.match-studio-status{font-size:14px;line-height:1.6}

.match-studio-help,.match-board-root+p{font-size:12px;line-height:1.6;color:var(--text-secondary);margin:10px 0}.match-board-root{min-width:0;max-width:100%}
.match-pitch-viewport{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;border-radius:10px;scrollbar-color:#647c62 #e3e9df;scrollbar-width:thin}
.match-pitch-viewport:focus-visible{outline:3px solid #86b638;outline-offset:3px}
.match-pitch{position:relative;isolation:isolate;width:calc(100% - 60px);min-width:800px;margin:0 auto;aspect-ratio:1.6;background:var(--match-pitch-background,repeating-linear-gradient(90deg,#285b3b 0%,#285b3b 10%,#2b6140 10%,#2b6140 20%));overflow:hidden}
.match-pitch-lines{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2;color:var(--match-pitch-markings,#ffffff);pointer-events:none}
.match-pitch-players{position:absolute;inset:0;pointer-events:none}
.match-player{position:absolute;transform:translate(-50%,-50%);width:78px;padding:3px 2px;background:transparent;border:2px solid transparent;border-radius:8px;display:flex;flex-direction:column;align-items:center;gap:1px;cursor:grab;user-select:none;-webkit-user-select:none;touch-action:none;pointer-events:auto;color:#fff}
.match-player .player-jersey{width:40px;height:40px;flex:none}.match-player .shirt-number{font-size:15px}.match-player-name{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700;line-height:16px;text-shadow:0 1px 3px #000}
.match-player-role{font-size:10px;line-height:13px;color:#eef6eb;text-shadow:0 1px 3px #000}.match-player.selected{z-index:2}.match-player.dragging{cursor:grabbing;z-index:3}.match-player:focus-visible{outline:3px solid #c7f36b;outline-offset:2px;z-index:4}
@media(min-width:1200px){.match-player{width:90px}.match-player .player-jersey{width:46px;height:46px}.match-player-name{font-size:12px}.match-player-role{font-size:11px}}
@media(max-width:650px){.match-studio-shell{padding:16px 12px}}
.match-player.swap-target .player-jersey{filter:drop-shadow(0 0 4px var(--lime))}.match-player.swap-target .match-player-name{background:var(--lime);color:#18231d;text-shadow:none}
.match-player-goals{display:flex;flex-wrap:wrap;justify-content:center;gap:2px;max-width:100%;font-size:11px;line-height:13px}.match-player-goals>span{display:inline-block}
.match-bench{margin-top:14px;padding:16px;background:var(--bg-surface);border:1px solid var(--line);border-radius:10px}.match-bench[hidden]{display:none}.match-bench h2{font-size:16px;margin:0 0 8px}.match-bench>p,.match-board-notice{font-size:13px;line-height:1.5}.match-bench>button{border:1px solid var(--line);background:var(--paper);padding:8px 12px;border-radius:6px}
.match-bench-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.match-reserve{display:flex;flex-direction:column;align-items:center;gap:3px;width:110px;max-width:100%;padding:8px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:7px;touch-action:none;user-select:none}.match-reserve .player-jersey,.match-drag-ghost .player-jersey{width:36px;height:36px}.match-reserve .match-player-name{color:var(--ink);text-shadow:none}.match-reserve .match-player-role{color:var(--text-secondary);text-shadow:none}.match-reserve .shirt-number{font-size:14px}
.match-drag-ghost{position:fixed;transform:translate(-50%,-50%);pointer-events:none;z-index:100;width:90px;display:flex;flex-direction:column;align-items:center;background:#183222e6;border-radius:8px;padding:6px;color:white}.match-board-notice:empty{display:none}

@media(max-height:560px){body[data-page=match-studio]{height:560px;overflow:auto}}

/* M4.2: independent presentation dimensions, never tactical coordinates. */
.match-editor-workspace{grid-template-columns:220px minmax(0,1fr);transition:grid-template-columns .18s ease}
.match-workspace-sidebar{min-height:0;overflow:auto;background:var(--bg-surface);border-right:1px solid var(--line);padding:8px 12px}
.match-sidebar-toggle{display:block;margin:0 0 10px auto;width:34px;height:34px;background:var(--control-bg);color:var(--ink);border:1px solid var(--line);border-radius:6px;font-size:22px;cursor:pointer}
.match-editor-workspace.sidebar-collapsed{grid-template-columns:48px minmax(0,1fr)}
.sidebar-collapsed>.match-workspace-sidebar{padding:8px 6px}
.match-workspace-stage .match-pitch{width:var(--match-pitch-width,1200px);height:var(--match-pitch-height,650px);min-width:800px;aspect-ratio:auto}
.match-team-tools{display:grid;gap:8px;margin-top:16px}.match-team-tools h2{font-size:11px;text-transform:uppercase;letter-spacing:1px}
.studio-team-dialog{width:min(460px,calc(100vw - 32px));max-height:80dvh;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--bg-surface);color:var(--ink)}
.studio-team-dialog::backdrop{background:#0009}.studio-team-dialog>h2{font-size:22px;margin:0 0 20px}.studio-team-dialog>button{position:absolute;right:20px;top:20px}.studio-team-dialog label{display:grid;gap:8px;font-size:13px}.studio-team-dialog input{width:100%;padding:12px;background:var(--control-bg);color:var(--ink);border:1px solid var(--line);border-radius:8px}.studio-team-list{display:grid;gap:8px;margin-top:16px}.studio-team-option{padding:14px;text-align:left;background:var(--control-bg);color:var(--ink);border:1px solid var(--line);border-left:6px solid var(--team);box-shadow:inset 3px 0 var(--team2);border-radius:8px;cursor:pointer}.studio-team-option:disabled{opacity:.4;cursor:default}.studio-team-option[hidden]{display:none}
.match-workspace-sidebar :focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.match-tactical-host[hidden]{display:none}
.match-source-tools{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}.match-source-reset{width:100%;overflow-wrap:anywhere}
@media(max-width:700px){.match-workspace-sidebar{order:2;flex:none;max-height:230px;overflow:auto;border-right:0;border-top:1px solid var(--line)}.match-sidebar-toggle{margin:0 0 6px}.match-tactical-host{display:flex;gap:14px}.match-team-tools{flex:none;width:170px;margin:0}.match-editor-workspace.sidebar-collapsed{display:flex}.match-pitch-group{width:180px}.match-workspace-identity p{white-space:normal;font-size:11px}.match-studio-topbar{min-height:0}.match-workspace-stage .match-pitch{width:var(--match-pitch-width,1200px)}}
@media(max-width:700px){body[data-page=match-studio] .match-tactical-host>.match-tactical-tools{flex:none;max-width:none}.match-source-tools{flex:none;width:155px;margin:0;padding:0 0 0 12px;border-top:0;border-left:1px solid var(--line);display:flex;align-items:flex-end}.match-source-reset{min-height:44px}.sidebar-collapsed .match-sidebar-toggle{display:inline-flex;align-items:center;gap:8px;width:auto;padding:0 12px}.sidebar-collapsed .match-sidebar-toggle::after{content:'Araçlar';font-size:14px;font-weight:600}}
/* MOBILE1.1: on phones and short screens the workspace is one full (small-viewport) screen tall and the page scrolls to it,
   so the header, title and notices such as the local-draft banner can no longer squeeze the pitch and tools away. */
@media (max-width:700px),(max-height:560px){body[data-page=match-studio]{overflow-y:auto}body[data-page=match-studio] .match-studio-shell,body[data-page=match-studio] .match-studio-shell>div{flex-shrink:0;min-height:auto}body[data-page=match-studio] .match-editor-workspace{flex:none;height:max(320px,100svh)}}
@media(prefers-reduced-motion:reduce){.match-editor-workspace{transition:none}}
