/* LearnHip Secret Role Plays
   Follows the card player look (randomq/cardset.css): warm table, white cards, navy lattice card backs, blue pill buttons, Nunito. */

/* 1. Design tokens */

.lh-rp {
  --table: #e9e3d8;
  --ink: #2b2a28;
  --title: #4d473d;
  --muted: #8a7f6c;
  --gold: #8a7a5c;
  --link: #6b6458;
  --navy: #26436e;
  --blue: #1875d0;
  --blue-edge: #125ca6;
  --white: #fff;
  --pile: #fbfaf7;
  --edge: #d6cebf;
  --lattice: rgba(255, 255, 255, 0.10);
  --ring: rgba(255, 255, 255, 0.25);
  --focus: rgba(24, 117, 208, 0.35);
  --role-a: #1875d0;
  --role-b: #c46a1c;
  --secret-bg: #fff4d6;
  --secret-edge: #e5c25a;
  --shadow-card: 0 16px 34px rgba(60, 45, 20, 0.20);
  --shadow-mini: 0 4px 12px rgba(60, 45, 20, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --font: "Nunito", sans-serif;
  --w: 680px;
}

body.page-roleplays {
  overflow-x: hidden;
  background: #e9e3d8;
}

body.page-roleplays .mainCenter {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.page-roleplays footer,
body.page-roleplays .footer {
  background: #f4f1eb;
  color: #6b6458;
}

body.page-roleplays footer a,
body.page-roleplays .footer a {
  color: #6b6458;
}

/* 2. Base and resets inside the activity */

.lh-rp {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 28px 16px 40px;
  background: var(--table);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.lh-rp *,
.lh-rp *::before,
.lh-rp *::after {
  box-sizing: border-box;
}

.lh-rp p,
.lh-rp ul,
.lh-rp h1,
.lh-rp h2,
.lh-rp h3 {
  margin: 0;
  padding: 0;
  max-width: none;
  font-family: var(--font);
  color: inherit;
}

.lh-rp button {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
  box-shadow: none;
  cursor: pointer;
}

.lh-rp button:hover {
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.lh-rp button:focus,
.lh-rp a:focus {
  outline: none;
}

.lh-rp button:focus-visible,
.lh-rp a:focus-visible,
.lh-rp summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

.lh-rp .rp-wrap {
  width: min(100%, var(--w));
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

.lh-rp h1 {
  color: var(--title);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.lh-rp .is-play h1 {
  font-size: 20px;
}

.lh-rp .is-play {
  --w: 540px;
  gap: 24px;
}

.lh-rp .rp-howto {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  text-wrap: balance;
}

.lh-rp .rp-lead {
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  text-wrap: balance;
}

.lh-rp .rp-head {
  display: grid;
  gap: 8px;
}

/* 3. Home: packs and tiles */

.lh-rp .rp-pack {
  display: grid;
  gap: 12px;
}

.lh-rp .rp-pack-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.lh-rp .rp-pack h2 {
  color: var(--title);
  font-size: 20px;
  font-weight: 900;
}

.lh-rp .rp-pack-players {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lh-rp .rp-pack-blurb {
  color: var(--muted);
  font-size: 15px;
}

.lh-rp .rp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.lh-rp .rp-tile {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-mini), 0 2px 0 var(--edge);
  color: var(--ink);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.lh-rp .rp-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(60, 45, 20, 0.14), 0 2px 0 var(--edge);
  color: var(--ink);
  text-decoration: none;
}

.lh-rp .rp-tile-title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.lh-rp .rp-tile-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.lh-rp .rp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lh-rp .rp-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--table);
  color: var(--title);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.lh-rp .rp-chip.is-work {
  background: #e3edf7;
  color: var(--navy);
}

.lh-rp .rp-chip.is-everyday {
  background: #fbeedf;
  color: #8a4a12;
}

/* 4. Role play view */

.lh-rp .rp-back {
  justify-self: start;
  color: var(--link);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.lh-rp .rp-back:hover {
  color: var(--title);
  text-decoration: underline;
}

.lh-rp .rp-kicker {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.lh-rp .rp-head .rp-meta {
  justify-content: center;
}

.lh-rp .rp-box {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--pile);
  box-shadow: 0 2px 0 var(--edge);
  font-size: 16px;
}

.lh-rp .rp-box b {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lh-rp .rp-box.is-intro {
  background: var(--white);
  font-size: 17px;
  line-height: 1.4;
}

.lh-rp .rp-step-title {
  color: var(--title);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.lh-rp .rp-roles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.lh-rp .rp-role-btn {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: 0 3px 0 var(--edge);
  text-align: center;
}

.lh-rp .rp-role-btn:hover {
  background: var(--white);
  box-shadow: 0 3px 0 var(--edge);
}

.lh-rp .rp-role-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--edge);
}

.lh-rp .rp-role-name {
  font-size: 18px;
  font-weight: 900;
}

.lh-rp .rp-roles.is-pair .rp-role-btn {
  min-width: 150px;
}

.lh-rp .rp-roles.is-pair .rp-role-name {
  font-size: 30px;
  line-height: 1;
}

.lh-rp .rp-role-sub {
  color: var(--muted);
  font-size: 13px;
}

.lh-rp .rp-role-btn[aria-pressed="true"] {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 3px 0 #1a2f4f;
}

.lh-rp .rp-role-btn[aria-pressed="true"] .rp-role-sub {
  color: rgba(255, 255, 255, 0.75);
}

/* 5. The role card (flips) */

.lh-rp .rp-deck {
  perspective: 1400px;
}

.lh-rp .rp-deck {
  position: relative;
}

.lh-rp .rp-stage {
  position: relative;
  z-index: 1;
}

.lh-rp .rp-stage.is-deal {
  animation: rp-deal 260ms ease-out both;
}

@keyframes rp-deal {
  from { transform: translateX(60px) rotate(6deg); }
  to { transform: translateX(0) rotate(0deg); }
}

.lh-rp .rp-start {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.lh-rp .rp-deck.is-flipped .rp-start {
  visibility: hidden;
}

.lh-rp .rp-start-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 2px 6px rgba(60, 45, 20, 0.12);
}

.lh-rp .rp-start-card.is-a { transform: rotate(-2.5deg); }
.lh-rp .rp-start-card.is-b { transform: rotate(1.5deg); }

.lh-rp .rp-scene {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 300ms ease;
}

.lh-rp .rp-deck.is-flipped .rp-scene {
  transform: rotateY(180deg);
}

.lh-rp .rp-face {
  grid-area: 1 / 1;
  min-height: 0;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.lh-rp .rp-front {
  transform: rotateY(180deg);
}

/* The face you can't see doesn't set the card's height */
.lh-rp .rp-deck:not(.is-flipped) .rp-front,
.lh-rp .rp-deck.is-flipped .rp-back-face {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}

.lh-rp .rp-deck.is-flipped .rp-back-face {
  bottom: 0;
}

.lh-rp .rp-deck:not(.is-flipped) .rp-front,
.lh-rp .rp-deck.is-flipped .rp-back-face {
  pointer-events: none;
}

.lh-rp .rp-back-face {
  position: relative;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
  cursor: pointer;
}

.lh-rp .rp-back-face::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 10px;
  background-color: var(--navy);
  background-image:
    repeating-linear-gradient(45deg, var(--lattice) 0 1.5px, transparent 1.5px 18px),
    repeating-linear-gradient(-45deg, var(--lattice) 0 1.5px, transparent 1.5px 18px);
}

.lh-rp .rp-back-face.is-empty {
  cursor: default;
}

.lh-rp .rp-badge {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  max-width: 86%;
  padding: 18px 40px;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: 0 0 0 6px var(--ring);
  text-align: center;
}

.lh-rp .rp-badge-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lh-rp .rp-badge-name {
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  text-wrap: balance;
}

.lh-rp .rp-badge-hint {
  color: var(--muted);
  font-size: 14px;
}

.lh-rp .rp-front {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 30px 30px 28px;
}

@media (hover: hover) and (pointer: fine) {
  .lh-rp .rp-deck:not(.is-flipped) .rp-back-face:not(.is-empty):hover {
    box-shadow: 0 22px 40px rgba(60, 45, 20, 0.28);
  }
}

.lh-rp .rp-card-kicker {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lh-rp .rp-card-name {
  margin-top: -10px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
}

.lh-rp .rp-card-text {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
}

.lh-rp .rp-points {
  display: grid;
  gap: 6px;
  margin: -4px 0 0;
  padding-left: 24px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.lh-rp .rp-secret {
  padding: 12px 16px;
  border: 2px dashed var(--secret-edge);
  border-radius: var(--radius-sm);
  background: var(--secret-bg);
  font-size: 17px;
}

.lh-rp .rp-secret b,
.lh-rp .rp-goal b,
.lh-rp .rp-ideas b,
.lh-rp .rp-phrases-title {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lh-rp .rp-secret b {
  color: #8a6a10;
}

.lh-rp .rp-goal {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--table);
  font-size: 17px;
  font-weight: 800;
}

.lh-rp .rp-ideas ul {
  display: grid;
  gap: 4px;
  padding-left: 20px;
  font-size: 16px;
}

.lh-rp .rp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.lh-rp .rp-chips li {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: #e3edf7;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
}

.lh-rp .rp-card-actions {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

/* 6. Buttons */

.lh-rp .pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 44px;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--blue-edge);
}

.lh-rp .pill-btn:hover {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 0 var(--blue-edge);
}

.lh-rp .pill-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--blue-edge);
}

/* 8. Small screens and motion */

@media (max-width: 480px) {
  .lh-rp h1 { font-size: 22px; }
  .lh-rp .is-play h1 { font-size: 20px; }
  .lh-rp .rp-front { padding: 24px 20px 22px; }
  .lh-rp .rp-card-text { font-size: 18px; }
  .lh-rp .rp-badge { padding: 16px 22px; }
  .lh-rp .rp-badge-name { font-size: 24px; }
  .lh-rp .rp-role-btn { min-width: 0; flex: 1 1 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .lh-rp .rp-scene { transition: none; }
  .lh-rp .rp-stage.is-deal { animation: none; }
  .lh-rp .rp-tile { transition: none; }
}
