/* Module "gamead" (Glyphenbrigade banners in the lobby, 2.102.0, public/js/modules/gamead/gamead.js): styles. The look
   is David's preview werbebanner-vorschau.html; the colours are the game's own and stay the same in every Kwaba theme
   (the banners show the game, not Kwaba).

   Steps by window width - the margin beside the tiles is (100vw - 1600px) / 2 + 20px (.wrap's padding); minus the
   edge tabs on the left and some space the banner is min(margin - 58px, 420px) wide:
     from 2036 px       180-420 px, full banners (.gad-full)
     1856-2035 px       90-179 px, slim strips (.gad-slim)
     below 1856 px      no banners, the dashboard tile instead (.gad-tile) */

.gad, .gad-tile {
  --g-bg: #090a13; --g-green: #8fe39a; --g-green-dim: #1f4a3a; --g-lav: #9a9aaa; --g-text: #c9c3e6;
  --g-fire: #dfa762; --g-fire-2: #ad6741; --g-gold: #ffd27a; --g-ice: #4dd6e8; --g-gem: #7ac943;
}

/* -------------------------------------------------- slots: fixed beside the tile column, 16 px away from it */
.gad-slot { display: none; position: fixed; top: 52px; bottom: 16px; z-index: 2; }
/* width from the viewport without the scroll bar (a fixed box's % is the viewport) - the page is centred in that too */
.gad-slot.gad-left { right: calc(50% + 796px); }
.gad-slot.gad-right { left: calc(50% + 796px); }
@media (min-width: 2036px) {
  .gad-slot.gad-full { display: block; width: min(calc(50% - 838px), 420px); }
}
@media (min-width: 1856px) and (max-width: 2035.98px) {
  .gad-slot.gad-slim { display: block; width: calc(50% - 838px); }
}
.gad-slot > .gad { display: flex; height: 100%; }

/* -------------------------------------------------- banner, shared */
.gad {
  position: relative; overflow: hidden; border-radius: 4px; container-type: inline-size; isolation: isolate;
  font-family: var(--data); color: var(--g-text); background: var(--g-bg); cursor: pointer; text-decoration: none;
  transition: box-shadow .25s;
}
.gad:hover, .gad:focus-visible { text-decoration: none; box-shadow: 0 0 0 1px rgba(143, 227, 154, .55), 0 0 28px rgba(143, 227, 154, .18); outline: none; }
.gad > canvas.gad-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.gad .gad-vig {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 0, 0, .65) 100%), linear-gradient(transparent 70%, rgba(0, 0, 0, .5));
}
.gad .gad-tag { position: absolute; top: 6px; right: 8px; font-size: 9px; letter-spacing: .15em; color: rgba(201, 195, 230, .45); z-index: 3; }
.gad .gad-cta { display: block; margin: 0 auto; text-align: center; font-family: var(--data); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

/* A: character rain */
.gad-a { flex-direction: column; justify-content: center; align-items: center; padding: 8%; }
.gad-a .gad-box { background: rgba(9, 10, 19, .86); padding: 7cqi 6cqi; text-align: center; border: 1px solid rgba(143, 227, 154, .25); width: 100%; }
.gad-a .gad-logo {
  margin: 0; color: var(--g-green); text-shadow: 0 0 12px rgba(143, 227, 154, .55); font-family: var(--data); font-weight: 700;
  font-size: clamp(14px, 11cqi, 30px); line-height: 1.15; letter-spacing: .32em; white-space: pre; padding-left: .32em;
}
.gad-a .gad-rule { color: rgba(143, 227, 154, .5); font-size: clamp(9px, 5cqi, 13px); letter-spacing: 0; overflow: hidden; white-space: nowrap; margin: 3cqi 0; }
.gad-a .gad-sub { font-size: clamp(9px, 5.2cqi, 14px); letter-spacing: .14em; color: var(--g-text); text-transform: uppercase; line-height: 1.5; text-wrap: balance; }
.gad-a .gad-bar { margin: 6cqi auto 0; width: 80%; height: 12px; border: 1px solid rgba(255, 210, 122, .55); position: relative; overflow: hidden; }
.gad-a .gad-bar i {
  position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: repeating-linear-gradient(90deg, var(--g-gold) 0 6px, transparent 6px 9px);
  animation: gad-ldbar 1.4s ease-in-out infinite alternate;
}
/* the stripe swings inside the bar: from the left edge to the right edge (70 % of the bar = 233 % of the 30 % stripe) */
@keyframes gad-ldbar { from { transform: translateX(0); } to { transform: translateX(233.34%); } }
.gad-a .gad-cta { color: var(--g-gold); font-size: clamp(10px, 6cqi, 16px); margin-top: 4cqi; }
.gad-a:hover .gad-cta { text-shadow: 0 0 10px rgba(255, 210, 122, .7); }

/* B: night clearing */
.gad-b { flex-direction: column; justify-content: space-between; padding: 7% 6% 8%; }
.gad-b .gad-top { text-align: center; background: linear-gradient(rgba(9, 10, 19, .9), rgba(9, 10, 19, .55) 75%, transparent); margin: -7cqi -6cqi 0; padding: 7cqi 6cqi 10cqi; }
.gad-b .gad-title { font-weight: 700; color: #e9e6f5; font-size: clamp(13px, 9.4cqi, 28px); letter-spacing: .06em; line-height: 1.1; }
.gad-b .gad-title span { color: var(--g-green); }
.gad-b .gad-meta { margin-top: 3cqi; font-size: clamp(9px, 4.6cqi, 13px); color: var(--g-lav); letter-spacing: .12em; text-transform: uppercase; }
.gad-b .gad-bottom { text-align: center; background: linear-gradient(transparent, rgba(9, 10, 19, .85) 35%); margin: 0 -6cqi -8cqi; padding: 12cqi 6cqi 8cqi; }
.gad-b .gad-boss { font-size: clamp(9px, 4.8cqi, 13px); color: var(--g-text); margin-bottom: 5cqi; line-height: 1.45; }
.gad-b .gad-boss b { color: var(--g-fire); font-weight: 600; }
.gad-b .gad-cta { font-size: clamp(10px, 5.8cqi, 15px); color: var(--g-bg); background: var(--g-gold); padding: 3.5cqi 2cqi; border-radius: 2px; box-shadow: 0 0 18px rgba(255, 210, 122, .35); }
.gad-b:hover .gad-cta { background: #ffe2a6; }

/* D: combo terminal */
.gad-d {
  flex-direction: column; padding: 8% 7%; gap: 12px;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px), var(--g-bg);
}
.gad-d .gad-hd { font-size: clamp(9px, 4.6cqi, 12px); color: var(--g-green); border: 1px solid rgba(143, 227, 154, .35); padding: 2cqi 3cqi; display: flex; justify-content: space-between; letter-spacing: .1em; }
.gad-d .gad-hd span:last-child { color: rgba(143, 227, 154, .55); }
.gad-d .gad-out { flex: 1; font-size: clamp(9px, 5cqi, 14px); line-height: 1.55; white-space: pre-wrap; word-break: break-word; min-height: 0; overflow: hidden; }
.gad-out .gad-t-pr { color: rgba(143, 227, 154, .6); }
.gad-out .gad-t-fi { color: #ff9a4a; text-shadow: 0 0 8px rgba(255, 140, 60, .5); }
.gad-out .gad-t-ic { color: var(--g-ice); text-shadow: 0 0 8px rgba(77, 214, 232, .45); }
.gad-out .gad-t-el { color: #ffe85a; text-shadow: 0 0 8px rgba(255, 232, 90, .45); }
.gad-out .gad-t-big { color: #fff; font-weight: 700; letter-spacing: .08em; }
.gad-out .gad-t-kb { color: #e9e6f5; font-weight: 700; }
.gad-out .gad-t-dim { color: var(--g-lav); }
.gad-out .gad-t-ac { color: #9be35a; text-shadow: 0 0 8px rgba(155, 227, 90, .45); }
.gad-out .gad-t-dk { color: #b48cff; text-shadow: 0 0 8px rgba(160, 110, 255, .5); }
.gad-d .gad-cur { display: inline-block; width: .6em; background: var(--g-green); color: transparent; animation: gad-blink 1s steps(1) infinite; }
@keyframes gad-blink { 50% { opacity: 0; } }
.gad-d .gad-cta { font-size: clamp(10px, 5.4cqi, 15px); color: var(--g-green); border: 1px dashed rgba(143, 227, 154, .55); padding: 3.5cqi 2cqi; }
.gad-d:hover .gad-cta { background: rgba(143, 227, 154, .1); }

/* S: slim strip (90-179 px) */
.gad-s { flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0; }
.gad-s .gad-vt {
  writing-mode: vertical-rl; font-weight: 700; color: var(--g-green); text-shadow: 0 0 12px rgba(143, 227, 154, .6);
  letter-spacing: .35em; font-size: clamp(12px, 15cqi, 22px); background: rgba(9, 10, 19, .85); padding: 14px 6px; border: 1px solid rgba(143, 227, 154, .25);
}
.gad-s .gad-at { font-size: clamp(20px, 30cqi, 34px); color: var(--g-green); text-shadow: 0 0 14px rgba(143, 227, 154, .7); background: rgba(9, 10, 19, .85); width: 70%; text-align: center; border: 1px solid rgba(143, 227, 154, .25); }
.gad-s .gad-cta { margin: 0; writing-mode: vertical-rl; color: var(--g-gold); font-size: 12px; letter-spacing: .3em; background: rgba(9, 10, 19, .85); padding: 10px 4px; border: 1px solid rgba(255, 210, 122, .5); }

/* -------------------------------------------------- dashboard tile "game" (lobby.html): only below 1856 px, always
   while customising so it can be moved or removed on wide windows too */
@media (min-width: 1856px) { .gad-tile { display: none; } }
.dash.editing .gad-tile { display: block; }
.gad-tile-link { display: block; color: inherit; text-decoration: none; }
.gad-tile-link:hover { text-decoration: none; }
.gad-strip { position: relative; height: 88px; overflow: hidden; border-radius: 2px; display: grid; place-items: center; container-type: inline-size; background: var(--g-bg); }
.gad-strip > canvas.gad-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.gad-strip pre {
  position: relative; margin: 0; font-family: var(--data); color: var(--g-green); text-shadow: 0 0 10px rgba(143, 227, 154, .55); font-weight: 700;
  font-size: clamp(11px, 4.2cqi, 16px); letter-spacing: .3em; background: rgba(9, 10, 19, .86); padding: 6px 10px 6px calc(10px + .3em);
}
.gad-tile-link p { margin: 10px 0 12px; font-size: .84rem; color: var(--ui-dim, var(--muted)); }
.gad-tile-link:hover .btn.primary { background: rgba(63, 240, 176, .34); box-shadow: var(--glow-spirit); }

@media (prefers-reduced-motion: reduce) {
  .gad-a .gad-bar i, .gad-d .gad-cur { animation: none; }
}
