* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e5e5e5;
  line-height: 1;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: #2d2d2d;
  border-radius: 12px;
  border: 3px solid #8b7355;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: block;
}

.logo-container {
  padding: 0;
  margin: 0;
  background: linear-gradient(135deg, #333333 0%, #505050 100%);
  border-bottom: 3px solid #8b7355;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
  position: relative;
  display: block;
  z-index: 1;
}

.logo-container img {
  max-width: 800px;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  display: block;
  border: 0;
  vertical-align: top;
  line-height: 0;
  object-fit: cover;
}

h1, h2, h3 {
  margin: 0;
  padding: 0;
  font-weight: 600;
  color: #e5e5e5;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

h1 {
  font-size: 1.75rem;
  text-align: center;
}

h2 {
  font-size: 1.1rem;
  color: #c9b896;
}

h3 {
  font-size: 1rem;
  color: #bfbfbf;
}

.betting-area {
  background: linear-gradient(180deg, #3d3d3d 0%, #2a2a2a 100%);
  padding: 10px 15px;
  border-bottom: 2px solid #8b7355;
}

.bet-adjust-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #4a90d9;
  background: linear-gradient(180deg, #4a90d9 0%, #2c5aa0 100%);
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.bet-adjust-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(180deg, #5ba0e9 0%, #3c6ab0 100%);
  box-shadow: 0 6px 12px rgba(74, 144, 217, 0.4);
}

.bet-adjust-btn:active {
  transform: scale(0.95);
}

.bet-adjust-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.bet-amount-display {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fbbf24;
  min-width: 50px;
  text-align: center;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.bet-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

#current-bet {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.quick-bet-buttons {
  display: flex;
  gap: 10px;
}

.quick-bet-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  background: linear-gradient(180deg, #525252 0%, #3d3d3d 100%);
  border: 1px solid #6b6b6b;
  border-radius: 4px;
  color: #e5e5e5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-bet-btn:hover {
  background: linear-gradient(180deg, #6b6b6b 0%, #525252 100%);
  transform: translateY(-1px);
}

.quick-bet-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.game-area {
  padding: 20px;
  display: grid;
  gap: 15px;
  background: 
    radial-gradient(ellipse at center, #1e5631 0%, #0d3320 70%, #082618 100%);
  background-size: cover;
  position: relative;
}

.game-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px
    );
  pointer-events: none;
}

.dealer-area, .player-area, .community-cards-area {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 8px 12px 4px 12px;
  border: 2px solid rgba(139, 115, 85, 0.5);
  backdrop-filter: blur(2px);
  position: relative;
  z-index: 1;
}

.dealer-area h2, .player-area h2, .community-cards-area h2 {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d3320;
  padding: 2px 12px;
  font-size: 0.75rem;
  color: #bbb;
  border-radius: 4px;
  white-space: nowrap;
}

.community-cards-area h2 {
  color: #4ade80;
}

.community-cards-area {
  background: rgba(0, 0, 0, 0.35);
  border-color: #4ade80;
  border-width: 2px;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}


.hand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 85px;
  margin: 8px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 2px dashed rgba(139, 115, 85, 0.4);
}

.hand img {
  width: 85px;
  height: 119px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  object-fit: cover;
  object-position: center;
}

.hand img:hover {
  transform: translateY(-5px);
}

.hand img[src*="card_back"] {
  padding: 0;
  margin: 0;
}

.card-deal {
  animation: dealCard 0.4s ease-out both;
}

@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translateX(-100px) translateY(-50px) rotate(-15deg) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
}

.card-flip-container {
  perspective: 1000px;
  display: inline-block;
}

.card-flip {
  animation: flipCard 0.6s ease-in-out forwards;
  transform-style: preserve-3d;
}

@keyframes flipCard {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.split-hand {
  display: inline-block;
  margin: 0 8px;
  padding: 8px;
  border: 2px solid rgba(139, 115, 85, 0.5);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.value {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fbbf24;
  margin-top: 8px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.controls {
  padding: 15px;
  background: linear-gradient(180deg, #2d2d2d 0%, #1f1f1f 100%);
  border-top: 2px solid #8b7355;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #525252 0%, #3d3d3d 100%);
  color: #e5e5e5;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

button:hover {
  background: linear-gradient(180deg, #6b6b6b 0%, #525252 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

button:disabled {
  background: linear-gradient(180deg, #2a2a2a 0%, #1f1f1f 100%);
  color: #555;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#place-bet {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 0 20px rgba(34, 197, 94, 0.2);
}

#place-bet:hover {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 197, 94, 0.3);
}

#place-bet:disabled {
  background: linear-gradient(180deg, #2a2a2a 0%, #1f1f1f 100%);
  box-shadow: none;
}

.poker-button {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 0 20px rgba(245, 158, 11, 0.2);
}

.poker-button:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 30px rgba(245, 158, 11, 0.3);
}

.poker-button:disabled {
  background: linear-gradient(180deg, #2a2a2a 0%, #1f1f1f 100%);
  box-shadow: none;
}

.message {
  padding: 15px;
  background: linear-gradient(180deg, #1f1f1f 0%, #171717 100%);
  border-top: 1px solid #333;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .logo-container img {
    max-height: 80px;
    object-fit: contain;
  }

  .betting-area {
    padding: 6px 10px;
  }

  .bet-adjust-btn {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }

  .bet-amount-display {
    font-size: 1.1rem;
    min-width: 45px;
  }

  .bet-row {
    gap: 12px;
    justify-content: center;
  }

  #current-bet {
    font-size: 0.85rem;
  }

  .quick-bet-buttons {
    gap: 8px;
  }

  .quick-bet-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  #place-bet {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  .game-area {
    padding: 8px;
    gap: 6px;
  }

  .dealer-area, .player-area, .community-cards-area {
    padding: 6px;
  }

  .dealer-area h2, .player-area h2, .community-cards-area h2 {
    font-size: 0.9rem;
  }

  .controls {
    padding: 8px;
    gap: 5px;
  }

  button {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: 60px;
  }

  .hand img {
    width: 55px;
    height: 77px;
  }

  .hand {
    min-height: 55px;
    padding: 4px;
    gap: 4px;
    margin: 4px 0;
  }

  .value {
    font-size: 0.85rem;
    margin-top: 4px;
  }

  .message {
    padding: 8px;
    font-size: 0.9rem;
    min-height: 35px;
  }

  .help-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .quick-bet-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  #place-bet {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .logo-container img {
    max-height: 50px;
  }

  .betting-area {
    padding: 5px 8px;
  }

  .bet-adjust-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .bet-amount-display {
    font-size: 1rem;
    min-width: 40px;
  }

  .bet-row {
    gap: 10px;
    justify-content: center;
  }

  .quick-bet-btn {
    padding: 5px 8px;
    font-size: 0.65rem;
  }

  #place-bet {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .hand img {
    width: 48px;
    height: 67px;
  }

  button {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-width: 50px;
  }

  .hand {
    min-height: 50px;
    padding: 3px;
    gap: 3px;
  }

  .dealer-area h2, .player-area h2, .community-cards-area h2 {
    font-size: 0.8rem;
  }

  .value {
    font-size: 0.75rem;
  }

  .quick-bet-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .controls {
    gap: 4px;
  }

  .message {
    padding: 6px;
    font-size: 0.8rem;
    min-height: 30px;
  }
}

.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 1000;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification-error {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: 1px solid #b91c1c;
}

.notification-success {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: 1px solid #15803d;
}

.notification-info {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: 1px solid #1d4ed8;
}

.notification-fade {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 8px 15px;
  background: linear-gradient(180deg, #2d2d2d 0%, #1a1a1a 100%);
  border-bottom: 2px solid #8b7355;
}

.balance-display {
  font-size: 1.1rem;
  margin: 0;
  color: #22c55e;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

@media (max-width: 768px) {
  .top-bar {
    padding: 6px 10px;
  }
  
  .balance-display {
    font-size: 0.95rem;
  }
}

.site-footer {
  text-align: center;
  padding: 12px;
  color: #888;
  font-size: 0.8rem;
}

.site-footer a {
  color: #4ade80;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .top-bar {
    padding: 5px 8px;
  }
  
  .balance-display {
    font-size: 0.85rem;
  }
}

.help-btn {
  padding: 10px 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a90d9 0%, #2c5aa0 100%);
  border: 2px solid #1e4080;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.help-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(180deg, #5ba0e9 0%, #3c6ab0 100%);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.5);
}

.rules-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.rules-modal.show {
  display: flex;
}

.rules-content {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border: 3px solid #8b7355;
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.2s ease;
}

.rules-content h2 {
  background: linear-gradient(180deg, #1a5a1a 0%, #0d3d0d 100%);
  color: #ffd700;
  padding: 15px 20px;
  margin: 0;
  font-size: 1.4rem;
  text-align: center;
  border-bottom: 2px solid #8b7355;
}

.rules-text {
  padding: 20px;
}

.rules-text h3 {
  color: #ffd700;
  font-size: 1.1rem;
  margin: 15px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #555;
}

.rules-text h3:first-child {
  margin-top: 0;
}

.rules-text p {
  color: #ccc;
  margin-bottom: 10px;
  line-height: 1.5;
}

.rules-text ul,
.rules-text ol {
  margin: 0 0 15px 0;
  padding-left: 25px;
}

.rules-text li {
  color: #bbb;
  margin-bottom: 10px;
  line-height: 1.5;
}

.rules-text strong {
  color: #e5e5e5;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.close-btn:hover {
  opacity: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
