/*
 * FROSTFIRE NIGHT — "Frosted Glass" (r547 redesign)
 * ---------------------------------------------------------------------------
 * This is NOT a recolour of Celestial Night. It is a different design language:
 *
 *   Celestial            Frostfire
 *   -----------------    -------------------------------------------------
 *   Georgia serif        monospace, uppercase, wide tracking
 *   carved arch corners  sharp 0–2px corners, 45° cut (clip-path) on one side
 *   opaque navy + gold   translucent frosted glass over a hairline lattice
 *   gold filigree        ❄ / ◇ marks, chevrons, 1px double rules
 *   floating nav pill    full-width nav split into cells by hairlines
 *   3 separate stat cards  one continuous hairline strip with dividers
 *   art behind the text  art inside a clipped rhombus panel on the right
 *
 * Rules: paint + geometry only. No board, pawn, die, pip, coin-value or
 * interaction selector is touched. Everything is scoped to the theme.
 */

html[data-cosmetic-theme="frostfire"] {
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  --ff-hair: rgba(178, 228, 250, .26);
  --ff-hair-strong: rgba(214, 245, 255, .55);
  --ff-ink: #e8f8ff;
  --ff-ink-soft: #9dc0d3;
  --ff-glass: rgba(150, 214, 240, .07);
  --ff-glass-2: rgba(150, 214, 240, .11);
  --ff-frost: #bfeaff;
  --ff-deep: #061019;
}

/* ── base shell: hairline lattice instead of a night sky ────────────────── */
html[data-cosmetic-theme="frostfire"] body.app-body {
  background-color: var(--ff-deep);
  color: var(--ff-ink);
}
html[data-cosmetic-theme="frostfire"] .app-shell {
  background:
    linear-gradient(180deg, rgba(6, 16, 25, .96), rgba(4, 11, 18, .99));
  box-shadow: none;
}
html[data-cosmetic-theme="frostfire"] .screen:not(#screen-game) {
  background-image:
    repeating-linear-gradient(0deg, rgba(150, 214, 240, .055) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(150, 214, 240, .055) 0 1px, transparent 1px 34px),
    radial-gradient(circle at 82% 4%, rgba(96, 180, 220, .16), transparent 55%);
  background-attachment: local, local, local;
}
/* বরফকণা: সূক্ষ্ম বিন্দু, কোনো বড় আভা নয় */
html[data-cosmetic-theme="frostfire"] #screen-home .home-fx-orb-a,
html[data-cosmetic-theme="frostfire"] #screen-home .home-fx-orb-b {
  background: radial-gradient(circle at 50% 50%, rgba(190, 240, 255, .1), transparent 62%);
  filter: blur(6px);
}
html[data-cosmetic-theme="frostfire"] #screen-home .home-fx-grid {
  background-image:
    repeating-linear-gradient(0deg, rgba(190, 240, 255, .05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(190, 240, 255, .05) 0 1px, transparent 1px 22px);
  opacity: 1;
}

/* ── header: a flat instrument panel, square, hairline-ruled ───────────── */
html[data-cosmetic-theme="frostfire"] .app-header {
  height: 62px;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(12, 30, 44, .96), rgba(6, 16, 25, .92));
  border-bottom: 1px solid var(--ff-hair);
  box-shadow: 0 1px 0 rgba(220, 248, 255, .1);
}
html[data-cosmetic-theme="frostfire"] .player-pill {
  border-radius: 0;
  border: 1px solid var(--ff-hair);
  background: var(--ff-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
html[data-cosmetic-theme="frostfire"] .player-name,
html[data-cosmetic-theme="frostfire"] .player-pill .uid,
html[data-cosmetic-theme="frostfire"] .player-pill small {
  font-family: var(--ff-mono);
  letter-spacing: .6px;
  text-transform: uppercase;
  font-size: 10px;
}
html[data-cosmetic-theme="frostfire"] .token-balance-chip {
  border-radius: 0;
  border: 1px solid var(--ff-hair);
  background: var(--ff-glass);
  font-family: var(--ff-mono);
  letter-spacing: .5px;
}
html[data-cosmetic-theme="frostfire"] .btn-sound-icon {
  border-radius: 0;
  border: 1px solid var(--ff-hair);
  background: var(--ff-glass);
}

/* ── nav: split into cells by hairlines (no floating pill) ─────────────── */
html[data-cosmetic-theme="frostfire"] .bottom-nav-bar {
  height: 60px;
  margin: 0 10px 10px;
  padding: 0;
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: rgba(8, 20, 30, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -1px 0 rgba(220, 248, 255, .1), 0 12px 26px rgba(0, 6, 12, .5);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
html[data-cosmetic-theme="frostfire"] .b-tab:not(.b-tab-profile) {
  min-height: 58px;
  padding: 4px 2px 6px;
  border-right: 1px solid rgba(178, 228, 250, .16);
  border-radius: 0;
  color: var(--ff-ink-soft);
}
html[data-cosmetic-theme="frostfire"] .b-tab:last-child { border-right: 0; }
html[data-cosmetic-theme="frostfire"] .b-tab:not(.b-tab-profile) .bt-label {
  font-family: var(--ff-mono);
  font-size: 8.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
html[data-cosmetic-theme="frostfire"] .b-tab:not(.b-tab-profile) .bt-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  color: #a8cfe2;
}
html[data-cosmetic-theme="frostfire"] .b-tab:not(.b-tab-profile).active {
  color: var(--ff-ink);
  background: linear-gradient(180deg, rgba(190, 240, 255, .16), rgba(190, 240, 255, .02));
  box-shadow: inset 0 2px 0 var(--ff-hair-strong);
}
html[data-cosmetic-theme="frostfire"] .b-tab:not(.b-tab-profile).active .bt-icon {
  border-color: var(--ff-hair-strong);
  background: rgba(190, 240, 255, .12);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(150, 225, 255, .35);
}

/* ── home hero: text on glass, art inside a clipped rhombus panel ──────── */
html[data-cosmetic-theme="frostfire"] #screen-home { padding: 12px 12px 22px; gap: 10px; }
html[data-cosmetic-theme="frostfire"] .home-welcome-card {
  position: relative;
  min-height: 218px;
  padding: 20px 16px 30px;
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(190, 240, 255, .1), rgba(6, 22, 34, .25) 55%, rgba(4, 12, 20, .6)),
    rgba(8, 24, 36, .55);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(230, 250, 255, .22), 0 14px 28px rgba(0, 6, 12, .45);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  overflow: hidden;
}
/* আর্ট: ডান দিকে আলাদা তির্যক প্যানেল (পুরো কার্ডের ব্যাকগ্রাউন্ড নয়) */
html[data-cosmetic-theme="frostfire"] .home-welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  background: url('/images/cosmetics/theme-frostfire.webp') 62% 42% / cover no-repeat;
  clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .85;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 42%);
  mask-image: linear-gradient(90deg, transparent, #000 42%);
}
/* r556 — owner: "হোম স্ক্রিনে এই লেখা কেন?" — থিমের নাম-স্ট্যাম্প বাদ */
html[data-cosmetic-theme="frostfire"] .home-welcome-card::after {
  content: none;
  display: none;
  position: absolute;
  left: 16px;
  bottom: 8px;
  display: block;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ff-frost);
  font-family: var(--ff-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1;
  opacity: .9;
  animation: none;
}
html[data-cosmetic-theme="frostfire"] .home-welcome-shine { display: none; }
html[data-cosmetic-theme="frostfire"] .home-welcome-copy { position: relative; z-index: 1; max-width: 56%; }
html[data-cosmetic-theme="frostfire"] .home-kicker {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ff-frost);
  border-bottom: 1px solid var(--ff-hair);
  padding-bottom: 5px;
}
html[data-cosmetic-theme="frostfire"] .home-welcome-copy h1 {
  font-family: var(--ff-mono);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.2px;
  text-transform: uppercase;
}
html[data-cosmetic-theme="frostfire"] .home-welcome-copy h1 span { font-family: inherit; color: #ffffff; }
html[data-cosmetic-theme="frostfire"] .home-welcome-copy p:not(.ls-tagline) {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ff-ink-soft);
}
html[data-cosmetic-theme="frostfire"] .home-welcome-copy .ls-tagline {
  font-family: var(--ff-mono);
  font-size: 8.5px;
  letter-spacing: .4px;
  color: #a9d5e8;
}

/* ── stats: one hairline strip with dividers, not three cards ──────────── */
html[data-cosmetic-theme="frostfire"] .home-stats-strip {
  gap: 0;
  padding: 0;
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: var(--ff-glass);
  overflow: hidden;
}
html[data-cosmetic-theme="frostfire"] .home-stat-item {
  flex: 1 1 0;
  padding: 9px 6px 10px;
  border-right: 1px solid rgba(178, 228, 250, .18);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-cosmetic-theme="frostfire"] .home-stat-item:last-child { border-right: 0; }
html[data-cosmetic-theme="frostfire"] .home-stat-item:first-child {
  background: linear-gradient(180deg, rgba(190, 240, 255, .12), transparent);
  box-shadow: inset 0 2px 0 var(--ff-hair-strong);
}
html[data-cosmetic-theme="frostfire"] .home-stat-item small {
  font-family: var(--ff-mono);
  font-size: 7.5px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #8fb4c8;
}
html[data-cosmetic-theme="frostfire"] .home-stat-item strong {
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: -.3px;
  color: var(--ff-ink);
}
html[data-cosmetic-theme="frostfire"] .home-stat-icon { font-size: 13px; filter: grayscale(.25); }

/* ── section headings: chevron + hairline rule ─────────────────────────── */
html[data-cosmetic-theme="frostfire"] .home-section-heading,
html[data-cosmetic-theme="frostfire"] .section-heading {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ff-ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ff-hair);
}
html[data-cosmetic-theme="frostfire"] .home-section-heading::before,
html[data-cosmetic-theme="frostfire"] .section-heading::before {
  content: '›  ';
  color: var(--ff-frost);
  font-family: var(--ff-mono);
}
html[data-cosmetic-theme="frostfire"] .home-section-heading::after { content: ''; }

/* ── mode cards: glass tiles with a cut corner, no drop shadow stack ───── */
html[data-cosmetic-theme="frostfire"] .home-mode-grid { gap: 9px; }
html[data-cosmetic-theme="frostfire"] .home-mode-card,
html[data-cosmetic-theme="frostfire"] .mode-card,
html[data-cosmetic-theme="frostfire"] .room-pill,
html[data-cosmetic-theme="frostfire"] .match-summary-card,
html[data-cosmetic-theme="frostfire"] .play-panel {
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: var(--ff-glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(230, 250, 255, .14);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
/* কার্ডের গঠনই আলাদা: রো লেআউট, আইকন-টেক্সট-তীর এক লাইনে */
html[data-cosmetic-theme="frostfire"] .home-mode-card {
  min-height: 96px;
  padding: 13px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  text-align: left;
}
html[data-cosmetic-theme="frostfire"] .home-mode-copy { align-items: flex-start; text-align: left; gap: 3px; }
html[data-cosmetic-theme="frostfire"] .home-mode-arrow { margin-left: auto; }
html[data-cosmetic-theme="frostfire"] .home-mode-card::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--ff-hair-strong);
  border-right: 1px solid var(--ff-hair-strong);
  background: none;
  border-radius: 0;
  opacity: .8;
}
html[data-cosmetic-theme="frostfire"] .home-mode-friends { background: var(--ff-glass-2); }
html[data-cosmetic-theme="frostfire"] .home-mode-copy strong {
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ff-ink);
}
html[data-cosmetic-theme="frostfire"] .home-mode-copy small { color: var(--ff-ink-soft); font-size: 9.5px; line-height: 1.4; }
html[data-cosmetic-theme="frostfire"] .home-mode-icon,
html[data-cosmetic-theme="frostfire"] .home-mode-friends .home-mode-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: rgba(190, 240, 255, .1);
  color: var(--ff-frost);
  box-shadow: none;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
html[data-cosmetic-theme="frostfire"] .home-mode-arrow {
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: transparent;
  color: var(--ff-frost);
  width: 22px;
  height: 22px;
}

/* ── buttons: sharp, mono, chevron edge ────────────────────────────────── */
html[data-cosmetic-theme="frostfire"] .btn-play-hero,
html[data-cosmetic-theme="frostfire"] .home-mode-cta,
html[data-cosmetic-theme="frostfire"] .shop-theme-action,
html[data-cosmetic-theme="frostfire"] .vault-theme-action {
  border: 1px solid var(--ff-hair-strong);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(214, 245, 255, .95), rgba(150, 210, 235, .82));
  color: #04141f;
  font-family: var(--ff-mono);
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
html[data-cosmetic-theme="frostfire"] .btn-play-hero:active,
html[data-cosmetic-theme="frostfire"] .home-mode-cta:active { transform: translateY(1px); }

/* ── store & vault: gallery shelves with hairline frames ──────────────── */
html[data-cosmetic-theme="frostfire"] .shop-title,
html[data-cosmetic-theme="frostfire"] .vault-title {
  font-family: var(--ff-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}
html[data-cosmetic-theme="frostfire"] .shop-head { align-items: center; padding: 2px 0 0; }
html[data-cosmetic-theme="frostfire"] .shop-feature:not(.is-theme-feature),
html[data-cosmetic-theme="frostfire"] .shop-feature.is-theme-feature,
html[data-cosmetic-theme="frostfire"] .hero-event-banner {
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(190, 240, 255, .08), rgba(6, 20, 30, .5));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
html[data-cosmetic-theme="frostfire"] .sf-title,
html[data-cosmetic-theme="frostfire"] .heb-title {
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: .8px;
  text-transform: uppercase;
}
html[data-cosmetic-theme="frostfire"] .shop-tabs { gap: 0; border-bottom: 1px solid var(--ff-hair); }
html[data-cosmetic-theme="frostfire"] .shop-tab,
html[data-cosmetic-theme="frostfire"] .vault-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 0;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #8fb4c8;
  background: transparent;
}
html[data-cosmetic-theme="frostfire"] .shop-tab.is-active,
html[data-cosmetic-theme="frostfire"] .vault-tab.is-active {
  color: #04141f;
  background: linear-gradient(180deg, #d9f6ff, #9fd4ec);
  border-color: var(--ff-hair-strong);
  box-shadow: none;
}
html[data-cosmetic-theme="frostfire"] .shop-card {
  border: 1px solid rgba(178, 228, 250, .18);
  border-radius: 0;
  background: rgba(150, 214, 240, .05);
  box-shadow: none;
}
html[data-cosmetic-theme="frostfire"] .shop-card .sc-art {
  border: 1px solid rgba(178, 228, 250, .14);
  border-radius: 0;
}
html[data-cosmetic-theme="frostfire"] .shop-theme-card,
html[data-cosmetic-theme="frostfire"] .vault-theme-card {
  border-radius: 0;
  border-color: var(--ff-hair);
}
html[data-cosmetic-theme="frostfire"] .vault-sheet {
  border-radius: 0;
  border: 1px solid var(--ff-hair);
  background: linear-gradient(180deg, rgba(10, 26, 38, .99), rgba(4, 12, 20, .99));
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% 100%, 0 100%);
}
html[data-cosmetic-theme="frostfire"] .vault-head {
  padding-top: 16px;
  border-bottom: 1px solid var(--ff-hair);
}
html[data-cosmetic-theme="frostfire"] .vault-tabs { padding-top: 10px; }
html[data-cosmetic-theme="frostfire"] .name-modal-box,
html[data-cosmetic-theme="frostfire"] .match-search-modal,
html[data-cosmetic-theme="frostfire"] .sc-cf-card,
html[data-cosmetic-theme="frostfire"] .gift-review-card {
  border-radius: 0;
  border: 1px solid var(--ff-hair);
  background: rgba(8, 22, 34, .97);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

/* ── floating controls ────────────────────────────────────────────────── */
html[data-cosmetic-theme="frostfire"] #vault-fab,
html[data-cosmetic-theme="frostfire"] #friends-fab {
  border: 1px solid var(--ff-hair);
  border-radius: 0;
  background: rgba(10, 28, 40, .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 6, 12, .45);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

@media (max-width: 360px) {
  html[data-cosmetic-theme="frostfire"] .home-welcome-copy { max-width: 62%; }
  html[data-cosmetic-theme="frostfire"] .home-welcome-copy h1 { font-size: 17px; }
  html[data-cosmetic-theme="frostfire"] .home-mode-card { min-height: 142px; padding: 10px; }
}
@media (max-height: 640px) {
  html[data-cosmetic-theme="frostfire"] .home-stats-strip { margin-right: 58px; }
  html[data-cosmetic-theme="frostfire"] #screen-home { padding-bottom: 140px; }
}
