/* Game Screen Specific Styles */

/* Game Screen Header */
.game-screen .screen-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-primary);
  z-index: 100;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.game-screen .logo-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-gold);
}

.game-screen .logo-icon {
  font-size: 1.5rem;
}

.game-info {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
}

.room-display,
.pot-display {
  color: var(--text-primary);
  white-space: nowrap;
}

.pot-display {
  color: var(--text-gold);
}

.game-timer {
  display: flex;
  align-items: center;
}

.timer-display {
  background: var(--danger);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.9rem;
  opacity: 1;
  min-width: 60px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(220, 20, 60, 0.3);
}

/* Game Container */
.game-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 60px;
  background: radial-gradient(ellipse at center, var(--felt-green) 0%, var(--dark-felt) 100%);
}

.game-main {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 1rem;
  gap: 0.75rem;
  min-height: 0;
}

/* All Players Section */
.all-players-section {
  /* Clean positioning, no backgrounds */
}

.all-players-grid {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.player-display {
  text-align: center;
  color: var(--text-primary);
  position: relative;
  transition: all 0.3s ease;
  min-width: 120px;
}

.player-display.current-turn {
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  transform: scale(1.05);
  animation: currentTurnPulse 2s ease-in-out infinite;
}

@keyframes currentTurnPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  }
  50% { 
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
  }
}

.player-display:hover {
  transform: translateY(-2px);
}

.player-name {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  display: block;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.player-cards {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.collected-cards {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(212, 175, 55, 0.4);
}

/* Play Area */
.play-area {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  min-height: 0;
  flex: 1;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.suit-display-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.suit-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.suit-symbol {
  font-size: 3rem;
  color: var(--text-gold);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  animation: suitPulse 2s ease-in-out infinite;
}

@keyframes suitPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.played-cards-area {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-height: 150px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.round-display-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.round-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.round-info {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.round-result {
  color: var(--warning);
  font-size: 0.9rem;
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
  margin-top: 0.5rem;
  animation: roundResultFadeIn 0.5s ease-in;
}

.round-result.winner {
  color: var(--gold);
}

.round-result.broken {
  color: var(--danger);
}

@keyframes roundResultFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Played Cards */
.played-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 70px;
}

.played-card .card {
  transform: scale(1.15);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 15px;
}

.played-by {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 58, 46, 0.95);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: 15;
  min-width: 80px;
  text-align: center;
  border: 2px solid var(--border-gold);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
}

/* Player Section */
.player-section {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

.player-info {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.player-name {
  color: var(--text-gold);
  font-weight: bold;
  font-size: 1rem;
}

.card-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.player-hand {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.75rem;
  min-height: 110px;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-message {
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Card Styles */
.card {
  width: 60px;
  height: 85px;
  background: var(--card-bg);
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.card:hover:not(.disabled):not(.dimmed) {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card.selectable {
  cursor: pointer;
  border-color: var(--border-primary);
}

.card.selectable:hover {
  transform: translateY(-12px);
  border-color: var(--gold);
  box-shadow: 0 16px 32px rgba(212, 175, 55, 0.4);
}

.card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.card.disabled:hover {
  transform: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card.dimmed {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(60%);
}

.card.dimmed:hover {
  transform: none;
  border-color: #ddd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card.highlighted {
  border-color: var(--warning);
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
  animation: card-highlight 2s infinite;
}

.card.collected-card {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(212, 175, 55, 0.15) 100%);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  position: relative;
}

.card.collected-card::before {
  content: "★";
  position: absolute;
  top: 2px;
  right: 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: bold;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card.broke-round {
  border-color: var(--danger);
  animation: card-shake 0.6s ease-in-out;
  box-shadow: 0 0 16px rgba(220, 20, 60, 0.6);
}

/* Card Display Elements */
.card-corner {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  z-index: 2;
}

.card-rank {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 1px;
  font-family: 'Times New Roman', serif;
}

.card-suit-small {
  font-size: 12px;
  line-height: 1;
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: bold;
  z-index: 1;
}

/* Card Suit Colors */
.card.hearts .card-rank,
.card.hearts .card-suit-small,
.card.hearts .card-center,
.card.diamonds .card-rank,
.card.diamonds .card-suit-small,
.card.diamonds .card-center {
  color: var(--card-red);
}

.card.clubs .card-rank,
.card.clubs .card-suit-small,
.card.clubs .card-center,
.card.spades .card-rank,
.card.spades .card-suit-small,
.card.spades .card-center {
  color: var(--card-black);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  animation: modal-slide-in 0.3s ease-out;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.wallet-modal {
  max-width: 600px;
}

.modal-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-secondary);
  margin-bottom: 1rem;
}

.modal-header h3 {
  color: var(--text-gold);
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--danger);
}

.modal-body {
  padding: 0 1.5rem 1rem 1.5rem;
}

.modal-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Wallet Modal Specific */
.wallet-section {
  margin-bottom: 2rem;
}

.wallet-section h4 {
  color: var(--text-gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-secondary);
  padding-bottom: 0.5rem;
}

.wallet-info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.address-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wallet-address-full {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-all;
  flex: 1;
}

.deposit-input-group,
.withdraw-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.deposit-input-group input,
.withdraw-input-group input {
  flex: 1;
}

.input-suffix {
  color: var(--text-muted);
  font-weight: bold;
  padding: 0 0.5rem;
}

.section-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Transfer Modals */
.player-selection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.player-option {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-option:hover {
  border-color: var(--warning);
  background: rgba(255, 140, 0, 0.1);
  transform: translateY(-1px);
}

.player-option.selected {
  border-color: var(--warning);
  background: rgba(255, 140, 0, 0.15);
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.4);
}

.player-card-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: var(--bg-card);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.transfer-request-info {
  text-align: center;
  padding: 1rem 0;
}

.transfer-message {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card-count-info {
  font-size: 1rem;
  color: var(--text-gold);
  font-weight: bold;
}

.transfer-benefit {
  background: rgba(34, 139, 34, 0.2);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 1rem;
  color: var(--success);
  font-weight: bold;
  font-size: 0.9rem;
}

/* Loading and Notifications */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 31, 26, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(6px);
}

.loading-content {
  text-align: center;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid var(--border-gold);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-secondary);
  border-top: 4px solid var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

.loading-text {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 350px;
}

.toast {
  background: rgba(45, 90, 71, 0.95);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  min-width: 300px;
  animation: toast-slide-in 0.3s ease-out;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.toast.error {
  border-left-color: var(--danger);
  background: rgba(220, 20, 60, 0.15);
}

.toast.success {
  border-left-color: var(--success);
  background: rgba(34, 139, 34, 0.15);
}

.toast.warning {
  border-left-color: var(--warning);
  background: rgba(255, 140, 0, 0.15);
}

.toast.transfer {
  border-left-color: var(--warning);
  background: rgba(255, 140, 0, 0.15);
}

/* Animations */
@keyframes modal-slide-in {
  from {
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes card-highlight {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 32px rgba(255, 140, 0, 1);
    transform: scale(1.03);
  }
}

@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Responsive Design for Game Screen */
@media (max-width: 968px) {
  .game-screen .screen-header {
    flex-direction: column;
    text-align: center;
    height: auto;
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .game-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .all-players-grid {
    gap: 1.5rem;
  }
  
  .game-main {
    padding: 1rem;
    gap: 1rem;
  }
  
  .play-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
  }
  
  .suit-display-column,
  .round-display-column {
    flex-direction: row;
    gap: 1rem;
  }
  
  .suit-symbol {
    font-size: 2rem;
  }
  
  .played-cards-area {
    min-height: 120px;
    order: 2;
  }
  
  .suit-display-column {
    order: 1;
  }
  
  .round-display-column {
    order: 3;
  }
}

@media (max-width: 768px) {
  .game-container {
    padding-top: 90px;
  }
  
  .card {
    width: 50px;
    height: 70px;
  }
  
  .card-rank {
    font-size: 12px;
  }
  
  .card-center {
    font-size: 24px;
  }
  
  .player-hand {
    gap: 0.3rem;
    padding: 0.5rem;
  }
  
  .modal-content {
    min-width: 300px;
    margin: 1rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .toast {
    min-width: auto;
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .card {
    width: 45px;
    height: 65px;
  }
  
  .card-rank {
    font-size: 10px;
  }
  
  .card-center {
    font-size: 18px;
  }
  
  .played-by {
    bottom: -30px;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .modal-content {
    min-width: 280px;
    max-width: 95%;
  }
  
  .loading-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .spinner {
    width: 50px;
    height: 50px;
  }
}