/* === DEPRESSING CALCULATORS — SHARED STYLES === */
/* v7.1 — pixel brutalist with improved readability */

:root {
  --bg: #fafaf8;
  --card: #fff;
  --text: #111;
  --body: #333;
  --sub: #666;
  --hint: #999;
  --border: #ddd;
  --acc: #111;
  --green: #00b894;
  --red: #e17055;
  --orange: #fdcb6e;
  --fm: 'Space Mono', monospace;
  --fp: 'Press Start 2P', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fm);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Scanlines */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.012) 3px, rgba(0,0,0,0.012) 4px);
  pointer-events: none;
  z-index: 999;
}

/* === ANIMATIONS === */
@keyframes powerOn {
  0% { opacity: 0; transform: scaleY(0.005); }
  40% { opacity: 0.8; transform: scaleY(0.005); }
  55% { transform: scaleY(1); }
  100% { opacity: 1; transform: scaleY(1); }
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes pixelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px,1px); }
  40% { transform: translate(2px,-1px); }
  60% { transform: translate(-1px,2px); }
  80% { transform: translate(1px,-1px); }
  100% { transform: translate(0); }
}
@keyframes barGrow { from { width: 0; } to { width: var(--bar-w); } }
@keyframes hpGrow { from { width: 0; } to { width: var(--hp-w, 7%); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes skullFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes dotReveal { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

/* === LAYOUT === */
.c {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  animation: powerOn .7s ease-out both;
}

/* === NAVIGATION === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 40px;
  border-bottom: 2px solid #000;
}
.topbar-logo {
  font-family: var(--fp);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.5px;
}
.topbar-right { display: flex; gap: 16px; }
.topbar-right a {
  font-size: 11px;
  color: var(--sub);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.topbar-right a:hover { color: #000; }

.back {
  font-size: 12px;
  color: #000;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 28px;
  border-bottom: 2px dashed #000;
}
.back:hover { border-bottom-style: solid; }

.tag {
  font-size: 11px;
  color: var(--sub);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tag a {
  color: var(--sub);
  text-decoration: none;
  border-bottom: 1px dashed #aaa;
}
.tag a:hover { color: #000; }

/* === TYPOGRAPHY === */
h1 {
  font-family: var(--fp);
  font-size: clamp(12px, 3.5vw, 16px);
  line-height: 1.7;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
h1 .cursor {
  display: inline-block;
  width: 10px;
  height: 14px;
  background: #000;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.sub-text, .sub {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 32px;
  line-height: 1.6;
  border-left: 3px solid #000;
  padding-left: 12px;
}

/* === HERO (homepage) === */
.hero { text-align: center; margin-bottom: 48px; }
.skull {
  font-size: 36px;
  display: inline-block;
  animation: skullFloat 3s ease infinite;
  margin-bottom: 20px;
}

/* === PIXEL CARD === */
.card {
  background: var(--card);
  border: 2px solid #000;
  padding: 24px 22px;
  margin-bottom: 8px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px;
  width: 6px; height: 6px;
  background: #000;
}
.card::after {
  content: '';
  position: absolute;
  top: -2px; right: -2px;
  width: 6px; height: 6px;
  background: #000;
}

/* === FORMS === */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label {
  font-family: var(--fp);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--sub);
  margin-bottom: 4px;
  display: block;
  text-transform: uppercase;
}
.form input, .form select {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--fm);
  font-size: 16px;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
  border-radius: 0;
}
.form input:focus, .form select:focus { border-color: #000; }
.form input::placeholder { color: #bbb; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { font-size: 11px; color: var(--hint); margin-top: -4px; }

.btn {
  width: 100%;
  background: #000;
  color: #fff;
  font-family: var(--fm);
  font-size: 14px;
  font-weight: 700;
  padding: 14px;
  border: 2px solid #000;
  cursor: pointer;
  transition: all .12s;
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.btn:hover { background: #fff; color: #000; }
.btn:active { animation: glitch .2s ease; }

/* === RESULTS === */
#R { display: none; }
#R.on { display: block; animation: pop .4s ease; }

.r-card {
  border: 2px solid #000;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 8px;
  background: var(--card);
  position: relative;
}
.r-card::before { content: ''; position: absolute; top: -2px; left: -2px; width: 6px; height: 6px; background: #000; }
.r-card::after { content: ''; position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; background: #000; }
.r-label {
  font-family: var(--fp);
  font-size: 8px;
  color: var(--sub);
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.r-num {
  font-family: var(--fp);
  font-weight: 700;
  font-size: clamp(36px, 12vw, 56px);
  line-height: 1;
  margin-bottom: 6px;
}
.r-num .g { color: var(--green); }
.r-num .b { color: var(--red); }
.r-num .w { color: var(--orange); }
.r-unit { font-size: 12px; color: var(--sub); margin-bottom: 20px; }
.r-comment {
  font-size: 14px;
  color: var(--body);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto;
}

/* === STATS CARDS === */
.r-stats-card {
  border: 2px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: var(--card);
}
.r-stat { text-align: center; flex: 1; }
.r-stat-val { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.r-stat-label {
  font-family: var(--fp);
  font-size: 7px;
  color: var(--sub);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.r-stat + .r-stat { border-left: 2px solid var(--border); }

/* === PILL BADGE === */
.pill {
  display: inline-block;
  font-family: var(--fp);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border: 2px solid;
  margin-bottom: 20px;
  opacity: 0;
  transform: scale(0.7) translateY(6px);
  transition: all .4s cubic-bezier(.17,.89,.32,1.25);
}
.pill.on { opacity: 1; transform: scale(1) translateY(0); }
.pill.dead { border-color: var(--red); color: var(--red); background: rgba(225,112,85,0.08); }
.pill.warn { border-color: var(--orange); color: #e67e22; background: rgba(253,203,110,0.08); }
.pill.ok { border-color: var(--sub); color: #636e72; background: rgba(99,110,114,0.06); }
.pill.good { border-color: var(--green); color: #00695c; background: rgba(0,184,148,0.08); }

/* === COMPARISON BARS === */
.compare-card { border: 2px solid var(--border); padding: 20px 22px; margin-bottom: 8px; background: var(--card); }
.compare-title { font-family: var(--fp); font-size: 8px; letter-spacing: 1.5px; color: var(--sub); margin-bottom: 14px; text-align: center; text-transform: uppercase; }
.compare-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.compare-row:last-child { margin-bottom: 0; }
.compare-label { font-size: 12px; color: var(--sub); min-width: 75px; text-align: right; line-height: 1.3; }
.compare-label.you { color: #000; font-weight: 700; }
.compare-bar-wrap { flex: 1; height: 14px; background: #eee; border: 2px solid var(--border); overflow: hidden; }
.compare-bar { height: 100%; animation: barGrow .8s ease both; min-width: 3px; }
.compare-bar.you { background: #000; }
.compare-bar.avg { background: #bbb; }
.compare-bar.fast { background: var(--green); opacity: 0.6; }
.compare-bar.slow { background: var(--red); opacity: 0.4; }
.compare-val { font-size: 11px; font-weight: 700; min-width: 50px; color: var(--text); }
.compare-val.dim { color: var(--sub); font-weight: 400; }
.compare-note { font-size: 11px; color: var(--hint); text-align: center; margin-top: 10px; }
.compare-badge { display: inline-block; font-family: var(--fp); font-size: 7px; letter-spacing: 1px; padding: 5px 12px; border: 2px solid; margin-top: 8px; }
.compare-badge.top { border-color: var(--green); color: #00695c; }
.compare-badge.mid { border-color: var(--orange); color: #e65100; }
.compare-badge.low { border-color: var(--red); color: var(--red); }

/* === TIMELINE === */
.tl-card { border: 2px solid var(--border); padding: 20px 22px 14px; margin-bottom: 8px; background: var(--card); }
.tl-title { font-family: var(--fp); font-size: 8px; letter-spacing: 1.5px; color: var(--sub); margin-bottom: 14px; text-align: center; text-transform: uppercase; }
.tl { position: relative; padding-left: 32px; }
.tl::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-row { position: relative; padding-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.tl-row:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -32px; top: 3px; width: 10px; height: 10px; border: 2px solid var(--border); background: var(--card); z-index: 1; }
.tl-dot.you { background: #000; border-color: #000; }
.tl-dot.retire { border-color: var(--sub); }
.tl-dot.death { border-color: var(--red); background: var(--red); }
.tl-dot.money { border-color: var(--orange); background: var(--orange); }
.tl-dot.future { border-color: var(--border); border-style: dashed; background: none; }
.tl-dot.dots { border: none; background: none; }
.tl-yr { font-weight: 700; font-size: 13px; min-width: 42px; color: var(--text); }
.tl-yr.dim { color: var(--sub); }
.tl-yr.hl { color: var(--orange); }
.tl-yr.dead { color: var(--red); }
.tl-yr.acc { color: #000; }
.tl-txt { font-size: 12px; color: var(--sub); line-height: 1.4; }
.tl-txt b { font-weight: 700; color: var(--text); }
.tl-dots-row { padding-bottom: 10px; }
.tl-dots-txt { font-size: 16px; color: var(--sub); letter-spacing: 4px; }

/* === BREAKDOWN CARDS === */
.breakdown-card { border: 2px solid var(--border); padding: 20px 22px; margin-bottom: 8px; background: var(--card); }
.breakdown-title { font-family: var(--fp); font-size: 8px; letter-spacing: 1.5px; color: var(--sub); margin-bottom: 14px; text-transform: uppercase; }
.bd-row, .breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 13px; }
.bd-row:last-child, .breakdown-row:last-child { border-bottom: none; }
.bd-label, .b-label { color: var(--sub); }
.bd-val, .b-val { font-weight: 700; }
.bd-val.lost, .b-val.sad { color: var(--red); }
.bd-val.total { font-family: var(--fp); font-size: 11px; }

/* === SNAP CARD (shareable) === */
.snap-card {
  background: #0d0d12;
  border: 2px solid #222;
  padding: 32px 24px 24px;
  margin-bottom: 8px;
  color: #e8e6e1;
  text-align: center;
  overflow: hidden;
}
.snap-top { font-family: var(--fp); font-size: 7px; letter-spacing: 2px; color: #444; margin-bottom: 12px; }
.snap-q { font-size: 14px; font-weight: 700; color: #888; margin-bottom: 8px; }
.snap-num { font-family: var(--fp); font-weight: 700; font-size: clamp(32px, 9vw, 48px); line-height: 1; margin-bottom: 4px; color: #fff; }
.snap-unit { font-size: 12px; color: #666; margin-bottom: 12px; }
.snap-pill { display: inline-block; font-family: var(--fp); font-size: 7px; letter-spacing: 1px; padding: 5px 12px; border: 1px solid; margin-bottom: 14px; }
.snap-pill.dead { border-color: rgba(255,59,74,0.3); color: #ff6b6b; }
.snap-pill.warn { border-color: rgba(253,203,110,0.3); color: #fdcb6e; }
.snap-pill.ok { border-color: rgba(108,92,231,0.3); color: #a29bfe; }
.snap-pill.good { border-color: rgba(0,184,148,0.3); color: #55efc4; }
.snap-comment { font-size: 12px; color: #888; line-height: 1.6; max-width: 360px; margin: 0 auto 12px; }
.snap-link { display: block; font-family: var(--fp); font-size: 7px; color: #444; text-decoration: none; letter-spacing: 1.5px; margin-top: 8px; }

/* === SHARE BUTTONS === */
.share-row { display: flex; gap: 6px; margin-bottom: 16px; }
.sh-btn {
  flex: 1;
  padding: 14px 8px;
  border: 2px solid #000;
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #000;
  color: #fff;
}
.sh-btn:hover { background: #fff; color: #000; }
.sh-btn.download { background: var(--card); color: #000; border-color: var(--border); }
.sh-btn.download:hover { border-color: #000; }
.sh-btn:disabled { opacity: 0.5; cursor: wait; }

.retry { text-align: center; margin-top: 16px; }
.retry a {
  font-size: 13px;
  color: #000;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px dashed #000;
}
.retry a:hover { border-bottom-style: solid; }

/* === SOUND TOGGLE === */
.sound-toggle {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 36px; height: 36px;
  background: var(--card);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 99;
  transition: all .12s;
}
.sound-toggle:hover { border-color: #000; }

/* === HOMEPAGE CARDS === */
.calc-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 40px; }
.calc-card {
  border: 2px solid #000;
  padding: 20px 22px;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  display: block;
  position: relative;
  transition: all .12s;
  animation: pixelIn .4s ease both;
}
.calc-card:nth-child(1) { animation-delay: .15s; }
.calc-card:nth-child(2) { animation-delay: .28s; }
.calc-card:nth-child(3) { animation-delay: .41s; }
.calc-card:nth-child(4) { animation-delay: .54s; }
.calc-card::before { content: ''; position: absolute; top: -2px; left: -2px; width: 6px; height: 6px; background: #000; }
.calc-card::after { content: ''; position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; background: #000; }
.calc-card:hover { animation: glitch .3s ease; }
.calc-card:hover .calc-name { color: #6c5ce7; }
.calc-card.live .calc-status {
  display: inline-block;
  background: #000;
  color: #fff;
  font-family: var(--fp);
  font-size: 7px;
  padding: 3px 8px;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.calc-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.calc-desc { font-size: 12px; color: var(--sub); line-height: 1.6; }

/* === HP BAR === */
.hp-section { margin-bottom: 40px; }
.hp-label { font-family: var(--fp); font-size: 8px; letter-spacing: 1px; color: var(--sub); margin-bottom: 6px; }
.hp-track { height: 14px; background: #eee; border: 2px solid #000; position: relative; }
.hp-fill { height: 100%; background: #000; animation: hpGrow 1.5s ease both; animation-delay: .8s; width: 0; }
.hp-text { font-size: 11px; color: var(--sub); margin-top: 5px; }

/* === PIXEL DIVIDER === */
.pixel-div { display: flex; justify-content: center; gap: 4px; margin: 32px 0; }
.pixel-div i { display: block; width: 4px; height: 4px; background: #ddd; font-style: normal; }
.pixel-div i:nth-child(odd) { background: #bbb; }

/* === CONTENT (about, privacy) === */
.content { font-size: 13px; color: var(--body); line-height: 1.9; }
.content p { margin-bottom: 14px; }
.content h2 {
  font-family: var(--fp);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text);
  margin: 28px 0 10px;
  text-transform: uppercase;
}
.about { margin-bottom: 40px; }
.about h2 { font-family: var(--fp); font-size: 10px; letter-spacing: 1px; margin-bottom: 14px; }
.about p { font-size: 13px; color: var(--body); line-height: 1.9; margin-bottom: 12px; }

/* === CONTACT === */
.contact-item { margin-bottom: 20px; }
.contact-item:last-child { margin-bottom: 0; }
.contact-label { font-family: var(--fp); font-size: 7px; letter-spacing: 1px; color: var(--sub); margin-bottom: 6px; text-transform: uppercase; }
.contact-val { font-size: 14px; font-weight: 700; }
.contact-val a { color: #000; text-decoration: none; border-bottom: 1px dashed #000; }
.contact-val a:hover { border-bottom-style: solid; }
.contact-note { font-size: 11px; color: var(--sub); margin-top: 4px; }

/* === SEO SECTION === */
.seo {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 2px solid var(--border);
  color: var(--sub);
  font-size: 13px;
  line-height: 1.9;
}
.seo h2 { font-family: var(--fp); font-size: 10px; letter-spacing: 1px; color: var(--sub); margin-bottom: 12px; }
.seo h3 { font-family: var(--fp); font-size: 8px; letter-spacing: 1px; color: var(--hint); margin: 20px 0 6px; text-transform: uppercase; }
.seo p { margin-bottom: 12px; }

/* === FOOTER === */
.foot {
  margin-top: 28px;
  text-align: center;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.foot-coffee {
  display: inline-block;
  border: 2px solid #000;
  padding: 10px 20px;
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 700;
  color: #000;
  text-decoration: none;
  margin-bottom: 14px;
  transition: all .12s;
  position: relative;
}
.foot-coffee::before { content: ''; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; background: #000; }
.foot-coffee::after { content: ''; position: absolute; top: -2px; right: -2px; width: 5px; height: 5px; background: #000; }
.foot-coffee:hover { background: #000; color: #fff; }
.foot-links { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; font-size: 11px; }
.foot-links a { color: var(--sub); text-decoration: none; }
.foot-links a:hover { color: #000; }
.foot-links span { color: #ddd; }
.foot p { font-size: 10px; color: var(--hint); }

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .c { padding: 32px 16px 60px; }
  .row { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr; }
  h1 { font-size: 11px; }
  .topbar-logo { font-size: 8px; }
  .compare-label { min-width: 55px; font-size: 10px; }
  .sound-toggle { bottom: 12px; right: 12px; width: 32px; height: 32px; font-size: 12px; }
}
