/* =========================
   lost & found — spooky ui
   ========================= */

:root{
  --bg0:#05060a;
  --bg1:#0a0c12;
  --ink:#e9eef8;
  --muted:#b7c0d6;
  --dim:#7d88a6;

  --accent:#7ef0c5;     /* eerie mint */
  --accent2:#bb7ef0;    /* ghost violet */
  --danger:#ff6a6a;

  --card: rgba(12, 14, 22, 0.72);
  --card2: rgba(18, 20, 34, 0.78);
  --stroke: rgba(255,255,255,0.10);
  --stroke2: rgba(126,240,197,0.22);

  --shadow: 0 18px 50px rgba(0,0,0,0.55);
  --radius: 18px;

  --font: ui-sans-serif, system-ui, -apple-system, "segoe ui", roboto, arial, sans-serif;
  --mono: ui-monospace, "sfmono-regular", menlo, consolas, "liberation mono", monospace;

  --base: 16px;
}

html, body { height: 100%; }
html { font-size: var(--base); }
body{
  margin:0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(187,126,240,0.18), transparent 55%),
    radial-gradient(900px 600px at 80% 30%, rgba(126,240,197,0.12), transparent 60%),
    radial-gradient(700px 500px at 50% 90%, rgba(255,106,106,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* film grain / noise overlay */
body::before{
  content:"";
  position: fixed;
  inset: -40px;
  pointer-events:none;
  opacity: 0.10;
  mix-blend-mode: overlay;
  background:
    repeating-radial-gradient(circle at 20% 30%,
      rgba(255,255,255,0.10) 0 1px,
      rgba(0,0,0,0.12) 1px 2px);
  filter: blur(0.4px);
  transform: translateZ(0);
}

/* faint scanlines */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  opacity: 0.10;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.05),
      rgba(255,255,255,0.05) 1px,
      transparent 2px,
      transparent 6px
    );
  mix-blend-mode: soft-light;
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

.shell{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 16px;
}

.wrap{
  width: min(980px, 100%);
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

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

.panel{
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.panel .inner{
  padding: 22px;
}

.panel .topline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.brand{
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.title{
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.subtitle{
  margin:0;
  color: var(--muted);
  font-size: 0.98rem;
}

.badge{
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.20);
  white-space: nowrap;
}

.glow{
  text-shadow:
    0 0 18px rgba(126,240,197,0.25),
    0 0 28px rgba(187,126,240,0.18);
}

hr.sep{
  border:0;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(126,240,197,0.26), transparent);
  margin: 16px 0;
}

.story{
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
}

.muted{ color: var(--muted); }
.dim{ color: var(--dim); }

.list{
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.kbd{
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.28);
  color: var(--ink);
}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor:pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  user-select:none;
  touch-action: manipulation;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(126,240,197,0.40);
  background: rgba(126,240,197,0.08);
}

.btn:active{
  transform: translateY(0px);
}

.btn.primary{
  border-color: rgba(126,240,197,0.42);
  background: linear-gradient(180deg, rgba(126,240,197,0.18), rgba(0,0,0,0.20));
}

.btn.ghost{
  border-color: rgba(187,126,240,0.35);
}

.btn.danger{
  border-color: rgba(255,106,106,0.45);
}

.btn .icon{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(126,240,197,0.40);
}

.btn.ghost .icon{
  background: var(--accent2);
  box-shadow: 0 0 18px rgba(187,126,240,0.35);
}

.smallprint{
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 0.92rem;
  line-height: 1.4;
}

/* settings */
.settings h2{
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.setting{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.setting:first-of-type{ border-top: 0; padding-top: 6px; }

.setting .label{
  display:flex;
  flex-direction:column;
  gap: 4px;
}

.setting .label strong{
  font-size: 0.98rem;
}

.setting .label span{
  font-size: 0.90rem;
  color: var(--dim);
  line-height: 1.35;
}

.switch{
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.32);
  cursor:pointer;
  flex: 0 0 auto;
}

.switch input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.switch .knob{
  position:absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.80);
  box-shadow: 0 10px 18px rgba(0,0,0,0.4);
  transition: left 140ms ease, background 140ms ease;
}

.switch input:checked + .knob{
  left: 26px;
  background: rgba(126,240,197,0.92);
}

/* footer-ish card */
.cardnote{
  font-family: var(--mono);
  font-size: 0.90rem;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 12px;
  line-height: 1.45;
}

.cardnote b{ color: var(--ink); }

/* accessibility knobs */
html.big-text{ font-size: 18px; }
html.reduce-motion *{
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* a tiny “haunted” flicker, but polite about reduced motion */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  48% { opacity: 0.96; }
  50% { opacity: 0.84; }
  52% { opacity: 0.98; }
  60% { opacity: 0.92; }
}
.flicker{
  animation: flicker 6.5s infinite;
}
@media (prefers-reduced-motion: reduce){
  .flicker{ animation: none; }
}

/* focus states */
.btn:focus-visible,
.switch:focus-within{
  outline: 2px solid rgba(126,240,197,0.55);
  
  /* =========================
   play.html extras
   ========================= */

.hud{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.hud .left{
  display:flex;
  flex-direction:column;
  gap: 4px;
}

.hud .right{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.tag{
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
  padding: 6px 10px;
}

.grid{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

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

.itemname{
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

.itemdesc{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.kv{
  display:grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.kv div{
  padding: 6px 0;
}
.kv .k{
  color: var(--dim);
}
.kv .v{
  color: var(--ink);
}

.meter{
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.meterrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  overflow:hidden;
}

.bar > span{
  display:block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(126,240,197,0.95), rgba(187,126,240,0.70));
}

.log{
  font-family: var(--mono);
  font-size: 0.90rem;
  line-height: 1.45;
  color: var(--muted);
  max-height: 260px;
  overflow:auto;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
  margin-top: 12px;
}

.logline{
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.10);
}
.logline:last-child{ border-bottom: 0; }

.notice{
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
  line-height: 1.45;
}

.modal{
  position: fixed;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.modal.open{ display:flex; }

.modal .panel{
  width: min(820px, 100%);
}

.modal .actions{
  margin-top: 14px;
}
/* item art */
.itemmedia{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25) inset;
}

.itemimg{
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position: relative;
}

.itemimg img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.itemimg .placeholder{
  font-family: var(--mono);
  color: rgba(233,238,248,0.55);
  text-align:center;
  line-height: 1.35;
  padding: 14px;
}

.itemimg::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: radial-gradient(60% 60% at 50% 40%, rgba(126,240,197,0.10), transparent 55%);
  mix-blend-mode: screen;
}

/* bigger art in inspect modal */
.inspectmedia{
  display:flex;
  justify-content:center;
  margin: 6px 0 14px;
}
.insp


  outline-offset: 2px;
}
