/**
 * SPINSTRUCT Game Play Page Styles
 */
:root {
  --play-bg: #14181e;
  --play-surface: #1d232c;
  --play-surface-2: #242c37;
  --play-border: #2d3744;
  --play-red: #ff3038;
  --play-red-hover: #e0242c;
  --play-gold: #f5a623;
  --play-green: #2ecc71;
  --play-text: #e1e7ee;
  --play-muted: #8b99a9;
}

body.play-page-body {
  margin: 0;
  padding: 0;
  background: var(--play-bg);
  color: var(--play-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP GAME BAR */
.game-play-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #171d24;
  border-bottom: 1px solid var(--play-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left {
  flex: 0 0 auto;
}

.header-center {
  flex: 1 1 auto;
  justify-content: center;
  overflow: hidden;
}

.header-right {
  flex: 0 0 auto;
}

.back-to-lobby {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--play-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--play-surface);
  border: 1px solid var(--play-border);
  transition: all 0.2s;
}

.back-to-lobby:hover {
  color: #fff;
  border-color: var(--play-red);
  background: var(--play-surface-2);
}

.play-brand-logo img {
  height: 28px;
  width: auto;
  display: block;
}

.game-title-info {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-title-info h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-tag {
  font-size: 11px;
  font-weight: 600;
  color: #a7b7c8;
  background: var(--play-surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--play-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.mode-badge.demo {
  background: rgba(245, 166, 35, 0.15);
  color: var(--play-gold);
  border: 1px solid rgba(245, 166, 35, 0.4);
}

.mode-badge.real {
  background: rgba(46, 204, 113, 0.15);
  color: var(--play-green);
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.mode-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* Balance & Actions in Header */
.user-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--play-surface);
  border: 1px solid var(--play-border);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.user-balance-pill svg {
  color: var(--play-gold);
}

.btn-deposit-quick {
  background: var(--play-red);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-deposit-quick:hover {
  background: var(--play-red-hover);
}

.btn-login-quick {
  background: var(--play-red);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}

.btn-login-quick:hover {
  background: var(--play-red-hover);
}

.control-btn {
  background: var(--play-surface);
  border: 1px solid var(--play-border);
  color: var(--play-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.control-btn:hover {
  color: #fff;
  border-color: #526377;
  background: var(--play-surface-2);
}

.control-btn.active {
  color: var(--play-gold);
}

/* MAIN STAGE */
.game-play-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.game-stage-wrapper {
  position: relative;
  width: 100%;
  background: #0d1014;
  height: calc(100vh - 60px);
  min-height: 540px;
  max-height: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-stage-wrapper.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  z-index: 99999;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Loader */
.game-loader-overlay {
  position: absolute;
  inset: 0;
  background: #11151a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.3s;
}

.game-loader-overlay.loaded {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--play-surface-2);
  border-top-color: var(--play-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login Required Box (When Game Requires Real Account) */
.login-required-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  padding: 20px;
}

.login-required-card {
  position: relative;
  z-index: 2;
  background: rgba(22, 28, 36, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--play-border);
  border-radius: 16px;
  padding: 36px 30px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

.lock-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 48, 56, 0.15);
  color: var(--play-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-required-card h2 {
  font-size: 20px;
  margin: 0 0 10px;
  color: #fff;
}

.login-required-card p {
  color: var(--play-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px;
}

.login-card-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.login-card-actions .btn-login {
  flex: 1;
  background: var(--play-red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px;
  border-radius: 10px;
  transition: background 0.15s;
}

.login-card-actions .btn-login:hover {
  background: var(--play-red-hover);
}

.login-card-actions .btn-register {
  flex: 1;
  background: var(--play-surface-2);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--play-border);
}

.login-card-actions .btn-register:hover {
  border-color: #617388;
}

/* BOTTOM DETAILS & SIMILAR GAMES */
.game-bottom-wrap {
  background: var(--play-surface);
  border-top: 1px solid var(--play-border);
  padding: 30px 20px 50px;
}

.game-bottom-wrap .container {
  max-width: 1280px;
  margin: 0 auto;
}

.game-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--play-border);
  margin-bottom: 28px;
}

.meta-game-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meta-cover-thumb {
  width: 52px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
}

.meta-text h2 {
  font-size: 18px;
  margin: 0 0 4px;
  color: #fff;
}

.meta-badges {
  display: flex;
  gap: 8px;
}

.meta-badge {
  font-size: 12px;
  color: var(--play-muted);
  background: var(--play-surface-2);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--play-border);
}

.similar-heading {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.similar-heading::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--play-red);
  border-radius: 2px;
  display: inline-block;
}

.similar-games-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

@media(max-width: 1100px) {
  .similar-games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media(max-width: 768px) {
  .similar-games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media(max-width: 480px) {
  .similar-games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.similar-card {
  position: relative;
  aspect-ratio: 160/210;
  border-radius: 12px;
  overflow: hidden;
  background: #14181f;
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.similar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.similar-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.similar-card .similar-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.similar-card .similar-overlay span {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* RESPONSIVE DESIGN */
@media(max-width: 768px) {
  .game-play-header {
    height: 52px;
    padding: 0 10px;
  }

  .game-stage-wrapper {
    height: calc(100vh - 52px);
    min-height: 420px;
  }

  .game-title-info h1 {
    font-size: 13px;
    max-width: 140px;
  }

  .provider-tag {
    display: none;
  }

  .back-to-lobby span {
    display: none;
  }

  .user-balance-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .btn-deposit-quick {
    padding: 5px 10px;
    font-size: 11px;
  }

  .btn-deposit-quick span {
    display: none;
  }
}
