@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --bg: #fdf6e3;
  --fg: #1a0a2e;
  --card: #fff8f0;
  --accent: #e8005a;
  --accent2: #0057e7;
  --accent3: #ff8c00;
  --dim: #9b7fa6;
  --border: #c9a0dc;
  --shadow: #b07fc0;
  --glow: rgba(232,0,90,0.06);
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Halftone scanlines — subtle on light bg */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(100,0,80,0.04) 3px,
    rgba(100,0,80,0.04) 4px
  );
  z-index: 9999;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  margin-bottom: 2rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  cursor: pointer;
}

.logo-link:hover h1 { text-shadow: 4px 4px 0 var(--accent2); }

#pet {
  image-rendering: pixelated;
  flex-shrink: 0;
}

.title-block h1 {
  font-size: 2rem;
  letter-spacing: 4px;
  line-height: 1;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--accent2);
}

.title-block h1 span { color: var(--accent2); }

.subtitle {
  font-size: 8px;
  color: var(--dim);
  margin-top: 0.5rem;
  letter-spacing: 2px;
}

/* Card */
.card {
  border: 2px solid var(--border);
  background: var(--card);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  image-rendering: pixelated;
  box-shadow: 4px 4px 0 var(--shadow);
}

.card-label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--card);
  padding: 0 6px;
  font-size: 8px;
  color: var(--dim);
  letter-spacing: 1px;
}

/* Drop zone */
#drop-zone {
  border: 2px dashed var(--border);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  margin-bottom: 1rem;
}

#drop-zone:hover, #drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--glow);
}

.drop-inner { pointer-events: none; }
.drop-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.drop-inner p { font-size: 9px; color: var(--dim); line-height: 2; }
.drop-inner small { font-size: 7px; }

.or-divider {
  text-align: center;
  color: var(--dim);
  font-size: 8px;
  margin: 1rem 0;
  letter-spacing: 2px;
}

textarea#text-input {
  width: 100%;
  min-height: 120px;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--fg);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 0.75rem;
  resize: vertical;
  line-height: 1.8;
  outline: none;
  margin-bottom: 1rem;
}

textarea#text-input:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.8rem 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 2px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.05s;
  box-shadow: 4px 4px 0 #a0003e;
}

.btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #a0003e; }
.btn.small { width: auto; display: inline-block; font-size: 8px; padding: 0.5rem 0.75rem; }
.btn.outline {
  background: transparent;
  color: var(--accent2);
  border: 2px solid var(--accent2);
  box-shadow: 4px 4px 0 #003da0;
}
.btn.outline:active { box-shadow: 2px 2px 0 #003da0; }

/* Result */
.result-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

#qr-img {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.link-block { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }

#link-out {
  color: var(--accent2);
  font-size: 8px;
  word-break: break-all;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.timer-bar {
  width: 100%;
  height: 8px;
  background: #e8d8f0;
  border: 1px solid var(--border);
}

#timer-fill {
  height: 100%;
  background: var(--accent3);
  width: 100%;
  transition: width 1s linear;
}

.timer-label { font-size: 7px; color: var(--dim); }
.one-time-note { font-size: 7px; color: var(--accent); }

/* Loading */
.loading { text-align: center; padding: 2rem; color: var(--dim); font-size: 9px; }

/* Download content */
#dl-content pre {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.dl-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hidden { display: none !important; }

/* pixel corners */
.card::before, .card::after {
  content: '';
  position: absolute;
  width: 4px; height: 4px;
  background: var(--bg);
}
.card::before { top: -2px; right: -2px; }
.card::after { bottom: -2px; left: -2px; }
