/* =========================================================
   NostalgiaNet — Components (buttons/cards/windows/forms)
   ========================================================= */

.card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-1);
  overflow:hidden;
}

.card__hd{
  padding: var(--s-3) var(--s-4);
  display:flex; align-items:center; justify-content: space-between; gap: var(--s-3);
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--panel2) 80%, transparent);
}

.card__title{
  display:flex; align-items:center; gap: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .2px;
}
.card__title img{ width: 18px; height: 18px; }

.card__bd{ padding: var(--s-4); }
.card__ft{ padding: var(--s-3) var(--s-4); border-top: 1px solid var(--stroke); background: color-mix(in oklab, var(--panel2) 75%, transparent); }

.pill{
  display:inline-flex; align-items:center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: color-mix(in oklab, var(--panel2) 70%, transparent);
  font-size: 12px;
  color: var(--muted);
}

kbd{
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, #000 25%, transparent);
}

.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke2);
  background: color-mix(in oklab, var(--panel2) 75%, transparent);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out);
  user-select:none;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.06); }
.btn:active{ transform: translateY(0px) scale(.99); }
.btn--accent{
  border-color: color-mix(in oklab, var(--accent) 40%, var(--stroke2));
  background: linear-gradient(180deg,
     color-mix(in oklab, var(--accent) 20%, transparent),
     color-mix(in oklab, var(--panel2) 60%, transparent));
}
.btn--ghost{
  background: transparent;
  box-shadow: none;
}
.btn img{ width: 16px; height: 16px; }

.input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, #000 14%, transparent);
  outline: none;
}
.input:focus, select:focus, textarea:focus{
  border-color: color-mix(in oklab, var(--accent) 45%, var(--stroke2));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}

hr.sep{
  border:0;
  height: 1px;
  background: var(--stroke);
  margin: var(--s-4) 0;
}

.mini{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.h1{ font-size: 20px; font-weight: 900; }
.h2{ font-size: 14px; font-weight: 900; }

.badge{
  display:inline-flex; align-items:center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--panel2) 70%, transparent);
  font-size: 12px;
}
.badge--good{ border-color: color-mix(in oklab, var(--good) 35%, var(--stroke)); }
.badge--warn{ border-color: color-mix(in oklab, var(--warn) 35%, var(--stroke)); }
.badge--bad{ border-color: color-mix(in oklab, var(--bad) 35%, var(--stroke)); }

/* nav */
.nav{
  display:flex; flex-direction: column; gap: 8px;
}
.nav a{
  display:flex; align-items:center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--panel2) 60%, transparent);
  text-decoration:none;
}
.nav a:hover{ filter: brightness(1.06); }
.nav a[aria-current="page"]{
  border-color: color-mix(in oklab, var(--accent) 40%, var(--stroke2));
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 18%, transparent),
    color-mix(in oklab, var(--panel2) 70%, transparent));
}
.nav img{ width: 18px; height: 18px; }

/* toast */
.toast-wrap{
  position: fixed;
  inset: auto 14px 14px auto;
  z-index: 9999;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.toast{
  width: min(420px, calc(100vw - 28px));
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: color-mix(in oklab, #000 22%, var(--panel2));
  box-shadow: var(--shadow-2);
  padding: 12px 14px;
}
.toast__top{ display:flex; justify-content: space-between; gap: 10px; }
.toast__title{ font-weight: 900; font-size: 13px; }
.toast__msg{ font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* modal */
.modal{
  position: fixed;
  inset: 0;
  display:none;
  place-items:center;
  z-index: 9000;
  background: rgba(0,0,0,0.55);
}
.modal[aria-hidden="false"]{ display:grid; }
.modal__panel{
  width: min(760px, calc(100vw - 28px));
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  background: color-mix(in oklab, #000 18%, var(--panel2));
  box-shadow: var(--shadow-2);
  overflow:hidden;
}
.modal__hd{ padding: 12px 14px; border-bottom: 1px solid var(--stroke); display:flex; justify-content: space-between; align-items:center; gap: 10px; }
.modal__bd{ padding: 14px; }
.modal__title{ font-weight: 900; }

/* classic retro touches */
.marquee{
  white-space: nowrap;
  overflow:hidden;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel2) 65%, transparent);
  padding: 8px 10px;
}
.marquee__inner{
  display:inline-block;
  padding-left: 100%;
  animation: scroll 16s linear infinite;
}
@keyframes scroll{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-100%); }
}

.blink{
  animation: blink 1.1s step-start infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

/* “window” component (used in desktop mode + optional widgets) */
.win{
  position:absolute;
  min-width: 320px;
  min-height: 220px;
  width: 520px;
  height: 360px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: color-mix(in oklab, #000 16%, var(--panel2));
  box-shadow: var(--shadow-2);
  overflow:hidden;
  display:flex;
  flex-direction: column;
}
.win__bar{
  display:flex; align-items:center; justify-content: space-between;
  padding: 10px 10px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  user-select:none;
}
.win__title{
  display:flex; align-items:center; gap: 8px;
  font-weight: 900; font-size: 12px;
}
.win__title img{ width: 16px; height: 16px; }
.win__controls{ display:flex; gap: 6px; }
.win__btn{
  width: 28px; height: 22px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, #000 18%, transparent);
}
.win__btn:hover{ filter: brightness(1.08); }
.win__body{ flex:1; overflow:auto; }
.win__body iframe{ width:100%; height:100%; border:0; background: transparent; }

.win__resizer{
  position:absolute; right: 8px; bottom: 8px;
  width: 16px; height: 16px;
  border-right: 3px solid color-mix(in oklab, var(--accent) 45%, var(--stroke2));
  border-bottom: 3px solid color-mix(in oklab, var(--accent) 45%, var(--stroke2));
  opacity: 0.8;
  cursor: nwse-resize;
}

/* tables */
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  vertical-align: top;
}
.table th{
  text-align:left;
  background: color-mix(in oklab, var(--panel2) 70%, transparent);
  font-weight: 900;
}
.table tr:last-child td{ border-bottom: 0; }

/* code blocks */
pre.code{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, #000 22%, transparent);
  overflow:auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}
