/* The Giveaway tab, /giveaway (giveaway.js). Nov 24: "exciting too not cheesey". Nov 25, on drawings of /cs2: "seamless
   and cleaner", "please fix/clean I like the colors and stuff tho": the soft violet light behind each case, the rarity
   colours, no hard edges. Then its own tab: "dead center only the givaway rooles at top ... 3 or 4 up small on edges
   and 1 big middle and one semi big we will do 5". The rules in one strip at the top; the five centred, the big one
   in the middle, the semi-big one on its left and the three small ones down the right edge; the one pressed opens
   under them. A phone: one under the other. */
.gw { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 0 28px; }

/* ---- the rules, and only them, at the top ---- */
.gw-rules { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gw-rules h1 { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.gw-rule-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.gw-rule-list li { padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 4%, transparent); font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.gw-rule-list b { display: block; margin-bottom: 1px; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.gw-you { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; min-height: 28px; }
.gw-you-line { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); text-align: center; }
.gw-you-line strong { color: var(--ink); font-weight: 650; }

/* ---- the five ---- */
.gw-grid { display: grid; gap: 14px; width: 100%; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr);
  grid-template-areas: "semi big s2" "semi big s3" "semi big s4"; }
.gw-grid.n0 { display: none; }
.gw-grid.n1 { grid-template-columns: minmax(0, 540px); justify-content: center; grid-template-areas: "big"; }
.gw-grid.n2 { max-width: 900px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); grid-template-areas: "semi big"; }
.gw-grid.n3 { grid-template-areas: "semi big s2"; }
.gw-grid.n4 { grid-template-areas: "semi big s2" "semi big s3"; }

.gw-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 16px 14px 14px;
  border-radius: 16px; text-align: center; background: color-mix(in srgb, var(--ink) 3.5%, transparent); transition: background .15s, box-shadow .15s; }
.gw-card:hover { background: color-mix(in srgb, var(--ink) 5.5%, transparent); }
.gw-card.on { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #8b6cf0 75%, var(--ink)); background: color-mix(in srgb, #8b6cf0 7%, transparent); }
.gw-pick, .gw-pick:hover:not(:disabled), .gw-pick:active:not(:disabled) { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0;
  border-radius: inherit; background: none; box-shadow: none; transform: none; opacity: 1; cursor: pointer; }
.gw-pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gw-card.on .gw-pick { cursor: default; }
.gw-kicker { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gw-kicker.won { color: var(--ok); font-weight: 650; }
.gw-name { margin: 0; max-width: 100%; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; text-transform: none; overflow-wrap: anywhere; }
.gw-card.big .gw-name { font-size: 22px; }
.gw-card.semi .gw-name { font-size: 16.5px; }

/* the case, on its soft violet light, floating slowly */
.gw-img { position: relative; isolation: isolate; width: 100%; display: flex; justify-content: center; padding: 4px 0; }
.gw-img::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 92%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, #8b6cf0 30%, transparent), color-mix(in srgb, #8b6cf0 10%, transparent) 55%, transparent 100%); pointer-events: none; }
.gw-img img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); animation: gw-float 6s ease-in-out infinite; }
.gw-card.big .gw-img img { max-width: 300px; }
.gw-card.big .gw-img::before { max-width: 330px; }
.gw-card.semi .gw-img img { max-width: 230px; }
.gw-card.semi .gw-img::before { max-width: 250px; }
/* (the big and semi-big ones: the case takes whatever height is left, so no empty band above or under it) */
.gw-card.big .gw-img, .gw-card.semi .gw-img { flex: 1 1 auto; align-items: center; }
.gw-img.none { display: none; }
@keyframes gw-float { 50% { transform: translateY(-6px); } }

.gw-clock { display: flex; justify-content: center; gap: 12px; font-variant-numeric: tabular-nums; }
.gw-clock[hidden] { display: none; }
.gw-clock span { display: flex; align-items: baseline; gap: 3px; }
.gw-clock b { font-weight: 650; line-height: 1; letter-spacing: -.02em; }
.gw-clock small { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.gw-card.big .gw-clock b { font-size: 30px; }
.gw-card.semi .gw-clock { gap: 8px; }
.gw-card.semi .gw-clock b { font-size: 19px; }
.gw-drawing { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.gw-when { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.gw-stats { margin: 0; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.gw-mine { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.gw-card.semi .gw-when { font-size: 11.5px; }

/* a small one: the case on the left, the rest beside it */
.gw-card.small { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px 10px 10px; text-align: left; }
.gw-card.small .gw-img { flex: none; width: 96px; padding: 0; }
.gw-card.small .gw-img::before { width: 110%; }
.gw-card.small .gw-img img { max-width: 96px; animation: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .28)); }
.gw-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gw-card.small .gw-name { font-size: 14px; }
.gw-card.small .gw-clock { justify-content: flex-start; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.gw-card.small .gw-mine { font-size: 12px; }

/* an owner's: take one back (pressed twice), or add one to an empty spot */
.gw-back, .gw-back:hover:not(:disabled) { position: relative; z-index: 2; min-height: 0; margin-top: 2px; padding: 2px 8px; border: 0; border-radius: 6px; background: none;
  color: var(--ink-3); font: inherit; font-size: 11.5px; text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.gw-back:hover:not(:disabled) { color: var(--err); }
.gw-card.small .gw-back { position: absolute; right: 6px; top: 4px; margin: 0; }
.gw-card.add { padding: 0; background: none; box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.gw-card.add:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.gw-add-btn, .gw-add-btn:hover:not(:disabled) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; min-height: 96px;
  padding: 12px; border: 0; border-radius: inherit; background: none; color: var(--ink-2); font: inherit; box-shadow: none; }
.gw-add-btn b { font-size: 26px; font-weight: 400; line-height: 1; }
.gw-add-btn span { font-size: 13px; font-weight: 600; color: var(--ink); }
.gw-add-btn small { font-size: 11px; color: var(--ink-3); }
.gw-none { margin: 6px auto; font-size: 13px; color: var(--ink-2); text-align: center; }

/* ---- the one pressed: under the five ---- */
.gw-detail { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.gw-detail[hidden] { display: none; }
.gw-d-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 14px; text-align: center; }
.gw-d-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; text-transform: none; }
.gw-d-you { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.gw-d-you:empty { display: none; }
.gw-d-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gw-d-note { text-align: center; }
.gw-d-note[hidden] { display: none; }
.gw-d-body { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 16px 36px; align-items: start; }
.gw-d-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gw-d-col[hidden] { display: none; }
.gw-d-body:has(> .gw-d-col[hidden]) { grid-template-columns: minmax(0, 720px); justify-content: center; }
.gw-d-col h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gw-fair { max-width: 860px; margin: 0 auto; text-align: center; }

/* ---- owners: a new one ---- */
.gw-add { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 8px 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.gw-add[hidden] { display: none; }
.gw-add h2 { flex: 1 0 100%; margin: 0; font-size: 13px; font-weight: 650; text-transform: none; text-align: center; }
.gw-add label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-3); }
.gw-add input, .gw-add select { min-height: 30px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.gw-add #gwaPrize { width: 250px; }
.gw-add-btns { display: flex; gap: 6px; }
.gw-add .gv-note { flex: 1 0 100%; text-align: center; }

/* ---- shared: you, who's in, what's inside, the fair draw (once on /cs2 too) ---- */
.gv-count { margin: 0; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gv-you { margin: 0; max-width: 520px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.gv-you strong { color: var(--ink); font-weight: 600; }
.gv-enter { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 14px; border-radius: 7px; border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.gv-enter:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); opacity: .88; }
.gv-enter.quiet, .gv-enter.quiet:hover:not(:disabled) { background: transparent; color: var(--ink); border-color: var(--rule-2); opacity: 1; }
.gv-enter.quiet:hover:not(:disabled) { border-color: var(--ink-2); }
.gv-enter:disabled { opacity: .5; cursor: default; }
.gv-trade { display: flex; gap: 6px; width: 100%; max-width: 520px; }
.gv-trade input { flex: 1 1 auto; min-width: 0; min-height: 28px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink); font: inherit; font-size: 12px; }
.gv-note { margin: 0; font-size: 12px; color: var(--ink-2); }
.gv-note.bad { color: var(--err); }

.gv-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; }
.gv-list li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 48px; align-items: center; gap: 10px; min-height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.gv-bar { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); pointer-events: none; }
.gv-list li > :not(.gv-bar) { position: relative; }
.gv-n { color: var(--ink-3); font-size: 11.5px; }
.gv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-t { color: var(--ink-2); font-size: 12px; }
.gv-p { text-align: right; font-weight: 600; }
.gv-list li.me { box-shadow: inset 0 0 0 1px var(--ink-3); }
.gv-list li.win .gv-name::after { content: " · won"; color: var(--ok); font-weight: 600; }
.gv-empty { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.gv-all, .gv-all:hover:not(:disabled) { align-self: flex-start; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; box-shadow: none; }

/* what's inside, in Valve's rarity colours: a grid that wraps, each skin on a soft light of its rarity's colour */
.gv-inside { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gv-skin { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 6px 6px; border-radius: 8px; font-size: 11px; color: var(--ink-2); text-align: center;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--rarity, var(--ink-3)) 20%, transparent), transparent 72%);
  box-shadow: inset 0 -2px 0 var(--rarity, var(--rule-2)); }
.gv-skin img { width: 72px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .25)); }
.gv-skin span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-skin.rare { --rarity: #e4ae39; }
.gv-skin.rare b { font-size: 30px; line-height: 54px; color: #e4ae39; text-shadow: 0 0 14px rgba(228, 174, 57, .45); }
.gv-rules { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.gv-rules p { margin: 0 0 6px; }
.gv-rules ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin: 6px 0; padding: 0; list-style: none; }
.gv-rules code { font-size: 11px; word-break: break-all; }

@media (prefers-reduced-motion: reduce) { .gw-img img { animation: none; } }
/* a tablet: the big one across the top, the semi-big one and the small ones under it */
@media (max-width: 980px) {
  .gw-rule-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gw-grid, .gw-grid.n3, .gw-grid.n4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "big big" "semi s2" "semi s3" "semi s4"; }
  .gw-grid.n2 { grid-template-areas: "big big" "semi semi"; }
  .gw-grid.n3 { grid-template-areas: "big big" "semi s2"; }
  .gw-grid.n4 { grid-template-areas: "big big" "semi s2" "semi s3"; }
}
/* a phone: one under the other; the small ones stay a row each */
@media (max-width: 640px) {
  .gw { gap: 14px; }
  .gw-rule-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .gw-rule-list li { padding: 8px 10px; font-size: 11.5px; }
  .gw-rule-list li:last-child { grid-column: 1 / -1; }
  .gw-grid, .gw-grid.n1, .gw-grid.n2, .gw-grid.n3, .gw-grid.n4 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "big" "semi" "s2" "s3" "s4"; gap: 10px; }
  .gw-grid.n1 { grid-template-areas: "big"; }
  .gw-grid.n2 { grid-template-areas: "big" "semi"; }
  .gw-grid.n3 { grid-template-areas: "big" "semi" "s2"; }
  .gw-grid.n4 { grid-template-areas: "big" "semi" "s2" "s3"; }
  .gw-card.big .gw-name { font-size: 19px; }
  .gw-card.big .gw-img img { max-width: 230px; }
  .gw-card.semi .gw-img img { max-width: 160px; }
  .gw-card.big .gw-clock b { font-size: 25px; }
  .gw-d-body { grid-template-columns: minmax(0, 1fr); }
  .gv-inside { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
  .gv-skin img { width: 60px; height: 45px; }
  .gv-list li { grid-template-columns: 18px minmax(0, 1fr) auto 44px; gap: 8px; }
  .gw-add #gwaPrize { width: 100%; }
  .gw-add label { flex: 1 1 100%; }
}
