/* Track home: the gallery of accounts (owner, 30 Nov 2026). Cards use the dark surface of the account page's tab cards. */
.gal-hero { background: radial-gradient(70% 120% at 0% 0%, #2e7a1c 0%, transparent 60%), linear-gradient(160deg, #165e19, #0f3d11); color: #fff; }
.gal-hero__wrap { display: block; padding-top: 2.25rem; padding-bottom: 2.25rem; }
.gal-hero__title { margin: 0; font: 700 clamp(2rem, 3vw + 1rem, 3.25rem)/1.05 var(--font-head); }
.gal-hero__lead { margin: 0.625rem 0 0; font-size: 1.125rem; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.gal-hero__lead:empty { display: none; }
.gal-sections { display: grid; gap: 2.25rem; padding-top: 2rem; padding-bottom: 3rem; }
.gal-section__head { display: flex; align-items: baseline; gap: 0.75rem; margin: 0 0 1rem; padding-bottom: 0.625rem; border-bottom: 2px solid var(--sec-line, #1d3527); }
.gal-section__title { margin: 0; font: 700 1.5rem/1.2 var(--font-head); color: var(--ink); }
.gal-section__count { font: 700 0.875rem/1 var(--font-ui); color: var(--muted); }
/* every row full (owner's layout rule): cards wrap at --cols per row and the last row's cards widen to fill it */
.gal-grid { --cols: 3; --gap: 1.25rem; display: flex; flex-wrap: wrap; gap: var(--gap); }
.gal-grid > .gcard { flex: 1 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
/* one colour per kind of account (owner, 30 Nov 2026): real = Euronis green, demo = the black surface, backtest = blue */
.gal-section--real { --sec-line: #209603; }
.gal-section--demo { --sec-line: #1d3527; }
.gal-section--backtest { --sec-line: #2f6fd1; }
.gal-section--real .gcard {
  background: radial-gradient(60% 90% at 0% 0%, rgba(160, 206, 78, .22), transparent 70%), radial-gradient(55% 80% at 100% 100%, rgba(32, 150, 3, .3), transparent 70%), #0f3d11;
  border-color: #2a6b22;
}
.gal-section--real .gcard:hover { border-color: #4f9a3a; }
.gal-section--backtest .gcard {
  background: radial-gradient(60% 90% at 0% 0%, rgba(110, 160, 255, .16), transparent 70%), radial-gradient(55% 80% at 100% 100%, rgba(47, 111, 209, .22), transparent 70%), #0b1a33;
  border-color: #1f3a66;
}
.gal-section--backtest .gcard:hover { border-color: #3d68ad; }
.gal-section--backtest .gcard__broker, .gal-section--backtest .gcard__foot { color: #a9b9d6; }
.gcard {
  position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 0.875rem; padding: 1.125rem 1.125rem 1rem;
  border-radius: 1rem; color: #f2f6ef; text-decoration: none; overflow: hidden;
  background: radial-gradient(60% 90% at 0% 0%, rgba(160, 206, 78, .13), transparent 70%), radial-gradient(55% 80% at 100% 100%, rgba(32, 150, 3, .16), transparent 70%), #0b1a12;
  border: 1px solid #1d3527; box-shadow: 0 2px 4px rgba(8, 26, 14, .12), 0 6px 14px rgba(8, 26, 14, .10);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.gcard:hover { transform: translateY(-3px); border-color: #3b6b2a; box-shadow: 0 10px 28px rgba(8, 26, 14, .28); color: #f2f6ef; }
.gcard:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.gcard__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; }
.gcard__icon { width: 2.75rem; height: 2.75rem; border-radius: 0.625rem; overflow: hidden; background: #1c3a22; display: grid; place-items: center; font: 800 1.25rem var(--font-head); color: var(--lime); border: 1px solid rgba(255,255,255,.14); }
.gcard__icon img { width: 100%; height: 100%; object-fit: cover; }
.gcard__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; font: 700 1.0625rem/1.2 var(--font-ui); color: #fff; overflow: hidden; }
.gcard__broker { display: block; margin-top: 0.1875rem; font: 500 0.8125rem/1.2 var(--font-body); color: #a7b7a4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .money-type { height: 1.5rem; padding: 0 0.5625rem 0 0.4375rem; font: 800 0.5938rem/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; top: 0; }
.gcard__profit { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.gcard__profit-label { font: 700 0.6875rem/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.gcard__profit-value { font: 700 2rem/1 var(--font-num); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.gcard__spark { height: 4.5rem; margin: 0 -0.25rem; }
.gcard__spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gcard__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255,255,255,.10); padding-top: 0.75rem; }
.gcard__stat { text-align: center; min-width: 0; }
.gcard__stat + .gcard__stat { border-left: 1px solid rgba(255,255,255,.10); }
.gcard__stat dt { font: 700 0.625rem/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.gcard__stat dd { margin: 0.375rem 0 0; font: 700 1.1875rem/1 var(--font-num); font-variant-numeric: tabular-nums; }
.gcard__foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #a7b7a4; }
.gcard__go { font: 700 0.8125rem var(--font-ui); color: var(--lime); }
.is-pos { color: #a5e070; } .is-neg { color: #ff8f80; }
@media (max-width: 68.75rem) { .gal-grid { --cols: 2 !important; } }
@media (max-width: 40rem) { .gal-grid { --cols: 1 !important; --gap: 1rem; } .gal-sections { gap: 1.75rem; } }
.gcard__id { min-width: 0; }
.gal-empty { padding-top: 2rem; padding-bottom: 3rem; color: var(--muted); }
.gal-empty[hidden] { display: none; }
.gal-grid--1 { --cols: 1; } .gal-grid--2 { --cols: 2; } .gal-grid--3 { --cols: 3; }

/* /admin/gallery: arranging bar and drag states */
.gal-arrange { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-top: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.gal-arrange__msg { flex: 1 1 12rem; color: var(--green-800); font-weight: 600; }
.gal-arrange__link { font-weight: 600; }
.gal-arrange button { min-height: 2.5rem; padding: 0 1rem; border-radius: 0.5rem; font: 700 0.9375rem var(--font-ui); cursor: pointer; }
.gal-arrange__save { border: 0; background: var(--green-600); color: #fff; }
.gal-arrange__save:hover { background: #1b8203; }
.gal-arrange__reset { border: 1px solid var(--border-strong); background: #fff; color: var(--green-800); }
.is-arranging .gcard { cursor: grab; }
.is-arranging .gcard:hover { transform: none; }
.gcard.is-dragging { opacity: .45; outline: 2px dashed var(--lime); outline-offset: 3px; }

/* depth behind each card (owner, 1 Dec 2026): a faint chart grid that fades in from the top right, and two soft
   waves along the bottom, like an equity curve seen through glass. Drawn in CSS and inline SVG (img-src allows data:). */
.gcard { isolation: isolate; }
.gcard > * { position: relative; z-index: 1; }
.gcard::before, .gcard::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.gcard::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 2rem 2rem;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 80%);
}
.gcard::after {
  top: auto; height: 62%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='.07'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='.045'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 120 C60 95 110 140 170 112 S280 60 330 82 S385 70 400 58 L400 200 L0 200Z' fill='url(%23a)'/%3E%3Cpath d='M0 150 C70 130 120 165 190 140 S300 105 350 122 S390 112 400 104 L400 200 L0 200Z' fill='url(%23b)'/%3E%3Cpath d='M0 120 C60 95 110 140 170 112 S280 60 330 82 S385 70 400 58' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
