/* Premium polish layer: restrained, content-first, and compatible with the existing UI. */
:root {
  --premium-bg: #0d0f10;
  --premium-surface: #151819;
  --premium-surface-raised: #1a1e20;
  --premium-surface-soft: #202426;
  --premium-line: rgba(255, 255, 255, .085);
  --premium-line-strong: rgba(255, 255, 255, .14);
  --premium-text: #f3f0e9;
  --premium-text-soft: #d0d3d2;
  --premium-muted: #929b9f;
  --premium-warm: #d4b77f;
  --premium-warm-soft: #a98b59;
  --premium-shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --premium-shadow-soft: 0 10px 32px rgba(0, 0, 0, .18);
  --premium-radius-lg: 22px;
  --premium-radius-md: 16px;
  --premium-ease: cubic-bezier(.22, 1, .36, 1);
}

html { background: var(--premium-bg); }

body {
  color: var(--premium-text);
  background:
    radial-gradient(900px 430px at 50% -180px, rgba(212, 183, 127, .085), transparent 72%),
    radial-gradient(720px 420px at 96% 35%, rgba(255, 255, 255, .025), transparent 75%),
    linear-gradient(180deg, #111416 0%, var(--premium-bg) 44%, #101213 100%);
}

body::selection { color: #101213; background: #e9d5ad; }

.site-header {
  position: relative;
  z-index: 12;
  border-color: var(--premium-line) !important;
  background: rgba(16, 19, 21, .88) !important;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .16);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.header-inner { min-height: 112px; }

.brand { border-radius: 12px; }

.brand-kicker {
  color: #80898d !important;
  font-weight: 700;
  letter-spacing: .25em;
}

.brand h1 {
  color: #ead6ad !important;
  text-shadow: 0 8px 30px rgba(208, 173, 107, .12);
}

.brand-caption { color: #8d969a !important; }

.header-summary {
  border: 1px solid var(--premium-line) !important;
  background: rgba(255, 255, 255, .025) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 10px 28px rgba(0, 0, 0, .12);
  color: #aeb5b8 !important;
}

.header-summary i { background: rgba(255, 255, 255, .22) !important; }

.support-link {
  min-height: 54px;
  border-color: var(--premium-line-strong) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 12px 30px rgba(0, 0, 0, .18) !important;
  color: #eef0ef !important;
}

.support-link small { color: #8f989c !important; }
.support-link > [data-icon] { color: #d2d6d7 !important; }

main { padding-top: clamp(28px, 3.2vw, 46px); }

.feature-showcase { margin-bottom: clamp(26px, 4vw, 48px); }
.feature-toolbar { margin-bottom: 18px; }

.eyebrow {
  color: #8d969a !important;
  font-weight: 700;
  letter-spacing: .18em;
}

.feature-toolbar h2,
.catalog-title h2,
.personal-shelf-heading h2,
.related-games-heading h2 {
  color: var(--premium-text) !important;
  letter-spacing: -.015em;
}

.feature-stage {
  gap: 14px !important;
  margin-top: 20px !important;
}

.feature-stage > a {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--premium-radius-lg) !important;
  box-shadow: var(--premium-shadow-soft) !important;
  transition: transform 260ms var(--premium-ease), border-color 220ms ease, box-shadow 260ms ease !important;
}

.feature-main::after {
  background:
    linear-gradient(90deg, rgba(8, 11, 12, .92) 0%, rgba(8, 11, 12, .63) 43%, rgba(8, 11, 12, .08) 78%),
    linear-gradient(0deg, rgba(5, 7, 8, .86), transparent 58%) !important;
}

.feature-mini::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(5, 7, 8, .88) 0%, rgba(5, 7, 8, .1) 72%);
  pointer-events: none;
}

.feature-kicker,
.feature-mini-label {
  color: #e1c994 !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .4);
}

.feature-copy strong {
  color: #f6f1e7;
  font-weight: 760;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .42);
}

.feature-description { color: #c9cecf !important; }
.feature-status { color: #b8c0c2 !important; }
.feature-status i { background: var(--premium-warm-soft) !important; box-shadow: 0 0 0 5px rgba(169, 139, 89, .15) !important; }

.feature-mini strong {
  color: #f3f0e9;
  text-shadow: 0 5px 20px rgba(0, 0, 0, .45);
}

.feature-mini > span:last-child { color: #b9c0c2 !important; }

.feature-controls {
  margin-top: 12px !important;
  gap: 7px !important;
}

.feature-controls button {
  width: 38px !important;
  min-width: 38px !important;
  height: 34px !important;
  border-color: var(--premium-line-strong) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #aeb5b7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.feature-controls button:disabled { opacity: .34; }

.notice {
  border-color: rgba(212, 183, 127, .18) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(115deg, rgba(212, 183, 127, .055), transparent 32%),
    linear-gradient(135deg, #1a1c1d, #141719) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), var(--premium-shadow-soft) !important;
}

.notice::before { background: var(--premium-warm-soft) !important; }
.notice-symbol { color: var(--premium-warm) !important; }
.notice h2 { color: #e9e5dc; }

.notice-list li {
  border-color: var(--premium-line) !important;
  color: #d8d6d0 !important;
}

.notice-list li > span:not(.step-number) {
  color: #e7e3da !important;
  font-weight: 600 !important;
}

.notice-list .step-number { color: #c8aa71 !important; }

.catalog {
  padding-top: clamp(4px, 1vw, 12px);
}

.catalog-heading {
  padding-top: 26px;
  border-top: 1px solid var(--premium-line);
}

.total-count { color: #8f989b !important; border-color: var(--premium-line) !important; }

.search-field {
  border-color: var(--premium-line-strong) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #8f989c !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.search-field:focus-within {
  border-color: rgba(212, 183, 127, .55) !important;
  background: rgba(255, 255, 255, .05) !important;
  box-shadow: 0 0 0 3px rgba(212, 183, 127, .08) !important;
}

.search-field input { color: var(--premium-text) !important; }
.search-field kbd { border-color: var(--premium-line-strong) !important; color: #899296; }

.catalog-toolbar { border-color: var(--premium-line) !important; }
.filter-label,
.catalog-version-note,
.catalog-hint { color: #8f989c !important; }

.glass-radio-group,
.category-filters {
  border-color: var(--premium-line) !important;
  background: rgba(255, 255, 255, .025) !important;
}

.category-filters button,
.version-filters button {
  color: #aeb5b8 !important;
  border-color: transparent !important;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

.category-filters button:hover,
.version-filters button:hover { color: #f0f1ef !important; background: rgba(255, 255, 255, .055) !important; }

.category-filters button[aria-pressed="true"],
.version-filters button[aria-pressed="true"] {
  color: #111416 !important;
  border-color: rgba(255, 255, 255, .82) !important;
  background: #f0f1ef !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .2) !important;
}

.version-section-heading {
  border-color: var(--premium-line) !important;
}

.version-section-heading h3 { color: #e7e5df !important; }
.group-count { color: #868f93 !important; }

.game-grid { gap: 16px 17px !important; }

.game-card {
  border-color: var(--premium-line) !important;
  border-radius: var(--premium-radius-md) !important;
  background: linear-gradient(180deg, #191d1f, #151819) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16) !important;
  transition: transform 240ms var(--premium-ease), border-color 200ms ease, box-shadow 240ms ease !important;
}

.cover-wrap { background: #1d2123 !important; }
.cover-wrap::after { background: linear-gradient(0deg, rgba(5, 7, 8, .5), transparent 56%) !important; }

.cover-category {
  border-color: rgba(255, 255, 255, .14) !important;
  border-radius: 7px !important;
  background: rgba(18, 21, 22, .78) !important;
  color: #e4e5e2 !important;
  backdrop-filter: blur(8px);
}

.card-body { padding: 17px 16px 14px !important; }
.card-title-line h4 { color: #eeece6 !important; }
.card-genre { color: #a1aaad !important; }
.card-subtitle { color: #899397 !important; }
.card-resources { color: #9da5a8 !important; border-color: var(--premium-line) !important; }
.card-resources i { color: #535b5e !important; }

.card-arrow {
  border-color: var(--premium-line-strong) !important;
  background: rgba(255, 255, 255, .025) !important;
  color: #aeb5b7 !important;
}

.catalog-end span { background: var(--premium-line) !important; }
.catalog-end p { color: #727c80 !important; }

.personal-game-card,
.related-game-card {
  border-color: var(--premium-line) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #181c1e, #141718) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.personal-game-copy strong,
.related-game-copy strong { color: #ecebe6 !important; }
.personal-game-copy small,
.related-game-copy small { color: #8f989c !important; }
.personal-game-state { color: #c5a972 !important; }

.breadcrumbs { color: #808a8e !important; }
.breadcrumbs a { color: #b8bec0 !important; }

.detail-hero {
  border-color: var(--premium-line) !important;
  border-radius: var(--premium-radius-lg) !important;
  background:
    radial-gradient(500px 260px at 80% 20%, rgba(212, 183, 127, .055), transparent 70%),
    linear-gradient(135deg, #191d1f, #121516) !important;
  box-shadow: var(--premium-shadow) !important;
}

.detail-hero > img { filter: saturate(.94) contrast(1.02); }

.detail-intro .eyebrow,
.detail-category,
.panel-label { color: #aeb6b8 !important; }

.detail-intro h2 { color: #f2efe8 !important; letter-spacing: -.01em; }
#gameSummary { color: #aeb5b8 !important; line-height: 1.8; }

.detail-tags span {
  border-color: var(--premium-line) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #b8bec0 !important;
}

.bookmark-button,
.button-secondary {
  border-color: var(--premium-line-strong) !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #d4d7d7 !important;
}

.button-primary {
  border-color: #efeee9 !important;
  background: #efeee9 !important;
  color: #111416 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

.detail-tabs {
  padding: 5px !important;
  border-color: var(--premium-line) !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, .025) !important;
}

.detail-tabs button {
  min-height: 52px !important;
  border-radius: 9px !important;
  color: #9ea7aa !important;
}

.detail-tabs button:hover { color: #eef0ed !important; background: rgba(255, 255, 255, .055) !important; }

.detail-tabs button[aria-selected="true"] {
  border-color: rgba(255, 255, 255, .85) !important;
  background: #efeee9 !important;
  color: #111416 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .24) !important;
}

.tab-panel {
  border-color: var(--premium-line) !important;
  border-radius: var(--premium-radius-md) !important;
  background: linear-gradient(145deg, #181c1e, #141718) !important;
  box-shadow: var(--premium-shadow-soft) !important;
}

.panel-main h3 { color: #efede7 !important; }
.panel-description { color: #b8bec0 !important; }
.panel-main p:not(.panel-label):not(.panel-description),
.panel-steps li { color: #9fa8ab !important; }
.panel-side { border-color: var(--premium-line) !important; }
.panel-side h4 { color: #c2c7c8 !important; }

.panel-steps li::before {
  border-color: rgba(212, 183, 127, .35) !important;
  background: rgba(212, 183, 127, .06) !important;
  color: #d0b477 !important;
}

.event-image-card,
.event-plan-card {
  border-color: var(--premium-line) !important;
  background: #1a1e20 !important;
  box-shadow: var(--premium-shadow-soft) !important;
}

.event-plan-card h4 { color: #d1b77f !important; }
.event-image-card figcaption,
.event-plan-card ul { color: #adb5b8 !important; }
.event-plan-card li::marker { color: #bd9e65 !important; }

.info-dialog {
  border-color: var(--premium-line-strong) !important;
  background: #181c1e !important;
  color: #f1eee7 !important;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .7) !important;
}

.info-dialog::backdrop { background: rgba(5, 7, 8, .74) !important; backdrop-filter: blur(8px); }
.dialog-icon { color: #d3b67c !important; border-color: rgba(212, 183, 127, .35) !important; background: rgba(212, 183, 127, .07) !important; }
#dialogText { color: #aab2b5 !important; }

.site-footer { border-color: var(--premium-line) !important; color: #778185 !important; }
.footer-wordmark { color: #b6bcbd !important; }

@media (hover: hover) {
  .support-link:hover {
    border-color: rgba(212, 183, 127, .36) !important;
    background: linear-gradient(145deg, rgba(212, 183, 127, .09), rgba(255, 255, 255, .035)) !important;
    transform: translateY(-1px);
  }

  .feature-stage > a:hover {
    border-color: rgba(255, 255, 255, .18) !important;
    box-shadow: 0 26px 64px rgba(0, 0, 0, .32) !important;
    transform: translateY(-2px) scale(1.006) !important;
  }

  .feature-controls button:hover:not(:disabled) {
    border-color: rgba(212, 183, 127, .34) !important;
    background: rgba(212, 183, 127, .09) !important;
    color: #e7d7b7 !important;
  }

  .game-card:hover {
    border-color: rgba(255, 255, 255, .17) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .3) !important;
    transform: translateY(-3px) !important;
  }

  .game-card:hover img { transform: scale(1.025) !important; }

  .game-card:hover .card-title-line h4 { color: #fff !important; }
  .game-card:hover .card-arrow { border-color: #eeeae1 !important; background: #eeeae1 !important; color: #111416 !important; }

  .personal-game-card:hover,
  .related-game-card:hover {
    border-color: rgba(255, 255, 255, .16) !important;
    background: #1d2123 !important;
    transform: translateY(-2px);
  }

  .button-primary:hover { background: #fff !important; border-color: #fff !important; transform: translateY(-1px); }
  .button-secondary:hover,
  .bookmark-button:hover { border-color: rgba(212, 183, 127, .36) !important; background: rgba(212, 183, 127, .08) !important; color: #eadaba !important; }
}

@media (max-width: 760px) {
  .site-header { box-shadow: 0 8px 28px rgba(0, 0, 0, .16); }
  .header-inner { min-height: 86px; }
  main { padding-top: 20px; }
  .feature-showcase { margin-bottom: 26px; }
  .feature-stage { margin-top: 12px !important; }
  .feature-stage > a { border-radius: 16px !important; }
  .feature-controls { margin-top: 9px !important; }
  .notice { border-radius: 14px !important; box-shadow: none !important; }
  .catalog-heading { padding-top: 21px; }
  .search-field { width: 100%; }
  .game-grid { gap: 11px 10px !important; }
  .game-card { border-radius: 13px !important; box-shadow: none !important; }
  .card-body { padding: 11px 12px 9px !important; }
  .detail-hero { border-radius: 16px !important; box-shadow: 0 16px 42px rgba(0, 0, 0, .24) !important; }
  .detail-intro { padding: 22px 19px !important; }
  .detail-tabs { margin-top: 18px !important; }
  .detail-tabs button { min-height: 62px !important; }
  .tab-panel { border-radius: 14px !important; box-shadow: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Game details: keep the cover intact while bringing the four actions into the first screen. */
.detail-hero { grid-template-columns: minmax(0, 35%) minmax(0, 1fr); }
.detail-hero > img { height: auto; min-height: 0; aspect-ratio: 1; object-fit: cover; }
.detail-intro { padding: clamp(24px, 3vw, 42px); }

/* Event information is scannable first; artwork opens at its original aspect ratio. */
.event-content-section { margin-top: 26px; }
.event-content-section + .event-content-section {
  border-top: 1px solid var(--premium-line);
  padding-top: 26px;
}
.event-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.event-section-heading h4 { margin: 0; color: #e9e4d9; font-size: 18px; font-weight: 700; }
.event-section-heading span { color: #aeb6b8; font-size: 12px; }
.event-plan { margin-top: 14px; align-items: stretch; }
.event-plan-card,
.event-plan-card:first-child,
.event-plan-card:nth-child(2),
.event-plan-card:last-child { grid-column: auto; }
.event-plan-card:only-child { grid-column: 1 / -1; }
.event-plan-card h5 { margin: 0 0 9px; color: #d1b77f; font-size: 15px; line-height: 1.45; }
.event-plan-card ul { padding-left: 18px; }
.event-image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.event-image-card {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.event-image-card:hover { border-color: rgba(212, 183, 127, .5) !important; transform: translateY(-2px); }
.event-image-card:focus-visible { outline: 2px solid #d1b77f; outline-offset: 3px; }
.event-image-preview { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: #101416; }
.event-image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.event-image-caption { display: grid; gap: 5px; padding: 12px 14px 14px; }
.event-image-caption strong { color: #e9e5dd; font-size: 13px; line-height: 1.45; }
.event-image-caption small { color: #aeb6b8; font-size: 11px; }
.event-viewer {
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--premium-line-strong);
  border-radius: 14px;
  background: #171b1d;
  color: #eeeae2;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
}
.event-viewer::backdrop { background: rgba(5, 8, 10, .82); }
.event-viewer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 8px 10px 8px 20px;
  border-bottom: 1px solid var(--premium-line);
  background: #1b2022;
}
.event-viewer-header strong { font-size: 14px; line-height: 1.5; }
.event-viewer-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 9px; background: #292f32; color: #eeeae2; cursor: pointer; }
.event-viewer-close:hover { background: #3b4347; }
.event-viewer-close:focus-visible { outline: 2px solid #d1b77f; outline-offset: 2px; }
.event-viewer-close svg { width: 20px; height: 20px; }
.event-viewer > img { display: block; width: 100%; height: auto; }

@media (max-width: 760px) {
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero > img { aspect-ratio: 16 / 9; }
  .event-content-section { margin-top: 20px; }
  .event-content-section + .event-content-section { padding-top: 20px; }
  .event-plan,
  .event-image-gallery { grid-template-columns: 1fr; }
  .event-section-heading h4 { font-size: 16px; }
  .event-image-preview { aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  .event-image-card:hover { transform: none; }
}

/* Shorter catalog on desktop; preserve the current tablet and phone cards. */
@media (min-width: 1101px) {
  .game-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 14px !important; }
  .card-body { padding: 11px 13px 9px !important; }
  .card-subtitle { margin-bottom: 6px; }
}

/* A restrained color flow for key titles, without flashing the body text. */
#recommendedTitle,
#catalogTitle,
#gameTitle,
.panel-main h3 {
  color: #e8d7bd !important;
  text-shadow: none !important;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  #recommendedTitle,
  #catalogTitle,
  #gameTitle,
  .panel-main h3 {
    background-image: linear-gradient(105deg, #f2eee5 0%, #dfbd82 28%, #cfabcc 57%, #f2eee5 84%, #dfbd82 100%);
    background-size: 220% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  @media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
    #recommendedTitle,
    #catalogTitle,
    #gameTitle { animation: title-color-flow 10s ease-in-out infinite alternate; }
  }
}

.panel-description .invite-code-highlight {
  color: #a01532;
  background: #fff0f3;
  border: 1px solid #f5a7b8;
  border-radius: 6px;
  padding: 3px 9px;
  margin: 2px 3px;
  display: inline-block;
  font-weight: 800;
  font-size: 1.1em;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

@keyframes title-color-flow {
  to { background-position: 100% 50%; }
}

.version-section-heading h3,
.event-section-heading h4 { color: #d9bd8d !important; }
.detail-intro .eyebrow,
.panel-label { color: #c7b1ce !important; }

@media (hover: hover) {
  .game-card:hover .card-title-line h4,
  .game-card:focus-visible .card-title-line h4 { color: #e8c98f !important; }
}
