/* UNO Host Styles */

/* ===== Reset Extension ===== */
* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100dvh;
}

/* ===== Screen Extension ===== */
.screen {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Title Extension ===== */
.title {
  font-size: 3rem;
  color: var(--primary);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== Form Elements ===== */
.form-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

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

.player-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.player-input {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.2s;
}

.player-input:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

/* ===== Button Extensions ===== */
.btn {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ===== Room Code ===== */
.room-code-container {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

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

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

.room-code-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 100;
}

.menu-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  white-space: nowrap;
}

.menu-btn:hover {
  background: var(--bg-input);
}

/* ===== Player Status ===== */
.player-status-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.player-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  border-left: 4px solid var(--text-muted);
}

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

.player-status .name {
  font-weight: 600;
}

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

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

.waiting-text {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ===== Game Screen ===== */
.game-header {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

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

.game-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.discard-pile {
  display: flex;
  justify-content: center;
}

/* ===== Card Large ===== */
.card-large {
  width: 100px;
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  background: var(--bg-card);
  border: 3px solid white;
}

.card-large.red { background: var(--uno-red); }
.card-large.blue { background: var(--uno-blue); }
.card-large.green { background: var(--uno-green); }
.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%
  );
}

/* ===== Current Color ===== */
.current-color {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  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 ===== */
.turn-indicator {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

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

/* ===== Player Hands Overview ===== */
.player-hands-overview {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.player-hand-status {
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  text-align: center;
}

.player-hand-status.active {
  border: 2px solid var(--primary);
}

.player-hand-status .name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.player-hand-status .card-count {
  font-size: 1.5rem;
  color: var(--primary);
}

.player-hand-status .card-count-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Game Log ===== */
.game-log {
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
}

.log-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-input);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.log-entry:last-child {
  border-bottom: none;
}

/* ===== Winner Screen ===== */
.winner-content {
  justify-content: center;
  text-align: center;
}

.winner-banner {
  font-size: 2.5rem;
  animation: pulse 1s ease-in-out infinite;
}

.winner-name {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.final-standings {
  width: 100%;
  margin-bottom: 2rem;
}

.standings-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

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

/* ===== Testing Badge ===== */
.testing-badge {
  position: fixed;
  top: env(safe-area-inset-top);
  right: 0;
  background: var(--warning);
  color: #000;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 0 8px;
}
