:root{
  --bg:#191309;
  --plate:#2b2113;
  --plate-raised:#382a17;
  --steel:#a89468;
  --steel-dark:#6b5934;
  --ink:#f2e6c9;
  --ink-dim:#bfa87e;
  --brass:#d4af37;
  --brass-bright:#f0cf6a;
  --seal-red:#b5451b;
  --seal-green:#2f7a4f;
  --font-body:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display:"Cinzel", Georgia, "Times New Roman", serif;
  --font-dial:"Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --seismic-radial-blur: 10px;      
  --seismic-glass-saturation: 140%; 
  --seal-glow-intensity: 2;        
  --seal-glow-locked: 0 0 10px 1px rgba(181,69,27, calc(0.6 * var(--seal-glow-intensity)));
  --seal-glow-unlocked: 0 0 12px 2px rgba(47,122,79, calc(0.6 * var(--seal-glow-intensity)));
  --seismic-grain-opacity: 0.09;    
  --seismic-glyph-opacity: 0.16;    
  --seal-transition-speed: 0.4s;    
}

*{ box-sizing:border-box; }

html, body{
  margin:0; padding:0; min-height:100%;
  background:radial-gradient(ellipse at 50% -10%, #2e2313 0%, transparent 60%), var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
}

body{ padding:32px 18px 64px; position:relative; }


body::before{
  content:""; position:fixed; inset:0; z-index:-2; pointer-events:none;
  background:url("assets/images/glyph-tile.svg") 0 0 / 240px 240px repeat;
  opacity: var(--seismic-glyph-opacity);
}

body::after{
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:url("assets/images/noise-tile.svg") 0 0 / 300px 300px repeat;
  opacity: var(--seismic-grain-opacity);
  mix-blend-mode:screen;
}

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

header{ display:flex; flex-direction:column; align-items:center; text-align:center; margin-bottom:34px; }
.mark{ height:52px; width:auto; margin-bottom:14px; }
.title-row{ display:flex; align-items:center; gap:14px; }
.glyph-icon{ width:22px; height:22px; flex:none; opacity:0.8; }
h1{ font-family:var(--font-display); font-size:26px; font-weight:700; margin:0; letter-spacing:0.03em; color:var(--brass-bright); }
.tagline{ font-size:14px; color:var(--ink-dim); margin:14px 0 0; max-width:420px; line-height:1.6; }


.frieze{
  width:216px; height:14px; margin:22px auto 0;
  background:repeating-linear-gradient(
    -55deg,
    var(--brass) 0 5px,
    transparent 5px 13px
  );
  opacity:0.55;
}

.progress-block{ display:flex; flex-direction:column; align-items:center; gap:10px; margin-bottom:30px; }
.seals{ display:flex; justify-content:center; gap:7px; flex-wrap:wrap; }
.seal-dot{
  width:15px; height:15px; border-radius:50%;
  background:var(--brass); border:1.5px solid var(--brass-bright);
  transition:background .3s, border-color .3s;
  background:linear-gradient(180deg, rgba(212,175,55,0.10), rgba(56,42,23,0.35));
  border:1px solid rgba(212,175,55,0.25);
  border-radius:14px;
  backdrop-filter: blur(var(--seismic-radial-blur)) saturate(var(--seismic-glass-saturation));
  -webkit-backdrop-filter: blur(var(--seismic-radial-blur)) saturate(var(--seismic-glass-saturation));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.35);
}
.seal-dot.done{ background:var(--seal-green); border-color:var(--seal-green); }
.seal-dot.active{ border-color:var(--steel); box-shadow:0 0 0 3px rgba(154,146,132,0.18); }
.progress-meta{ font-family:var(--font-dial); font-size:13px; color:var(--ink-dim); display:flex; gap:8px; align-items:center; }
.progress-sep{ opacity:0.5; }

.hint-plate{
  background:linear-gradient(180deg, var(--plate-raised), var(--plate));
  border:1px solid #3a372f; border-radius:6px;
  padding:20px 22px; margin-bottom:46px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 20px rgba(0,0,0,0.35);
}
.hint-plate .num{ font-size:12px; color:var(--brass); font-weight:600; margin-bottom:8px; }
.hint-plate .text{ font-size:16px; line-height:1.75; color:var(--ink); }

.lock{
  position:relative;
  background:#26241f;
  border-radius:18px;
  border:5px solid var(--seal-red);
  padding:30px 22px 26px;
  box-shadow:inset 0 0 0 4px var(--steel-dark), inset 0 1px 1px rgba(255,255,255,0.1), 0 18px 40px rgba(0,0,0,0.5);
  transition:border-color .4s;
}
.lock.open{ border-color:var(--seal-green); }

.shackle{ position:absolute; top:-26px; left:50%; transform:translateX(-50%); width:64px; height:44px; }
.shackle svg{ width:100%; height:100%; display:block; }
.shackle .arc{
  fill:none; stroke:var(--steel); stroke-width:10; stroke-linecap:round;
  transition:transform .5s cubic-bezier(.34,1.56,.64,1);
  transform-origin:8px 40px;
}
.lock.open .shackle .arc{ transform:translateX(-6px) rotate(-38deg); }

.indicator{
  position:absolute; top:14px; left:50%; transform:translateX(-50%);
  width:16px; height:16px; border-radius:3px; background:var(--seal-red);
  box-shadow: var(--seal-glow-locked);
  rotate:45deg;
  transition: background var(--seal-transition-speed), box-shadow var(--seal-transition-speed);
}
}
.lock.open .indicator{ background:var(--seal-green); box-shadow: var(--seal-glow-unlocked); }

.reels{ display:flex; justify-content:center; gap:6px; flex-wrap:wrap; margin-top:26px; direction:ltr; }
.reel{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  touch-action:none; 
  outline:none; border-radius:8px;
}
.reel:focus-visible{ box-shadow:0 0 0 2px var(--brass-bright); }
.reel.locked{ opacity:0.7; pointer-events:none; }

.reel-btn{
  width:30px; height:22px; border:none; border-radius:4px;
  background:var(--steel-dark); color:var(--ink);
  font-size:11px; cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.15);
  touch-action:none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.reel-btn:active{ background:#4a463d; }

.reel-window{
  width:30px; height:40px; border-radius:15px;
  background:#0e0d0c; border:1px solid #060605;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-dial); font-size:19px; font-weight:700;
  color:var(--brass-bright);
  box-shadow:inset 0 2px 4px rgba(0,0,0,0.8);
  cursor:grab; user-select:none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.reel-window:active{ cursor:grabbing; }

.lock-footer{ margin-top:22px; text-align:center; font-size:12px; color:var(--ink-dim); min-height:16px; }
.hint-controls{ text-align:center; font-size:11px; color:var(--ink-dim); opacity:0.7; margin:4px 0 0; }

#puzzleView{ display:flex; flex-direction:column; align-items:center; }

.ghost-btn{
  background:none; border:1px solid rgba(255,255,255,0.15); color:var(--ink-dim);
  font-size:12px; padding:8px 16px; border-radius:20px; cursor:pointer;
  margin-top:18px; transition:border-color .2s, color .2s;
}
.ghost-btn:hover{ border-color:var(--brass); color:var(--brass-bright); }

.victory{ text-align:center; display:flex; flex-direction:column; align-items:center; }
.victory .mascot{ width:150px; height:auto; margin-bottom:8px; }
.victory h2{ font-family:var(--font-display); font-size:24px; font-weight:700; margin:0 0 10px; color:var(--brass-bright); }
.victory p{ color:var(--ink-dim); font-size:14px; line-height:1.7; max-width:440px; margin:0 0 26px; }

.verify-status{ font-size:13px; color:var(--ink-dim); max-width:380px; margin:0 0 22px; line-height:1.6; }
.verify-status.error{ color:var(--seal-red); }

.upload-box{
  border:1.5px dashed #4a463d; border-radius:10px; padding:28px 20px;
  cursor:pointer; margin-bottom:22px; display:block;
}
.upload-box:hover{ border-color:var(--steel); }
.upload-box span{ font-size:14px; color:var(--ink-dim); }
input[type="file"]{ display:none; }

.shield-wrap{ margin-top:6px; margin-bottom:22px; }
#shieldPreview{ max-width:100%; border-radius:12px; box-shadow:0 14px 30px rgba(0,0,0,0.5); }

.cta{
  font-family:var(--font-display); font-weight:600; font-size:17px; letter-spacing:0.02em;
  background:var(--brass); color:#1a1611; border:none; border-radius:8px; padding:14px 36px;
  cursor:pointer; transition:transform .15s, box-shadow .15s;
}
.cta:hover{ background:var(--brass-bright); transform:translateY(-2px); }
.cta[disabled]{ opacity:0.4; cursor:default; transform:none; }

.hidden{ display:none !important; }

@media (max-width:420px){
  .reel-window{ width:26px; }
  .reel-btn{ width:26px; }
}

@media (prefers-reduced-motion:reduce){
  .shackle .arc, .lock, .indicator{ transition:none; }
}
