/* Components: the reusable pieces (boxes, chips, tabs, messages, avatars, badges). */

/* ---------- Panel (a box of content) ---------- */
.panel {
  background: color-mix(in srgb, var(--color-panel) 88%, transparent);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  min-width: 0;
}

/* A text box and a button side by side, wrapping when narrow */
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row input { flex: 1 1 180px; min-width: 0; }
.row button { flex: 1 0 auto; }

/* ---------- Idea chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
.chip {
  text-align: left;
  font: 600 var(--text-sm)/1.2 var(--font-ui);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  background: var(--color-well);
}
.chip:hover:not(:disabled) { color: var(--color-text); }

/* ---------- Messages ---------- */
.status { font-weight: 700; color: var(--color-text-muted); }
.status:empty { display: none; }
.status.err { color: var(--color-danger); }

.credits {
  margin: 0;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-gold);
}

/* Game of the day */
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-sm);
  padding: var(--gap-md);
  border-radius: var(--radius-md);
  background: var(--color-well);
  border: 1px dashed var(--color-gold);
}
.theme-card p { margin: 0; color: var(--color-text-muted); font-weight: 600; }
.theme-card b { color: var(--color-gold); }

/* "Building your game" and "Your game is ready" */
.progress,
.ready-card {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: var(--gap-md);
  border-radius: var(--radius-md);
  background: var(--color-well);
}
.progress p,
.ready-card p { margin: 0; font-weight: 600; }
.ready-card { flex-direction: column; align-items: stretch; border: 1px solid var(--color-accent); box-shadow: var(--glow-accent); }
.ready-card b { color: var(--color-accent-2); }

.dots { display: flex; gap: 6px; flex: none; }
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--glow-accent);
  animation: bounce 1s infinite ease-in-out;
}
.dots i:nth-child(2) { background: var(--color-accent-2); box-shadow: var(--glow-accent-2); animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--color-well);
}
.tabs button {
  flex: 1;
  padding: 9px 6px;
  font-size: var(--text-sm);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}
.tabs button[aria-selected="true"] {
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-well);
  border: 1px solid var(--color-line);
  font-size: 18px;
  line-height: 1;
}

.account-link {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-line);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
}
.account-link:hover { border-color: var(--color-accent-2); box-shadow: var(--glow-accent-2); }

/* ---------- Face button ---------- */
.face-button {
  flex: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  font-size: 15px;
}
.face-button .face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-well);
  border: 1px dashed var(--color-accent-2);
  color: var(--color-accent-2);
  font-size: 18px;
  overflow: hidden;
}
.face-button .face img { width: 100%; height: 100%; object-fit: cover; }
.face-button.has-face .face { border: 2px solid var(--color-accent-2); box-shadow: var(--glow-accent-2); }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
.badge {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
}

/* ---------- Pop-up message at the bottom ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-2);
  color: var(--color-on-accent-2);
  font: 700 var(--text-md) var(--font-ui);
  box-shadow: var(--glow-accent-2);
  z-index: 60;
}

/* ---------- Header: Party mode link, 🔥 streak and 🔔 challenge inbox ---------- */
.party-link {
  flex: none;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  color: var(--color-on-accent);
  background: var(--color-accent);
  box-shadow: var(--glow-accent);
}
.party-link:hover { filter: brightness(1.1); }

.streak-chip {
  flex: none;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
}

.inbox-button {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}
.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-on-accent);
  background: var(--color-accent);
  box-shadow: var(--glow-accent);
}

/* A row of small buttons (e.g. "Get more games" and "Have a code?") */
.row-buttons { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
