/* ════════════════════════════════════════════════
   Die Schattenschneiderin — Game Gate Styles
   ════════════════════════════════════════════════ */

:root {
  --bg:            #080810;
  --deep:          #0d0d1a;
  --purple:        #2d1b69;
  --gold:          #c9a84c;
  --gold-light:    #e8c87a;
  --gold-dim:      #7a6030;
  --parchment:     #d4b896;
  --parchment-dark:#a08060;
  --text:          #c8b8a2;
  --text-light:    #ede0cc;
  --text-dim:      #7a6a58;
  --red:           #c84040;
  --font-title:    'Cinzel Decorative', serif;
  --font-heading:  'Cinzel', serif;
  --font-body:     'IM Fell English', serif;
  --transition:    0.8s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  position: relative;
}

/* ── Fog Layers ── */
.fog-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fog-1 {
  background: radial-gradient(ellipse 200% 80% at 20% 110%,
    rgba(45,27,105,0.35) 0%, transparent 60%);
  animation: fogDrift1 18s ease-in-out infinite;
  opacity: 0.7;
}

.fog-2 {
  background: radial-gradient(ellipse 200% 80% at 80% 110%,
    rgba(13,13,26,0.5) 0%, transparent 60%);
  animation: fogDrift2 24s ease-in-out infinite;
  opacity: 0.6;
}

.fog-3 {
  background: radial-gradient(ellipse 300% 40% at 50% 105%,
    rgba(201,168,76,0.07) 0%, transparent 50%);
  animation: fogDrift3 30s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes fogDrift1 {
  0%,100% { transform: translateX(-3%) scaleY(1); }
  50%     { transform: translateX(3%)  scaleY(1.08); }
}
@keyframes fogDrift2 {
  0%,100% { transform: translateX(4%)  scaleY(1); }
  50%     { transform: translateX(-4%) scaleY(0.93); }
}
@keyframes fogDrift3 {
  0%,100% { transform: translateX(-2%) translateY(2%); }
  50%     { transform: translateX(2%)  translateY(-2%); }
}

/* ── Particle Canvas ── */
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── Screens ── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

.screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 680px;
  width: 100%;
  text-align: center;
}

/* ── Logo ── */
.hero-logo {
  display: block;
  width: auto;
  height: 156px;
  opacity: 0.88;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.35));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0);    filter: drop-shadow(0 0 16px rgba(201,168,76,0.35)); }
  50%       { transform: translateY(-6px); filter: drop-shadow(0 6px 22px rgba(201,168,76,0.5)); }
}

/* ── Brand / Intro ── */
.brand-mark {
  color: var(--gold-dim);
  font-size: 0.85rem;
  letter-spacing: 0.8em;
}

.site-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  color: var(--gold-light);
  letter-spacing: 0.05em;
  animation: titleGlow 3s ease-in-out infinite;
}

.hero-persona {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--gold);
  letter-spacing: 0.12em;
}

.site-subtitle {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--parchment-dark);
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.divider {
  color: var(--gold-dim);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

.intro-text {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.9;
}

.intro-text em { color: var(--gold-light); font-style: italic; }

@keyframes titleGlow {
  0%,100% { text-shadow: 0 0 30px rgba(201,168,76,0.3), 0 0 60px rgba(201,168,76,0.1); }
  50%     { text-shadow: 0 0 50px rgba(201,168,76,0.6), 0 0 100px rgba(201,168,76,0.2); }
}

/* ── Button ── */
.btn-medieval {
  background: linear-gradient(180deg, #1e140a 0%, #140d06 100%);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.8rem 2.5rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.1);
}

.btn-medieval::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201,168,76,0.18);
  pointer-events: none;
  transition: border-color 0.3s ease;
}

.btn-medieval:hover {
  background: linear-gradient(180deg, #2e2010 0%, #1a1008 100%);
  border-color: var(--gold);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 0 0 30px rgba(201,168,76,0.25), 0 0 60px rgba(201,168,76,0.1);
  transform: translateY(-1px);
}

.btn-medieval:hover::before { border-color: rgba(201,168,76,0.4); }
.btn-medieval:active { transform: translateY(0); }

.btn-medieval.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* ── Guard Screen ── */
.guard-figure {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 20px rgba(201,168,76,0.3));
  animation: guardPulse 4s ease-in-out infinite;
}

@keyframes guardPulse {
  0%,100% { filter: drop-shadow(0 0 20px rgba(201,168,76,0.25)); }
  50%     { filter: drop-shadow(0 0 35px rgba(201,168,76,0.5)); }
}

.dialogue-box {
  background: linear-gradient(180deg,
    rgba(13,13,26,0.95) 0%,
    rgba(8,8,16,0.95) 100%);
  border: 1px solid var(--gold-dim);
  padding: 1.8rem 2.2rem;
  max-width: 560px;
  width: 100%;
  position: relative;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialogue-box::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201,168,76,0.14);
  pointer-events: none;
}

.dialogue-text {
  color: var(--parchment);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.85;
  white-space: pre-wrap;
}

.dialogue-cursor {
  color: var(--gold);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0; }
}

/* ── Trial Header ── */
.trial-header {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trial-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.trial-track {
  width: 100%;
  height: 2px;
  background: rgba(201,168,76,0.15);
}

.trial-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  box-shadow: 0 0 8px rgba(201,168,76,0.5);
  transition: width 0.6s ease;
}

.trial-name {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(201,168,76,0.3);
}

/* ── Parchment ── */
.parchment {
  background: linear-gradient(180deg,
    rgba(40,30,15,0.96) 0%,
    rgba(30,22,10,0.96) 50%,
    rgba(40,30,15,0.96) 100%);
  border: 1px solid var(--gold-dim);
  padding: 2rem 2.2rem;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: 0 4px 40px rgba(0,0,0,0.6),
              inset 0 0 40px rgba(0,0,0,0.35);
}

.parchment::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201,168,76,0.14);
  pointer-events: none;
}

.parchment-ornament {
  color: var(--gold-dim);
  font-size: 1.2rem;
  text-align: center;
}

.parchment-ornament.top  { margin-bottom: 1.2rem; }
.parchment-ornament.bottom { margin-top: 1.2rem; }

/* ── Riddle ── */
.riddle-question {
  color: var(--parchment);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.riddle-choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.riddle-choice {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(201,168,76,0.2);
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  width: 100%;
}

.riddle-choice:hover {
  border-color: var(--gold-dim);
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
}

.riddle-choice.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
}

.choice-key {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--gold-dim);
  min-width: 1.2rem;
}

/* ── Symbol Puzzle ── */
.symbol-instruction {
  color: var(--parchment);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.symbol-instruction em { color: var(--gold-light); }

.rune-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.rune-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.5rem;
  border: 1px solid rgba(201,168,76,0.2);
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rune-card:hover {
  border-color: var(--gold-dim);
  background: rgba(201,168,76,0.08);
}

.rune-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.15);
  box-shadow: 0 0 20px rgba(201,168,76,0.2);
}

.rune-glyph {
  font-size: 2.2rem;
  color: var(--gold-light);
  line-height: 1;
}

.rune-label {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Code Input ── */
.code-instruction {
  color: var(--parchment);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.code-instruction strong { color: var(--gold-light); }

.code-input-wrap {
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
}

.code-input {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: none;
  border-bottom: 2px solid var(--gold);
  padding: 0.8rem 1.2rem;
  color: var(--gold-light);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.code-input::placeholder { color: var(--text-dim); font-style: italic; }

.code-input:focus {
  border-bottom-color: var(--gold-light);
  box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}

.attempts-text {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.8rem;
}

/* ── Error Messages ── */
.error-msg {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--red);
  font-size: 0.92rem;
  min-height: 1.4rem;
  text-shadow: 0 0 10px rgba(200,64,64,0.3);
}

/* ── Victory / Gate ── */
#screen-victory {
  overflow: hidden;
  background: var(--bg);
  z-index: 20;
}

.gate-left,
.gate-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(201,168,76,0.025) 0px,
      rgba(201,168,76,0.025) 1px,
      transparent 1px,
      transparent 42px
    ),
    linear-gradient(180deg, #1c1208 0%, #0e0904 50%, #1c1208 100%);
  border: 2px solid var(--gold-dim);
  transition: transform 1.6s cubic-bezier(0.76, 0, 0.24, 1);
  z-index: 2;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

.gate-left  { left: 0;  transform: translateX(0); }
.gate-right { right: 0; transform: translateX(0); }

.gate-left::before,
.gate-right::before {
  content: 'ᛊ';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  color: rgba(201,168,76,0.1);
  font-family: serif;
}

/* Gate seam glow */
.gate-left::after {
  content: '';
  position: absolute;
  right: -3px; top: 0;
  width: 5px; height: 100%;
  background: linear-gradient(180deg, var(--gold-dim), var(--gold), var(--gold-dim));
  box-shadow: 0 0 25px rgba(201,168,76,0.7);
}

.gate-right::after {
  content: '';
  position: absolute;
  left: -3px; top: 0;
  width: 5px; height: 100%;
  background: linear-gradient(180deg, var(--gold-dim), var(--gold), var(--gold-dim));
  box-shadow: 0 0 25px rgba(201,168,76,0.7);
}

.gate-open .gate-left  { transform: translateX(-100%); }
.gate-open .gate-right { transform: translateX(100%); }

.victory-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease 0.9s;
}

.gate-open .victory-content { opacity: 1; }

.victory-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(201,168,76,0.5);
}

.victory-subtitle {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  color: var(--parchment);
  text-transform: uppercase;
}

.victory-redirect {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .rune-grid        { grid-template-columns: repeat(2,1fr); }
  .screen-inner     { padding: 1.2rem; gap: 1rem; }
  .parchment        { padding: 1.5rem 1.2rem; }
  .btn-medieval     { padding: 0.7rem 1.8rem; }
  .dialogue-box     { padding: 1.2rem 1.4rem; }
}

/* ── Game Footer (Legal Compliance) ── */
.game-footer {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  z-index: 20;
}

.game-footer a {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.game-footer a:hover {
  color: var(--gold-light);
}

