/* Team art review page (tools/team_review). A proofing desk: the art sits on game grass, the chrome is
   quiet frost and spruce, and the only red on the page is a mark somebody left. */
:root {
  color-scheme: light;
  --page: #e8eeeb;
  --panel: #f6f9f7;
  --raised: #ffffff;
  --ink: #14221c;
  --muted: #51625a;
  --line: #c8d4ce;
  --spruce: #1d4a38;
  --spruce-deep: #143528;
  --on-spruce: #eef5f1;
  --on-spruce-muted: #a9c4b6;
  --candy: #c2182b;
  --candy-soft: #fbe3e6;
  --ok: #1a744a;
  --ok-soft: #dcefe4;
  --brass: #86600c;
  --brass-soft: #f5ebcd;
  --grass: #66bb66;            /* EA's grass: the grey tile times the green of landinfo.xml (make_ground_tiles.py) */
  --display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --rail: 248px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101915;
  --panel: #16221d;
  --raised: #1c2b24;
  --ink: #e7efea;
  --muted: #9bafa5;
  --line: #2d4137;
  --spruce: #173c2e;
  --spruce-deep: #0f2a20;
  --candy: #ff5d6c;
  --candy-soft: #40191e;
  --ok: #58c590;
  --ok-soft: #163426;
  --brass: #e2b84f;
  --brass-soft: #382e14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #101915; --panel: #16221d; --raised: #1c2b24; --ink: #e7efea; --muted: #9bafa5; --line: #2d4137;
    --spruce: #173c2e; --spruce-deep: #0f2a20; --candy: #ff5d6c; --candy-soft: #40191e;
    --ok: #58c590; --ok-soft: #163426; --brass: #e2b84f; --brass-soft: #382e14;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-stretch: 88%; font-weight: 600; letter-spacing: 0.005em; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.grow { flex: 1 1 auto; }
[hidden] { display: none !important; }
.narrow-only { display: none; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

button, select, input[type="search"], input[type="text"], input[type="password"], textarea {
  background: var(--raised); border: 1px solid var(--line); border-radius: 5px; min-height: 36px; padding: 6px 12px;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--spruce); border-color: var(--spruce); color: var(--on-spruce); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--spruce-deep); border-color: var(--spruce-deep); }
button.linkish, a.linkish { background: none; border: 0; min-height: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
button.small { min-height: 28px; padding: 2px 9px; font-size: 13px; }
textarea { width: 100%; min-height: 76px; resize: vertical; line-height: 1.45; }

/* A row of choices of which one is on. */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; background: var(--raised); overflow: hidden; }
.seg > button { border: 0; border-radius: 0; background: none; min-height: 34px; padding: 5px 12px; }
.seg > button + button { border-left: 1px solid var(--line); }
.seg > button[aria-pressed="true"] { background: var(--spruce); color: var(--on-spruce); font-weight: 600; }
.pick { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.pick select { color: var(--ink); font-size: 15px; }

/* The red tab: on a card, in the rail, on a mark. Always "somebody left something here". */
.tab { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 3px; background: var(--candy); color: #fff;
  font: 600 13px/22px var(--display); text-align: center; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .tab { color: #1b0508; }
.tab.done { background: var(--muted); }
.flag { display: inline-block; padding: 0 7px; border-radius: 3px; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.flag.ok { background: var(--ok-soft); color: var(--ok); }
.flag.changes { background: var(--candy-soft); color: var(--candy); }
.flag.stale { background: var(--brass-soft); color: var(--brass); }

/* ---- the frame: rail and desk ---- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--spruce); color: var(--on-spruce); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.brand { padding: 22px 20px 16px; }
.brand h1 { font-size: 25px; line-height: 1.15; }
.brand p { margin-top: 6px; font-size: 13px; color: var(--on-spruce-muted); }
.cats { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; }
.cats button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 4px; min-height: 38px; padding: 6px 12px;
  color: var(--on-spruce); text-align: left; font-size: 15px; }
.cats button:hover { background: #ffffff14; }
.cats button[aria-current="true"] { background: var(--on-spruce); color: var(--spruce-deep); font-weight: 600; }
.cats .n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--on-spruce-muted); font-size: 13px; }
.cats button[aria-current="true"] .n { color: var(--spruce); }
.rail-foot { margin-top: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--on-spruce-muted); }
.rail-foot .linkish { color: var(--on-spruce); }
.rail-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #ffffff12; border-color: #ffffff33; color: var(--on-spruce); font-weight: 600; font-size: 15px; }
.rail-btn:hover:not(:disabled) { background: #ffffff22; border-color: #ffffff66; }
.rail-btn[aria-pressed="true"], .rail-btn[aria-pressed="true"]:hover:not(:disabled) { background: var(--on-spruce); border-color: var(--on-spruce); color: var(--spruce-deep); }
.sync.local { color: #f3d98a; }

.desk { padding: 20px clamp(16px, 2.4vw, 36px) 48px; min-width: 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.search { flex: 1 1 220px; max-width: 340px; }
.search input { width: 100%; }
.count { margin-left: auto; color: var(--muted); font-size: 13px; }
.about { color: var(--muted); max-width: 68ch; margin-bottom: 16px; }
.empty { padding: 56px 0; color: var(--muted); text-align: center; }

/* ---- the contact sheet ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 22px 18px; }
.card { display: flex; flex-direction: column; align-self: start; width: 100%; padding: 0; border: 0; background: none; text-align: left; min-height: 0; border-radius: 4px; }
.plate { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; padding: 12px; background: var(--grass); border-radius: 4px;
  outline: 1px solid #00000022; outline-offset: -1px; }
.plate { background-image: url("ground_grass.png"); background-size: 360px; }
.plate img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.plate.pixel img { image-rendering: pixelated; }
.plate .blank { color: #eef4e6; font-size: 13px; text-align: center; }
.card:hover .plate, .card:focus-visible .plate { outline: 3px solid var(--ink); outline-offset: -3px; }
.card .tab { position: absolute; top: -7px; right: 8px; }
.card .flags { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.card .name { display: block; margin-top: 8px; font: 600 16px/1.25 var(--display); font-stretch: 88%; }
.card .facts { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* ---- every comment, in one list ---- */
.notes-asset { margin: 0 0 26px; }
.notes-asset > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.notes-asset h3 { font-size: 19px; }
.notes-asset header span { color: var(--muted); font-size: 13px; }
.note-row { display: grid; grid-template-columns: 172px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crop { position: relative; background-color: var(--grass); background-repeat: no-repeat; border-radius: 3px; overflow: hidden; }
.crop i { position: absolute; border: 2px solid var(--candy); box-shadow: 0 0 0 1px #ffffffd0; }
.note-row .whole { width: 172px; aspect-ratio: 4 / 3; background: var(--grass); border-radius: 3px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.note-row .whole img { max-width: 100%; max-height: 100%; }

/* ---- a comment, in the list and in the viewer ---- */
.c-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.c-head b { color: var(--ink); font-weight: 600; }
.c-where { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.c-text { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.c-replies { margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; }
/* What can be done to a comment: one real button (the next thing to do), the rest as quiet words. */
.c-actions button.quiet { background: none; border: 0; min-height: 26px; padding: 0; font-size: 13px; color: var(--muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.c-actions button.quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
.c-edit { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.c-edit .c-actions { margin-top: 0; }

/* ---- the viewer ---- */
dialog { color: var(--ink); }
dialog::backdrop { background: #06120dcc; }
.viewer { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--page); }
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 372px; }
.v-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.v-head { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--spruce); color: var(--on-spruce); }
.v-head button { background: #ffffff14; border-color: #ffffff3a; color: var(--on-spruce); }
.v-head button:hover:not(:disabled) { background: #ffffff26; border-color: #ffffff77; }
.v-title { flex: 1 1 auto; min-width: 0; }
.v-title h2 { font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-title p { font-size: 13px; color: var(--on-spruce-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-spruce-muted); font-variant-numeric: tabular-nums; }
.v-nav button { min-width: 36px; padding: 4px 0; font-size: 20px; line-height: 1; }
.v-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.v-tools #v-frame { min-width: 104px; font-variant-numeric: tabular-nums; }
.mark-btn { border-color: var(--candy); color: var(--candy); font-weight: 600; }
.mark-btn[aria-pressed="true"] { background: var(--candy); color: #fff; }
:root[data-theme="dark"] .mark-btn[aria-pressed="true"] { color: #1b0508; }
#v-hide[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }

.stage-wrap { position: relative; flex: 1 1 0; min-height: 0; min-width: 0; display: flex; }
/* The stage scrolls a canvas that is the picture plus half a stage of room on every side (review.js,
   layout): the picture can be moved anywhere, so there are no scrollbars to show where it "ends". */
.stage { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; scrollbar-width: none; cursor: crosshair; touch-action: none; overscroll-behavior: contain; background: var(--grass); }
.stage::-webkit-scrollbar { display: none; }
.canvas { position: relative; }
/* EA's own ground, tiled from the picture's corner and scaled with it (review.js, layout): at game size
   the tufts are the size they are in the game. */
.stage[data-bg="grass"] .canvas { background-image: url("ground_grass.png"); }
.stage[data-bg="snow"] { background: #ddeeff; }
.stage[data-bg="snow"] .canvas { background-image: url("ground_snow.png"); }
.stage[data-tool="move"] { cursor: grab; touch-action: auto; }
.stage.panning { cursor: grabbing; }
.stage[data-bg="dark"] { background: #20292b; }
.stage[data-bg="light"] { background: #ebecdf; }
.stage[data-bg="check"] { background-color: #bac5bc;
  background-image: linear-gradient(45deg, #d9e0d7 25%, transparent 25%), linear-gradient(-45deg, #d9e0d7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d9e0d7 75%), linear-gradient(-45deg, transparent 75%, #d9e0d7 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.sheet { position: absolute; line-height: 0; }
.sheet img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.marks { position: absolute; inset: 0; }
.marks.hidden .mark { display: none; }
.mark { position: absolute; min-height: 0; padding: 0; cursor: pointer; background: #c2182b24; border: 2px solid #c2182b; border-radius: 2px; box-shadow: 0 0 0 1px #ffffffd9, inset 0 0 0 1px #ffffff80; }
.mark:hover { background: #c2182b3d; border-color: #c2182b; }
/* What a highlight says, when the pointer rests on it; a click opens the whole comment beside it. */
.mark:not(.draft):not(.open):hover::after { content: attr(data-note); position: absolute; left: -2px; top: calc(100% + 6px); z-index: 4; width: max-content; max-width: 280px;
  padding: 6px 9px; border-radius: 4px; background: #14221cf2; color: #eef5f1; font: 13px/1.4 var(--body); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; }
.mark .tab { position: absolute; left: -2px; bottom: 100%; border-radius: 3px 3px 0 0; background: #c2182b; color: #fff; }
.mark.low .tab { bottom: auto; top: -2px; border-radius: 0 0 3px 0; }
.mark.done { border-style: dashed; border-color: #4c5d55; background: none; }
.mark.done .tab { background: #4c5d55; }
.mark.other { border-style: dotted; opacity: 0.75; }
.mark.sel { box-shadow: 0 0 0 1px #ffffffd9, 0 0 0 5px #c2182b55; background: #c2182b33; z-index: 2; }
.mark.draft { border-style: dashed; background: #c2182b33; pointer-events: none; z-index: 3; }
/* The comment of a highlight, beside it on the picture. */
.note-pop { position: absolute; z-index: 6; width: 330px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto; padding: 12px;
  background: var(--raised); border: 1px solid var(--line); border-left: 4px solid var(--candy); border-radius: 5px; box-shadow: 0 10px 30px #00000059; }
.note-pop .comment { border: 0; padding: 0; margin: 0; background: none; cursor: default; }
.note-pop .pop-title { font-weight: 600; margin: 0 26px 8px 0; }
.note-pop .pop-close { position: absolute; top: 6px; right: 6px; min-height: 26px; width: 26px; padding: 0; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); }
.note-pop .pop-close:hover { color: var(--ink); }
.note-pop .c-head { padding-right: 24px; }
.zoom-now { min-width: 5ch; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-note { position: absolute; left: 14px; top: 12px; padding: 6px 11px; border-radius: 4px; background: #14221ce0; color: #eef5f1; font-size: 13px; pointer-events: none; }
.v-status { display: flex; justify-content: space-between; gap: 14px; padding: 6px 14px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.v-status .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v-panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.v-panel h3 { font-size: 15px; margin-bottom: 8px; }
#p-verdict { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.verdict-row { display: flex; gap: 8px; }
.verdict-row button { flex: 1 1 0; font-weight: 600; }
.verdict-row button[data-v="ok"][aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.verdict-row button[data-v="changes"][aria-pressed="true"] { background: var(--candy); border-color: var(--candy); color: #fff; }
:root[data-theme="dark"] .verdict-row button[aria-pressed="true"] { color: #08130d; }
.verdict-others { margin-top: 8px; font-size: 13px; color: var(--muted); }
#p-change { border-bottom: 1px solid var(--line); }
#p-change:empty { display: none; }
#p-change details { padding: 9px 16px; font-size: 13px; }
#p-change summary { cursor: pointer; color: var(--muted); }
#p-change details p { margin-top: 7px; max-height: 190px; overflow: auto; }
.p-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.p-group { margin: 14px 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.p-group:first-child { margin-top: 0; }
.p-empty { color: var(--muted); font-size: 14px; }
.comment { padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--candy); border-radius: 4px; background: var(--raised); margin-bottom: 8px; cursor: pointer; }
.comment.done { border-left-color: var(--muted); }
.comment.done .c-text { color: var(--muted); }
.comment.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.comment.whole-asset { border-left-style: double; }
#p-composer { padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--raised); }
.composer-where { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 13px; color: var(--muted); }
.composer-where.area { color: var(--candy); font-weight: 600; }
.composer-buttons { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-buttons .keys { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ---- the name question, and the toast ---- */
.ask { width: min(400px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 6px; background: var(--raised); padding: 22px; }
.ask h2 { font-size: 22px; margin-bottom: 6px; }
.ask label { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.ask input { color: var(--ink); font-size: 15px; }
.ask .warn { margin-top: 10px; color: var(--candy); font-size: 13px; }
.ask-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2147483647; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 5px;
  background: var(--ink); color: var(--page); font-size: 14px; box-shadow: 0 6px 22px #00000040; }
.toast[hidden] { display: none; }

@media (max-width: 900px) {
  .wide-only { display: none !important; }
  .narrow-only { display: inline; }
  .app { display: block; }
  .rail { position: static; height: auto; }
  .brand { padding: 14px 16px 6px; }
  .brand h1 { font-size: 21px; }
  .cats { flex-direction: row; overflow-x: auto; padding: 6px 12px 10px; gap: 6px; }
  .cats button { width: auto; flex: none; border: 1px solid #ffffff33; min-height: 34px; }
  .cats .n { margin-left: 4px; }
  .rail-foot { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px 12px; }
  .rail-btn { width: auto; gap: 8px; }
  .count { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
  .note-row { grid-template-columns: minmax(0, 1fr); }
  .viewer[open] { display: flex; flex-direction: column; overflow-y: auto; }
  .v-main { flex: none; height: 68vh; height: 68dvh; }
  .v-panel { border-left: 0; border-top: 1px solid var(--line); min-height: auto; }
  .p-scroll { overflow: visible; flex: none; }
  .v-status .hint, .v-nav span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .mark.flash { animation: flash 0.9s ease-out 1; }
  @keyframes flash { from { box-shadow: 0 0 0 1px #ffffffd9, 0 0 0 16px #c2182b66; } to { box-shadow: 0 0 0 1px #ffffffd9, 0 0 0 5px #c2182b55; } }
}
@media print {
  .rail, .bar, .toast, .c-actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .note-row { break-inside: avoid; }
}
