/* ========================================
   COMPONENTS.CSS — Kortit, galleria, modaalit, tarrat
   Elävät komponentit — jokainen on oma olentonsa
   ======================================== */

/* ---------- KORTIT (yleinen) ---------- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  animation: cardBreathe 8s var(--cubic-breathe) infinite;
}

/* Hidas hengitys — kortti elää vaikka et koskisi */
@keyframes cardBreathe {
  0%, 100% {
    border-color: var(--bg-elevated);
    box-shadow: 0 0 0 rgba(212, 168, 67, 0);
  }
  50% {
    border-color: rgba(212, 168, 67, 0.12);
    box-shadow: 0 0 25px rgba(212, 168, 67, 0.06);
  }
}

.card:hover {
  animation: none;
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.12), 0 0 60px rgba(212, 168, 67, 0.06);
  transform: translateY(-4px);
}

/* Warm-taustalla cardit tarvitsevat oman taustan erottuakseen */
.section-warm .card {
  background-color: #413450;
  border-color: rgba(212, 168, 67, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  /* cardBreathe ylikirjoittaisi borderin tummaksi (var(--bg-elevated)) —
     oma hengitys pitää reunan kultaisena warm-taustalla */
  animation: cardBreatheWarm 8s var(--cubic-breathe) infinite;
}

@keyframes cardBreatheWarm {
  0%, 100% {
    border-color: rgba(212, 168, 67, 0.26);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  }
  50% {
    border-color: rgba(212, 168, 67, 0.15);
    box-shadow: 0 0 25px rgba(212, 168, 67, 0.1);
  }
}

.section-warm .card:hover {
  box-shadow:
    0 0 35px rgba(212, 168, 67, 0.18),
    0 0 70px rgba(212, 168, 67, 0.08),
    0 0 120px rgba(212, 168, 67, 0.04),
    inset 0 0 40px rgba(212, 168, 67, 0.06),
    inset 0 0 80px rgba(212, 168, 67, 0.03),
    0 0 40px rgba(180, 74, 138, 0.06),
    0 0 80px rgba(180, 74, 138, 0.03);
  border-color: var(--gold);
  transform: translateY(-6px) scale(1.02);
  animation: none;
}

/* Warm-taustalla kortin shimmer — oma gradientti, pysähtyy hoverissa */
.section-warm .card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    var(--gold-dim),
    transparent,
    var(--magenta-dim),
    transparent,
    var(--teal-dim),
    transparent,
    var(--gold-dim)
  );
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: -1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
  pointer-events: none;
}

.section-warm .card:hover::before {
  opacity: 1;
  animation: warmCardShimmer 4s ease infinite;
}

@keyframes warmCardShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Warm-taustalla gallery-itemit tarvitsevat myös erottuvuutta */
.section-warm .gallery-item {
  background-color: #2a2235;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Warm-taustalla guide-cardit */
.section-warm .guide-card {
  background-color: #2a2235;
}

/* Elävä reunaväri — hidas liuku */
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    var(--gold-dim),
    var(--teal-dim),
    var(--magenta-dim),
    var(--gold-dim)
  );
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: -1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
}

.card:hover::before {
  opacity: 1;
  animation: shimmerBorder 4s ease infinite;
}

@keyframes shimmerBorder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.card-title {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  color: var(--text-primary);
  margin-block-end: 8px;
}

/* Etusivun toiminta-kortit — keskitetty kuten ovet (entrance-card) */
.section-warm .card {
  text-align: center;
}

/* Luettavuus: card-text (#8a8090) purppuraa vasten on vain 3.25:1 —
   nostetaan text-secondary-tasolle (5.33:1, WCAG AA 4.5:1) */
.section-warm .card .card-text {
  color: var(--text-secondary);
}

/* Ikonit toiminta-korteissa — sama kieli kuin entrance-korteissa */
.card-icon {
  position: relative;
  z-index: 1;
  font-size: 2.8rem;
  line-height: 1;
  color: var(--gold);
  margin-block-end: 14px;
  filter: drop-shadow(0 0 6px rgba(212, 168, 67, 0.2));
  transition: transform var(--transition), color var(--transition), filter var(--transition);
  display: inline-block;
}

.card:hover .card-icon {
  transform: scale(1.2) rotate(-8deg);
  color: var(--gold-hover);
  filter: drop-shadow(0 0 14px rgba(212, 168, 67, 0.45));
}

.card-text {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.6;
  transition: color var(--transition);
}

.card-text:hover {
  color: var(--text-secondary);
}

/* ---------- GALLERIA ---------- */

/* Galleria-kategorioiden omat väriteemat */
.gallery-section {
  position: relative;
}

/* Hienovarainen erotin kategorioiden välillä — kultainen valoreuna */
.gallery-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.06), transparent);
  pointer-events: none;
}

.gallery-section:last-child::after {
  display: none;
}

.gallery-section[data-theme="vampire"] {
  --gallery-accent: var(--magenta-soft);
  --gallery-accent-dim: var(--magenta-dim);
  --gallery-accent-hue: 320;
  /* Vaaleampi sävy kuvauksille — kontrasti 4.5:1 warm-taustalla */
  --gallery-accent-soft: #c677a7;
}

.gallery-section[data-theme="tekken7"] {
  --gallery-accent: #c44a2a;
  --gallery-accent-dim: rgba(196, 74, 42, 0.2);
  --gallery-accent-hue: 14;
  --gallery-accent-soft: #d2775f;
}

.gallery-section[data-theme="sf6"] {
  --gallery-accent: #4a8ac4;
  --gallery-accent-dim: rgba(74, 138, 196, 0.2);
  --gallery-accent-hue: 210;
  --gallery-accent-soft: #659bcc;
}

.gallery-section[data-theme="sf3"] {
  --gallery-accent: #4ac46a;
  --gallery-accent-dim: rgba(74, 196, 106, 0.2);
  --gallery-accent-hue: 140;
  --gallery-accent-soft: #4ac46a;
}

.gallery-section[data-theme="ssf2t"] {
  --gallery-accent: var(--gold);
  --gallery-accent-dim: var(--gold-dim);
  --gallery-accent-hue: 38;
  --gallery-accent-soft: var(--gold);
}

.gallery-section[data-theme="tekken3"] {
  --gallery-accent: var(--teal);
  --gallery-accent-dim: var(--teal-dim);
  --gallery-accent-hue: 170;
  --gallery-accent-soft: #3c9b8d;
}

.gallery-section[data-theme="vg"] {
  --gallery-accent: #3a8ac4;
  --gallery-accent-dim: rgba(58, 138, 196, 0.2);
  --gallery-accent-hue: 208;
  --gallery-accent-soft: #5a9acf;
}

.gallery-section[data-theme="bg"] {
  --gallery-accent: #c47a3a;
  --gallery-accent-dim: rgba(196, 122, 58, 0.2);
  --gallery-accent-hue: 28;
  --gallery-accent-soft: #d48f55;
}

.gallery-section[data-theme="lan-party"] {
  --gallery-accent: #ffb559;
  --gallery-accent-dim: rgba(255, 181, 89, 0.2);
  --gallery-accent-hue: 34;
  --gallery-accent-soft: #ffcc80;
}

.gallery-section[data-theme="lfgc"] {
  --gallery-accent: #9D4EDD;
  --gallery-accent-dim: rgba(157, 78, 221, 0.2);
  --gallery-accent-hue: 270;
  --gallery-accent-soft: #b47cdd;
}

/* Kategorian otsikon korostusväri */
.gallery-section[data-theme] .section-title .span {
  color: var(--gallery-accent);
  animation: galleryTitleGlow 4s ease-in-out infinite;
  transition: text-shadow var(--transition);
}

.gallery-section[data-theme] .section-title .span:hover {
  text-shadow: 0 0 30px var(--gallery-accent), 0 0 60px var(--gallery-accent-dim);
}

@keyframes galleryTitleGlow {
  0%, 100% { text-shadow: 0 0 15px var(--gallery-accent-dim); }
  50%      { text-shadow: 0 0 35px var(--gallery-accent); }
}

/* Kategorian gallery-item hover -värit */
.gallery-section[data-theme] .gallery-item:hover {
  border-color: var(--gallery-accent);
  box-shadow: 0 0 25px var(--gallery-accent-dim), 0 0 0 1px var(--gallery-accent-dim), 0 0 60px var(--gallery-accent-dim);
  transform: translateY(-2px);
}

.gallery-section[data-theme] .gallery-item:hover .gallery-label {
  color: var(--gallery-accent);
  text-shadow: 0 0 10px var(--gallery-accent-dim);
}

.gallery-section[data-theme] .gallery-item:hover img {
  transform: scale(1.1);
}

/* Kategorian kuvauksen korostus — accent-soft: kontrasti 4.5:1 warm-taustalla */
.gallery-section[data-theme] .section-desc-sm {
  color: var(--gallery-accent-soft, var(--gallery-accent));
  opacity: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Scroll-snap mobiililla — galleria toimii kuin kuvakaruselli */
@media (max-width: 576px) {
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 16px;
    padding-block-end: 8px;
  }

  .gallery-grid .gallery-item {
    scroll-snap-align: start;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  display: block;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover img {
  transform: scale(1.08);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  filter: brightness(1.08);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(13, 10, 15, 0.6) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item .gallery-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  color: var(--text-primary);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-600);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
}

.gallery-item:hover .gallery-label {
  opacity: 1;
  transform: translateY(0);
}

/* Kosketusnäytöt — ei hoveria, labelit aina näkyvissä tummennuksen kanssa */
@media (hover: none) {
  .gallery-item .gallery-label {
    opacity: 1;
    transform: translateY(0);
  }
  .gallery-item::after {
    opacity: 1;
  }
}

/* ---------- MODAALI ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 50%, var(--bg-card) 100%);
  background-size: 200% 200%;
  animation: modalPlaceholder 2s ease infinite;
}

@keyframes modalPlaceholder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Modaalin ohjeistus — näkyy ensimmäisellä kerralla */
.modal-instructions {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-family: var(--ff-inter);
  font-size: var(--fs-tiny);
  color: var(--text-secondary);
  background: rgba(13, 10, 15, 0.85);
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--gold-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  z-index: 3;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-instructions-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-content img.fade-in {
  opacity: 1;
  transform: scale(1);
}

.modal-content img.fade-out {
  opacity: 0;
  transform: scale(0.95);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 10, 15, 0.7);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.modal-close:hover {
  background: var(--gold);
  color: var(--bg-deep);
}

/* Modaalinavigointi — edellinen/seuraava */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 10, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 2;
  opacity: 0;
}

.modal-content:hover .modal-nav {
  opacity: 1;
}

.modal-nav:hover {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.modal-nav-prev {
  left: 12px;
}

.modal-nav-next {
  right: 12px;
}

/* Kuvan laskuri */
.modal-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-oxanium);
  font-size: var(--fs-tiny);
  color: var(--gold);
  background: rgba(13, 10, 15, 0.7);
  padding: 4px 12px;
  border-radius: 12px;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition);
  text-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.modal-content:hover .modal-counter {
  opacity: 1;
}

/* Kosketusnäytöt — ei hoveria, nuolet ja laskuri aina näkyvissä */
@media (hover: none) {
  .modal-nav,
  .modal-counter {
    opacity: 1;
  }
}

/* ---------- HAHMOKORTIT (info-sivu) ---------- */
.character-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px 100px;
  text-align: center;
  transition: all var(--transition-slow);
  animation: cardBreathe 10s var(--cubic-breathe) infinite;
}

.character-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.18), 0 0 0 1px rgba(212, 168, 67, 0.1), 0 0 80px rgba(212, 168, 67, 0.06);
  transform: translateY(-6px) scale(1.03);
}

.character-card:hover img {
  border-color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 0 35px rgba(212, 168, 67, 0.3), 0 0 70px rgba(212, 168, 67, 0.15), 0 0 0 3px rgba(212, 168, 67, 0.08);
  filter: brightness(1.15);
}

/* ---------- KATALOGIKORTTI (oma design) ---------- */
.catalogue-card {
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--gold-dim-2);
  border-radius: 20px;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.catalogue-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(ellipse at 30% 50%, rgba(212, 168, 67, 0.06), transparent 70%);
  pointer-events: none;
}

.catalogue-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 50px rgba(212, 168, 67, 0.12), 0 0 0 1px rgba(212, 168, 67, 0.08);
  transform: translateY(-4px);
}

.catalogue-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 32px;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.catalogue-icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
  transition: transform var(--transition);
}

.catalogue-title {
  flex: 1;
  font-family: var(--ff-oxanium);
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.catalogue-arrow {
  font-size: 1.8rem;
  color: var(--gold);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.catalogue-card:hover .catalogue-arrow {
  transform: translateX(6px);
}

.catalogue-card:hover .catalogue-icon {
  transform: rotate(-12deg);
}

@media (max-width: 576px) {
  .catalogue-link {
    padding: 18px 20px;
  }
  .catalogue-title {
    font-size: var(--fs-small);
  }
}

/* ---------- ULKOINEN GALLERIA-LINKKI — laatikko ---------- */
.gallery-external-card {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.gallery-external-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 32px;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--gold-dim-2);
  border-radius: 14px;
  text-decoration: none;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.gallery-external-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at 40% 50%, rgba(212, 168, 67, 0.07), transparent 70%);
  pointer-events: none;
}

.gallery-external-link:hover {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.10), 0 0 0 1px rgba(212, 168, 67, 0.06);
  transform: translateY(-3px);
  gap: 18px;
}

.gallery-external-label {
  position: relative;
  z-index: 1;
  font-family: var(--ff-oxanium);
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.gallery-external-link:hover .gallery-external-label {
  color: var(--gold);
}

.gallery-external-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.5rem;
  color: var(--gold);
  transition: transform var(--transition);
  transform: translateY(-2px);
}

.gallery-external-link:hover .gallery-external-arrow {
  transform: translateY(-2px) translateX(5px);
}

@media (max-width: 576px) {
  .gallery-external-link {
    padding: 14px 22px;
    gap: 10px;
  }
  .gallery-external-label {
    font-size: var(--fs-tiny);
  }
}

/* LahtiFGC-teemalla oma väri */
.gallery-section[data-theme="lfgc"] .gallery-external-link {
  border-color: rgba(157, 78, 221, 0.25);
}

.gallery-section[data-theme="lfgc"] .gallery-external-link::before {
  background: radial-gradient(ellipse at 40% 50%, rgba(157, 78, 221, 0.08), transparent 70%);
}

.gallery-section[data-theme="lfgc"] .gallery-external-link:hover {
  border-color: #9D4EDD;
  box-shadow: 0 0 40px rgba(157, 78, 221, 0.12), 0 0 0 1px rgba(157, 78, 221, 0.08);
}

.gallery-section[data-theme="lfgc"] .gallery-external-link:hover .gallery-external-label {
  color: #b47cdd;
}

.gallery-section[data-theme="lfgc"] .gallery-external-arrow {
  color: #9D4EDD;
}

.character-card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  margin: 0 auto 16px;
  border: 3px solid var(--bg-elevated);
  transition: all var(--transition);
  box-shadow: 0 0 0 rgba(212, 168, 67, 0);
  animation: characterBorderBreathe 6s ease-in-out infinite;
}

@keyframes characterBorderBreathe {
  0%, 100% { border-color: var(--bg-elevated); box-shadow: 0 0 0 rgba(212, 168, 67, 0); }
  50%      { border-color: rgba(212, 168, 67, 0.15); box-shadow: 0 0 12px rgba(212, 168, 67, 0.08); }
}

.character-name {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  color: var(--text-primary);
  margin-block-end: 4px;
}

.character-role {
  font-size: var(--fs-small);
  color: var(--gold);
  font-weight: var(--fw-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.character-link {
  display: inline-block;
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  transition: all var(--transition);
  margin-block-start: 8px;
}

.character-link:hover {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212, 168, 67, 0.3);
}

/* ---------- HERO SECTION (sisäsivut) ---------- */
.page-hero {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-block: 100px 50px;
  animation: hueShift 30s ease-in-out infinite;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 10, 15, 0.7) 0%, var(--bg-body) 100%);
  z-index: 0;
}

/* Hengittävä taustavalo page-heroille */
.page-hero::after {
  content: '';
  position: absolute;
  width: 70vw;
  height: 70vw;
  top: -25%;
  right: -15%;
  background: radial-gradient(circle, hsla(var(--gold-hue), 60%, 55%, 0.15) 0%, transparent 60%);
  filter: blur(70px);
  animation: heroGlow 15s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes heroGlow {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50%  { transform: translate(-5%, 5%) scale(1.2); opacity: 1; }
  100% { transform: translate(3%, -3%) scale(0.9); opacity: 0.5; }
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: var(--fs-h1);
  color: var(--text-primary);
  margin-block-end: 12px;
  transition: text-shadow var(--transition-slow);
}

.page-hero h1:hover {
  text-shadow: 0 0 30px rgba(240, 232, 240, 0.08);
}

.page-hero h1 .span {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
  animation: titleGlow 4s ease-in-out infinite;
  transition: text-shadow var(--transition-slow);
}

.page-hero h1 .span:hover {
  text-shadow: 0 0 40px rgba(212, 168, 67, 0.5), 0 0 80px rgba(212, 168, 67, 0.2);
}

.page-hero p {
  color: #d4c4dc;
  max-width: 60ch;
  margin-inline: auto;
  font-size: var(--fs-body);
  transition: color var(--transition-slow), text-shadow var(--transition-slow);
}

.page-hero p:hover {
  color: #e4d8e4;
  text-shadow: 0 0 30px rgba(212, 212, 220, 0.12), 0 0 60px rgba(212, 212, 220, 0.05);
}

/* ---------- OHJEKORTIT (videopeli/lautapeli) ---------- */
.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all var(--transition);
  animation: guideBreathe 10s var(--cubic-breathe) infinite;
  position: relative;
  overflow: hidden;
}

@keyframes guideBreathe {
  0%, 100% {
    border-color: var(--bg-elevated);
    box-shadow: 0 0 0 rgba(26, 138, 122, 0);
  }
  50% {
    border-color: rgba(26, 138, 122, 0.10);
    box-shadow: 0 0 20px rgba(26, 138, 122, 0.05);
  }
}

.guide-card:hover {
  animation: none;
  border-color: var(--teal);
  box-shadow: 0 0 30px rgba(26, 138, 122, 0.15), 0 0 0 1px rgba(26, 138, 122, 0.08), 0 0 60px rgba(26, 138, 122, 0.06);
  transform: translateY(-5px);
}

/* Hienovarainen shimmer guide-cardin hoverissa */
.guide-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(26, 138, 122, 0.06) 30%,
    rgba(180, 74, 138, 0.04) 60%,
    transparent 100%
  );
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.guide-card:hover::before {
  opacity: 1;
  animation: guideShimmer 4s ease infinite;
}

@keyframes guideShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.guide-card:hover .guide-number {
  color: var(--teal);
  transform: scale(1.15);
  text-shadow: 0 0 20px rgba(26, 138, 122, 0.5);
}

.guide-number {
  font-family: var(--ff-oxanium);
  font-size: 3rem;
  font-weight: var(--fw-800);
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
  min-width: 40px;
  transition: all var(--transition);
}

.guide-content h3 {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  color: var(--text-primary);
  margin-block-end: 8px;
}

.guide-content p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.6;
  transition: color var(--transition);
}

.guide-content p:hover {
  color: var(--text-secondary);
}

/* ---------- PELIVALIKOIMA ---------- */
.game-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.game-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition);
  animation: cardBreathe 10s var(--cubic-breathe) infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

/* Pelivalikoiman shimmer-efekti — hienovarainen valo */
.game-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(212, 168, 67, 0.03) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.game-item:hover {
  animation: none;
  border-color: var(--gold);
  transform: translateY(-4px) scale(1.04);
  box-shadow:
    0 0 25px rgba(212, 168, 67, 0.1),
    0 0 50px rgba(212, 168, 67, 0.05),
    inset 0 0 30px rgba(212, 168, 67, 0.04);
}

.game-item:hover::before {
  opacity: 1;
  animation: gameShimmer 3s ease infinite;
}

@keyframes gameShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.game-item:hover .game-name {
  color: var(--gold);
}

.game-item:hover .game-genre {
  color: var(--teal);
  text-shadow: 0 0 10px rgba(26, 138, 122, 0.3);
}

.game-item .game-name {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  color: var(--text-primary);
  transition: color var(--transition);
  position: relative;
  z-index: 1;
}

.game-item .game-genre {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-block-start: 8px;
  position: relative;
  z-index: 1;
}

/* ---------- RESPONSIVE IFRAME ---------- */
.responsive-iframe {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.responsive-iframe iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- HELP BUTTON ---------- */
.btn-help {
  animation: helpBreathe 4s var(--cubic-breathe) infinite;
}

.btn-help:hover {
  animation: none;
}

@keyframes helpBreathe {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.3);
  }
  50% {
    box-shadow: 0 4px 35px rgba(212, 168, 67, 0.5);
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .guide-card {
    flex-direction: column;
    gap: 12px;
  }

  .game-collection {
    grid-template-columns: repeat(2, 1fr);
  }

  .entrance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .character-card img {
    width: 120px;
    height: 120px;
  }

  .character-card {
    padding: 20px 24px;
  }
}

@media (max-width: 576px) {
  .entrance-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-block-start: 32px;
  }

  .game-collection {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .guide-number {
    font-size: 2.4rem;
    min-width: 32px;
  }

  .character-card img {
    width: 100px;
    height: 100px;
  }

  .card {
    padding: 16px;
  }

  .entrance-card {
    padding: 24px 16px;
  }
}

/* ---------- FOOTER (siirretty layout.css:ään) ---------- */

/* ---------- SISÄÄNKÄYNTIKORTIT (etusivu) ---------- */
/* Taustakuvio — orgaaninen, off center, hengittävä */
.entrance-section {
  position: relative;
  overflow: hidden;
}

.taverna-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  animation: patternDrift 30s ease-in-out infinite alternate;
}

.taverna-pattern::before {
  content: '';
  position: absolute;
  width: 80vw;
  height: 80vw;
  top: 10%;
  left: 5%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 40%,
    hsla(calc(var(--pattern-hue) + 20), 60%, 60%, 0.3) 0%,
    hsla(calc(var(--pattern-hue) + 40), 50%, 50%, 0.15) 20%,
    hsla(calc(var(--pattern-hue) + 60), 40%, 40%, 0.08) 40%,
    transparent 60%
  );
  filter: blur(40px);
  animation: patternMorph 20s ease-in-out infinite alternate;
}

.taverna-pattern::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  bottom: 5%;
  right: 10%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 60% 50%,
    hsla(calc(var(--pattern-hue) + 100), 50%, 50%, 0.25) 0%,
    hsla(calc(var(--pattern-hue) + 120), 40%, 40%, 0.1) 25%,
    transparent 50%
  );
  filter: blur(50px);
  animation: patternMorph2 25s ease-in-out infinite alternate;
}

/* Kolmas lonkero — kapeampi, orgaanisempi */
.taverna-pattern .pattern-tendril {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 40vw;
  height: 2px;
  transform-origin: 0 0;
  background: linear-gradient(
    90deg,
    hsla(calc(var(--pattern-hue) + 60), 70%, 60%, 0.2) 0%,
    transparent 100%
  );
  filter: blur(20px);
  animation: tendrilSway 18s ease-in-out infinite alternate;
}

@keyframes patternDrift {
  0%   { --pattern-x: 30%; --pattern-y: 60%; --pattern-hue: 38; --pattern-scale: 1; }
  25%  { --pattern-x: 35%; --pattern-y: 55%; --pattern-hue: 42; --pattern-scale: 1.05; }
  50%  { --pattern-x: 25%; --pattern-y: 65%; --pattern-hue: 35; --pattern-scale: 0.95; }
  75%  { --pattern-x: 32%; --pattern-y: 58%; --pattern-hue: 170; --pattern-scale: 1.02; }
  100% { --pattern-x: 28%; --pattern-y: 62%; --pattern-hue: 38; --pattern-scale: 1; }
}

@keyframes patternMorph {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(3%, -4%) scale(1.1) rotate(5deg); }
  66%  { transform: translate(-2%, 3%) scale(0.95) rotate(-3deg); }
  100% { transform: translate(4%, 2%) scale(1.05) rotate(2deg); }
}

@keyframes patternMorph2 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(-3%, 2%) scale(1.08) rotate(-4deg); }
  66%  { transform: translate(2%, -3%) scale(0.92) rotate(3deg); }
  100% { transform: translate(-2%, -1%) scale(1.03) rotate(-2deg); }
}

@keyframes tendrilSway {
  0%   { transform: rotate(-15deg) scaleX(1); opacity: 0.15; }
  50%  { transform: rotate(10deg) scaleX(1.2); opacity: 0.25; }
  100% { transform: rotate(-5deg) scaleX(0.9); opacity: 0.15; }
}

.entrance-section .container {
  position: relative;
  z-index: 1;
}

.entrance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-block-start: 56px;
}

.entrance-card {
  position: relative;
  background: linear-gradient(180deg, #221c2a 0%, #1a1520 100%);
  border: 1px solid rgba(212, 168, 67, 0.30);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  transition: all var(--transition-slow);
  overflow: hidden;
  cursor: pointer;
  animation: entranceBreathe 10s var(--cubic-breathe) infinite;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Hidas hengitys — ovi elää taustalla */
@keyframes entranceBreathe {
  0%, 100% {
    border-color: rgba(212, 168, 67, 0.30);
    box-shadow:
      0 8px 28px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 14px rgba(212, 168, 67, 0.06);
  }
  50% {
    border-color: rgba(212, 168, 67, 0.42);
    box-shadow:
      0 8px 28px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 28px rgba(212, 168, 67, 0.12);
  }
}

.entrance-card:hover {
  animation: none;
  transform: translateY(-10px) scale(1.04) perspective(800px) rotateY(2deg) rotateX(-2deg);
  border-color: var(--gold);
  box-shadow:
    0 12px 50px rgba(212, 168, 67, 0.25),
    0 0 0 1px rgba(212, 168, 67, 0.15),
    0 0 80px rgba(212, 168, 67, 0.08),
    0 0 120px rgba(212, 168, 67, 0.04),
    inset 0 0 40px rgba(212, 168, 67, 0.06),
    inset 0 0 80px rgba(212, 168, 67, 0.03);
}

/* Ovi-efekti — hoverissa "avautuu" — vahvempi valo, elävä gradientti */
.entrance-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim) 0%, transparent 35%, var(--teal-dim) 100%);
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.entrance-card:hover::before {
  opacity: 1;
  animation: entranceShimmer 4s ease infinite;
}

@keyframes entranceShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Valon välähdys — kuin ovi avautuisi ja valo tulvii sisään */
.entrance-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.2) 0%, rgba(180, 74, 138, 0.1) 25%, rgba(26, 138, 122, 0.08) 50%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.5s var(--cubic-out), opacity 0.4s ease;
  pointer-events: none;
}

.entrance-card:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.entrance-card:hover .entrance-title {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.entrance-card:hover .entrance-desc {
  color: var(--text-secondary);
}

.entrance-icon {
  position: relative;
  z-index: 1;
  font-size: 4rem;
  color: var(--gold);
  margin-block-end: 16px;
  transition: transform var(--transition), color var(--transition), filter var(--transition);
  filter: drop-shadow(0 0 6px rgba(212, 168, 67, 0.2));
  display: inline-block;
}

.entrance-card:hover .entrance-icon {
  transform: scale(1.35) rotate(-10deg);
  color: var(--gold-hover);
  filter: drop-shadow(0 0 18px rgba(212, 168, 67, 0.5));
}

.entrance-title {
  position: relative;
  z-index: 1;
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  font-weight: var(--fw-800);
  color: var(--text-primary);
  margin-block-end: 8px;
}

.entrance-desc {
  position: relative;
  z-index: 1;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.5;
  /* Kaksi riviä (line-height 1.5 × 2) — pitää ovet samankorkuisina:
     lyhyempi kuvaus ei jätä korttia visuaalisesti kevyemmäksi.
     Keskitetty pystyyn: yksirivinen kuvaus leijuu tasapainossa,
     ei jätä tyhjää laatikon alareunaan. */
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive: entrance-grid */
@media (max-width: 992px) {
  .entrance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .entrance-card {
    padding: 32px 20px;
  }
}

@media (max-width: 768px) {
  .entrance-grid {
    grid-template-columns: 1fr;
  }

  .entrance-desc {
    min-height: 0;
  }
}

/* ---------- TOIMINTA-DESC ---------- */
.toiminta-desc {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-block-end: 48px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- KALENTERI ---------- */
.calendar-section {
  margin-block-end: 64px;
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin-inline: auto;
}

.calendar-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all var(--transition-slow);
  animation: cardBreathe 8s var(--cubic-breathe) infinite;
}

.calendar-entry:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 0 25px rgba(212, 168, 67, 0.08);
  transform: translateY(-2px);
}

/* Calendar-entry shimmer */
.calendar-entry {
  position: relative;
  overflow: hidden;
}

.calendar-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(212, 168, 67, 0.03) 50%,
    transparent 100%
  );
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
  border-radius: inherit;
}

.calendar-entry:hover::before {
  opacity: 1;
  animation: calendarShimmer 4s ease infinite;
}

@keyframes calendarShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.calendar-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.calendar-date-day {
  font-family: var(--ff-oxanium);
  font-size: 2.4rem;
  font-weight: var(--fw-800);
  color: var(--gold);
  line-height: 1;
}

.calendar-date-month {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-info {
  flex: 1;
}

.calendar-title {
  font-family: var(--ff-oxanium);
  font-size: 1.6rem;
  font-weight: var(--fw-700);
  color: var(--text-primary);
  margin-block-end: 4px;
}

.calendar-time {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
}

.calendar-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: var(--fs-small);
}

/* ---------- ETUSIVUN GALLERIA ---------- */
.home-gallery-section {
  margin-block-start: 16px;
}

.section-subtitle {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h2);
  font-weight: var(--fw-700);
  text-align: center;
  margin-block-end: 32px;
}

.section-subtitle .span {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 800px;
  margin-inline: auto;
}

.home-gallery-item {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-slow);
  border: 1px solid var(--bg-elevated);
  position: relative;
}

.home-gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--gold-dim);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.12);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
  transition: all var(--transition);
}

.gallery-placeholder:hover {
  background: var(--bg-card);
  color: var(--gold-dim);
}

/* Kun kuvat on lisätty, placeholder katoaa */
.home-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.home-gallery-item:hover img {
  transform: scale(1.05);
}

/* Scroll-reveal stagger — kuvat heräävät yksitellen */
.home-gallery-item.taverna-reveal {
  transform: translateY(30px);
  filter: blur(4px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}
.home-gallery-item.taverna-reveal:nth-child(1) { transition-delay: 0s; }
.home-gallery-item.taverna-reveal:nth-child(2) { transition-delay: 0.08s; }
.home-gallery-item.taverna-reveal:nth-child(3) { transition-delay: 0.16s; }
.home-gallery-item.taverna-reveal:nth-child(4) { transition-delay: 0.24s; }
.home-gallery-item.taverna-reveal:nth-child(5) { transition-delay: 0.32s; }
.home-gallery-item.taverna-reveal:nth-child(6) { transition-delay: 0.4s; }

@media (max-width: 768px) {
  .home-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .home-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer kielipilleri — yhteinen kaikille sivuille */
.footer-lang {
  display: flex;
  gap: 8px;
  margin-block-start: 12px;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: 1px solid var(--bg-elevated);
  border-radius: 100px;
  font-size: 0.85rem;
  font-family: var(--ff-oxanium);
  font-weight: var(--fw-700);
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}
.lang-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,168,67,0.08);
}
