:root {
  --bg: #f4f4f4;
  --black: #161616;
  --grey: #cdcdcd;
  --blue: #4fa7ff;
  --orange: #fa8b48;
  --green: #4edd00;
  --red: #e53935;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--black);
  font-family: Arial, sans-serif;
}

/* ---------------- Header ---------------- */
.topbar {
  background: #000;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.logo {
  height: 40px;
}

.topbar-right {
  position: absolute;
  right: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.help-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* ---------------- Stats ---------------- */
.stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 18px 0 8px;
}

.condensed {
  font-family: "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
  letter-spacing: -0.05em;
}

.page-title {
  margin: 0;
  font-weight: 800;
  font-size: 28px;
}

.counter-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.timer {
  font-weight: 800;
  font-size: 22px;
}

/* ---------------- Layout ---------------- */
.layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
}

.left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.right-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---------------- Actors ---------------- */
.actors-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  margin: 12px 0 8px;
}

.actor-card img {
  width: 180px;
  border-radius: 16px;
  object-fit: cover;
}

.actor-name {
  margin: 8px 0 0;
  font-weight: 700;
}

/* ---------------- Controls ---------------- */
.controls {
  width: 100%;
  max-width: 520px;
}

.controls input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.suggestions {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
}

.suggestions div {
  padding: 8px 10px;
  cursor: pointer;
}

.suggestions div:hover {
  background: #eee;
}

.button-row {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ---------------- Buttons ---------------- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  color: #fff;
  cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.btn-submit {
  background: var(--orange);
}

.btn-red {
  background: var(--red);
}

.btn-blue {
  background: var(--blue);
}

/* ---------------- Guesses (Chain) ---------------- */
.chain-box {
  background: var(--grey);
  border-radius: 12px;
  padding: 12px 14px;
}

.chain-box h3 {
  margin: 6px 0 10px;
}

#chainList {
  list-style: none;
  margin: 0;
  padding: 0;
}

#chainList li {
  margin: 8px 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}

#chainList li.grey {
  background: #ddd;
}

#chainList li.blue {
  background: var(--blue);
  color: #fff;
}

#chainList li.orange {
  background: var(--orange);
  color: #fff;
}

#chainList li.green {
  background: var(--green);
  color: #fff;
}

/* Status under guesses */
.status {
  min-height: 22px;
}

/* ---------------- Overlays / Popups ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay.visible {
  display: flex;
}

.overlay-card {
  background: #fff;
  border: 2px solid #444;
  border-radius: 10px;
  width: 320px;
  padding: 20px;
  text-align: center;
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;   /* dark popup */
  color: #fff;        /* white text */
  border: 2px solid #444;
  border-radius: 10px;
  width: 320px;
  padding: 16px;
  z-index: 1000;
}

.popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: #fff; /* white close button */
}

/* ---------------- Footer ---------------- */
.footer {
  margin: 28px 0;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.footer img {
  display: block;
  margin: 8px auto 0;
}

/* Left-aligned nav for topbar */
.topbar-left {
  position: absolute;
  left: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Active pill outline */
.nav-link.active {
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- End Popup Enhancements ---------- */
#popup .page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: 10px;
  text-align: center; /* center title */
}

.popup-movie {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center; /* center film | year */
}

.popup-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.mini-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.popup-poster {
  width: 160px;
  border-radius: 12px;
  display: block;
  margin: 12px auto 0; /* center poster */
}

.share-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
}
