/* Shared presentation language. Game boards and payment behaviour are independent. */
:root {
  --ui-surface: #101e18;
  --ui-line: #c8d4ad24;
  --ui-gold: #d4b876;
  --ui-muted: #abb8ac;
  --ui-radius: 18px;
  --ui-fast: 180ms;
  --ui-enter: 360ms;
  --ui-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}
body > main {
  min-width: 0;
  width: 100%;
  max-width: 1600px;
}

.filter-bar,
.resume-list {
  overscroll-behavior-x: contain;
}

.hero {
  min-height: 480px;
  border-color: var(--ui-line);
  border-radius: 22px;
}
.hero .hero-copy {
  width: 58%;
  padding: 44px 40px 30px;
}
.hero h1 {
  font-size: clamp(36px, 3.6vw, 58px);
  letter-spacing: -1.8px;
}
.hero-description {
  font-size: 14px;
  color: var(--ui-muted);
}
.hero .hero-tag {
  bottom: 96px;
  border-color: #d4b87644;
}

.hero-bottom {
  margin-top: auto;
  margin-bottom: 16px;
}
.hero-bottom .hero-controls button {
  width: 44px;
  height: 44px;
}
.hero-dot {
  min-width: 16px;
}
.ticker {
  display: block;
}
#games {
  margin-top: 40px;
  scroll-margin-top: 100px;
}
#games > .section-heading {
  margin-bottom: 18px;
}
#games > .section-heading h2 {
  font-size: clamp(26px, 3vw, 38px);
}
#games > .section-heading h2 span {
  color: #d3dfce;
  font-weight: 650;
}
#games .small-badge {
  color: var(--ui-muted);
  background: none;
  border: 0;
  font-size: 12px;
}
.filter-bar {
  gap: 8px;
  margin-bottom: 24px;
}
.filter-bar .filter {
  min-height: 44px;
  border-radius: 24px;
  font-size: 13px;
}
.filter-bar .filter.active {
  background: #253522;
  border-color: #b4c78a66;
  color: #dcf1ad;
}
.board-lobby,
.card-lobby {
  margin: 0 0 40px;
}
.board-lobby-grid,
.card-lobby-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.card-collection-heading {
  margin: 0 0 18px;
  align-items: center;
}
.card-collection-heading h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.6px;
}
.card-collection-heading > span {
  color: var(--ui-muted);
}
.strategy-card {
  --card-accent: #c3fa4c !important;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: 0 12px 24px #0002;
}
.strategy-card .strategy-art {
  aspect-ratio: 4/5;
  height: auto;
}
.strategy-card .strategy-cover {
  filter: saturate(0.9);
  transition: transform 700ms var(--ui-ease);
}
.strategy-card .strategy-art:after {
  background:
    linear-gradient(0deg, #101e18, #101e1855 24%, transparent 50%),
    linear-gradient(#06100c44, transparent 25%);
}
.strategy-card .strategy-art-name {
  left: 22px;
  bottom: 18px;
  font-size: clamp(26px, 2.8vw, 38px);
  letter-spacing: -0.8px;
}
.strategy-card .strategy-copy {
  padding: 0 22px 20px !important;
}
.strategy-card .strategy-copy > .eyebrow,
.strategy-card .strategy-bottom > span {
  display: none;
}
.strategy-card .strategy-copy > p {
  color: #b8c5b9;
  margin: 4px 0 18px;
  min-height: 38px;
  font-size: 14px;
  line-height: 1.45;
}
.strategy-card .strategy-bottom {
  border: 0;
  padding: 0;
}
.strategy-card .strategy-bottom > button {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 10px 16px;
  box-shadow: none;
}
.strategy-card .strategy-mode {
  top: 14px;
  left: 14px;
  font-size: 10px;
  letter-spacing: 0.7px;
  padding: 7px 8px;
  border: 0;
}
.strategy-card .strategy-favorite {
  position: absolute;
  width: 44px;
  height: 44px;
  top: 10px;
  right: 10px;
  border-color: #d4b87650;
}
.arcade-card .strategy-cover {
  object-fit: cover;
  object-position: center;
}
.arcade-card .strategy-art-name {
  font-style: italic;
  letter-spacing: -1.5px;
}
.arcade-card .strategy-art-name em {
  color: var(--ui-gold);
}
.strategy-favorite svg {
  width: 20px;
  height: 20px;
}
.strategy-favorite[aria-pressed='true'] {
  color: #d9c18b;
  background: #283326;
}
.strategy-card:hover {
  transform: none;
}
@media (hover: hover) and (pointer: fine) {
  .strategy-card:hover,
  .strategy-card:focus-within {
    transform: translateY(-5px);
    border-color: #d4b87677;
    box-shadow: 0 20px 40px #0005;
  }
}
.strategy-card:active {
  transform: scale(0.99);
}
.card-category-entry {
  min-height: 220px;
  border-radius: var(--ui-radius);
  border-color: var(--ui-line);
}
.card-category-copy {
  padding: 30px;
  gap: 14px;
}
.card-category-copy strong {
  font-size: clamp(25px, 3vw, 36px);
}
.card-category-copy small {
  color: var(--ui-gold);
}
.card-category-back {
  min-height: 44px;
  padding: 8px 0;
}
#categories {
  margin-top: 56px;
}
.category-card {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
}
.category-caption {
  color: #d9c493;
}
.tournament-banner {
  border-color: var(--ui-line);
  border-radius: 22px;
}

/* Resume cards contain only public summaries; existing game flows handle the action. */
.lobby-resume {
  margin: 30px 0 0;
  padding: 22px 24px;
  border: 1px solid #d4b87638;
  border-radius: var(--ui-radius);
  background: linear-gradient(110deg, #25331e66, #101e18);
}
.lobby-resume[hidden] {
  display: none;
}
.resume-heading .eyebrow {
  color: var(--ui-gold);
  font-size: 10px;
}
.resume-heading h2 {
  font-size: 20px;
  margin: 7px 0 16px;
  letter-spacing: -0.4px;
}
.resume-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
}
.resume-game {
  flex: 0 0 330px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--ui-line);
  background: #0b1711;
  border-radius: 12px;
  text-align: left;
  color: #edf4e8;
  scroll-snap-align: start;
}
.resume-game img {
  border-radius: 7px;
  width: 44px;
  height: 54px;
  object-fit: cover;
}
.resume-game > span:first-of-type {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.resume-game strong {
  font-size: 15px;
}
.resume-game small {
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.5;
}
.resume-action {
  margin-left: auto;
  color: #d7e9a5;
  font-size: 12px;
  white-space: nowrap;
}
.resume-game:hover,
.resume-game:focus-visible {
  border-color: var(--ui-gold);
}
.resume-feedback {
  margin: 0;
  color: #eec7ad;
  font-size: 13px;
}
.resume-feedback:empty {
  display: none;
}

/* Each cover has its own light treatment. Motion runs only where it can be seen. */
.lobby-fx {
  --lobby-fx-play: paused;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}
.lobby-fx i {
  position: absolute;
  display: block;
  opacity: 0;
  animation-play-state: var(--lobby-fx-play) !important;
}
.fx-haze {
  inset: 45% -20% -10%;
  background: radial-gradient(ellipse at 40% 60%, #c5cda524, transparent 62%);
  animation: lobby-haze 9s ease-in-out infinite alternate;
}
.fx-light {
  inset: -30%;
  background: linear-gradient(115deg, transparent 35%, #ffe7a329 48%, transparent 60%);
  animation: lobby-light 7s ease-in-out infinite;
}
.fx-detail {
  inset: 0;
}
.fx-sparks {
  inset: 0;
  background:
    radial-gradient(circle at 23% 55%, #ffe6a8 0 1px, transparent 2px),
    radial-gradient(circle at 70% 32%, #e9cd82 0 1px, transparent 2px),
    radial-gradient(circle at 76% 72%, #fff2c0 0 1px, transparent 2px);
  animation: lobby-sparks 6s ease-in-out infinite;
}
.strategy-card.art-visible:is(:hover, :focus-within) .lobby-fx,
.hero[data-fx-active='true'] > .lobby-fx {
  --lobby-fx-play: running;
}
.hero > .lobby-fx {
  inset: 0 0 155px 42%;
}
.hero[data-promotion='collection'] > .lobby-fx {
  display: none;
}
[data-lobby-game='battleship'] .fx-detail,
.hero[data-promotion='battleship'] .fx-detail {
  inset: 50% -20% -15%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    ellipse,
    transparent 0 16%,
    #c1eee82a 17% 17.6%,
    transparent 18% 26%
  );
  animation: lobby-water 6s ease-out infinite;
}
[data-lobby-game='battleship'] .fx-haze {
  background: radial-gradient(ellipse, #8dc8c92e, transparent 65%);
}
[data-lobby-game='tichu'] .fx-detail {
  inset: auto;
  width: 9%;
  height: 5%;
  left: 58.5%;
  top: 15.5%;
  background: radial-gradient(ellipse, #fff3cba6, #ffb53b44 32%, transparent 70%);
  animation: lobby-glow 4.5s ease-in-out infinite;
}
.hero[data-promotion='tichu'] .fx-haze {
  background: radial-gradient(ellipse, #ebad482e, transparent 65%);
}
[data-lobby-game='mancala'] .fx-detail,
.hero[data-promotion='mancala'] .fx-detail {
  background:
    radial-gradient(ellipse at 35% 55%, #a9ecc13d, transparent 12%),
    radial-gradient(ellipse at 63% 65%, #ffdd8e33, transparent 14%);
  animation: lobby-glow 5s ease-in-out infinite;
}
[data-lobby-game='reversi'] .fx-detail {
  background: linear-gradient(45deg, transparent 48%, #e3ecd322 50%, transparent 52%);
  animation: lobby-light 8s ease-in-out infinite;
}
[data-lobby-game='stratego'] .fx-haze {
  background: radial-gradient(ellipse, #bdcf7433, transparent 65%);
}
[data-lobby-game='backgammon'] .fx-detail {
  background: radial-gradient(circle at 50% 50%, #d6b96533, transparent 35%);
  animation: lobby-glow 5s ease-in-out infinite;
}
@keyframes lobby-haze {
  from {
    opacity: 0.25;
    transform: translate(-4%, 5%) scale(1);
  }
  to {
    opacity: 0.65;
    transform: translate(5%, -5%) scale(1.12);
  }
}
@keyframes lobby-light {
  0%,
  35% {
    opacity: 0;
    transform: translateX(-85%);
  }
  50% {
    opacity: 0.8;
  }
  75%,
  100% {
    opacity: 0;
    transform: translateX(85%);
  }
}
@keyframes lobby-sparks {
  0%,
  100% {
    opacity: 0;
    transform: translateY(7%);
  }
  45% {
    opacity: 0.75;
  }
  85% {
    opacity: 0;
    transform: translateY(-12%);
  }
}
@keyframes lobby-water {
  from {
    opacity: 0.35;
    transform: scale(0.65);
  }
  to {
    opacity: 0;
    transform: scale(1.1);
  }
}
@keyframes lobby-glow {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.9;
  }
}

/* Shared timings for panels, while the wallet's desktop sidebar stays in place. */
.primary-button,
.outline-button,
.strategy-bottom > button,
.resume-game,
.filter-bar button {
  transition:
    background var(--ui-fast),
    border-color var(--ui-fast),
    transform var(--ui-fast) var(--ui-ease),
    box-shadow var(--ui-fast);
}
.payment-center[open],
.info-dialog[open] {
  animation: ui-panel-enter var(--ui-enter) var(--ui-ease);
}
.payment-center [role='tabpanel']:not([hidden]),
.play-hub[open] .ph-main {
  animation: ui-content-enter 240ms var(--ui-ease);
}
.payment-center {
  border-color: #d4b87638;
  background: #0d1a13;
}
.pc-sidebar {
  background: linear-gradient(160deg, #1d3022, #101b14);
}
.pc-surface {
  border-color: var(--ui-line);
  border-radius: 14px;
}
.pc-close,
.pc-sidebar button {
  transition:
    background var(--ui-fast),
    color var(--ui-fast);
}
@keyframes ui-panel-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ui-content-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.br-result:not([hidden]),
.cr-result-head,
.game-result-dialog[open] {
  animation-duration: var(--ui-enter);
  animation-timing-function: var(--ui-ease);
}

@media (min-width: 1600px) {
  .board-lobby-grid,
  .card-lobby-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .hero .hero-copy {
    width: 65%;
    padding: 36px 30px 26px;
  }

  .hero .hero-tag {
    bottom: 96px;
    max-width: 36%;
  }
  .board-lobby-grid,
  .card-lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  body > main {
    padding: calc(var(--header) + 12px) 14px calc(72px + env(safe-area-inset-bottom));
  }
  .hero {
    min-height: 0;
    border-radius: 18px;
    touch-action: manipulation;
  }
  .hero .hero-copy {
    width: 100%;
    min-height: 0;
    padding: 76px 18px 12px !important;
  }
  .hero .hero-kicker,
  .hero .hero-description {
    display: none;
  }
  .hero h1 {
    min-height: 64px;
    font-size: 29px;
    line-height: 1.08;
    letter-spacing: -1px;
  }
  .hero h1 > span {
    display: inline;
  }
  .hero .hero-buttons {
    margin-top: 16px !important;
    gap: 14px;
    justify-content: space-between;
  }
  .hero .hero-primary {
    min-height: 44px;
    max-width: 64%;
    padding: 10px 14px;
    font-size: 12px;
  }
  .hero .hero-buttons .text-link {
    font-size: 11px;
    min-height: 44px;
    gap: 5px;
  }
  .hero .hero-buttons .text-link span {
    animation: none;
  }
  .hero .hero-tag {
    display: none;
  }
  .hero[data-promotion='collection'] .hero-collection-art {
    inset: -48px -10px auto 20%;
    height: 230px;
    gap: 8px;
    mask-image: linear-gradient(0deg, transparent, #000 50%);
  }
  .hero[data-promotion='collection'] .hero-shade {
    background: linear-gradient(0deg, #0b120c 30%, #0b120c66 65%, transparent);
  }
  .hero .hero-image,
  .hero:not([data-promotion='chess']):not([data-promotion='collection']) .hero-image {
    inset: -25px -10px auto 20%;
    height: 235px;
    background-position: center 34%;
  }
  .hero .hero-shade,
  .hero:not([data-promotion='chess']) .hero-shade {
    background: linear-gradient(0deg, #0b120c 40%, #0b120c99 65%, transparent);
  }
  .hero > .lobby-fx {
    inset: 0 0 auto 20%;
    height: 220px;
  }

  .hero .hero-bottom {
    margin: 0 16px 10px;
    gap: 8px;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .hero-dots {
    display: none;
  }
  .hero-pagination {
    font-size: 11px;
    gap: 8px;
  }
  .hero-index:after {
    content: ' /';
    color: #8c9e88;
  }
  .hero-controls {
    gap: 5px;
  }
  .hero .hero-controls button {
    width: 44px;
    height: 44px;
  }
  #games {
    margin-top: 24px;
    scroll-margin-top: 78px;
  }
  #games > .section-heading {
    margin-bottom: 12px;
  }
  #games > .section-heading .eyebrow,
  #games > .section-heading .small-badge {
    display: none;
  }
  #games > .section-heading h2 {
    font-size: 24px;
    margin: 0;
  }
  .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 18px;
    padding: 2px 0 8px;
    scrollbar-width: none;
  }
  .filter-bar .filter {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 10px 14px;
  }
  .board-lobby,
  .card-lobby {
    margin-bottom: 28px;
  }
  .card-collection-heading {
    gap: 10px;
    margin-bottom: 12px;
  }
  .card-collection-heading h3 {
    font-size: 17px;
    letter-spacing: -0.3px;
  }
  .card-collection-heading > span {
    font-size: 11px;
  }
  .card-lobby .card-collection-heading > span {
    display: none;
  }
  .board-lobby-grid,
  .card-lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .strategy-card {
    border-radius: 14px;
  }
  .strategy-card .strategy-art {
    aspect-ratio: 4/5;
  }
  .strategy-card .strategy-art-name {
    left: 12px;
    bottom: 12px;
    font-size: 22px;
    letter-spacing: -0.6px;
  }
  .strategy-card .strategy-mode {
    top: 10px;
    left: 8px;
    padding: 5px;
    font-size: 9px;
    letter-spacing: 0;
    gap: 4px;
  }
  .strategy-card .strategy-favorite {
    width: 40px;
    height: 40px;
    right: 4px;
    top: 4px;
    font-size: 23px;
  }
  .strategy-card .strategy-copy {
    padding: 0 12px 12px !important;
  }
  .strategy-card .strategy-copy > p {
    font-size: 12px;
    min-height: 52px;
    margin: 0 0 12px;
    line-height: 1.4;
  }
  .strategy-card .strategy-bottom > button {
    min-height: 44px;
    padding: 9px 12px;
    font-size: 13px;
  }
  .card-category-entry {
    min-height: 190px;
  }
  .card-category-copy {
    padding: 20px;
    gap: 12px;
  }
  .card-category-copy strong {
    font-size: 25px;
    max-width: 220px;
  }
  .card-category-copy > span {
    max-width: 210px;
    font-size: 12px;
    line-height: 1.5;
  }
  .card-category-art {
    left: 30%;
  }
  #categories {
    margin-top: 32px;
  }
  .lobby-resume {
    margin-top: 18px;
    padding: 16px;
  }
  .resume-heading h2 {
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .resume-heading .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .resume-game {
    flex-basis: 280px;
  }
}
@media (max-width: 360px) {
  .hero .hero-copy {
    padding-inline: 16px !important;
    padding-top: 115px !important;
  }
  .hero h1 {
    font-size: 26px;
    min-height: 62px;
  }
  .hero .hero-buttons {
    gap: 6px;
  }
  .hero .hero-primary {
    padding-inline: 10px;
    font-size: 11px;
  }
  .hero .hero-buttons .text-link {
    font-size: 10px;
  }
  .strategy-card .strategy-mode {
    font-size: 8px;
  }
  .strategy-card .strategy-art-name {
    font-size: 20px;
  }
  .strategy-card .strategy-copy {
    padding-inline: 10px !important;
  }
}
.motion-off .lobby-fx,
.lobby-motion-blocked .lobby-fx {
  display: none;
}
.lobby-effects-paused .lobby-fx,
.page-hidden .lobby-fx {
  --lobby-fx-play: paused !important;
}
.lobby-effects-paused .hero *,
.lobby-effects-paused .category-card *,
.lobby-effects-paused .tournament-banner * {
  animation: none !important;
}
.lobby-motion-blocked .hero *,
.lobby-motion-blocked .category-card * {
  animation-play-state: paused !important;
}
.motion-off .payment-center[open],
.motion-off .info-dialog[open],
.motion-off .payment-center [role='tabpanel'],
.motion-off .ph-main {
  animation: none;
}
.motion-off .strategy-card,
.motion-off .strategy-cover {
  transition: none;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .lobby-fx {
    display: none;
  }
  .hero *,
  .strategy-card,
  .strategy-card *,
  .resume-game,
  .payment-center[open],
  .payment-center [role='tabpanel'],
  .info-dialog[open],
  .ph-main {
    animation: none !important;
    transition: none !important;
  }
  .strategy-card:hover,
  .strategy-card:active,
  .strategy-card .strategy-cover {
    transform: none !important;
  }
}

@media (max-width: 600px) {
  .filter-bar {
    display: none;
  }
  #lobby-resume {
    margin: 16px 0;
  }
  .resume-list {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 88%);
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .resume-game {
    scroll-snap-align: start;
    min-width: 0;
  }
  .resume-heading h2 {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  #lobby-resume {
    padding: 12px;
  }
  .resume-heading .eyebrow {
    display: none;
  }
  .resume-heading h2 {
    margin: 0 0 8px;
    font-size: 16px;
  }
  .resume-list {
    padding: 0 0 4px;
  }
  .resume-game {
    padding: 7px;
  }
  .resume-game img {
    width: 32px;
    height: 40px;
  }
  .card-collection-heading {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  .card-collection-heading > span {
    flex: 0 0 auto;
  }
}

/* Compact slide navigation; only the current game is named in the hero. */
.hero-progress {
  display: none;
}
.hero:is([data-promotion='tekken3']) .hero-tag strong {
  max-width: 240px;
}
body:is(.lobby-effects-paused, .lobby-motion-blocked) .ticker-track {
  animation-play-state: paused;
}
@media (max-width: 600px) {
  .hero {
    touch-action: pan-y;
  }
  .hero .hero-copy {
    padding-top: 100px !important;
  }
  .hero-pagination {
    flex: 1;
    flex-wrap: wrap;
    column-gap: 6px;
    max-width: 122px;
  }
  .hero-progress {
    display: block;
    order: 2;
    width: 100%;
    height: 3px;
    background: #b5c38c33;
    border-radius: 3px;
    overflow: hidden;
  }
  .hero-progress::after {
    content: '';
    display: block;
    width: var(--carousel-position, 7.14%);
    height: 100%;
    background: var(--promo-accent);
    transition: width 350ms ease;
  }
  .ticker {
    margin: 14px 0 18px;
  }
}
