.random-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 54px;
  z-index: 15;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(40, 20, 40, .75);
  border: 1.5px solid rgba(255, 123, 191, .45);
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(255, 180, 220, .95);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 14px rgba(255, 123, 191, .28)
}

.btn-mini.pulse {
  animation: pulse-soft 1.2s ease-in-out
}

@keyframes pulse-soft {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 123, 191, .0)
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 123, 191, .22)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 123, 191, .0)
  }
}

.random-overlay.hidden {
  display: none
}

.random-overlay .ro-emoji {
  animation: spin .9s ease
}

.level-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: grid;
  place-items: center;
  z-index: 50
}

.level-overlay.hidden {
  display: none
}

.level-chip {
  display: inline-block;
  background: rgba(20, 18, 30, .92);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 14px 22px;
  border-radius: 16px;
  font-weight: 1000;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  font-size: 34px;
  letter-spacing: .02em;
  text-shadow: 0 0 18px rgba(123, 92, 255, .6), 0 0 8px rgba(255, 255, 255, .5);
  animation: level-pop 1.2s ease
}

@keyframes level-pop {
  0% {
    transform: translateY(-14px) scale(.9);
    opacity: 0
  }

  25% {
    transform: translateY(0) scale(1);
    opacity: 1
  }

  80% {
    opacity: 1
  }

  100% {
    transform: translateY(-8px) scale(1.03);
    opacity: 0
  }
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, .8), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, .8), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1px 1px at 15% 60%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1200px 800px at 20% 0%, rgba(160, 64, 255, .25), rgba(0, 0, 0, 0)),
    radial-gradient(1200px 800px at 100% 100%, rgba(255, 64, 160, .2), rgba(0, 0, 0, 0)),
    linear-gradient(180deg, #0c0b10, #0a0812);
  background-size:
    200% 200%, 200% 200%, 200% 200%, 200% 200%,
    200% 200%, 200% 200%, 200% 200%, 200% 200%,
    100% 100%, 100% 100%, 100% 100%;
  animation: starfield 80s linear infinite;
}

@keyframes starfield {
  0% {
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%
  }

  100% {
    background-position: 100% 100%, -100% -100%, 50% 100%, 100% -100%, -50% 50%, 100% 0%, -100% 100%, 50% -50%, 0% 0%, 0% 0%, 0% 0%
  }
}

#app {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-bottom: 88px;
  color: #f3eefc
}

.screen {
  display: none;
  width: 100%;
  max-width: 680px
}

.screen.active {
  display: block
}

.header {
  text-align: center;
  margin-bottom: 8px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto
}

.logo-container {
  margin-bottom: 32px;
}

.header-logo {
  max-width: 200px;
  height: auto;
  margin: 0 auto 20px;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.logo-main {
  font-family: 'Cinzel', serif;
  font-size: 68px;
  font-weight: 900;
  background: linear-gradient(135deg, #a06cff 0%, #ff7bbf 50%, #ffa0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .08em;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 8px rgba(255, 123, 191, .4));
}

.logo-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .18em;
  color: rgba(255, 180, 220, .85);
  text-transform: uppercase;
  margin-top: -4px;
}

.intro-text {
  max-width: 560px;
  margin: 0 auto 36px;
  padding: 0 20px;
}

.intro-text p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(255, 220, 240, .88);
  margin: 0;
  text-align: center;
  font-weight: 500;
}

.section-title {
  margin: 0 0 28px;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  letter-spacing: .12em;
  font-weight: 700;
  color: rgba(255, 200, 230, .95);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 123, 191, .6), transparent);
}

.header-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  position: relative
}

.grid.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 16, .35);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: grid;
  place-items: center;
}

.grid.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 123, 191, .25);
  border-top-color: rgba(255, 123, 191, .9);
  border-radius: 50%;
  animation: spinner-rot .9s linear infinite, spinner-glow 1.6s ease-in-out infinite;
}

@keyframes spinner-rot {
  to {
    transform: translate(-50%, -50%) rotate(360deg)
  }
}

@keyframes spinner-glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 123, 191, .4)
  }

  50% {
    box-shadow: 0 0 18px rgba(255, 123, 191, .75)
  }
}

.role-card {
  background: rgba(20, 15, 30, .4);
  border: 2px solid rgba(255, 123, 191, .3);
  border-radius: 20px;
  padding: 0;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all .3s cubic-bezier(.25, .46, .45, .94);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05);
  min-height: 200px;
}

.role-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 123, 191, .15), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(160, 64, 255, .1), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
}

.role-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 123, 191, .65);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 123, 191, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.role-card:hover::before {
  opacity: 1
}

.role-card:active {
  transform: translateY(-2px)
}

.role-card.has-img {
  background-size: cover;
  background-position: center;
  min-height: 220px;
}

.role-card.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(20, 10, 30, .08) 0%,
      rgba(20, 10, 30, .25) 35%,
      rgba(15, 8, 25, .55) 70%,
      rgba(10, 5, 20, .78) 100%);
  pointer-events: none;
}

.role-card-content {
  position: relative;
  z-index: 2;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 216px;
  justify-content: flex-end;
}

.role-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .04em;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7), 0 0 18px rgba(255, 123, 191, .35);
}

.role-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  font-size: 16px;
  color: rgba(255, 123, 191, .85);
  filter: drop-shadow(0 0 8px rgba(255, 123, 191, .5));
}

.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(255, 200, 230, .75);
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(255, 123, 191, .4), transparent);
}

.role-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 123, 191, .12);
  border: 1px solid rgba(255, 123, 191, .35);
  border-radius: 999px;
  align-self: center;
  backdrop-filter: blur(8px);
}

.badge-icon {
  font-size: 12px;
  filter: drop-shadow(0 0 6px rgba(255, 123, 191, .4));
}

.badge-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255, 200, 230, .95);
  text-transform: none;
}

/* Home roles note */
.roles-note {
  margin: 50px auto 8px;
  max-width: 860px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25)
}

.rn-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .06em;
  color: #fff;
  margin: 0 0 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5)
}

.rn-text {
  margin: 0;
  color: rgba(230, 225, 240, .95);
  line-height: 1.5;
  font-size: 14px
}

.optin-card {
  min-height: 180px;
  background: linear-gradient(135deg, rgba(123, 92, 255, .15) 0%, rgba(255, 123, 191, .12) 100%);
  border-color: rgba(255, 123, 191, .65);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 28px rgba(255, 123, 191, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
  position: relative;
  overflow: hidden;
}

.optin-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 123, 191, .2), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(160, 64, 255, .15), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}

.optin-card .role-card-content {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px;
  position: relative;
  z-index: 2;
}

.optin-line {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .08em;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6), 0 0 12px rgba(255, 123, 191, .4);
  line-height: 1.4;
}

.optin-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  flex-direction: column
}

.optin-input {
  appearance: none;
  border: 1.5px solid rgba(255, 123, 191, .6);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  min-width: 0;
  width: 100%;
  transition: all .2s ease;
}

.optin-input::placeholder {
  color: rgba(255, 255, 255, .85)
}

.optin-input:focus {
  outline: none;
  border-color: rgba(255, 123, 191, 1);
  background: rgba(255, 255, 255, .2);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, .4);
}

.optin-input.invalid {
  border-color: #ff4d8d;
  box-shadow: 0 0 0 2px rgba(255, 77, 141, .3)
}

.optin-card .btn {
  padding: 11px 16px;
  border-radius: 10px;
  white-space: nowrap;
  width: 100%;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.optin-error {
  color: #ff7bbf;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 600
}

.optin-msg {
  font-weight: 800;
  color: rgba(255, 255, 255, .98);
  background: rgba(123, 92, 255, .22);
  border: 1px solid rgba(123, 92, 255, .45);
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(123, 92, 255, .2);
}

@media (max-width:480px) {
  .optin-form {
    flex-direction: column;
    align-items: stretch
  }

  .optin-card .btn {
    width: 100%
  }
}

@media (max-width:480px) {
  #app {
    padding: 12px 12px 92px;
  }

  .logo-main {
    font-size: 46px;
  }

  .logo-sub {
    font-size: 16px;
  }

  .intro-text p {
    font-size: 16px;
  }

  .roles-note {
    padding: 12px 14px;
  }

  .card {
    max-width: 94vw;
    border-radius: 14px;
  }

  .card-content {
    padding: 16px 12px 14px;
  }

  .card-actions {
    padding: 0 10px 32px;
  }

  .card-cta {
    gap: 10px
  }

  .card-cta .btn-fav-subtle {
    width: 44px;
    height: 44px;
  }

  .btn-next {
    font-size: 16px;
    padding: 12px 14px
  }

  .rating-star {
    font-size: 28px;
  }

  /* Reduce role card height further on small phones */
  .role-card {
    min-height: 160px
  }

  .role-card.has-img {
    min-height: 180px
  }
}

.card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  transition: box-shadow .3s ease;
  overflow: hidden;
  will-change: transform, filter, opacity
}

.card.enter {
  animation: cardFlipBlur .5s cubic-bezier(.25, .8, .25, 1)
}

@keyframes cardFlipBlur {
  0% {
    opacity: 0;
    transform: perspective(800px) rotateY(-12deg) translateY(6px);
    filter: blur(8px)
  }

  60% {
    opacity: 1;
    transform: perspective(800px) rotateY(2deg) translateY(0);
    filter: blur(2px)
  }

  100% {
    opacity: 1;
    transform: perspective(800px) rotateY(0) translateY(0);
    filter: blur(0)
  }
}

.card.slotting {
  animation: cardSlot .6s cubic-bezier(.25, .8, .25, 1)
}

@keyframes cardSlot {
  0% {
    transform: perspective(900px) rotateX(0);
    filter: blur(0)
  }

  45% {
    transform: perspective(900px) rotateX(90deg);
    filter: blur(6px)
  }

  55% {
    transform: perspective(900px) rotateX(90deg);
    filter: blur(6px)
  }

  100% {
    transform: perspective(900px) rotateX(0);
    filter: blur(0)
  }
}

.card.swipe-out {
  animation: swipeOut .4s cubic-bezier(.55, .085, .68, .53) forwards
}

@keyframes swipeOut {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1
  }

  100% {
    transform: translateX(-120%) scale(.92);
    opacity: 0
  }
}

.card.swipe-in {
  animation: swipeIn .45s cubic-bezier(.25, .46, .45, .94) forwards
}

@keyframes swipeIn {
  0% {
    transform: translateX(120%) scale(.92);
    opacity: 0
  }

  100% {
    transform: translateX(0) scale(1);
    opacity: 1
  }
}

/* removed striped veil during slot spin per feedback */
.card.center {
  text-align: center
}

.game-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.gh-row-logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.game-logo {
  height: 32px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  opacity: 0.95;
}

.gh-row-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.role-name {
  font-size: 13px;
  font-weight: 700;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.level-flames {
  margin-left: 6px;
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(255, 120, 0, .35));
  opacity: 1
}

.level-label {
  margin-left: 12px;
  margin-right: 4px;
  color: #7b5cff;
  font-weight: 900
}

.level-flames .flame {
  opacity: .3;
  transition: opacity .2s ease
}

.level-flames .flame.on {
  opacity: 1
}

.level-flames .flame.burst {
  animation: flame-burst 1.2s cubic-bezier(.34, 1.56, .64, 1);
  transform-origin: center;
  position: relative;
  z-index: 1
}

@keyframes flame-burst {
  0% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1) drop-shadow(0 0 4px rgba(255, 120, 0, .4))
  }

  15% {
    transform: scale(1.4) rotate(-8deg);
    filter: brightness(1.6) drop-shadow(0 0 16px rgba(255, 140, 0, .9)) drop-shadow(0 0 28px rgba(255, 80, 0, .6))
  }

  35% {
    transform: scale(1.8) rotate(5deg);
    filter: brightness(1.9) drop-shadow(0 0 24px rgba(255, 160, 0, 1)) drop-shadow(0 0 40px rgba(255, 60, 0, .8))
  }

  55% {
    transform: scale(1.5) rotate(-3deg);
    filter: brightness(1.5) drop-shadow(0 0 18px rgba(255, 140, 0, .85))
  }

  75% {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 120, 0, .6))
  }

  100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1) drop-shadow(0 0 6px rgba(255, 120, 0, .35))
  }
}

.level-flames.level-transition {
  animation: flames-glow 1.2s ease
}

@keyframes flames-glow {

  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(255, 120, 0, .35))
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(255, 140, 0, .95)) drop-shadow(0 0 35px rgba(255, 80, 0, .7))
  }
}

.level-info {
  color: rgba(255, 180, 220, .95);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-num {
  font-weight: 800;
  font-size: 15px;
  opacity: 1;
  color: #fff
}

.level-sep {
  opacity: .4;
  font-weight: 400
}

.level-total {
  opacity: .7
}

.task-progress {
  margin-left: 4px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  opacity: .8
}

/* Minimal variant B */
.level-badge {
  background: #ff7bbf;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800
}

.level-badge {
  background: #7b5cff;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800
}

.rating-stars {
  display: flex;
  gap: 4px;
  justify-content: center
}

.rating-star {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: rgba(182, 164, 255, .5);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
  display: grid;
  place-items: center
}

.rating-star:hover {
  background: rgba(255, 255, 255, .12);
  color: rgba(182, 164, 255, .8);
  transform: none
}

.rating-star:active {
  transform: none
}

.rating-star.active {
  background: #ff7bbf;
  color: #fff
}

/* click feedback */
.rating-star.pop {
  animation: none
}

@keyframes starPop {
  0% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.25)
  }

  100% {
    transform: scale(1)
  }
}

.task-count {
  margin-left: 8px;
  opacity: .7;
  font-size: 12px;
  font-weight: 700
}

.progress-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 26px
}

.progress-fill {
  position: relative;
  height: 100%;
  background: linear-gradient(90deg, #7b5cff, #ff7bbf);
  width: 0%;
  transition: width .3s ease;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(123, 92, 255, .4)
}

.progress-fill.sparkle::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, .6) 40%, rgba(255, 255, 255, 0) 70%);
  filter: blur(.5px);
  animation: spark-move .9s ease forwards
}

@keyframes spark-move {
  0% {
    right: 100%
  }

  100% {
    right: -4px
  }
}

.progress-fill.hue-shift {
  animation: hue .9s ease
}

@keyframes hue {
  0% {
    filter: hue-rotate(0deg)
  }

  100% {
    filter: hue-rotate(40deg)
  }
}

.card-content {
  padding: 22px 20px 18px
}

.dialog-section {
  margin: 14px 0 -18px 0px
}

.dialog-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap
}

.dialog-text {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.005em;
  font-style: italic;
  color: rgba(255, 255, 255, .97)
}

.dialog-text.rolling,
.action-text.rolling {
  filter: none;
  opacity: 1
}

.dialog-text.shimmer,
.action-text.shimmer {
  animation: none;
  background: none;
  color: inherit
}

@keyframes text-shimmer {
  0% {
    background-position: -120% 0
  }

  100% {
    background-position: 120% 0
  }
}

.action-section {
  margin-top: 14px;
  margin-bottom: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08)
}

.action-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(182, 164, 255, .7);
  margin-bottom: 6px;
  font-weight: 700
}

.action-text {
  font-size: 17px;
  line-height: 1.5;
  opacity: .92
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, .15);
  border-top: 1px solid rgba(255, 255, 255, .06)
}

.actions-left {
  display: flex;
  align-items: center;
  gap: 12px
}

.btn {
  appearance: none;
  border: none;
  background: #6d4aff;
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease
}

.btn:hover {
  transform: translateY(-1px);
  background: #7c5bff;
  box-shadow: 0 4px 12px rgba(109, 74, 255, .3)
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(109, 74, 255, .2)
}

.btn.primary {
  font-size: 17px;
  background: linear-gradient(135deg, rgba(255, 123, 191, .25), rgba(160, 64, 255, .2));
  color: #fff;
  border: 2.5px solid rgba(255, 123, 191, .85);
  border-radius: 8px;
  padding: 16px 40px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 0 28px rgba(255, 123, 191, .45), 0 8px 20px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
  position: relative;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 10px), 0 10px);
  transition: all .2s ease;
}

.btn.primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 123, 191, .35), rgba(160, 64, 255, .3));
  border-color: rgba(255, 123, 191, 1);
  box-shadow: 0 0 40px rgba(255, 123, 191, .65), 0 12px 28px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .2);
  color: #fff;
}

.btn-next {
  appearance: none;
  border: none;
  background: #6d4aff;
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 74, 255, .2)
}

.btn-next:hover {
  transform: translateY(-1px);
  background: #7558f0;
  box-shadow: 0 6px 16px rgba(109, 74, 255, .35)
}

.btn-next:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(109, 74, 255, .3)
}

.btn-fav-subtle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 123, 191, .62);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: transform .15s ease, color .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: grid;
  place-items: center
}

.btn-fav-subtle:hover {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 123, 191, .9);
  transform: scale(1.08)
}

.btn-fav-subtle:active {
  transform: scale(.95)
}

.btn-fav-subtle.active {
  color: #fff;
  animation: heartPop .35s ease;
  background: #ff2e78;
  border-color: #ff2e78;
  box-shadow: 0 8px 22px rgba(255, 46, 120, .4), 0 0 0 2px rgba(255, 255, 255, .08) inset
}

@keyframes heartPop {
  0% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.25)
  }

  100% {
    transform: scale(1)
  }
}

.btn.subtle {
  background: transparent;
  border: 2px solid rgba(255, 123, 191, .28);
  color: rgba(255, 180, 220, .9)
}

.btn.subtle:hover {
  background: rgba(255, 123, 191, .12);
  border-color: rgba(255, 123, 191, .5);
  color: #fff
}

.icon-btn {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: #ff7bbf;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease
}

.icon-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, .12)
}

.icon-btn:active {
  transform: scale(.98)
}

.icon-btn.active {
  background: #ff2e78;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 46, 120, .25)
}

.random-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em
}

.random-badge .rb-emoji {
  display: inline-block
}

.random-badge.spin .rb-emoji {
  animation: spin .9s ease
}

@keyframes spin {
  0% {
    transform: rotate(0)
  }

  100% {
    transform: rotate(360deg)
  }
}

/* Mini buttons in top-right */
.btn-mini {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .9);
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 8px;
  box-shadow: none
}

.btn-mini:hover {
  background: rgba(255, 255, 255, .08)
}

.btn-mini.subtle {
  opacity: .85;
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8)
}

.btn-fav-play {
  appearance: none;
  background: transparent;
  color: rgba(255, 180, 220, .95);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  border: 2px solid rgba(255, 123, 191, .45);
  letter-spacing: .08em;
  text-transform: uppercase;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 8px), 0 8px)
}

.btn-fav-play:hover {
  background: rgba(255, 123, 191, .16);
  border-color: rgba(255, 123, 191, .85);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 123, 191, .25)
}

.btn.primary.subtle-fav {
  background: rgba(123, 92, 255, .12);
  border: 1px solid rgba(123, 92, 255, .25);
  color: rgba(255, 255, 255, .9);
  padding: 10px 20px;
  font-size: 14px;
  box-shadow: none
}

.btn.primary.subtle-fav:hover {
  background: rgba(123, 92, 255, .2);
  border-color: rgba(123, 92, 255, .35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 92, 255, .15)
}

.timer-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, .04);
  border-top: 1px solid rgba(255, 255, 255, .06)
}

.timer-ring-small {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg)
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, .1);
  stroke-width: 2.5
}

.circle {
  fill: none;
  stroke: #7b5cff;
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray .15s ease
}

.circle.done {
  stroke: #2ecc71;
  filter: drop-shadow(0 0 4px rgba(46, 204, 113, .4))
}

.timer-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px
}

.timer-btns {
  display: none
}

.btn-timer {
  appearance: none;
  border: 2.5px solid rgba(255, 123, 191, .6);
  background: transparent;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: all .2s ease;
  display: grid;
  place-items: center
}

.btn-timer.subtle {
  border-color: rgba(255, 255, 255, .35);
  color: rgba(255, 255, 255, .85)
}

.btn-timer:hover {
  background: rgba(255, 123, 191, .08);
  box-shadow: 0 0 14px rgba(255, 123, 191, .35);
  transform: translateY(-1px)
}

.btn-timer:hover {
  background: rgba(255, 255, 255, .12)
}

.btn-timer.subtle {
  background: rgba(255, 255, 255, .04)
}

.hidden {
  display: none
}

@media (min-width:720px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

@media (max-width:720px) {
  #app {
    display: block;
    padding: 16px 16px 96px;
  }

  .header {
    margin-bottom: 12px;
    padding: 0 8px;
  }

  .logo-main {
    font-size: 54px;
    letter-spacing: .06em;
  }

  .logo-sub {
    font-size: 18px;
    letter-spacing: .14em;
  }

  .intro-text {
    padding: 0 8px;
    margin-bottom: 28px;
  }

  .intro-text p {
    font-size: 17px;
    line-height: 1.3;
  }

  .section-title {
    font-size: 20px;
    padding-bottom: 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
  }

  .role-card {
    min-height: 200px;
  }

  .role-card-content {
    min-height: 200px;
    padding: 16px;
  }

  .roles-note {
    margin: 20px 0 8px;
    padding: 14px 16px;
  }

  .top-bar {
    flex-direction: row;
    align-items: center;
    gap: 8px
  }

  .top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px
  }

  .card {
    max-width: 92vw;
  }

  .card-actions {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 14px 40px;
  }

  .card-cta {
    flex-direction: row;
    align-items: center;
    gap: 12px
  }

  .card-cta .btn-fav-subtle {
    flex: 0 0 auto
  }

  .card-cta .btn-next {
    flex: 1 1 auto;
    min-width: 0
  }
}

/* Footer */
.intro-container,
.end-container {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  padding: 20px 2px;
}

.intro-header {
  margin-bottom: 2px
}

.intro-logo {
  max-width: 150px;
  height: auto;
  margin: 0 auto 20px;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.intro-title {
  font-family: 'Cinzel', serif;
  font-size: 42px;
  font-weight: 900;
  margin: 0;
  background: linear-gradient(135deg, #7b5cff, #ff7bbf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.01em;
  text-transform: uppercase;
  filter: drop-shadow(0 0 20px rgba(255, 123, 191, .5));
}

.intro-story {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 220, 240, .92);
  margin-bottom: 16px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(40, 20, 50, .6), rgba(30, 15, 40, .7));
  border: 1.5px solid rgba(255, 123, 191, .35);
  border-radius: 16px;
  text-align: left;
  box-shadow: 0 0 20px rgba(255, 123, 191, .15), inset 0 0 30px rgba(255, 123, 191, .05);
  backdrop-filter: blur(8px);
}

.intro-story .intro-hero {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 0 18px 0;
  display: block;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 16px rgba(255, 123, 191, .2);
  border: 1px solid rgba(255, 123, 191, .25);
}

.end-container {
  padding: 60px 24px
}

.end-logo {
  max-width: 150px;
  height: auto;
  margin: 0 auto 30px;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.end-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: end-icon-pop 1s cubic-bezier(.34, 1.56, .64, 1)
}

@keyframes end-icon-pop {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0
  }

  60% {
    transform: scale(1.15) rotate(10deg)
  }

  100% {
    transform: scale(1) rotate(0)
  }
}

.end-title {
  font-size: 42px;
  font-weight: 900;
  margin: 0 0 12px;
  background: linear-gradient(135deg, #7b5cff, #ff7bbf, #ffcf2e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.02em
}

.end-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 40px
}

.end-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap
}

.btn.large {
  padding: 14px 28px;
  font-size: 16px;
  min-width: 180px
}

.btn.secondary {
  background: rgba(255, 255, 255, .08);
  color: #fff
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateY(-1px)
}

.footer {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  z-index: 20;
  margin-top: 50px;
}

/* CTA under the card (Favorite + Next) */
.card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px 6px;
  transition: background .2s ease, box-shadow .2s ease, border-color .2s ease;
  border-radius: 12px;
}

/* Limit visual selection to the heart button only */
.card-cta:focus {
  outline: none
}

.card-cta *:focus {
  outline: none
}

/* Intro screen: fixed Start button, scrollable text */
#introScreen {
  max-height: 100vh;
  overflow: hidden
}

#introScreen .intro-container {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  height: calc(100vh - 120px);
  padding-top: 24px
}

#introScreen .intro-story {
  overflow: auto;
  max-height: 100%;
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 123, 191, .4) rgba(255, 255, 255, .05);
}

#introScreen .intro-story::-webkit-scrollbar {
  width: 8px
}

#introScreen .intro-story::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .05);
  border-radius: 10px
}

#introScreen .intro-story::-webkit-scrollbar-thumb {
  background: rgba(255, 123, 191, .4);
  border-radius: 10px;
  border: 2px solid rgba(30, 15, 40, .7)
}

#introScreen .intro-story::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 123, 191, .6)
}

#startRoleBtn {
  position: sticky;
  bottom: 0;
  z-index: 5
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30
}

.modal.hidden {
  display: none
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(2px)
}

.modal-content {
  position: relative;
  margin: 8vh auto 0;
  max-width: 600px;
  background: rgba(28, 24, 40, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6)
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 20px
}

.modal-title {
  font-weight: 900;
  font-size: 28px;
  color: #fff;
  letter-spacing: -.01em
}

.consent-btn {
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease
}

.consent-btn-disabled {
  transform: scale(.99);
  opacity: .85;
  box-shadow: none;
  background: rgba(255, 255, 255, .1)
}

.consent-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ff9ad1;
  background: rgba(255, 46, 120, .12);
  border: 1px solid rgba(255, 46, 120, .4);
  box-shadow: 0 4px 14px rgba(255, 46, 120, .18)
}

.consent-check {
  position: relative
}

.consent-check.shake {
  animation: shake-horizontal .45s ease
}

.consent-checkbox.consent-pulse {
  animation: pulse-outline 1s ease
}

@keyframes shake-horizontal {

  0%,
  100% {
    transform: translateX(0)
  }

  15% {
    transform: translateX(-6px)
  }

  30% {
    transform: translateX(5px)
  }

  45% {
    transform: translateX(-4px)
  }

  60% {
    transform: translateX(3px)
  }

  75% {
    transform: translateX(-2px)
  }

  90% {
    transform: translateX(1px)
  }
}

@keyframes pulse-outline {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 46, 120, .4)
  }

  70% {
    box-shadow: 0 0 0 8px rgba(255, 46, 120, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 46, 120, 0)
  }
}

.favorites-list {
  max-height: 54vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px
}

.fav-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 4px 12px;
  padding: 0 8px
}

.fav-group-title {
  font-weight: 900;
  font-size: 19px;
  color: #fff;
  opacity: .98;
  letter-spacing: -.01em
}

.fav-level-title {
  margin: 2px 6px 6px;
  font-weight: 800;
  color: rgba(255, 255, 255, .92);
  font-size: 12px
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 4px 4px
}

.favorites-empty {
  text-align: center;
  padding: 48px 24px;
  opacity: .65;
  font-size: 15px;
  line-height: 1.6
}

.favorite-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: all .2s cubic-bezier(.25, .46, .45, .94);
  position: relative;
  margin: 0 4px
}

.favorite-item:hover {
  background: rgba(255, 255, 255, .08);
  transform: translateX(2px);
  border-color: rgba(123, 92, 255, .25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15)
}

.favorite-item.selected {
  background: rgba(123, 92, 255, .12);
  border-color: rgba(123, 92, 255, .35);
  box-shadow: 0 0 0 1px rgba(123, 92, 255, .25), 0 4px 16px rgba(123, 92, 255, .15)
}

.favorite-item .fi-actions {
  display: flex;
  align-items: center;
  gap: 6px
}

.fi-detail {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .2);
  border-radius: 8px;
  border-left: 2px solid rgba(123, 92, 255, .5);
  animation: detail-expand .2s cubic-bezier(.25, .46, .45, .94)
}

@keyframes detail-expand {
  0% {
    opacity: 0;
    transform: translateY(-8px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

.fi-detail .fp-action {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  font-style: normal
}

.favorite-item .fi-remove {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .6);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0
}

.favorite-item .fi-remove:hover {
  background: rgba(255, 46, 120, .2);
  color: #ff7bbf;
  transform: scale(1.08)
}

.fi-header {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.fi-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .93);
  letter-spacing: .01em;
  font-style: italic;
  flex: 1;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical
}

.fi-rating {
  display: flex;
  gap: 2px;
  font-size: 12px;
  color: #ff7bbf;
  opacity: .95
}

.fi-meta {
  opacity: .85;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px
}

.fi-role {
  opacity: .9
}

.fi-level {
  background: rgba(123, 92, 255, .3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700
}

.favorite-preview {
  position: sticky;
  top: 8px;
  margin: 8px 6px 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(40, 36, 52, .9);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35)
}

.favorite-preview .fp-title {
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  margin-bottom: 6px
}

.favorite-preview .fp-dialog {
  font-weight: 800;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, .92)
}

.favorite-preview .fp-action {
  color: rgba(255, 255, 255, .92)
}

/* Stack draw overlay */
.stack-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 25;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(3px);
  pointer-events: none
}

.stack-overlay.hidden {
  display: none
}

.stack {
  position: relative;
  width: 280px;
  height: 180px
}

.stack-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(123, 92, 255, .15), rgba(255, 123, 191, .15));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3)
}

.stack-card.s3 {
  transform: translateY(-8px) scale(.96);
  opacity: .5
}

.stack-card.s2 {
  transform: translateY(-4px) scale(.98);
  opacity: .7
}

.stack-card.s1 {
  transform: translateY(0) scale(1);
  opacity: 1
}

.stack-overlay.animate .stack-card.s1 {
  animation: drawCard .6s ease forwards
}

@keyframes drawCard {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1
  }

  40% {
    transform: translateY(-12px) scale(1.02);
    opacity: 1
  }

  100% {
    transform: translateY(-120px) translateX(60px) scale(.92) rotate(8deg);
    opacity: 0
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 10px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  z-index: 40
}

/* Admin */
.admin-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px
}

.admin-controls {
  display: grid;
  grid-template-columns: 2fr 2fr auto;
  gap: 10px;
  margin: 12px 0
}

.admin-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin: 12px 0
}

.admin-input {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px
}

.admin-input::placeholder {
  color: rgba(255, 255, 255, .6)
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 16px
}

.admin-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08)
}

.admin-item:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(123, 92, 255, .25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15)
}

.ai-main {
  flex: 1
}

.ai-title {
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  margin-bottom: 6px
}

.ai-dialog {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .93);
  font-style: italic;
  margin-bottom: 6px
}

.ai-action {
  font-size: 13px;
  color: rgba(255, 255, 255, .85)
}

.ai-meta {
  display: flex;
  align-items: center;
  gap: 8px
}

.ai-chip {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, .9)
}

.ai-actions {
  display: flex;
  gap: 6px
}

/* Admin table view */
.admin-row {
  display: grid;
  grid-template-columns: 5fr 1.4fr .7fr .7fr .9fr .9fr .8fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  margin-bottom: 8px
}

.admin-head {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
  font-weight: 800;
  color: rgba(255, 255, 255, .92)
}

.admin-row .col {
  font-size: 12.5px
}

.admin-row .col.col-dialog {
  font-style: italic;
  color: rgba(255, 255, 255, .95);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.admin-row .col .col-sub {
  margin-top: 4px;
  font-style: normal;
  color: rgba(255, 255, 255, .85);
  opacity: .95;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.admin-head .sortable {
  user-select: none
}

.admin-row .col.col-avg,
.admin-row .col.col-rc,
.admin-row .col.col-fc,
.admin-row .col.col-level {
  font-weight: 800;
  color: rgba(255, 255, 255, .92);
  text-align: center
}

.admin-edit {
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  margin: -4px 0 10px
}

.ae-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px
}

.ae-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, .75)
}

.ae-grid textarea,
.ae-grid input {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px
}

.ae-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px
}

/* Compact icon buttons side-by-side */
.admin-row .col.col-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start
}

.admin-row .col.col-actions .btn {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  min-width: 32px;
  text-align: center
}

/* Role group heading */
.role-group-title {
  margin: 16px 2px 6px;
  font-weight: 900;
  color: #fff;
  opacity: .9
}

/* === Fantasy Teal Card Theme (overrides) === */
:root {
  --teal: #65e0d3;
  --teal-2: #39c2b7;
  --teal-dim: rgba(101, 224, 211, .22);
  --ink: #d7f4f1;
  --paper: #0b1e22;
  --paper-2: #0a171b;
}

body {
  background:
    radial-gradient(1200px 800px at 30% 10%, rgba(80, 40, 100, .15), rgba(0, 0, 0, 0)),
    radial-gradient(900px 700px at 80% 90%, rgba(120, 50, 140, .12), rgba(0, 0, 0, 0)),
    linear-gradient(180deg, #0f0a14, #12091a 40%, #0d0816);
  color: var(--ink);
}

/* Card container with double magenta border and inner glow */
#gameScreen .card {
  background: linear-gradient(135deg, rgba(30, 18, 46, .98), rgba(22, 12, 36, .98));
  border: 1px solid rgba(255, 123, 191, .45);
  border-radius: 17px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 123, 191, .15),
    0 25px 60px rgba(0, 0, 0, .78),
    0 0 20px rgba(255, 123, 191, .12),
    0 0 0 1px rgba(0, 0, 0, .5);
  position: relative;
  overflow: visible;
}

#gameScreen .card::before {
  /* thin concentric frame lines like reference - minimalist */
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  pointer-events: none;
  /* only thin concentric border lines, no heavy effects */
  border: 1px solid rgba(255, 123, 191, .65);
  box-shadow:
    inset 0 0 0 2px rgba(255, 123, 191, .55),
    inset 0 0 0 4px rgba(160, 64, 255, .45),
    inset 0 0 0 6px rgba(255, 123, 191, .5),
    inset 0 0 0 8px rgba(160, 64, 255, .4);
  /* ONLY simple corner cuts and minimal center ornaments - NO side lines */
  background:
    /* top center diamond - simple and small */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 60"><path d="M60 8 L50 18 L60 28 L70 18 Z" fill="none" stroke="rgba(255,123,191,0.75)" stroke-width="1.8"/><path d="M60 14 L56 18 L60 22 L64 18 Z" fill="rgba(255,123,191,0.4)"/><path d="M45 18 L60 5 L75 18" fill="none" stroke="rgba(255,123,191,0.7)" stroke-width="1.6"/></svg>') center 2px / 120px 60px no-repeat,
    /* top-left simple cut corners */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path d="M4 24 L4 4 L24 4" fill="none" stroke="rgba(255,123,191,0.7)" stroke-width="1.4"/><path d="M7 28 L7 7 L28 7" fill="none" stroke="rgba(160,64,255,0.6)" stroke-width="1.2"/><path d="M10 32 L10 10 L32 10" fill="none" stroke="rgba(255,123,191,0.6)" stroke-width="1.1"/></svg>') 4px 4px / 80px 80px no-repeat,
    /* top-right simple cut corners */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path d="M76 24 L76 4 L56 4" fill="none" stroke="rgba(255,123,191,0.7)" stroke-width="1.4"/><path d="M73 28 L73 7 L52 7" fill="none" stroke="rgba(160,64,255,0.6)" stroke-width="1.2"/><path d="M70 32 L70 10 L48 10" fill="none" stroke="rgba(255,123,191,0.6)" stroke-width="1.1"/></svg>') calc(100% - 4px) 4px / 80px 80px no-repeat,
    /* bottom-left simple cut corners */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path d="M4 56 L4 76 L24 76" fill="none" stroke="rgba(255,123,191,0.7)" stroke-width="1.4"/><path d="M7 52 L7 73 L28 73" fill="none" stroke="rgba(160,64,255,0.6)" stroke-width="1.2"/><path d="M10 48 L10 70 L32 70" fill="none" stroke="rgba(255,123,191,0.6)" stroke-width="1.1"/></svg>') 4px calc(100% - 4px) / 80px 80px no-repeat,
    /* bottom-right simple cut corners */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path d="M76 56 L76 76 L56 76" fill="none" stroke="rgba(255,123,191,0.7)" stroke-width="1.4"/><path d="M73 52 L73 73 L52 73" fill="none" stroke="rgba(160,64,255,0.6)" stroke-width="1.2"/><path d="M70 48 L70 70 L48 70" fill="none" stroke="rgba(255,123,191,0.6)" stroke-width="1.1"/></svg>') calc(100% - 4px) calc(100% - 4px) / 80px 80px no-repeat,
    /* bottom center diamond - simple and small */
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50"><path d="M50 42 L42 34 L50 26 L58 34 Z" fill="none" stroke="rgba(255,123,191,0.75)" stroke-width="1.8"/><path d="M50 36 L47 33 L50 30 L53 33 Z" fill="rgba(255,123,191,0.4)"/></svg>') center calc(100% - 2px) / 100px 50px no-repeat;
}

#gameScreen .card::after {
  /* on-card nebula + subtle corner glows (above content) */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 12px;
  z-index: 12;
  mix-blend-mode: screen;
  background:
    radial-gradient(980px 660px at 28% 24%, rgba(255, 123, 191, .28), transparent 70%),
    radial-gradient(820px 560px at 78% 78%, rgba(160, 64, 255, .22), transparent 72%),
    radial-gradient(3px 3px at 22% 32%, rgba(255, 255, 255, .88), transparent 48%),
    radial-gradient(2px 2px at 42% 70%, rgba(255, 255, 255, .78), transparent 48%),
    radial-gradient(3px 3px at 62% 38%, rgba(255, 255, 255, .82), transparent 48%),
    radial-gradient(2px 2px at 84% 58%, rgba(255, 255, 255, .75), transparent 48%),
    radial-gradient(24px 24px at 18px 18px, rgba(255, 123, 191, .2), rgba(0, 0, 0, 0) 76%),
    radial-gradient(24px 24px at calc(100% - 18px) 18px, rgba(255, 123, 191, .2), rgba(0, 0, 0, 0) 76%),
    radial-gradient(24px 24px at 18px calc(100% - 18px), rgba(255, 123, 191, .2), rgba(0, 0, 0, 0) 76%),
    radial-gradient(24px 24px at calc(100% - 18px) calc(100% - 18px), rgba(255, 123, 191, .2), rgba(0, 0, 0, 0) 76%);
  opacity: 1;
  animation: card-nebula-float 52s ease-in-out infinite;
}

/* Typography closer to the reference */
.dialog-text {
  font-family: 'Cormorant Garamond', serif;
  text-transform: none;
  letter-spacing: .01em;
  line-height: 1.45;
  font-weight: 600;
  font-size: 20px;
  color: rgba(255, 220, 240, .98);
  font-style: normal !important;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  position: relative;
}

/* remove shimmer for cleaner look */
.card.enter .dialog-text::after {
  display: none
}

.action-label {
  display: none;
}

.action-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 1.6;
  text-align: center;
  color: rgba(220, 180, 220, .92);
}

.task-title {
  font-family: 'Cinzel', 'Marcellus', serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 900;
  font-size: 22px;
  color: rgba(255, 200, 230, .98);
  text-align: center;
  margin: 20px 0 -15px;
  /* etwas mehr Raum zur Items-Leiste */
  text-shadow: 0 0 14px rgba(255, 123, 191, .35), 0 1px 2px rgba(0, 0, 0, .5);
}

.speaker-label {
  font-style: italic;
  font-weight: 700;
  color: rgba(200, 170, 220, .85);
  margin: 0;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
}

.task-meta .chip {
  background: rgba(255, 123, 191, .12);
  border: 1px solid rgba(255, 123, 191, .35);
  color: rgba(255, 200, 230, .95);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.items-needed {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 7px -5px;
  /* mehr Abstand nach unten zum Dialog */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.items-needed .item-chip {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 123, 191, .35);
  color: rgba(255, 200, 230, .95);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(255, 123, 191, .18);
}

/* Progress and separators in teal */
.progress-track {
  background: rgba(255, 123, 191, .12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35)
}

.progress-fill {
  background: linear-gradient(90deg, #ff7bbf, #b85cff);
  box-shadow:
    0 0 16px rgba(255, 123, 191, .5),
    0 0 8px rgba(255, 123, 191, .35);
}

.action-section {
  border-top: none;
  position: relative;
  padding-top: 24px;
}

.action-section::before {
  /* decorative divider */
  content: "◇◇◇";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(101, 224, 211, .4);
  font-size: 10px;
  letter-spacing: 8px;
  text-shadow: 0 0 8px rgba(101, 224, 211, .3);
}

/* Timer block centered and compact */
.timer-compact {
  display: grid;
  grid-template-columns: auto auto auto;
  /* buttons direkt an die Zahl */
  align-items: center;
  justify-items: center;
  justify-content: center;
  background: transparent;
  border-top: none;
  padding: 0px 10px 10px;
  margin: 1px auto 6px;
  /* auto -> zentriert und Breite nur so groß wie Inhalt */
  gap: 8px;
  position: relative;
  z-index: 6;
  width: fit-content;
}

.timer-compact #timerToggle {
  grid-column: 1
}

.timer-compact #timeDisplay {
  grid-column: 2
}

.timer-compact #timerReset {
  grid-column: 3
}

/* Play button with integrated progress circle */
.btn-timer-play {
  position: relative;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all .2s ease;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.btn-timer-play .circular-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.btn-timer-play .circle-bg {
  fill: none;
  stroke: rgba(255, 123, 191, .2);
  stroke-width: 2.1;
}

.btn-timer-play .circle {
  fill: none;
  stroke: #ff7bbf;
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: stroke-dasharray .15s ease;
  filter: drop-shadow(0 0 4px rgba(255, 123, 191, .5));
}

.btn-timer-play .play-icon {
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: rgba(255, 255, 255, .95);
  pointer-events: none;
  display: block;
  transition: all .2s ease;
}

.btn-timer-play:hover {
  transform: scale(1.08);
}

.btn-timer-play:hover .circle {
  filter: drop-shadow(0 0 8px rgba(255, 123, 191, .7));
}

/* Timer text centered */
.timer-text {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: .05em;
  color: rgba(255, 200, 230, .98);
  text-shadow:
    0 0 16px rgba(255, 123, 191, .5),
    0 0 8px rgba(255, 123, 191, .35);
  flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
  position: relative;
  z-index: 12;
}

/* Reset button */
.btn-timer-reset {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .35);
  color: transparent;
  /* Text ausblenden, wir zeichnen ein Icon */
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s ease;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}

.btn-timer-reset::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 58%;
  /* dünnes ringförmiges Reset-Icon */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="rgba(255,255,255,0.85)" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5a7 7 0 1 1-4.95 2.05"/><path d="M7 3v4h4"/></g></svg>');
}

.btn-timer-reset:hover {
  border-color: rgba(255, 123, 191, .7);
  background: rgba(255, 123, 191, .08);
  transform: scale(1.08);
}

.card-actions {
  background: transparent;
  border-top: none;
  padding: 0 20px 36px;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 14px
}

.card-actions .rating-stars {
  display: flex;
  gap: 2px
}

.card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 20px 0 12px
}

.card-cta .btn-fav-subtle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 123, 191, .45);
  background: transparent;
  font-size: 16px;
  display: grid;
  place-items: center;
  color: rgba(255, 123, 191, .85);
  transition: all .2s ease
}

.card-cta .btn-fav-subtle.active {
  background: rgba(255, 123, 191, .14);
  border-color: rgba(255, 123, 191, .75);
  color: #ff7bbf
}

.card-cta .btn-fav-subtle:hover {
  border-color: rgba(255, 123, 191, .75);
  box-shadow: 0 0 14px rgba(255, 123, 191, .32);
  transform: translateY(-1px)
}

.rating-star {
  background: transparent;
  border: none;
  color: rgba(255, 123, 191, .88);
  width: auto;
  height: auto;
  font-size: 34px;
  transition: all .2s ease;
  display: inline-block;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 0 8px rgba(255, 123, 191, .5));
}

.rating-star:hover {
  border-color: rgba(255, 123, 191, .6);
  color: #ff7bbf;
  box-shadow: 0 0 12px rgba(255, 123, 191, .35);
  transform: scale(1.08);
}

.rating-star.active {
  background: transparent;
  border: none;
  color: #ff7bbf;
  filter: drop-shadow(0 0 14px rgba(255, 123, 191, .85));
}

.card-actions .rating-star.active {
  background: transparent;
  border: none;
  color: #ff7bbf;
  text-shadow: 0 0 12px rgba(255, 123, 191, .75)
}

.btn-fav-subtle {
  color: rgba(255, 123, 191, .95);
  border: 1.5px solid rgba(255, 123, 191, .45);
  background: transparent;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.btn-fav-subtle:hover {
  background: rgba(255, 123, 191, .18);
  border-color: rgba(255, 123, 191, .85);
  color: var(--pink);
  box-shadow: 0 0 12px rgba(255, 123, 191, .5);
}

.btn-fav-subtle.active {
  background: rgba(255, 123, 191, .22);
  border-color: rgba(255, 123, 191, .9);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 123, 191, .55);
}

/* Buttons to match theme */
.btn-next {
  background: transparent;
  color: rgba(255, 180, 220, .98);
  border: 2.5px solid rgba(255, 123, 191, .75);
  border-radius: 6px;
  padding: 16px 52px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(255, 123, 191, .3), inset 0 0 20px rgba(255, 123, 191, .08);
  position: relative;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 8px), 0 8px);
}

.btn-next:hover {
  transform: translateY(-1px);
  background: rgba(255, 123, 191, .18);
  border-color: rgba(255, 123, 191, .95);
  box-shadow: 0 0 32px rgba(255, 123, 191, .5), inset 0 0 24px rgba(255, 123, 191, .12);
  color: #fff;
}

.btn {
  background: linear-gradient(135deg, #7b5cff, #ff7bbf)
}

.btn.subtle {
  background: rgba(255, 123, 191, .1);
  border: 2px solid rgba(255, 123, 191, .25);
  color: rgba(255, 180, 220, .95)
}

/* SVG Corner Ornaments - MUCH more elaborate */
#gameScreen .card-content {
  position: relative;
  z-index: 2
}

#gameScreen .card-content::before,
#gameScreen .card-content::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  opacity: .55;
  pointer-events: none;
}

#gameScreen .card-content::before {
  /* top-left ornament (disabled to match reference and avoid teal) */
  display: none !important;
}

/* remove extra diamonds under title to match reference cleaner divider */
.dialog-section::after {
  display: none
}

#gameScreen .card-content::after {
  /* top-right ornament (disabled) */
  display: none !important;
}

/* Bottom corner ornaments - MUCH more elaborate */
#gameScreen .card-actions {
  position: relative;
  z-index: 2
}

#gameScreen .card-actions::before,
#gameScreen .card-actions::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  opacity: .65;
  pointer-events: none;
  z-index: 3;
}

#gameScreen .card-actions::before {
  /* bottom-left ornament (disabled) */
  display: none !important;
}

#gameScreen .card-actions::after {
  /* bottom-right ornament (disabled) */
  display: none !important;
}

/* Timer buttons layout fix */
.timer-btns {
  display: flex;
  gap: 8px;
  flex-direction: row;
  align-items: center;
}

/* Timer state-based visibility */
#timerContainer[data-state="idle"] #timerReset {
  display: none
}

#timerContainer[data-state="disabled"] {
  display: none
}

#timerContainer[data-state="running"] #timerReset,
#timerContainer[data-state="paused"] #timerReset {
  display: inline-flex
}

/* Header/Top-bar theme */
.top-bar {
  padding: 10px 0 2px
}

.role-name {
  font-family: 'Marcellus', serif;
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: .06em;
  font-weight: 400;
  color: rgba(210, 180, 210, .75)
}

.level-label {
  color: rgba(255, 180, 220, .95);
  font-weight: 800
}

.level-info {
  color: rgba(255, 180, 220, .85)
}

.btn-mini {
  border: 1.5px solid rgba(255, 123, 191, .28);
  background: transparent;
  color: rgba(255, 180, 220, .75);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-mini:hover {
  background: rgba(255, 123, 191, .12);
  opacity: .95;
  border-color: rgba(255, 123, 191, .5)
}

/* Pink star level indicator */
.level-flames {
  filter: drop-shadow(0 0 6px rgba(255, 123, 191, .45));
}

.level-flames .flame {
  opacity: .25;
  color: rgba(255, 180, 220, .75)
}

.level-flames .flame.on {
  opacity: 1;
  color: #ff7bbf
}

/* Crest ornament above heading (rich, multilayer) */
.dialog-section {
  position: relative;
  padding-top: 32px
}

.dialog-section::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 32px;
  opacity: .92;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90 32"><path d="M2,16 L22,16 M68,16 L88,16" stroke="rgba(255,123,191,0.7)" stroke-width="1.2" stroke-linecap="round"/><path d="M45,3 L38,12 L45,21 L52,12 Z" fill="none" stroke="rgba(255,123,191,0.8)" stroke-width="1.4" stroke-linejoin="round"/><path d="M45,8 L42,12 L45,16 L48,12 Z" fill="rgba(255,123,191,0.3)" stroke="rgba(160,64,255,0.65)" stroke-width="0.8"/><circle cx="45" cy="12" r="2" fill="rgba(255,123,191,0.7)"/><circle cx="38" cy="12" r="1.2" fill="rgba(160,64,255,0.55)"/><circle cx="52" cy="12" r="1.2" fill="rgba(160,64,255,0.55)"/><path d="M26,14 L28,16 L26,18 M64,14 L62,16 L64,18" stroke="rgba(255,123,191,0.55)" stroke-width="1" stroke-linecap="round"/><line x1="30" y1="16" x2="34" y2="16" stroke="rgba(255,123,191,0.45)" stroke-width="0.8"/><line x1="56" y1="16" x2="60" y2="16" stroke="rgba(255,123,191,0.45)" stroke-width="0.8"/></svg>') center/contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(255, 123, 191, .45));
}

/* Animated starry/smoke background (global, behind app) */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  /* stars */
  background:
    radial-gradient(5px 5px at 12% 18%, rgba(255, 255, 255, .98), transparent 48%),
    radial-gradient(4px 4px at 28% 72%, rgba(255, 255, 255, .9), transparent 48%),
    radial-gradient(5px 5px at 63% 28%, rgba(255, 255, 255, .95), transparent 48%),
    radial-gradient(4px 4px at 82% 51%, rgba(255, 255, 255, .9), transparent 48%),
    radial-gradient(5px 5px at 48% 65%, rgba(255, 255, 255, .88), transparent 48%),
    radial-gradient(4px 4px at 19% 45%, rgba(255, 255, 255, .85), transparent 48%),
    radial-gradient(5px 5px at 71% 15%, rgba(255, 255, 255, .92), transparent 48%),
    radial-gradient(4px 4px at 38% 88%, rgba(255, 255, 255, .85), transparent 48%),
    radial-gradient(4px 4px at 88% 82%, rgba(255, 255, 255, .82), transparent 48%),
    radial-gradient(5px 5px at 55% 35%, rgba(255, 255, 255, .95), transparent 48%),
    radial-gradient(3px 3px at 8% 55%, rgba(255, 255, 255, .8), transparent 48%),
    radial-gradient(4px 4px at 92% 38%, rgba(255, 255, 255, .88), transparent 48%),
    radial-gradient(5px 5px at 42% 12%, rgba(255, 255, 255, .9), transparent 48%),
    radial-gradient(3px 3px at 68% 78%, rgba(255, 255, 255, .82), transparent 48%),
    radial-gradient(4px 4px at 25% 92%, rgba(255, 255, 255, .85), transparent 48%);
  animation: stars-float 34s linear infinite;
  opacity: .85;
  mix-blend-mode: screen;
}

body::after {
  /* smoke/nebula */
  background:
    radial-gradient(1200px 780px at 25% 15%, rgba(255, 123, 191, .20), transparent 72%),
    radial-gradient(980px 640px at 80% 85%, rgba(160, 64, 255, .16), transparent 72%);
  filter: blur(70px);
  animation: smoke-drift 68s ease-in-out infinite;
  opacity: .96;
  mix-blend-mode: screen;
}

@keyframes stars-float {
  0% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(-24px, -18px) scale(1.06)
  }

  66% {
    transform: translate(18px, -12px) scale(.98)
  }

  100% {
    transform: translate(0, 0) scale(1)
  }
}

/* Second star layer for depth */
body::before {
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(2px 2px at 15% 35%, rgba(255, 255, 255, .7), transparent 45%), radial-gradient(3px 3px at 45% 68%, rgba(255, 255, 255, .65), transparent 45%), radial-gradient(2px 2px at 78% 22%, rgba(255, 255, 255, .72), transparent 45%), radial-gradient(3px 3px at 32% 85%, rgba(255, 255, 255, .68), transparent 45%), radial-gradient(2px 2px at 88% 58%, rgba(255, 255, 255, .7), transparent 45%);
  animation: stars-float-2 42s linear infinite;
  opacity: .6;
  mix-blend-mode: screen
}

@keyframes stars-float-2 {
  0% {
    transform: translate(0, 0) scale(1)
  }

  40% {
    transform: translate(12px, -20px) scale(1.04)
  }

  80% {
    transform: translate(-10px, 16px) scale(.99)
  }

  100% {
    transform: translate(0, 0) scale(1)
  }
}

@keyframes smoke-drift {
  0% {
    transform: translate(0, 0) scale(1)
  }

  25% {
    transform: translate(-30px, -20px) scale(1.08)
  }

  50% {
    transform: translate(18px, 14px) scale(1.05)
  }

  75% {
    transform: translate(-16px, 24px) scale(1.1)
  }

  100% {
    transform: translate(0, 0) scale(1)
  }
}

@media (prefers-reduced-motion:reduce) {

  body::before,
  body::after {
    animation: none
  }
}

#\20 app {
  position: relative;
  z-index: 1
}

/* Force animation override */
html.force-anim body::before {
  animation: stars-float 32s linear infinite
}

html.force-anim body::after {
  animation: smoke-drift 70s ease-in-out infinite
}

#app {
  position: relative;
  z-index: 1
}

/* Speed up secondary star layer as well */
html.force-anim::before {
  animation: stars-float-2 33.6s linear infinite
}

/* Mobile tweaks */
@media (max-width:480px) {
  .dialog-text {
    font-size: 22px;
    letter-spacing: .055em;
    line-height: 1.3
  }

  .timer-text {
    font-size: 32px
  }

  .btn-timer-play {
    width: 44px;
    height: 44px
  }

  .btn-timer-play .play-icon {
    font-size: 14px
  }

  .btn-timer-reset {
    width: 44px;
    height: 44px;
    font-size: 16px
  }

  .btn-next {
    min-width: 130px;
    padding: 10px 20px
  }

  .card {
    border-radius: 16px
  }

  .card-content {
    padding: 22px 18px 18px
  }

  .rating-star {
    width: 32px;
    height: 32px;
    font-size: 16px
  }

  #app {
    padding: 16px;
    padding-bottom: 10px
  }
}

/* === Fantasy Polish Overrides v2 === */
/* Center content more like the reference */
#gameScreen .card .card-content {
  display: grid;
  gap: 18px;
  justify-items: center
}

.dialog-section,
.action-section {
  width: 100%;
  max-width: 92%;
  margin-inline: auto
}

#gameScreen .card {
  position: relative;
  overflow: hidden
}

/* Noise grain overlay for printed look */
#gameScreen .card .card-content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .03;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23noise)" opacity="0.5"/></svg>');
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

/* remove old card-content::after nebula (moved to card::after) */
@keyframes card-nebula-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1)
  }

  50% {
    transform: translate3d(-10px, -8px, 0) scale(1.03)
  }

  100% {
    transform: translate3d(6px, 10px, 0) scale(1)
  }
}

/* Moving backgrounds enabled */

/* Prevent card inner nebula from moving */
#gameScreen .card::after {
  animation: none !important
}


/* Divider line under headline like reference */
.action-section {
  border-top: none;
  position: relative;
  padding-top: 24px;
  margin-top: 18px
}

.action-section::before {
  content: "";
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 12px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90 12"><path d="M10 6 H38" stroke="rgba(255,123,191,0.55)" stroke-width="1.2"/><path d="M52 6 H80" stroke="rgba(255,123,191,0.55)" stroke-width="1.2"/><path d="M45 3 L41 6 L45 9 L49 6 Z" fill="rgba(255,123,191,0.8)"/></svg>') center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 123, 191, .35))
}

.card-actions .actions-left {
  grid-column: 1;
  justify-content: flex-start
}

.btn-fav-subtle {
  margin-left: 8px
}

.btn-next {
  grid-column: 3
}

/* Arrange stars and Next button aesthetically */
.card-actions {
  grid-template-columns: 1fr auto auto
}

.card-actions .actions-left {
  grid-column: 1;
  justify-content: flex-start
}

.btn-next {
  grid-column: 3;
  justify-self: end;
}

.btn-next {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .08), 0 6px 18px rgba(123, 92, 255, .35);
  position: relative;
  overflow: hidden
}

.btn-next::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, .15), transparent 70%);
  opacity: 0;
  transition: opacity .3s ease
}

.btn-next:hover::before {
  animation: wave-pulse 1.2s ease-in-out infinite
}

@keyframes wave-pulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(0.8)
  }

  50% {
    opacity: 1;
    transform: scale(1.1)
  }
}

.card-cta {
  margin-top: 14px;
  margin-bottom: 10px
}

#gameScreen .card::before {
  content: none !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important
}

#gameScreen .card {
  overflow: visible;
  border-color: transparent
}

#gameScreen .card .card-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  --corner: url('assets/frame-corner.png');
  --side: url('assets/frame-side.png');
  --tile: 300px;
  --csize: 116px;
  --scale: calc(var(--csize) / var(--tile));
  --tileScaled: calc(var(--tile) * var(--scale));
  --cornerInsetBase: 78px;
  --inset: calc(var(--cornerInsetBase) * var(--scale));
  --sideVisibleBase: 24px;
  --ethick: calc(var(--sideVisibleBase) * var(--scale));
  --bleed: 14px;
  --phaseSide: 0px;
  --phaseTop: 0px;
  --phaseBottom: 0px;
  --cornerOffset: -3px;
  transform: none;
  filter: drop-shadow(0 0 10px rgba(255, 123, 191, .25)) drop-shadow(0 0 20px rgba(160, 64, 255, .18))
}

#gameScreen .card .card-frame .corner {
  position: absolute;
  width: var(--csize);
  height: var(--csize);
  background: var(--corner) no-repeat center/contain;
  z-index: 2
}

#gameScreen .card .card-frame .corner.tl {
  top: var(--cornerOffset);
  left: var(--cornerOffset)
}

#gameScreen .card .card-frame .corner.tr {
  top: var(--cornerOffset);
  right: var(--cornerOffset);
  transform: rotate(90deg)
}

#gameScreen .card .card-frame .corner.br {
  bottom: var(--cornerOffset);
  right: var(--cornerOffset);
  transform: rotate(180deg)
}

#gameScreen .card .card-frame .corner.bl {
  bottom: var(--cornerOffset);
  left: var(--cornerOffset);
  transform: rotate(270deg)
}

#gameScreen .card .card-frame .edge {
  position: absolute;
  z-index: 1;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges
}

#gameScreen .card .card-frame .edge.left {
  left: 0;
  top: var(--inset);
  bottom: var(--inset);
  width: var(--ethick);
  background-image: var(--side);
  background-position: center var(--phaseSide);
  background-repeat: repeat-y;
  background-size: 100% var(--tileScaled)
}

#gameScreen .card .card-frame .edge.right {
  right: 0;
  top: var(--inset);
  bottom: var(--inset);
  width: var(--ethick);
  background-image: var(--side);
  background-position: center var(--phaseSide);
  background-repeat: repeat-y;
  background-size: 100% var(--tileScaled)
}

#gameScreen .card .card-frame .edge.top {
  left: calc(var(--inset) - var(--bleed));
  right: calc(var(--inset) - var(--bleed));
  top: 0;
  height: calc(var(--ethick) + var(--bleed));
  overflow: hidden
}

#gameScreen .card .card-frame .edge.bottom {
  left: calc(var(--inset) - var(--bleed));
  right: calc(var(--inset) - var(--bleed));
  bottom: 0;
  height: calc(var(--ethick) + var(--bleed));
  overflow: hidden
}

#gameScreen .card .card-frame .edge.top::before,
#gameScreen .card .card-frame .edge.bottom::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ethick);
  height: 4000px;
  background-image: var(--side);
  background-position: center var(--phaseTop);
  background-repeat: repeat-y;
  background-size: var(--ethick) var(--tileScaled);
  backface-visibility: hidden
}

#gameScreen .card .card-frame .edge.top::before {
  transform: rotate(90deg);
  transform-origin: left top
}

#gameScreen .card .card-frame .edge.bottom::before {
  transform: rotate(-90deg);
  transform-origin: left bottom;
  background-position: center var(--phaseBottom)
}

/* Feedback Form Styles */
.feedback-form-container {
  padding: 8px 4px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  appearance: none;
  border: 1.5px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .95);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all .2s ease;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, .4);
}

.form-input:focus,
.form-textarea:focus {
  border-color: rgba(123, 92, 255, .5);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, .15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.feedback-status {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  animation: status-slide-in .3s ease;
}

@keyframes status-slide-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-status.success {
  background: rgba(46, 204, 113, .15);
  border: 1px solid rgba(46, 204, 113, .4);
  color: rgba(46, 204, 113, 1);
}

.feedback-status.error {
  background: rgba(255, 46, 120, .15);
  border: 1px solid rgba(255, 46, 120, .4);
  color: rgba(255, 123, 191, 1);
}

#submitFeedbackBtn {
  position: relative;
  margin-top: 6px;
}

#submitFeedbackBtn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

.submit-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: rgba(255, 255, 255, .9);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-loading.hidden {
  display: none;
}