/* === Lobby === */
.lobby {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.lobby-header {
  text-align: center;
  margin-bottom: 30px;
}

.lobby-header h1 {
  font-size: 48px;
  color: var(--accent);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.lobby-section {
  background: var(--bg-medium);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
}

.lobby-section h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.lobby-form {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.lobby-form input {
  flex: 1;
}

.room-list {
  list-style: none;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--card-border);
}

.room-item .room-name {
  font-weight: 600;
}

.room-item .room-host {
  color: var(--text-muted);
  font-size: 13px;
}

/* === Draft === */
.draft {
  max-width: 1400px;
  width: 100%;
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 20px;
  padding: 20px;
}

.draft-sidebar {
  background: var(--bg-medium);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--card-border);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.draft-sidebar h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.draft-main {
  display: flex;
  flex-direction: column;
}

.draft-status {
  text-align: center;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--bg-medium);
  border-radius: 8px;
  font-weight: 600;
}

.draft-status.my-turn {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}

.mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--card-bg);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.mini-card:hover {
  border-color: var(--accent);
}

.mini-card.selected {
  border-color: var(--accent-green);
  background: rgba(46, 204, 113, 0.1);
}

.mini-card img {
  width: 30px;
  height: 42px;
  object-fit: cover;
  border-radius: 3px;
}

/* === Player Card === */
.player-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  background: var(--card-bg);
}

.player-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.player-card.selected {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.player-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.player-card img {
  width: 100%;
  display: block;
}

.player-card .card-name {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  position: absolute;
  bottom: 0;
  width: 100%;
}

.player-card .card-rating {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* === Game Screen === */
.game-screen {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  height: 100vh;
  padding: 12px;
  background-image: url('/assets/field.png');
  background-size: cover;
  background-position: center;
}

.game-screen::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.game-screen > * {
  position: relative;
  z-index: 1;
}

/* Top bar */
.game-topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(22, 33, 62, 0.9);
  border-radius: 12px;
  padding: 12px 24px;
}

.score-display {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 4px;
}

.team-info {
  text-align: center;
}

.team-info .team-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.team-info .attacks-remaining {
  font-size: 12px;
  color: var(--text-muted);
}

.half-indicator {
  font-size: 14px;
  color: var(--accent-gold);
  font-weight: 600;
}

/* Side panels */
.game-panel {
  background: rgba(22, 33, 62, 0.9);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
}

/* Duel area */
.duel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.duel-cards {
  display: flex;
  gap: 40px;
  align-items: center;
}

.duel-card-slot {
  text-align: center;
}

.duel-card-slot img {
  width: 180px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.duel-card-slot .card-back {
  width: 180px;
  height: 252px;
  background: var(--card-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.vs-indicator {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

/* Attribute buttons */
.attribute-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 500px;
  width: 100%;
}

.attr-btn {
  padding: 12px;
  background: rgba(15, 52, 96, 0.9);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.attr-btn:hover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.2);
}

.attr-btn .attr-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.attr-btn .attr-value {
  font-size: 20px;
  font-weight: 700;
}

.attr-btn .stars {
  color: var(--star-filled);
  font-size: 14px;
}

/* Consecutive wins / ball progress */
.ball-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(22, 33, 62, 0.9);
  border-radius: 20px;
}

.ball-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card-border);
  transition: background 0.3s;
}

.ball-step.active {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

.ball-step.goal {
  background: var(--accent-gold);
}

/* Piggy bank */
.piggy-bank {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(243, 156, 18, 0.2);
  border: 1px solid var(--accent-gold);
  border-radius: 8px;
}

.piggy-bank .points {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Action menu */
.action-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 8px 14px;
  background: rgba(22, 33, 62, 0.9);
  border: 1px solid var(--accent-gold);
  border-radius: 6px;
  color: var(--accent-gold);
  font-size: 12px;
}

.action-btn:hover {
  background: rgba(243, 156, 18, 0.2);
}

.action-btn .action-cost {
  font-weight: 700;
  margin-left: 4px;
}

/* Match log */
.match-log {
  max-height: 300px;
  overflow-y: auto;
}

.log-entry {
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.log-entry.goal {
  color: var(--accent-green);
  font-weight: 600;
}

.log-entry.possession-change {
  color: var(--accent-gold);
}

/* Duel result overlay */
.duel-result-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.duel-result-text {
  font-size: 48px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.5s ease-out;
}

.duel-result-text.win {
  color: var(--accent-green);
}

.duel-result-text.lose {
  color: var(--danger);
}

/* Goal celebration */
.goal-overlay {
  animation: goalFlash 0.5s 3;
}

.goal-overlay .goal-text {
  font-size: 72px;
  font-weight: 900;
  color: var(--accent-green);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  animation: pulse 0.5s 3;
}

.goal-overlay .scorer-text {
  font-size: 24px;
  color: var(--text-primary);
  margin-top: 12px;
}

/* Result screen */
.result-screen {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px;
}

.final-score {
  font-size: 72px;
  font-weight: 900;
  margin: 30px 0;
  letter-spacing: 8px;
}

.goal-scorers {
  margin: 20px 0;
}

.goal-scorers h3 {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.goal-scorer-item {
  padding: 6px 0;
  color: var(--text-primary);
}

/* Lineup builder */
.lineup-builder {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.lineup-section {
  margin-bottom: 20px;
}

.lineup-section h3 {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.lineup-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lineup-slot {
  width: 80px;
  height: 110px;
  border: 2px dashed var(--card-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.lineup-slot.filled {
  border-style: solid;
  border-color: var(--accent-green);
}

.lineup-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* Waiting spinner */
.waiting {
  text-align: center;
  padding: 40px;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Coin flip */
.coin-flip-container {
  text-align: center;
}

.coin {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #e67e22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 30px auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: coinSpin 1s ease-out;
}

@keyframes coinSpin {
  0% { transform: rotateY(0deg) scale(0.5); }
  50% { transform: rotateY(540deg) scale(1.2); }
  100% { transform: rotateY(1080deg) scale(1); }
}
