:root {
  /* Requested exact palette */
  --linkedin-feed: #f3f2ef;
  --linkedin-blue: #0a66c2;
  --linkedin-green: #057642;
  --card-border: #e0dfdc;
  --text-main: #1f1f1f;
  --text-muted: #666666;
  --page-bottom-pad: 5px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; }
/*
 Overscroll chrome: white band at top (nav) + feed grey below (incl. past bottom).
  Fixed attachment keeps the split viewport-locked so rubber-band feels consistent.
*/
html {
  min-height: 100%;
  background-color: var(--linkedin-feed);
  background-image: linear-gradient(
    180deg,
    #ffffff 0,
    #ffffff 90px,
    var(--linkedin-feed) 90px,
    var(--linkedin-feed) 100%
  );
  background-attachment: fixed;
  background-repeat: no-repeat;
  scroll-behavior: smooth;
  scroll-padding-bottom: var(--page-bottom-pad);
  scroll-padding-top: 0;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: var(--linkedin-feed);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: var(--page-bottom-pad);
}

.container {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 0 32px;
}

.nav {
  background: #ffffff;
  border-bottom: 1px solid #e0dfdc;
}

.nav__inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LinkedIn wordmark is Myriad Pro Bold; Source Sans 3 is the closest free substitute. */
.logo {
  font-family: "Source Sans 3", "Myriad Pro", Myriad, "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-size: calc(26px * 1.2);
  font-weight: 700;
  letter-spacing: -0.045em;
  color: #111;
}
.logo span { color: var(--linkedin-blue); }

.logo--home {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  line-height: 1;
}
.logo--home .logo {
  display: inline-block;
}
.logo--home:focus-visible {
  outline: 2px solid var(--linkedin-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn {
  display: inline-block;
  border-radius: 10px;
  padding: 12px 18px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  transition: all 160ms ease;
  border: 1px solid var(--card-border);
  cursor: pointer;
}

.btn--solid {
  background: var(--linkedin-blue);
  color: #fff;
  border-color: var(--linkedin-blue);
}
.btn--solid:hover { filter: brightness(1.06); }

.btn--outline {
  background: #fff;
  color: var(--text-main);
}
.btn--outline:hover { background: var(--linkedin-feed); }

.hero { padding-top: 64px; }
h1 {
  margin: 0;
  font-size: clamp(46px, 9vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: #111;
}
h1 span { color: var(--linkedin-blue); }

.hero p {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 28px;
  max-width: 820px;
  line-height: 1.45;
}

.hero__actions {
  margin-top: 34px;
  display: flex;
  gap: 12px;
}

.preview { margin-top: 58px; }
.panel {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--linkedin-feed);
  padding: 26px;
}
.panel__label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.panel__streak {
  margin-top: 16px;
  font-weight: 800;
  font-size: 52px;
  text-align: center;
  color: var(--text-main);
}
.panel__sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: -2px;
  font-size: 13px;
}

.duel {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
}

/* Plain label text — same as .game-streak__label (“current streak”). */
.duel__vs,
.game-vs {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  color: #666;
  line-height: 1.2;
  letter-spacing: normal;
  align-self: center;
}

.duel__card {
  min-width: 0;
  background: #fff;
  border: 1px solid #e0dfdc;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.duel__card:hover {
  transform: translateY(-2px);
  border-color: #cfcdc9;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.duel__topbar {
  height: 4px;
  background: #0a66c2;
}
.duel__head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px 0;
}
.duel__head strong {
  display: block;
  font-size: 14px;
}
.duel__head small {
  display: block;
  color: #666;
  font-size: 11px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0a66c2;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}
.avatar--green {
  background: #057642;
  color: #fff;
}

.degree {
  color: #0a66c2;
  border: 1px solid #0a66c2;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  margin-left: 6px;
}

.duel__card p {
  color: #1f1f1f;
  line-height: 1.45;
  font-size: 13px;
  padding: 6px 14px 0;
  margin: 0;
}
.duel__card p a,
.see-more {
  color: #0a66c2;
  text-decoration: none;
}

.duel__react {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.reactDots {
  display: flex;
  align-items: center;
}
.reactDots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #fff;
  margin-left: -4px;
}
.reactDots span:first-child {
  margin-left: 0;
  background: #0a66c2;
}
.reactDots span:nth-child(2) { background: #e03b3b; }
.reactDots span:nth-child(3) { background: #f5a623; }

.reactPill {
  background: #f3f2ef;
  border: 1px solid #e0dfdc;
  color: #666;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
}

.duel__actions {
  border-top: 1px solid #e0dfdc;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 10px 10px;
}
.duel__actions span {
  color: #666;
  font-size: 12px;
  text-align: center;
  padding: 6px 4px;
}

.duel__hint {
  margin-top: 14px;
  background: transparent;
  border: 0;
  color: #666;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
}
.duel__hint b { color: #0a66c2; }

.stats {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.stat {
  padding: 26px;
  background: transparent;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat + .stat { border-left: 1px solid var(--card-border); }
.stat strong {
  display: block;
  font-size: clamp(42px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
  color: #0a66c2;
}
.stat small {
  color: #666;
  font-size: 13px;
}

.board { margin-top: 42px; }
.board__head {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--linkedin-feed);
  padding: 10px 0 14px;
}
.board__tab {
  appearance: none;
  border: 1px solid #d6d5d2;
  background: #fff;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.board__tab:hover { background: #f3f2ef; }
.board__tab--active {
  color: #1f1f1f;
  border-color: #cfcfcb;
}

.board ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e0dfdc;
  border-radius: 12px;
  overflow: hidden;
}
.board li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border-bottom: 1px solid #e9e8e5;
  background: #fff;
  padding: 0 14px;
}
.board li:last-child { border-bottom: 0; }
.board li span { color: #666; }
.board li b { font-weight: 500; }
.board li em { font-style: normal; font-weight: 700; color: #1f1f1f; }
.board li.board__empty {
  display: block;
  padding: 20px 14px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

#screenStart {
  padding-bottom: 12px;
}

#screenStart .board {
  margin-bottom: 32px;
}

/* View switching: landing vs game */
.screen {
  display: none;
}
.screen.screen--active {
  display: block;
}

#screenGame {
  padding: 12px 0 16px;
  min-height: 60vh;
}

.game-wrap {
  max-width: 100%;
}

.game-streak {
  text-align: center;
  margin-bottom: 10px;
}

.game-streak #streakValue {
  display: block;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.game-streak__label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.game-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.game-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: transform 140ms ease, opacity 140ms ease;
}

.game-card:hover:not(:disabled) {
  transform: translateY(-2px);
}

.game-card:disabled {
  cursor: default;
}

.game-card.card--good .game-card__media img {
  outline: 3px solid #057642;
  outline-offset: 3px;
}

.game-card.card--bad .game-card__media img {
  outline: 3px solid #e03b3b;
  outline-offset: 3px;
}

/* Game screenshots: CSS-only sizing via object-fit.
   Wrapper reserves height immediately; image scales to fit.
   No JS resize pass needed — eliminates big-then-small flash. */
.game-card__media {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: min(85vh, 1024px);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 0;
}

.game-card__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.game-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.game-card .resultBadge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #e0dfdc;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}

#screenGameOver,
#screenWin {
  padding: 48px 0 64px;
  min-height: 50vh;
}

.game-end {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 32px 24px;
  background: #fff;
  border: 1px solid #e0dfdc;
  border-radius: 12px;
}

.game-end__title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1f1f1f;
}

.game-end__streak {
  margin: 0 0 8px;
  font-size: 18px;
  color: #666;
}

.game-end__save {
  margin: 0 0 24px;
  min-height: 1.2em;
  font-size: 14px;
  color: #666;
}

.game-end__save:empty {
  display: none;
}

.game-end__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

#leaderboardList {
  transition: opacity 120ms ease;
}

#leaderboardList.board--fading {
  opacity: 0.55;
}

.name-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.name-modal[hidden] {
  display: none;
}
.name-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.name-modal__panel {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.name-modal__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.name-modal__sub {
  margin: 0 0 16px;
  color: #666;
  font-size: 14px;
  line-height: 1.45;
}
.name-modal__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.name-modal__input {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
}
.name-modal__input:focus {
  outline: 2px solid var(--linkedin-blue);
  outline-offset: 2px;
}
.name-modal__error {
  margin: 0;
  min-height: 1.2em;
  color: #b24020;
  font-size: 13px;
}
.name-modal__submit {
  width: 100%;
  border: 0;
  cursor: pointer;
}

@media (max-width: 860px) {
  .container { padding: 0 18px; }
  .hero { padding-top: 44px; }
  .hero p { font-size: 18px; }
  .duel { grid-template-columns: 1fr; }
  .duel__vs { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid #e0dfdc; }
  .game-cards {
    grid-template-columns: 1fr;
  }
  .game-vs {
    display: none;
  }
}

