/* ============================================================
   components.css — Shared UI components (Figma green theme)
   Loaded globally via base_competition.html.
   Font: Manrope — loaded once in base_competition.html.
   ============================================================ */

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(221, 255, 226, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 107, 27, 0.08);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid #006b1b;
  background: #91f78e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #006b1b;
}

.header-avatar-placeholder svg {
  width: 22px;
  height: 22px;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
  color: #006b1b;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #006b1b;
  text-decoration: none;
  transition: background 0.15s;
}

.header-icon-btn:hover {
  background: rgba(0, 107, 27, 0.08);
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Status banner ── */
.status-banner {
  position: relative;
  border-radius: 12px;
  border-left: 8px solid;
  padding: 28px 32px 28px 32px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-alive        { background: #91f78e; border-color: #006b1b; }
.status-pending      { background: #fff3cd; border-color: #856404; }
.status-dead         { background: #f8e9e6; border-color: #b02500; }
.status-waiting      { background: #cfe2ff; border-color: #0a58ca; }
.status-pending-reg  { background: #fff3cd; border-color: #856404; }
.status-not-playing  { background: #e9ecef; border-color: #6c757d; }
.status-winner       { background: #fef3c7; border-color: #d97706; }
.status-game-paused  { background: #fff7ed; border-color: #ea580c; }
.status-game-finished { background: #f0f9ff; border-color: #0284c7; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #006b1b;
  color: #d1ffc8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: 9999px;
  padding: 4px 12px;
  align-self: flex-start;
}

.status-pending      .status-badge { background: #856404; }
.status-dead         .status-badge { background: #b02500; color: #ffe8e3; }
.status-waiting      .status-badge { background: #0a58ca; color: #cfe2ff; }
.status-pending-reg  .status-badge { background: #856404; }
.status-not-playing  .status-badge { background: #6c757d; color: #f8f9fa; }
.status-winner       .status-badge { background: #d97706; color: #fef3c7; }
.status-game-paused  .status-badge { background: #ea580c; color: #fff7ed; }
.status-game-finished .status-badge { background: #0284c7; color: #e0f2fe; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  flex-shrink: 0;
}

.status-title {
  font-size: 34px;
  font-weight: 800;
  color: #005e17;
  margin: 0;
  line-height: 1.1;
  text-align: left;
}

.status-dead         .status-title { color: #7a1a00; }
.status-pending      .status-title { color: #5a4000; }
.status-waiting      .status-title { color: #09368a; }
.status-pending-reg  .status-title { color: #5a4000; }
.status-not-playing  .status-title { color: #343a40; }
.status-winner       .status-title { color: #78350f; }
.status-game-paused  .status-title { color: #9a3412; }
.status-game-finished .status-title { color: #075985; }

.status-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: rgba(0, 94, 23, 0.8);
  margin: 0;
  line-height: 1.5;
}

.status-dead         .status-subtitle { color: rgba(122, 26, 0, 0.8); }
.status-pending      .status-subtitle { color: rgba(90, 64, 0, 0.8); }
.status-waiting      .status-subtitle { color: rgba(9, 54, 138, 0.8); }
.status-pending-reg  .status-subtitle { color: rgba(90, 64, 0, 0.8); }
.status-not-playing  .status-subtitle { color: rgba(52, 58, 64, 0.8); }
.status-winner       .status-subtitle { color: rgba(120, 53, 15, 0.8); }
.status-game-paused  .status-subtitle { color: rgba(154, 52, 18, 0.8); }
.status-game-finished .status-subtitle { color: rgba(7, 89, 133, 0.8); }

.status-deco {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 90px;
  height: 90px;
  pointer-events: none;
  opacity: 0.35;
}
.status-deco svg { width: 100%; height: 100%; }
.status-alive        .status-deco { color: #006b1b; }
.status-winner       .status-deco { color: #d97706; }
.status-pending      .status-deco { color: #856404; }
.status-dead         .status-deco { color: #b02500; }
.status-waiting      .status-deco { color: #0a58ca; }
.status-pending-reg  .status-deco { color: #856404; }
.status-not-playing  .status-deco { color: #6c757d; }
.status-game-paused  .status-deco { color: #ea580c; }
.status-game-finished .status-deco { color: #0284c7; }

/* ── Info row (unified: alerts + nav links) ── */
.info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 8px solid;
  border-radius: 12px;
  padding: 16px 20px;
  text-decoration: none;
  transition: background 0.15s;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.info-row--red     { background: #f8e9e6; border-color: #b02500; }
.info-row--green   { background: #e8fbe9; border-color: #006b1b; }
.info-row--blue    { background: #e7f0ff; border-color: #0a58ca; }
.info-row--neutral { background: white;   border-color: #006b1b; }

.info-row--red:hover     { background: #f0d8d4; }
.info-row--green:hover   { background: #d4f5d5; }
.info-row--blue:hover    { background: #d5e4ff; }
.info-row--neutral:hover { background: #f0faf1; }

.info-row__icon {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-row--red     .info-row__icon { background: rgba(176,37,0,0.1);  color: #b02500; }
.info-row--green   .info-row__icon { background: rgba(0,107,27,0.1);  color: #006b1b; }
.info-row--blue    .info-row__icon { background: rgba(10,88,202,0.1); color: #0a58ca; }
.info-row--neutral .info-row__icon { background: #ddffe2;             color: #006b1b; }

.info-row__icon svg {
  width: 22px;
  height: 22px;
}

.info-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-row__title {
  font-size: 15px;
  font-weight: 700;
}

.info-row--red     .info-row__title { color: #b02500; }
.info-row--green   .info-row__title { color: #005e17; }
.info-row--blue    .info-row__title { color: #09368a; }
.info-row--neutral .info-row__title { color: #0b361d; }

.info-row__subtitle {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.info-row--red     .info-row__subtitle { color: #b02500; }
.info-row--green   .info-row__subtitle { color: rgba(0,94,23,0.75); }
.info-row--blue    .info-row__subtitle { color: rgba(9,54,138,0.75); }
.info-row--neutral .info-row__subtitle { color: #3b6447; }

.info-row__chevron {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.55;
}

.info-row__chevron svg {
  width: 8px;
  height: 12px;
}

/* ── Stat card ── */
.stat-card {
  background: white;
  border: 1px solid rgba(139, 183, 149, 0.1);
  border-radius: 12px;
  padding: 22px 24px 18px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.stat-card--full {
  width: 100%;
  box-sizing: border-box;
}

.stat-card--warn {
  border-color: #fcd34d;
}
.stat-card--warn .stat-label { color: #92400e; }
.stat-card--warn .stat-value { color: #b45309; }
.stat-card--warn .stat-sub   { color: #92400e; }

.stat-card--done {
  border-color: #86efac;
}
.stat-card--done .stat-value { color: #15803d; }

.stat-card--winner {
  border-left: 4px solid #fbbf24;
  text-align: center;
}
.stat-card--winner .stat-value { font-size: 48px; }
.stat-card--winner .stat-label { color: #78350f; font-weight: 700; }
.stat-card--winner .stat-sub   { color: var(--color-text-muted, #6b7280); }

/* clickable stat card */
.stat-card--link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.stat-card--link:hover { background: #f0fdf4; }
.stat-card--link .stat-label,
.stat-card--link .stat-value,
.stat-card--link .stat-sub { color: inherit; }

.stat-value--md { font-size: 28px; }

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #3b6447;
  margin: 0 0 4px;
}

.stat-value {
  font-size: 44px;
  font-weight: 800;
  color: #006b1b;
  margin: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 12px;
  font-weight: 600;
  color: #3b6447;
  margin: 8px 0 0;
}

/* ── Nav list —— */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Hints card (used on player profile & victim page) ── */
.player-hints-card {
  background: white;
  border: 1px solid rgba(139, 183, 149, 0.1);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-hints-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #3b6447;
  margin: 0;
}

/* Hint rows rendered by feature templates */
.player-hints-card .hint-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-hints-card .hint-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #3b6447;
}

.player-hints-card .hint-value {
  font-size: 15px;
  font-weight: 600;
  color: #0b361d;
}

/* ── Popup / modal ── */
.popup-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 1001;
  max-width: 440px;
  width: calc(100% - 48px);
  box-sizing: border-box;
  font-family: 'Manrope', Arial, sans-serif;
}

/* scrollable variant — caps height so big lists don't overflow viewport */
.popup-container--scroll {
  max-height: 80dvh;
  overflow-y: auto;
  display: none;
}
.popup-container--scroll.active { display: block; }

/* stats table inside popup */
.popup-stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}
.popup-stats-table th,
.popup-stats-table td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.popup-stats-table th { font-weight: 700; color: #3b6447; background: #f0fdf4; }
.popup-stats-table__total td { background: #f9fafb; }

.popup-container.active {
  display: block;
}

.popup-container h2,
.popup-container h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0b361d;
  margin: 0 0 12px;
  text-align: left;
}

.popup-container h3 {
  font-size: 15px;
  margin-top: 16px;
}

.popup-container p {
  font-size: 14px;
  font-weight: 500;
  color: rgba(11,54,29,0.75);
  line-height: 1.5;
  margin: 0 0 8px;
}

.popup-container ul {
  padding-left: 1.4em;
  margin: 0 0 8px;
}

.popup-container li {
  font-size: 14px;
  font-weight: 500;
  color: rgba(11,54,29,0.75);
  line-height: 1.6;
}

.popup-picture-container {
  text-align: center;
  margin-bottom: 16px;
}

.popup-picture {
  max-width: 72px;
  height: auto;
}

.popup-button-container {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.multiple-options {
  justify-content: space-between;
}

.main-button {
  padding: 11px 22px;
  background: #006b1b;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.main-button:hover {
  background: #005e17;
}

.secondary-button {
  padding: 11px 22px;
  background: transparent;
  color: #006b1b;
  border: 1.5px solid rgba(0,107,27,0.3);
  border-radius: 8px;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.secondary-button:hover {
  background: #f0faf1;
}

/* ── Backdrop ── */
.backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
}

.backdrop.active {
  display: block;
}

/* ── Toast messages ── */
.game-toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.game-toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.game-toast--success {
  background: #e8f9ec;
  border: 1px solid #a3d9a9;
  color: #1a5c26;
}

.game-toast--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
}

.game-toast--warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
}

.game-toast--info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a5f;
}
