/* UNO TV Display Styles - Purple iOS Theme */

:root {
  --primary: #8B5CF6;
  --primary-dark: #7C3AED;
  --bg-dark: #1a1a2e;
  --bg-card: #25253d;
  --text: #ffffff;
  --text-muted: #a0a0b0;
  --success: #22c55e;
  --warning: #f59e0b;

  /* UNO card colors */
  --uno-red: #ff5555;
  --uno-blue: #5555ff;
  --uno-green: #22c55e;
  --uno-yellow: #fbbf24;
}

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

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Typography */
.title {
  font-family: 'Fredoka One', cursive;
  font-size: 5rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1rem;
}

.game-title {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  color: var(--primary);
}

/* Waiting Screen */
.room-code-display {
  text-align: center;
  margin-bottom: 3rem;
}

.room-label {
  display: block;
  color: var(--text-muted);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.room-code {
  font-family: 'Fredoka One', monospace;
  font-size: 5rem;
  color: var(--primary);
  letter-spacing: 0.2em;
}

.room-code-small {
  font-family: 'Fredoka One', monospace;
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.player-list {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.player-card {
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border-radius: 16px;
  text-align: center;
  min-width: 150px;
}

.player-card.connected {
  border: 2px solid var(--success);
}

.player-card .name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.player-card .status {
  color: var(--text-muted);
}

.player-card.connected .status {
  color: var(--success);
}

.waiting-text {
  color: var(--text-muted);
  font-size: 1.5rem;
}

/* Game Layout */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-card);
}

.game-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

/* Table Layout - Players around edges */
.table-layout {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.table-player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-radius: 16px;
  transition: all 0.3s;
}

.table-player.active {
  border: 3px solid var(--primary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Position players around table */
.table-player.pos-top {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.table-player.pos-bottom {
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.table-player.pos-left {
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.table-player.pos-right {
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.table-player .name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.table-player .card-count {
  font-size: 2.5rem;
  font-family: 'Fredoka One', cursive;
  color: var(--primary);
}

.table-player .card-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Mini hand display */
.mini-hand {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.mini-card {
  width: 20px;
  height: 30px;
  background: var(--primary-dark);
  border-radius: 3px;
}

/* Table Center */
.table-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.discard-pile {
  position: relative;
}

/* Card Styles */
.card-large {
  width: 120px;
  height: 180px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: bold;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  background: var(--bg-card);
  border: 4px solid white;
}

.card-large.red { background: var(--uno-red); color: white; }
.card-large.blue { background: var(--uno-blue); color: white; }
.card-large.green { background: var(--uno-green); color: white; }
.card-large.yellow { background: var(--uno-yellow); color: #333; }
.card-large.wild {
  background: linear-gradient(135deg,
    var(--uno-red) 0%, var(--uno-red) 25%,
    var(--uno-yellow) 25%, var(--uno-yellow) 50%,
    var(--uno-green) 50%, var(--uno-green) 75%,
    var(--uno-blue) 75%, var(--uno-blue) 100%
  );
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.current-color {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
}

.current-color.red { background: var(--uno-red); }
.current-color.blue { background: var(--uno-blue); }
.current-color.green { background: var(--uno-green); }
.current-color.yellow { background: var(--uno-yellow); color: #333; }

.turn-indicator {
  font-size: 1.5rem;
}

.turn-indicator span {
  color: var(--primary);
  font-weight: 600;
  font-size: 2rem;
}

.direction-indicator {
  font-size: 3rem;
  color: var(--text-muted);
  animation: spin 3s linear infinite;
}

.direction-indicator.reversed {
  animation-direction: reverse;
}

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

/* Winner Screen */
.winner-banner {
  font-family: 'Fredoka One', cursive;
  font-size: 5rem;
  color: var(--warning);
  margin-bottom: 1rem;
  animation: pulse 1s ease-in-out infinite;
}

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

.winner-name {
  font-family: 'Fredoka One', cursive;
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 3rem;
}

.final-standings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
}

.standings-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-card);
  border-radius: 12px;
  font-size: 1.5rem;
}

.standings-row.winner {
  background: var(--primary);
}

/* Confetti */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti {
  position: absolute;
  width: 15px;
  height: 15px;
  top: -15px;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  to {
    top: 100vh;
    transform: rotate(720deg);
  }
}

.hidden {
  display: none !important;
}
