/* ===========================================
   PAGE: Imposter (loaded after style.css)
   Laid out like the BiteMap page: the hero is the game table, in the felt of
   the mode you pick, with a hand of three cards to flip. Felt green, card red,
   Joker purple, gold chips and cream cards come from the app's Theme.
   =========================================== */

.im-hero {
  --room: #1F4A3F;
  --light: #3A7D63;
  --pixel: 'Pixelify Sans', var(--font-sans, system-ui), sans-serif;
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + var(--space-10)) var(--gutter) var(--space-12);
  background:
    radial-gradient(ellipse 70% 60% at 68% 45%, var(--light) 0%, transparent 70%),
    var(--room);
  transition: background-color 0.6s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.im-hero__inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

.im-hero__copy {
  text-align: center;
  position: relative;
  z-index: 2;
}

.im-hero__title {
  font-family: var(--pixel);
  font-size: clamp(56px, 9vw, 104px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: #F3EAD7;
  margin: 0 0 var(--space-4);
}

.im-hero__lead {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 var(--space-4);
}

.im-hero__lead em {
  font-style: normal;
  color: #F2B33D;
}

.im-hero__desc {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.82);
  max-width: 440px;
  margin: 0 auto var(--space-8);
}

.im-hero__note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #F2B33D;
}

.im-hero .store-badges { justify-content: center; }

/* Until release: the badge, dimmed and unlinked, under a gold tag. */
.im-soon {
  align-items: center;
  gap: 12px;
}

.im-soon__tag {
  font-family: var(--pixel);
  font-size: 16px;
  font-weight: 700;
  color: #1B1B1F;
  background: #F2B33D;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 0 #A87818;
}

.im-soon__badge {
  height: 44px;
  width: auto;
  opacity: 0.55;
}

.im-hero .bitemap-hero__links { justify-content: center; }

.im-hero .bitemap-hero__link,
.im-hero .bitemap-hero__sep { color: rgba(255, 255, 255, 0.75); }

.im-hero .bitemap-hero__link:hover { color: #fff; }

/* ----- The stage: a hand of three cards, the mode picker and a re-deal. ----- */

.im-stage {
  --card-w: 150px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.im-hand {
  position: relative;
  width: min(92vw, 480px);
  height: calc(var(--card-w) * 1.4 + 70px);
}

.im-card {
  position: absolute;
  left: 50%;
  top: 40px;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
  margin-left: calc(var(--card-w) / -2);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  transition: transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.im-card:nth-child(1) { transform: translateX(-86%) translateY(14px) rotate(-14deg); }
.im-card:nth-child(2) { transform: translateY(-10px); z-index: 1; }
.im-card:nth-child(3) { transform: translateX(86%) translateY(14px) rotate(14deg); }

.im-card:nth-child(1):hover { transform: translateX(-86%) translateY(2px) rotate(-14deg); }
.im-card:nth-child(2):hover { transform: translateY(-22px); }
.im-card:nth-child(3):hover { transform: translateX(86%) translateY(2px) rotate(14deg); }

.im-card:focus-visible { outline: none; }
.im-card:focus-visible .im-card__inner { box-shadow: 0 0 0 3px #fff; }

.im-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.im-card[aria-pressed="true"] .im-card__inner { transform: rotateY(180deg); }

.im-card__back,
.im-card__face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

/* The app's red card back: a diamond lattice inside a cream rule. */
.im-card__back {
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(255, 255, 255, 0.12) 9px 11px),
    repeating-linear-gradient(-45deg, transparent 0 9px, rgba(255, 255, 255, 0.12) 9px 11px),
    #B8323C;
  border: 3px solid #8E2530;
}

.im-card__back::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(243, 234, 215, 0.55);
  border-radius: 7px;
}

.im-card__face {
  transform: rotateY(180deg);
  background: #F3EAD7;
  color: #1B1B1F;
  border: 3px solid #D9CDB3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  text-align: center;
}

.im-card__corner {
  position: absolute;
  top: 8px;
  left: 9px;
  font-family: var(--pixel);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}

.im-card__category {
  font-family: var(--pixel);
  font-size: 11px;
  color: #6B6457;
  margin: 0;
}

.im-card__word {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

.im-card__question {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.im-card__face--joker {
  background: #3E2A6B;
  border-color: #F2B33D;
  color: #F3EAD7;
}

.im-card__face--joker .im-card__corner { color: #F2B33D; }

.im-card__mark {
  font-family: var(--pixel);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #F2B33D;
  margin: 0;
}

.im-card__joker {
  font-family: var(--pixel);
  font-size: 12px;
  text-transform: uppercase;
  margin: 0;
}

.im-card__face--joker .im-card__category { color: rgba(243, 234, 215, 0.7); }

.im-card__hint {
  font-family: var(--pixel);
  font-size: 11px;
  color: #F2B33D;
  margin: 0;
}

/* Question mode: once every card is up, the odd one out lights up. */
.im-card--odd .im-card__face {
  border-color: #F2B33D;
  box-shadow: 0 0 0 3px #F2B33D, 0 14px 28px rgba(0, 0, 0, 0.35);
}

.im-stage__hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.im-stage__status {
  margin-top: var(--space-2);
  min-height: 1.5em;
  font-size: var(--text-lg);
  font-weight: 800;
  color: #fff;
  text-align: center;
}

.im-picker {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.im-picker__chip,
.im-deal {
  font-family: var(--pixel);
  font-size: 16px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.im-picker__chip {
  padding: 9px 18px;
  color: #F3EAD7;
  background: rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.im-picker__chip:hover { border-color: rgba(255, 255, 255, 0.6); }

.im-picker__chip[aria-pressed="true"] {
  background: #F3EAD7;
  border-color: #F3EAD7;
  color: #1B1B1F;
}

/* The app's chunky button: a coloured face on a dark edge it sinks into. */
.im-deal {
  margin-top: var(--space-4);
  padding: 10px 22px;
  color: #fff;
  background: #F0483E;
  border: 0;
  box-shadow: 0 4px 0 #9E2A23;
}

.im-deal:active { transform: translateY(3px); box-shadow: 0 1px 0 #9E2A23; }

.im-picker__chip:focus-visible,
.im-deal:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Phones: the cards first, where the eye lands, then the words. */
@media (max-width: 899px) {
  .im-stage { order: -1; --card-w: 116px; }
  .im-hero { padding-top: calc(var(--nav-height) + var(--space-4)); }
  .im-hero__inner { gap: var(--space-6); }
  .im-card__word { font-size: 17px; }
  .im-card__question { font-size: 11px; }
  .im-card__mark { font-size: 32px; }
  .im-card__joker { font-size: 10px; }
  .im-card__category,
  .im-card__hint { font-size: 10px; }
}

@media (min-width: 900px) {
  .im-hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }

  .im-hero__copy { text-align: left; }

  .im-hero__desc { margin-left: 0; }

  .im-hero .store-badges,
  .im-hero .bitemap-hero__links { justify-content: flex-start; }
}

@media (min-width: 1100px) {
  .im-stage { --card-w: 168px; }
}

@media (prefers-reduced-motion: reduce) {
  .im-hero,
  .im-card,
  .im-card__inner { transition: none; }
}

/* ----- Below the hero: the dark edge of the table, so the felt above leads. ----- */

.im-wrap {
  max-width: 1080px;
  margin: 0 auto;
}

.im-heading {
  font-family: var(--pixel);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 700;
  color: #F3EAD7;
  text-align: center;
  margin: 0 0 var(--space-12);
}

.im-how {
  padding: var(--space-20) var(--gutter);
  background: #0E1C17;
}

.im-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
}

.im-step {
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
}

.im-step__phone {
  width: 220px;
  max-width: 100%;
  height: auto;
  margin: 0 auto var(--space-6);
  display: block;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.5));
}

.im-step__num {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  background: #F2B33D;
  color: #1B1B1F;
  font-weight: 900;
  font-size: 15px;
  line-height: 32px;
}

.im-step__title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: #fff;
  margin: 0 0 var(--space-2);
}

.im-step__text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.im-inside {
  padding: var(--space-20) var(--gutter);
  background: #13261F;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.im-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8) var(--space-12);
}

.im-list li {
  padding-left: var(--space-5);
  border-left: 3px solid #F2B33D;
}

.im-list h3 {
  font-size: var(--text-md);
  font-weight: 800;
  color: #fff;
  margin: 0 0 var(--space-2);
}

.im-list p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

@media (min-width: 760px) {
  .im-steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
  .im-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .im-list { grid-template-columns: repeat(3, 1fr); }
}

/* The same light film grain as BiteMap, so it doesn't sit on the cards and screens. */
.grain { opacity: 0.05; }
