* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, #0f172a, #0b1020 40%, #050912);
  color: #e9eefb;
  min-height: 100vh;
}

.pick-overlay,
.roster-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  padding: 16px;
}

.pick-overlay.show,
.roster-overlay.show {
  display: flex;
}

.pick-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  width: min(960px, 100%);
  animation: pop 0.4s ease;
  position: relative;
}

.tiers-container {
  width: min(1100px, 100%);
}

.roster-container {
  width: min(520px, 100%);
}

.pick-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.pick-panel.full {
  grid-column: 1 / -1;
}

.pick-panel.pilot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pick-panel .eyebrow {
  color: #a5f3fc;
}

.pick-title {
  font-size: 26px;
  font-weight: 800;
}

.pick-sub {
  color: #c8d3f2;
  font-size: 15px;
}

.pick-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: #0f162f;
  color: #e9eefb;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.team-card {
  cursor: pointer;
}

@keyframes pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #9fb0d9;
}

h1, h2, h3, h4 {
  margin: 4px 0 0;
}

.tier-badge {
  background: linear-gradient(120deg, #4f46e5, #06b6d4);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  color: #0b1020;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.panel.wide {
  grid-column: 1 / -1;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.status-card {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.status-name {
  font-size: 20px;
  font-weight: 800;
  color: #e2e8f0;
}

.pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.pool-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 8px 10px;
  border-radius: 12px;
  min-width: 0;
}

.pool-item .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-item .time {
  color: #9fb0d9;
  font-size: 13px;
}

.pool-item .badge {
  background: rgba(34,211,238,0.15);
  color: #a5f3fc;
}

.pool-item .avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.pool-item .avatar.sm {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.pool-item button {
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.pool-item button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0b1020;
  background: radial-gradient(circle at 30% 30%, hsl(var(--h,200),70%,65%), hsl(var(--h,200),70%,40%));
  border: 1px solid rgba(255,255,255,0.18);
  overflow: hidden;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 12px;
}

.avatar.lg {
  width: 90px;
  height: 90px;
  font-size: 24px;
  border-radius: 22px;
  background: radial-gradient(circle at 30% 30%, hsl(var(--h,200),70%,70%), hsl(var(--h,200),70%,45%));
}

.avatar.xl {
  width: 250px;
  height: 250px;
  font-size: 48px;
  border-radius: 28px;
  background: radial-gradient(circle at 30% 30%, hsl(var(--h,200),70%,70%), hsl(var(--h,200),70%,45%));
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.controls .status {
  color: #9fb0d9;
  font-size: 12px;
  min-width: 120px;
}

.turn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  z-index: 300;
  backdrop-filter: blur(2px);
}

.turn-overlay.show {
  display: flex;
}

.claim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 320;
  backdrop-filter: blur(2px);
}

.claim-overlay.show {
  display: flex;
}

.claim-card {
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 18px;
  border-radius: 14px;
  width: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.claim-card h3 {
  margin: 0 0 6px 0;
}

.claim-note {
  color: #9fb0d9;
  margin: 0 0 12px 0;
  font-size: 13px;
}

.claim-card select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
}

.claim-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.captain-chip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.captain-chip-card {
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.captain-chip-card .chip-stack {
  gap: 6px;
}

.captain-chip-card .chip.used {
  opacity: 0.35;
}

label {
  font-size: 12px;
  color: #c8d3f2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

select, button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f162f;
  color: #e9eefb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
}

select option {
  color: #e9eefb;
  background: #0f162f;
}

button {
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(120deg, #22d3ee, #4f46e5);
  border: none;
  color: #050912;
  font-weight: 700;
}

.ghost {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.nomination-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.pilot-card,
.info-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.pilot-card .pilot-name,
.info-card .captain-name {
  font-size: 22px;
  font-weight: 700;
}

.pilot-tier,
.info-card .captain-tier {
  color: #9fb0d9;
}

.pilot-meta {
  display: grid;
  gap: 4px;
}

.pilot-card .avatar {
  width: 150px;
  height: 150px;
  border-radius: 18px;
}

.pilot-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.info-meta {
  display: grid;
  gap: 6px;
}

.caps-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.caps-roster {
  font-size: 13px;
  color: #c8d3f2;
}

.bid-console {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: flex-start;
}

.bid-main {
  display: grid;
  gap: 8px;
  flex: 1;
}

.order-tile {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
}

.turn-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bid-row {
  display: flex;
  justify-content: space-between;
}

.order {
  display: grid;
  gap: 4px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-item {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item.active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34,211,238,0.5);
  background: rgba(34,211,238,0.15);
}

.order-item.disabled {
  opacity: 0.45;
  position: relative;
}

.order-item .order-x {
  color: #f87171;
  font-weight: 900;
  margin-left: 6px;
}

.order-item.pass {
  opacity: 0.55;
}

.order-chip {
  display: inline-block;
  min-width: 26px;
  padding: 4px 6px;
  background: #11182d;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}

.order-chip.outbid {
  opacity: 0.5;
}

.history-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .history-wrap {
    grid-template-columns: 1fr;
  }
}

.chip-tray {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  min-width: 30px;
  padding: 6px 7px;
  background: #11182d;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.chip.available {
  background: linear-gradient(120deg, #22d3ee, #4f46e5);
  color: #050912;
  border: none;
  cursor: pointer;
}

.chip.selected {
  box-shadow: 0 0 0 2px #22d3ee inset;
}

.actions {
  display: flex;
  gap: 6px;
}

.pulse-bid {
  animation: pulseBid 0.45s ease;
}

.pulse-pass {
  animation: pulsePass 0.45s ease;
}

@keyframes pulseBid {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34,211,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}

@keyframes pulsePass {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); transform: translateY(0); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0.05); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); transform: translateY(0); }
}

.log {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.log-entry {
  background: rgba(255,255,255,0.03);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
}

.teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.team-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chip-stack {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.captain-video {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 8px;
  min-height: 70px;
  flex-shrink: 0;
}

.team-card .avatar,
.team-card .avatar.sm {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.detail-main .avatar {
  flex-shrink: 0;
}

.badge {
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(79,70,229,0.2);
  color: #c7d2fe;
  font-size: 12px;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: auto;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: #c8d3f2;
  min-height: 26px;
  min-width: 0;
}

.slot-tier {
  margin-right: 8px;
  color: #a7b8e0;
  font-weight: 600;
}

.slot .slot-name.captain {
  color: #22d3ee;
  font-weight: 700;
}

.slot-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.slot-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-meta {
  color: #9fb0d9;
  font-size: 12px;
  white-space: nowrap;
  display: inline-block;
}

.slot-chip {
  flex-shrink: 0;
}
.slot-chip.used {
  opacity: 0.35;
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.tier-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.tier-block h4 {
  margin: 0;
}

.tier-pilot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}

.tier-pilot.drafted {
  opacity: 0.45;
  text-decoration: line-through;
}

.tier-pilot .meta {
  color: #9fb0d9;
  font-size: 12px;
}

.detail-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.detail-main {
  display: flex;
  gap: 8px;
  align-items: center;
}

.detail-meta {
  color: #c8d3f2;
  font-size: 12px;
}

.hint {
  color: #9fb0d9;
  font-size: 12px;
  min-height: 16px;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .nomination-body {
    grid-template-columns: 1fr;
  }
}
