  :root{
    --glass: rgba(18, 22, 30, 0.65);
    --border: rgba(255,255,255,0.08);
    --text:#e7edf4; --muted:#9aa6b2;
    --accent:#5eead4; --accent2:#a78bfa;
  }
  html,body{ margin:0; height:100%; background:#000; overflow:hidden; color:var(--text);
    font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial; }
  #starfield{ position:fixed; inset:0; z-index:0; display:block;
    background: radial-gradient(ellipse at center,#0b1022 0%,#03050c 70%,#000 100%); }

  .container{
    position:relative; z-index:1; width:min(960px,92vw); margin:4vh auto;
    padding:18px 20px; background:var(--glass); backdrop-filter: blur(10px) saturate(130%);
    border:1px solid var(--border); border-radius:18px; box-shadow:0 10px 50px rgba(0,0,0,.6);
    transition: transform 0.6s cubic-bezier(.2,.8,.2,1), opacity 0.6s ease;  /* for hide / show */
    will-change: transform;
  }
  header{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
    padding-bottom:8px; border-bottom:1px dashed var(--border); }
  .brand{ display:flex; gap:10px; align-items:center; font-weight:700; }
  .brand .emoji{ font-size:1.4rem; }
  .meta{ font-size:.9rem; color:var(--muted); }
  .grid{ display:grid; grid-template-columns: 1.1fr 1.4fr; gap:18px; margin-top:14px; }
  @media (max-width:860px){ .grid{ grid-template-columns:1fr; } }

  .panel{ border:1px solid var(--border); border-radius:14px; padding:12px; background:rgba(255,255,255,0.02); }
  .panel h3{ margin:4px 0 8px; font-size:1rem; color:#d6e2ff; }
  .row{ display:grid; grid-template-columns: 170px 1fr 70px; gap:10px; align-items:center; }
  .row + .row{ margin-top:10px; }
  label{ font-size:.92rem; }
  output{ text-align:right; color:var(--muted); font-variant-numeric: tabular-nums; }

  select, input[type="range"], button{ font: inherit; color: inherit; }
  select{
    width:100%; padding:10px; background:rgba(255,255,255,0.04);
    border:1px solid var(--border); border-radius:10px;
  }
  input[type="range"]{
    -webkit-appearance:none; appearance:none; height:8px; border-radius:999px; width:100%;
    background:linear-gradient(90deg,var(--accent),var(--accent2));
  }
  input[type="range"]::-webkit-slider-thumb{
    -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
    background:#0b132b; border:2px solid #cbd5e1; box-shadow:0 0 0 2px rgba(0,0,0,.3); cursor:pointer;
  }
  .buttons{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
  .btn{
    border:1px solid var(--border); background:rgba(255,255,255,0.05);
    color:var(--text); padding:10px 14px; border-radius:12px; cursor:pointer; font-weight:600;
  }
  .btn.primary{ background:linear-gradient(180deg,rgba(94,234,212,0.15),rgba(167,139,250,0.18)); border-color:rgba(94,234,212,0.5); }
  #btnCoffee:hover { box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.25) inset; }
  .legend{ display:flex; gap:10px; flex-wrap:wrap; }
  .pill{ border:1px solid var(--border); border-radius:999px; padding:4px 10px; color:var(--muted); }
  .footer{ display:flex; justify-content:space-between; gap:10px; margin-top:10px; padding-top:10px; border-top:1px dashed var(--border); color:var(--muted); font-size:.85rem; }
  .vuWrap{ height:8px; background:rgba(255,255,255,0.06); border:1px solid var(--border); border-radius:8px; overflow:hidden; }
  .vuBar{ height:100%; width:0%; background:linear-gradient(90deg,#4ade80,#facc15,#ef4444); }


    .row--preset { grid-template-columns: 140px 1fr; }
    #preset {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
    }

    .row--preset > output { display: none; }

  .selectedName{
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
  }

  .container.is-hidden{
    transform: translateY(-110vh);
    opacity: 0.85;
  }

  .showTab{
    position: fixed;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    z-index: 2;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.08);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(6px) saturate(130%);
  }
  .showTab:hover { background: rgba(255,255,255,0.12); }

  /* Modal styles */
  .modal{ position:fixed; inset:0; z-index:3; display:none; }
  .modal[aria-hidden="false"]{ display:block; }
  .modal__overlay{
    position:absolute; inset:0; backdrop-filter: blur(4px);
    background: radial-gradient(120% 120% at 50% -20%, rgba(167,139,250,0.20), transparent 60%),
                radial-gradient(120% 120% at 50% 120%, rgba(94,234,212,0.18), transparent 60%),
                rgba(0,0,0,0.55);
    animation: overlayIn .28s ease-out both;
  }
  .modal__card{
    position:relative; max-width:min(820px,92vw); margin:8vh auto; padding:18px 18px 4px;
    background: var(--glass); border:1px solid var(--border); border-radius:18px;
    box-shadow:0 20px 80px rgba(0,0,0,.6);
    color:var(--text);
    animation: cardIn .28s cubic-bezier(.2,.8,.2,1) both;
    outline:none;
  }
  .modal__header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
  .modal__header h1{ margin:0; font-size:1.3rem; }
  .modal__content{ max-height:65vh; overflow:auto; padding:6px 4px 16px; }
  .modal__content h2{ margin:16px 0 6px; font-size:1.05rem; color:#d6e2ff; }
  .modal__content p{ line-height:1.6; color:#dfe6ee; }
  .modal__content ul{ margin:6px 0 8px 18px; }
  .modal__content li{ margin:4px 0; }
  .modal__close{ line-height:1; padding:6px 10px; }
  @keyframes overlayIn{ from{ opacity:0 } to{ opacity:1 } }
  @keyframes cardIn{ from{ transform: translateY(12px); opacity:0 }
                     to{ transform: translateY(0); opacity:1 } }
  @media (prefers-reduced-motion: reduce){
    .modal__overlay, .modal__card{ animation:none }
  }

.btn-row {
  margin-bottom: 1rem;
}

.btn-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3em;
  color: #bfc4cb;
  font-size: 1em;
  letter-spacing: 0.01em;
}

.btn-group {
  display: flex;
  gap: 0.75em;
}

.console-stats.panel {
  margin-top: 10px;
  padding: 18px 18px 8px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.015);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
}
.stat-col {
  flex: 1 1 0%;
  min-width: 0;
  font-size: 1.05em;
  color: var(--text);
}
.stat-col strong {
  font-weight: 600;
  color: #fff;
}
#statFun {
  margin-top: 12px;
  font-size: .98em;
  color: #bfc4cb;
}
@media (max-width:600px) {
  .stat-row { flex-direction: column; gap: 2px; }
  .stat-col { margin-bottom: 2px; }
}

.stats-panels {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.funfact-panel {
  font-size: 1em;
  color: #7ef3d6;
  background: linear-gradient(90deg,rgba(127,255,212,0.07),rgba(186,203,255,0.07) 70%);
  border-left: 4px solid #5eead4;
  border-radius: 14px;
  padding: 13px 18px 13px 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.chatter-panel {
  background: linear-gradient(90deg,rgba(167,139,250,0.06),rgba(94,234,212,0.05) 70%);
  border-left: 4px solid #a78bfa;
  border-radius: 14px;
  padding: 13px 18px 13px 18px;
  font-size: 1em;
  color: #d5cfff;
  font-weight: 500;
  min-height: 1.7em;
  letter-spacing: 0.01em;
  transition: background 0.4s;
}
.easter-egg-pop {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8888;
  background: rgba(18,24,40,0.95);
  color: #fff;
  border-radius: 2em;
  padding: 1em 2em;
  font-size: 1.2em;
  font-weight: 700;
  box-shadow: 0 6px 22px 0 #04010c70;
  pointer-events: none;
  animation: popfade 4.3s cubic-bezier(.2,1,.6,1);
}
@keyframes popfade {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.95);}
  12%  { opacity: 1; transform: translateX(-50%) scale(1.08);}
  18%  { opacity: 1; transform: translateX(-50%) scale(1);}
  84%  { opacity: 1;}
  100% { opacity: 0; }
}

#badgeBar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5em 0 0.2em 0;
  padding: 0;
  align-items: flex-start;
}
.badge {
  background: linear-gradient(90deg, #21224b 60%, #303058 100%);
  color: #ffe8a5;
  border: none;
  border-radius: 22px;
  font-size: 1.08em;
  font-family: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  padding: 0.26em 1.1em 0.28em 1.1em;
  margin: 0;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(44,48,90,0.10);
  outline: none;
  transition: transform 0.08s, box-shadow 0.16s;
  position: relative;
  user-select: none;
}
.badge:focus,
.badge:hover {
  background: linear-gradient(90deg, #363699 60%, #6656ce 100%);
  color: #fff7df;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 3px 14px rgba(90,108,210,0.19);
  z-index: 2;
}
.badge-popover {
  position: absolute;
  background: #2a2747;
  color: #ffe8a5;
  border-radius: 11px;
  font-size: 1.04em;
  font-family: inherit;
  font-weight: 500;
  padding: 0.7em 1.1em;
  box-shadow: 0 3px 18px rgba(30,28,65,0.14);
  pointer-events: none;
  top: 120%;
  left: 50%;
  transform: translate(-50%, 0);
  white-space: pre-line;
  min-width: 160px;
  max-width: 260px;
  opacity: 0.98;
  z-index: 9999;
  animation: pop-badge 0.19s;
}
@keyframes pop-badge {
  from { opacity: 0; transform: translate(-50%, 20px);}
  to   { opacity: 0.98; transform: translate(-50%, 0);}
}

.slim-panel {
  width: 100%;
  margin: 0 auto 0 auto;
  padding: 12px 0 10px 0;
  background: #181818;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1.2px solid #2c2c2c;
  font-family: inherit;
  margin-bottom: 10px;
}

.centered-btn {
  display: flex;
  justify-content: center;
  margin-top: 7px;
}

.amazon-btn {
  background: #ffd814;
  color: #232f3e !important;
  font-weight: 600;
  border-radius: 18px;
  border: 1.5px solid #ffb300;
  box-shadow: 0 1px 6px rgba(255,215,20,0.13);
  padding: 3px 18px 3px 18px;
  font-size: 0.95em;
  line-height: 1.6;
  display: inline-block;
  transition: background 0.12s, border 0.12s;
}
.amazon-btn:hover,
.amazon-btn:focus {
  background: #ffc200;
  border-color: #e6a700;
  color: #111 !important;
  text-decoration: none;
  box-shadow: 0 2px 16px rgba(255,215,20,0.18);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

.center-screen {
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center */
}

.center-viewport {
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center */
  position: fixed;         /* always fixed! */
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 2;
  pointer-events: none; /* allow starfield canvas interaction */
}

#viewTransitionOverlay {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
#viewTransitionOverlay[style*="display: flex"] {
  pointer-events: all;
}

.container.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.showTab {
  background: #222;
  color: #fff;
  padding: 8px 18px;
  border-radius: 0 8px 8px 0;
  font-weight: 700;
  box-shadow: 0 4px 18px #0004;
  transition: opacity 0.3s;
  opacity: 0.8;
  position: fixed;
  top: 28px;  /* Or wherever you want */
  left: 0;
  z-index: 9999;
  cursor: pointer;
}
.showTab:hover { opacity: 1; }