/* ============================================
   Imperial Nobility — Blood Bowl Team Roster
   tools/INTeam/style.css
   ============================================ */

:root {
  --in-red:        #73030D;
  --in-red-dark:   #450008;
  --in-accent:     #732F3B;
  --in-gold:       #D4AF37;
  --in-gold-dark:  #9A7D0A;
  --in-gold-deep:  #6B5700;
  --in-bg:         #8C8C8C;
  --in-card:       #F2F2F2;
  --in-text:       #0D0D0D;
  --in-muted:      #555555;
  --in-border:     #D8D8D8;
  --in-radius:     4px;
}

/* --- PAGE BACKGROUND --- */
main {
  background: var(--in-bg);
  min-height: calc(100vh - 52px - 60px);
}

/* --- PAGE BANNER --- */
.page-banner {
  background: #1a0005;
  border-bottom: 3px solid var(--in-red);
  padding: 1.75rem 2rem;
}

.page-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.team-badge {
  width: 60px;
  height: 60px;
  background: var(--in-red);
  border: 2px solid var(--in-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--in-gold);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.team-title {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-size: 2rem;
  color: #f0ece4;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0;
}

.team-subtitle {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 500;
  font-size: 0.78rem;
  color: #a09090;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* --- ROSTER SECTION & GRID --- */
.roster-section {
  padding: 2rem;
  max-width: 1260px;
  margin: 0 auto;
}

.roster-grid {
  display: flex;
  flex-direction: column;  /* table-like vertical stack */
  gap: 0.6rem;
}

/* ==============================================
   PLAYER CARDS — single-line, full-width rows
   Everything on one line: num · name · pos | stats | skills
   ============================================== */
.player-card {
  background: var(--in-card);
  border: 3px solid var(--in-red);
  border-radius: var(--in-radius);
  width: 100%;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  user-select: none;
  outline: none;
  /* Single row — all items on one line */
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.28rem 0.75rem;
  min-height: 36px;
  box-shadow:
    3px 3px 0 0 var(--in-red-dark),
    6px 6px 0 0 rgba(0, 0, 0, 0.22),
    inset 1px 1px 0 rgba(255, 255, 255, 0.7),
    inset -1px -1px 0 rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.14s ease, transform 0.14s ease;
}

.player-card:hover,
.player-card:focus-visible {
  box-shadow:
    5px 5px 0 0 var(--in-red-dark),
    10px 10px 0 0 rgba(0, 0, 0, 0.18),
    inset 1px 1px 0 rgba(255, 255, 255, 0.7),
    inset -1px -1px 0 rgba(0, 0, 0, 0.1);
  transform: translate(-2px, -2px);
}

.player-card:focus-visible { border-color: #00e5a0; }

/* Star Player — gold border + ambient glow */
.player-card.star-player {
  border-color: var(--in-gold);
  box-shadow:
    3px 3px 0 0 var(--in-gold-dark),
    6px 6px 0 0 rgba(0, 0, 0, 0.22),
    inset 1px 1px 0 rgba(255, 255, 255, 0.7),
    inset -1px -1px 0 rgba(0, 0, 0, 0.1),
    0 0 16px rgba(212, 175, 55, 0.35);
}

.player-card.star-player:hover,
.player-card.star-player:focus-visible {
  box-shadow:
    5px 5px 0 0 var(--in-gold-dark),
    10px 10px 0 0 rgba(0, 0, 0, 0.18),
    inset 1px 1px 0 rgba(255, 255, 255, 0.7),
    inset -1px -1px 0 rgba(0, 0, 0, 0.1),
    0 0 24px rgba(212, 175, 55, 0.55);
  transform: translate(-2px, -2px);
}

/* ── All card text elements ── */
.card-num {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--in-red);
  flex-shrink: 0;
  white-space: nowrap;
}

.player-card.star-player .card-num { color: var(--in-gold-dark); }

.player-name {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--in-text);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Separator dots and pipes between sections */
.cd {
  color: #ccc;
  font-size: 0.8rem;
  flex-shrink: 0;
  user-select: none;
}

.player-pos {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--in-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.star-badge {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 700;
  font-size: 0.58rem;
  color: var(--in-gold-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--in-gold);
  background: rgba(212, 175, 55, 0.12);
  padding: 1px 4px;
  border-radius: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Inline stats: "MA 7 · ST 3 · AG 3+ · PA 4+ · AV 9+" */
.card-stats {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: #555;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Stat abbreviation label within .card-stats */
.ss {
  font-weight: 600;
  font-size: 0.72rem;
  color: #999;
}

/* Skills — takes all remaining space, truncates */
.card-skills {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: #555;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* GP value — star player only, pinned to right */
.card-value {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--in-gold-dark);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ====================================================
   MODAL OVERLAY
   ==================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay.active {
  opacity: 1;
}

/* --- TRADING CARD --- */
.trading-card {
  background: var(--in-card);
  border: 4px solid var(--in-red);
  border-radius: 6px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 1px 1px 0 rgba(255, 255, 255, 0.6);
  animation: cardIn 0.2s ease both;
  scrollbar-width: thin;
  scrollbar-color: var(--in-red) #eee;
}

.trading-card.star-card {
  border-color: var(--in-gold);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(212, 175, 55, 0.25),
    inset 1px 1px 0 rgba(255, 255, 255, 0.6);
}

.trading-card::-webkit-scrollbar       { width: 4px; }
.trading-card::-webkit-scrollbar-track { background: #eee; }
.trading-card::-webkit-scrollbar-thumb { background: var(--in-red); border-radius: 2px; }
.trading-card.star-card::-webkit-scrollbar-thumb { background: var(--in-gold-dark); }

@keyframes cardIn {
  from { transform: scale(0.93) translateY(10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* --- MODAL CLOSE --- */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.28);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s;
}

.modal-close:hover { background: rgba(0, 0, 0, 0.55); }

/* --- MODAL PLAYER HEADER --- */
.modal-player-header {
  background: var(--in-accent);
  padding: 1.1rem 3rem 1rem 1.1rem;
}

.modal-player-header.star-header {
  background: linear-gradient(110deg, #7A5800 0%, var(--in-gold) 50%, #7A5800 100%);
}

.modal-jersey {
  display: block;
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.modal-player-header.star-header .modal-jersey {
  color: rgba(10, 5, 0, 0.6);
}

.modal-name {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-style: italic;
  font-size: 1.45rem;
  color: #fff;
  line-height: 1.15;
  margin: 0;
}

.modal-player-header.star-header .modal-name {
  color: #1a0005;
}

.modal-position {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 500;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

.modal-player-header.star-header .modal-position {
  color: rgba(10, 5, 0, 0.6);
}

/* --- MODAL IMAGE (placeholder or real) --- */
.modal-image-area {
  width: 100%;
  height: 190px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 18px,
    rgba(0, 0, 0, 0.06) 18px,
    rgba(0, 0, 0, 0.06) 36px
  );
  pointer-events: none;
}

.modal-image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.img-placeholder-num {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 800;
  font-size: 5.5rem;
  color: rgba(255, 255, 255, 0.18);
  position: relative;
  z-index: 0;
  letter-spacing: -0.03em;
  pointer-events: none;
}

/* --- MODAL STATS --- */
.modal-stats {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--in-border);
}

.modal-stats-row {
  display: flex;
  border: 1px solid var(--in-border);
  border-radius: 2px;
  overflow: hidden;
}

.modal-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.2rem;
  border-right: 1px solid var(--in-border);
}

.modal-stat:last-child { border-right: none; }

.ms-label {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 500;
  font-size: 0.58rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
}

.ms-value {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--in-text);
  line-height: 1.3;
}

/* --- MODAL SKILLS --- */
.modal-skills {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--in-border);
}

.skills-label {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 700;
  font-size: 0.58rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
}

.skills-text {
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--in-text);
  line-height: 1.65;
  margin: 0;
}

/* --- MODAL FACT --- */
.modal-fact {
  padding: 0.9rem 1rem;
  font-family: 'Bespoke Slab', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.7;
  background: #f7f3f3;
  border-top: 1px solid var(--in-border);
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 720px) {
  .page-banner     { padding: 1.25rem 1rem; }
  .team-title      { font-size: 1.5rem; }
  .team-badge      { width: 48px; height: 48px; font-size: 1.1rem; }
  .roster-section  { padding: 1rem; }
  .roster-grid     { gap: 0.5rem; }
  .trading-card    { max-width: 100%; }
  .modal-name      { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .modal-overlay { padding: 0.5rem; align-items: flex-end; }
  .trading-card  { max-height: 94vh; border-radius: 6px 6px 0 0; }
  /* Let skills wrap on very small screens rather than truncate aggressively */
  .card-skills   { font-size: 0.66rem; }
}
