/* Generated into /css/templates.css by web/sitegen/templates.js - edit web/sitegen/templates-gallery/templates.css.
   The app template gallery. Uses the site's Volt Carbon variables (style.css); the only colours of its
   own are the per-category hues the app's gallery uses, passed in as --hue. */

.tg-hero h1 { max-width: 820px; }

/* ---------- gallery tools ---------- */
.tg-gallery { padding-bottom: 64px; }
.tg-tools { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 12px; }
.tg-search {
    display: flex; align-items: center; gap: 10px; max-width: 560px;
    background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; padding: 0 12px;
    color: var(--text-muted);
}
.tg-search:focus-within { border-color: var(--primary); }
.tg-search input {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text-primary);
    font: 400 15px/1.4 var(--font-primary); padding: 12px 0;
}
.tg-search input::placeholder { color: var(--text-muted); }
.tg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-chip {
    --hue: var(--primary);
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font: 500 13.5px/1 var(--font-primary); color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 999px; padding: 8px 13px;
}
.tg-chip span { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.tg-chip:hover { color: var(--text-primary); border-color: var(--text-muted); }
.tg-chip[aria-pressed="true"] { color: var(--bg-dark); background: var(--primary); border-color: var(--primary); }
.tg-chip[aria-pressed="true"] span { color: var(--bg-dark); }
.tg-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tg-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin: 4px 0 14px; }
.tg-empty { color: var(--text-secondary); padding: 32px 0; }

/* ---------- cards ---------- */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tg-card {
    display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--card-radius);
    transition: border-color .15s, transform .15s;
}
.tg-card .tg-card-body { padding: 12px 14px 16px; }
/* The preview: the template's own screenshot, a 9:16 window shown as 3:4 (the middle of the screen). */
.tg-shot { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #000; }
.tg-shot picture, .tg-shot img { display: block; width: 100%; height: 100%; }
.tg-shot img { object-fit: cover; object-position: 50% 40%; }
.tg-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tg-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tg-card[hidden] { display: none; }
.tg-tile {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font: 700 22px/1 var(--font-display); color: #fff;
    background: linear-gradient(145deg, var(--hue), color-mix(in srgb, var(--hue) 55%, #000));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.tg-tile-lg { width: 64px; height: 64px; font-size: 28px; border-radius: 18px; }
.tg-card-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tg-cat {
    --hue: var(--text-muted);
    align-self: flex-start; font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
    color: color-mix(in srgb, var(--hue) 45%, #fff); background: color-mix(in srgb, var(--hue) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--hue) 45%, transparent); border-radius: 999px; padding: 4px 8px;
}
.tg-card-title { font-family: var(--font-display); font-size: 16.5px; line-height: 1.3; color: var(--text-primary); margin: 2px 0 0; }
.tg-card-desc {
    font-size: 13.5px; line-height: 1.5; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tg-feats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tg-feats span {
    font: 500 11px/1 var(--font-primary); color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 6px;
}

/* ---------- one template ---------- */
.tg-detail { padding-top: 18px; padding-bottom: 40px; }
.tg-detail-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 48px; align-items: start; }
.tg-stage-col { position: sticky; top: 84px; }
.tg-stage { position: relative; }
.tg-phone {
    width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 9 / 18.5;
    border: 10px solid #1c1c20; border-radius: 34px; overflow: hidden; background: #000;
    box-shadow: 0 0 0 1px var(--border-color), var(--shadow-lg);
}
.tg-phone { position: relative; }
.tg-phone iframe { position: relative; display: block; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity .3s; }
/* The screenshot stands in for the demo until the frame has loaded (it is lazy below the fold). */
.tg-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.tg-phone.is-loaded iframe { opacity: 1; }
.tg-demo-note { font-size: 12.5px; color: var(--text-muted); text-align: center; max-width: 380px; margin: 12px auto 0; }
.tg-exit {
    position: absolute; top: 12px; right: 12px; z-index: 2; cursor: pointer;
    font: 600 13px/1 var(--font-primary); color: #fff; background: rgba(0,0,0,.72);
    border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 10px 14px;
}
.tg-exit[hidden] { display: none; }
/* Full screen: the Fullscreen API where the browser has it, an expanded view where it does not (iPhone
   Safari cannot put an iframe in full screen); both show the same frame at the size of the screen. */
.tg-stage:fullscreen, .tg-stage.is-expanded { background: #000; display: flex; align-items: stretch; justify-content: center; }
.tg-stage.is-expanded { position: fixed; inset: 0; z-index: 10000; }
.tg-stage:fullscreen .tg-phone, .tg-stage.is-expanded .tg-phone { max-width: none; aspect-ratio: auto; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
html.tg-no-scroll, html.tg-no-scroll body { overflow: hidden; }

.tg-info h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 14px 0 10px; }
.tg-info h2 { font-family: var(--font-display); font-size: 18px; margin: 28px 0 10px; }
.tg-head { display: flex; align-items: center; gap: 14px; }
.tg-head .tg-cat { align-self: center; }
.tg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tg-muted { color: var(--text-muted); font-size: 14px; }
.tg-play-note { margin-top: 10px; }
.tg-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tg-list li {
    font-size: 13.5px; color: var(--text-secondary); background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 10px;
}
.tg-more { padding-bottom: 64px; }
.tg-more h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 14px; }
.tg-all { display: inline-block; margin-top: 16px; color: var(--primary); }

/* ---------- games ---------- */
.tg-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-play-badge {
    align-self: center; font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
    color: var(--bg-dark); background: var(--primary); border-radius: 999px; padding: 4px 8px;
}
.tg-chip-play { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.tg-shelf { padding: 8px 0 28px; }
.tg-shelf h2, .tg-gallery > h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; }
.tg-gallery > h2 { margin-top: 12px; }
.tg-shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.tg-game {
    display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--card-radius);
    transition: border-color .15s, transform .15s;
}
.tg-game:hover, .tg-game:focus-visible { border-color: var(--primary); transform: translateY(-2px); }
.tg-game .tg-shot { aspect-ratio: 9 / 16; }
.tg-game .tg-game-play { position: absolute; right: 10px; bottom: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.tg-game-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px 12px; }
.tg-game-title { font: 600 15px/1.25 var(--font-display); color: var(--text-primary); }
.tg-game-genre { font-size: 12.5px; color: var(--text-muted); }
.tg-game-play { font: 700 12px/1 var(--font-primary); color: var(--bg-dark); background: var(--primary); border-radius: 999px; padding: 8px 12px; }
button.tg-all { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.tg-more-links { display: flex; flex-wrap: wrap; gap: 18px; }
.tg-more-links .tg-all { margin-top: 16px; }
.tg-howto-box { margin-top: 26px; padding: 4px 18px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--card-radius); }
.tg-howto-box h2 { margin-top: 14px; }
.tg-howto-box h3 { font: 600 13px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 6px; }
.tg-howto-box p { color: var(--text-secondary); }
.tg-howto { margin: 0; padding-left: 18px; color: var(--text-secondary); font-size: 14.5px; }
.tg-howto li { margin: 3px 0; }
.tg-btn-play { font-size: 16px; padding-left: 26px; padding-right: 26px; }

@media (max-width: 860px) {
    /* A game's page leads with the game itself. */
    .tg-detail.is-game .tg-stage-col { order: 0; }
    .tg-detail.is-game .tg-info { order: 1; }
    .tg-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .tg-stage-col { position: static; order: 2; }
    .tg-info { order: 1; }
    .tg-phone { max-width: 340px; }
}
@media (max-width: 420px) {
    .tg-grid { grid-template-columns: minmax(0, 1fr); }
    .tg-actions .btn { flex: 1 1 100%; text-align: center; }
}
