/* Game Setup Page */
.game-setup {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
}

.setup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.create-game,
.join-game {
  padding: 2rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-success:disabled,
.btn-success[disabled] {
  background: #6c757d;
  opacity: 0.6;
}

/* Game Notification Banner */
.game-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 600px;
  width: 90%;
  animation: slideDown 0.3s ease-out;
}

/* Card Response Notification Banner */
.card-response-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  max-width: 700px;
  width: 90%;
  animation: slideDown 0.3s ease-out;
}

.response-notification-content {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border: 4px solid #ffc107;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.response-notification-header h3 {
  margin: 0 0 1rem 0;
  color: #856404;
  font-size: 1.3rem;
}

.response-notification-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.shown-card-display,
.culprit-card-display {
  text-align: left;
}

.shown-card-display h4,
.culprit-card-display h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #856404;
  font-weight: 600;
  text-align: center;
}

.notification-card-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.notification-card-image .card {
  width: 140px;
  height: 196px;
  margin: 0;
}

.response-notification-question {
  margin: 1rem 0;
  color: #856404;
  font-size: 1rem;
}

.response-notification-buttons {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.response-notification-buttons .btn-large {
  min-width: 150px;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 1rem 2rem;
}

.response-notification-status {
  margin-top: 1rem;
}

.response-notification-status .response-given {
  font-weight: 600;
  color: #155724;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.response-notification-status .waiting-text {
  font-style: italic;
  color: #666;
  margin: 0.5rem 0;
}

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

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.notification-content {
  background: white;
  border: 3px solid #007bff;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
}

.notification-message {
  display: block;
  color: #333;
  line-height: 1.6;
}

.notification-header {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #007bff;
}

.notification-card {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

.notification-responses {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.notification-stack {
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.notification-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  color: #000;
  background: #f0f0f0;
  border-radius: 50%;
}

/* Game Header */
.game-header {
  padding: 1rem 2rem;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 2rem;
}

.game-header h1 {
  margin: 0 0 0.5rem 0;
}

.game-info {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.status {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: bold;
}

.status.waiting {
  background: #ffc107;
  color: #000;
}

.status.in-progress {
  background: #28a745;
  color: white;
}

.status.completed {
  background: #6c757d;
  color: white;
}

/* Game Board */
.game-board {
  padding: 2rem;
}

.player-area {
  margin-bottom: 3rem;
  padding: 1.5rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.player-area.current-player {
  border-color: #007bff;
  background: #f0f8ff;
}

.player-area h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
}

.player-area h4 {
  margin: 1rem 0 0.5rem 0;
  font-size: 1rem;
  color: #666;
}

/* Turn Instructions */
.turn-instruction {
  background: #e7f3ff;
  border: 2px solid #007bff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #004085;
  font-weight: 500;
  text-align: center;
}

/* Waiting for Responses */
.waiting-for-responses {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #856404;
  text-align: center;
  animation: pulse-waiting 2s ease-in-out infinite;
}

.waiting-for-responses .waiting-message {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  font-size: 1rem;
}

.waiting-for-responses .response-progress {
  margin: 0;
  font-size: 0.95rem;
}

.waiting-for-responses .response-progress strong {
  font-size: 1.1rem;
  color: #856404;
}

@keyframes pulse-waiting {

  0%,
  100% {
    border-color: #ffc107;
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
  }

  50% {
    border-color: #ff9800;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.2);
  }
}

.action-hint {
  margin-bottom: 0.5rem;
  color: #666;
  font-style: italic;
  text-align: center;
}

/* Cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  overflow: visible;
}

.card {
  width: 120px;
  height: 168px;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: visible;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}

.card:hover {
  z-index: 1001;
}

.card.clickable {
  cursor: pointer;
  border-color: #007bff;
  border-width: 3px;
  animation: pulse-border 2s ease-in-out infinite;
}

.card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  border-color: #0056b3;
  animation: none;
}

@keyframes pulse-border {

  0%,
  100% {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 123, 255, 0.4);
  }

  50% {
    border-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(0, 123, 255, 0.2);
  }
}

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

/* Card Tooltip */
.card-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 1000;
  width: 140px;
}

.card:hover .card-tooltip {
  opacity: 1;
}

.tooltip-content {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.tooltip-content .tooltip-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.tooltip-content .tooltip-item:last-child {
  margin-bottom: 0;
}

.tooltip-content .tooltip-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.tooltip-content strong {
  font-size: 0.9rem;
  color: #fff;
}

.tooltip-content .tooltip-disguise {
  color: #ffd700;
  font-size: 0.8rem;
}

.tooltip-content .tooltip-location {
  color: #87ceeb;
  font-size: 0.8rem;
}

/* Tooltip arrow pointing up */
.tooltip-content::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(0, 0, 0, 0.9);
}

.card.face-down {
  background: #6c757d;
}

/* Hand */
.hand {
  margin-bottom: 1.5rem;
}

/* Culprit */
.culprit {
  margin-bottom: 1.5rem;
}

.culprit .winner-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
  margin-left: 0.5rem;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* Stacks */
.stacks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.yes-stack,
.no-stack {
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f9f9f9;
}

.yes-stack {
  border-color: #28a745;
  background: #f0fff4;
}

.no-stack {
  border-color: #dc3545;
  background: #fff5f5;
}

/* Card Response Prompt */
.card-response-prompt {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #fff3cd;
  border: 3px solid #ffc107;
  border-radius: 8px;
}

.response-prompt-content h4 {
  margin-top: 0;
  color: #856404;
}

.shown-card-info {
  font-size: 1.1rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: white;
  border-radius: 4px;
  border-left: 4px solid #ffc107;
}

.response-prompt-content p {
  margin: 0.75rem 0;
  color: #856404;
}

.response-given {
  font-weight: 600;
  color: #155724;
}

.waiting-text {
  font-style: italic;
  color: #666;
}

.response-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.response-buttons .btn {
  min-width: 120px;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.75rem 2rem;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

/* Action Buttons Bar */
.action-buttons-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  justify-content: center;
  flex-wrap: wrap;
}

.action-buttons-bar .btn {
  min-width: 150px;
  font-size: 1rem;
  font-weight: 600;
}

/* Actions */
.actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

/* Other Players */
.other-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Draw Pile Info */
.draw-pile-info {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 4px;
  text-align: center;
  margin-top: 2rem;
}

/* Waiting Room */
.waiting-room {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  text-align: center;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: #f9f9f9;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  color: #000;
  background: #f0f0f0;
}

/* Game Card Modal */
.game-card-content {
  max-width: 800px;
  width: 95%;
  position: relative;
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #dee2e6;
}

.game-card-header h3 {
  margin: 0;
  color: #333;
}

.game-card-instructions {
  background: #e7f3ff;
  border: 2px solid #007bff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #004085;
  font-size: 0.95rem;
}

.game-card-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.game-card-section {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
}

.game-card-section h4 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #007bff;
}

.game-card-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-card-item {
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
  user-select: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.game-card-item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.game-card-item span {
  flex: 1;
}

.game-card-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.game-card-action-btn {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 2px solid;
  border-radius: 6px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: white;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.game-card-cross-btn {
  color: #dc3545;
  border-color: #dc3545;
}

.game-card-cross-btn:hover,
.game-card-cross-btn:active {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

.game-card-cross-btn:active {
  transform: scale(0.95);
}

.game-card-circle-btn {
  color: #28a745;
  border-color: #28a745;
}

.game-card-circle-btn:hover,
.game-card-circle-btn:active {
  background: #28a745;
  color: white;
  transform: scale(1.1);
}

.game-card-circle-btn:active {
  transform: scale(0.95);
}

.game-card-item.crossed-out {
  background: #f8f9fa;
  color: #999;
  text-decoration: line-through;
  border-color: #dc3545;
  opacity: 0.6;
}

.game-card-item.crossed-out .game-card-item-icon {
  opacity: 0.4;
}

.game-card-item.crossed-out .game-card-cross-btn {
  background: #dc3545;
  color: white;
  opacity: 1;
}

.game-card-item.circled {
  background: #d4edda;
  color: #155724;
  border-color: #28a745;
  border-width: 3px;
  font-weight: 600;
}

.game-card-item.circled .game-card-item-icon {
  filter: brightness(1.1);
}

.game-card-item.circled .game-card-circle-btn {
  background: #28a745;
  color: white;
}

.game-card-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1.5rem;
  border-top: 2px solid #dee2e6;
  margin-top: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .setup-options {
    grid-template-columns: 1fr;
  }

  .cards {
    justify-content: center;
  }

  .card {
    width: 100px;
    height: 140px;
  }

  .card-tooltip {
    width: 120px;
    margin-top: 6px;
  }

  .tooltip-content {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }

  .response-notification-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .other-players {
    grid-template-columns: 1fr;
  }

  .stacks {
    grid-template-columns: 1fr;
  }

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

  .game-card-item {
    padding: 1rem;
    gap: 1rem;
  }

  .game-card-item-actions {
    gap: 0.75rem;
  }

  .game-card-action-btn {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }

  .action-buttons-bar {
    flex-direction: column;
  }

  .action-buttons-bar .btn {
    width: 100%;
  }
}
