* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background-color: #fff;
  background-image: url("./assets/backgrounds/suits-pattern.png");
  background-repeat: repeat;
  background-attachment: fixed;
  color: #111;
}

.logo_main_black {
  margin-top: 44px;
  width: 342px;
  height: 100%;
  }

.site-header {
  min-height: 56px;
  padding: 20px 16px 10px;
}

.home-banner-wrap {
  padding: 0 16px 10px;
}

.home-banner {
  width: min(980px, 100%);
  height: 100px;
  margin: 0 auto;
  overflow: hidden;
  background: #1a3d2e;
  border-radius: 10px;
}

.home-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-header-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #111;
}

.site-logo-image {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.site-logo-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.header-button--outline {
  border: 1px solid #121212;
  background: #fff;
  color: #121212;
}

.header-button--dark {
  border: 1px solid #121212;
  background: #121212;
  color: #fff;
}

.page {
  padding: 8px 16px 40px;
}

.home-page {
  width: min(980px, 100%);
  margin: 0 auto;
}

.hero-section {
  text-align: center;
  padding-top: 8px;
}

.hero-title {
  margin: 40px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-spade {
  display: inline-block;
  font-size: 0.92em;
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-intro {
  margin: 28px auto 16px;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}

.top-up-button,
.modal-action,
.play-button {
  min-height: 38px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.top-up-button {
  min-width: 170px;
  padding: 0 16px;
  border: 1px solid #ccc;
  background: #fff;
}

.chips-row {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 3vw, 28px);
  flex-wrap: wrap;
}

.chip-button {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  transition:
    transform 0.18s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.chip-image {
  width: clamp(72px, 14vw, 96px);
  height: clamp(72px, 14vw, 96px);
  display: block;
  object-fit: contain;
}

.chip-button.active {
  transform: translateY(-2px) scale(1.04);
}

.chip-button[data-bet="50"].active {
  filter: drop-shadow(0 0 12px rgba(255, 210, 60, 0.95));
}

.chip-button[data-bet="100"].active {
  filter: drop-shadow(0 0 12px rgba(220, 45, 45, 0.9));
}

.chip-button[data-bet="300"].active {
  filter: drop-shadow(0 0 12px rgba(80, 160, 220, 0.95));
}

.chip-button[data-bet="500"].active {
  filter: drop-shadow(0 0 12px rgba(60, 60, 68, 0.85));
}

.hero-description {
  margin: 28px auto 0;
  max-width: 520px;
  font-size: 12px;
  line-height: 1.45;
  color: #666;
}

.play-button {
  margin-top: 18px;
  min-width: 170px;
  padding: 0 28px;
  border: 1px solid #0d0d0d;
  background: #0d0d0d;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.story-section {
  margin-top: 24px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 20px;
  align-items: center;
  background: #f3f3f352;
  border-radius: 10px;
  padding: 18px 20px;
}

.story-title {
  margin: 0 0 10px;
  font-size: 22px;
}

.story-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.story-image-wrap {
  display: flex;
  justify-content: center;
}

.story-image {
  width: min(100%, 360px);
  height: auto;
  display: block;
  border-radius: 10px;
}

.site-footer {
  margin: 24px 0 20px;
  text-align: center;
  color: #666;
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.rules-section {
  margin-top: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  background: #f3f3f352;
  border-radius: 10px;
  padding: 16px 18px;
}

.rules-icon {
  width: 92px;
  height: auto;
  display: block;
}

.rules-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.rules-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #333;
}

.is-hidden {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .header-button:hover,
  .top-up-button:hover,
  .modal-action:hover,
  .play-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(17, 27, 36, 0.14);
  }

  .header-button--outline:hover,
  .top-up-button:hover {
    background: #f8f8f8;
    border-color: #888;
  }

  .header-button--dark:hover,
  .play-button:hover,
  .modal-action:hover {
    background: #1d2f3d;
    border-color: #1d2f3d;
    color: #fff;
  }

  .chip-button:not(.active):hover {
    transform: translateY(-1px) scale(1.02);
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 3000;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: min(640px, 100%);
  background-color: #fff;
  background-image: url("./assets/backgrounds/suits-pattern-modal.png");
  background-repeat: repeat;
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  background-size: cover;
  background-position: center;
}

#modal-title {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

#modal-text {
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.modal-footer-text {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #444;
  text-align: center;
}

.modal-action {
  min-width: 110px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #121212;
  background: #121212;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
}

.matchmaking-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 18, 24, 0.52);
  z-index: 1000;
}

.matchmaking-overlay.is-hidden {
  display: none;
}

.matchmaking-content {
  width: min(680px, 96vw);
  min-height: 300px;
  padding: 20px 16px 16px;
  border-radius: 12px;
  background-color: #fff;
  background-image: url("./assets/backgrounds/suits-pattern-modal.png");
  background-repeat: repeat;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.matchmaking-progress {
  --progress: 0%;
  width: 116px;
  height: 116px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(#1d2f3d var(--progress), #dce5ec 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.matchmaking-progress.is-hidden {
  display: none;
}

.matchmaking-progress-inner {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #1d2f3d;
}

.matchmaking-title {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #2c3f4f;
}

.matchmaking-matchup {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(560px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

.matchmaking-matchup.is-hidden {
  display: none;
}

.matchmaking-player {
  text-align: center;
}

.battle-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #fff;
}

.battle-avatar--enemy {
  box-shadow: 0 0 10px rgba(167, 20, 20, 0.38);
}

.battle-avatar--photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.matchmaking-player .battle-avatar {
  width: 104px;
  height: 104px;
  margin-bottom: 4px;
}

.matchmaking-name {
  margin: 0;
  font-size: 13px;
}

.matchmaking-vs-image {
  width: 102px;
  height: 66px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .story-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .rules-section {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .matchmaking-content {
    min-height: 260px;
  }

  .matchmaking-matchup {
    gap: 8px;
  }

  .matchmaking-player .battle-avatar {
    width: 72px;
    height: 72px;
  }

  .matchmaking-vs-image {
    width: 72px;
    height: 46px;
  }
}

.game-page-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 8px 16px 32px;
}

.game-page {
  width: min(560px, 100%);
  margin: 0 auto;
  padding-top: 4px;
}

.game-breadcrumbs {
  margin: 0 0 16px;
  font-size: 14px;
  color: #888;
  text-align: left;
}

.game-breadcrumbs a {
  color: #111;
  text-decoration: none;
}

.game-breadcrumbs a:hover {
  text-decoration: underline;
}

.game-breadcrumbs-sep {
  margin: 0 6px;
  color: #aaa;
}

.game-rules-section {
  margin-top: 40px;
  width: 100%;
}

.game-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  margin-bottom: 28px;
}

.game-stat {
  text-align: left;
}

.game-stat--timer {
  text-align: right;
}

.game-stat-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.game-stat-value {
  margin: 0;
  font-size: clamp(34px, 8vw, 44px);
  font-weight: 700;
  line-height: 1;
}

.game-bet {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.game-bet-chip {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.opponent-section {
  margin-bottom: 24px;
}

.opponent-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.opponent-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hand-cards-label {
  margin: 0 0 12px;
  text-align: center;
  font-size: 14px;
}

.opponent-name {
  font-size: 13px;
  color: #333;
}

.game-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ddd;
}

.game-avatar--photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cards-row--hand {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.card-slot,
.cards-row--hand .playing-card {
  width: 100%;
  aspect-ratio: 5 / 7;
}

.card-slot {
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.playing-card {
  position: relative;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.playing-card--mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
}

.playing-card-mini-rank {
  font-size: clamp(20px, 3.2vw, 28px);
  font-weight: 700;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.playing-card-mini-suit {
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1;
}

.playing-card--red .playing-card-mini-rank,
.playing-card--red .playing-card-mini-suit {
  color: #e02020;
}

.playing-card--black .playing-card-mini-rank,
.playing-card--black .playing-card-mini-suit {
  color: #111;
}

.playing-card--large {
  width: 160px;
  flex: 0 0 160px;
  aspect-ratio: 5 / 7;
}

.playing-card--back {
  border-color: #bdbdbd;
}

.card-back-image,
.playing-card-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}

.table-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 28px 0 32px;
  min-height: 224px;
}

.table-center-play {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.table-center-play.is-hidden,
.table-center-result.is-hidden {
  display: none;
}

.table-center-result {
  width: min(100%, 380px);
  padding: 22px 18px;
  text-align: center;
  background-color: #fff;
  background-image: url("./assets/backgrounds/suits-pattern-modal.png");
  background-repeat: repeat;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background-size: cover;
  background-position: center;
}

.result-title {
  margin: 0 0 10px;
  font-size: 22px;
  text-transform: uppercase;
}

.result-text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.result-footer-text {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #444;
}

.deck-card,
.last-card-slot {
  width: 160px;
  flex: 0 0 160px;
  aspect-ratio: 5 / 7;
}

.deck-card {
  border-radius: 8px;
  overflow: hidden;
}

.last-card-slot:empty {
  width: 160px;
}

.player-section {
  margin-bottom: 20px;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.game-action {
  min-height: 52px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.game-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-action--light {
  border: 1px solid #111;
  background: #fff;
  color: #111;
}

.game-action--dark {
  border: 1px solid #111;
  background: #111;
  color: #fff;
}

.game-action-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.turn-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: #666;
  min-height: 18px;
}

@media (hover: hover) and (pointer: fine) {
  .game-action:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(17, 27, 36, 0.14);
  }
}

@media (max-width: 640px) {
  .game-stat--timer {
    text-align: center;
  }

  .game-stats {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .game-stat-value {
    font-size: 34px;
    text-align: center;
  }

  .game-actions {
    grid-template-columns: 1fr;
  }
}
