/* --- Nothing OS / Glyph Catch Pure OLED Design --- */

@font-face {
  font-family: 'NDot47';
  src: url('/assets/fonts/ndot_47_inspired_by_nothing.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-oled: #000000;
  --text-main: #FFFFFF;
  --text-dim: #777777;
  --text-sub: #A0A0A0;
  --accent-red: #D71921;
  --border-hairline: rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.4);
  --glyph-glow: rgba(255, 255, 255, 0.85);
  --surface-card: #0c0c0c;
  --surface-hover: #161616;
  --font-ndot: 'NDot47', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-oled);
  color: var(--text-main);
  font-family: var(--font-ndot);
  overflow: hidden;
  position: fixed;
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  padding-top: env(safe-area-inset-top, 12px);
  padding-bottom: env(safe-area-inset-bottom, 12px);
  background-color: var(--bg-oled);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-hairline);
  background: rgba(0, 0, 0, 0.9);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
}

.brand-title {
  font-size: 16px;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
}

.header-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-sub);
}

.stat-pill {
  border: 1px solid var(--border-hairline);
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.stat-pill span {
  color: var(--text-main);
  font-weight: bold;
}

/* Main Views Viewport */
main {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 18px 16px 80px;
}

.view.active {
  display: flex;
}

/* --- Glyph Catch View --- */
.status-ticker {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 18px;
  text-align: center;
}

.status-ticker.pulse {
  color: var(--accent-red);
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Glyph Matrix Interactive Display Area */
.glyph-chamber {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 20px;
}

/* Timer Bezel Ring */
.timer-ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: #181818;
  stroke-width: 4;
}

.timer-ring-progress {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 880;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear, stroke 0.3s;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.timer-ring-progress.urgent {
  stroke: var(--accent-red);
  filter: drop-shadow(0 0 8px var(--accent-red));
}

/* Center Canvas */
.canvas-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #000000;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  touch-action: none;
}

#glyph-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Countdown Label */
.countdown-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}

.countdown-digits {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-main);
}

.countdown-unit {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Action Prompt */
.glyph-instructions {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-sub);
  text-align: center;
  margin-top: 14px;
  text-transform: uppercase;
}

.hold-bar-container {
  width: 200px;
  height: 4px;
  background: #181818;
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.hold-bar {
  width: 0%;
  height: 100%;
  background: #FFFFFF;
  box-shadow: 0 0 8px #FFFFFF;
  transition: width 0.05s ease-out;
}

/* Idle / Empty Encounter State */
.idle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 30px 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  width: 100%;
  margin-top: 10px;
}

.idle-title {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.idle-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* --- Pokédex View --- */
.pokedex-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  background: #0d0d0d;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  color: #FFF;
  font-family: var(--font-ndot);
  font-size: 13px;
  letter-spacing: 0.1em;
  outline: none;
}

.search-input:focus {
  border-color: var(--border-active);
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  color: var(--text-dim);
  font-family: var(--font-ndot);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.active {
  background: #FFFFFF;
  color: #000000;
  border-color: #FFFFFF;
  font-weight: bold;
}

.view-mode-toggle {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.toggle-btn {
  background: none;
  border: 1px solid var(--border-hairline);
  color: var(--text-dim);
  font-family: var(--font-ndot);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
}

.toggle-btn.active {
  color: #FFF;
  border-color: #FFF;
}

/* Pokedex Grid */
.pokedex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.poke-card {
  aspect-ratio: 1;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.poke-card:active {
  background: var(--surface-hover);
  border-color: var(--border-active);
}

.poke-card.uncaught {
  opacity: 0.35;
}

.poke-card.caught {
  border-color: rgba(255, 255, 255, 0.25);
}

.poke-card.shiny {
  border-color: #FFD700;
  box-shadow: inset 0 0 8px rgba(255, 215, 0, 0.2);
}

.poke-id {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 9px;
  color: var(--text-dim);
}

.poke-sprite {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  margin: 4px 0 2px;
}

.poke-sprite.matrix-mode {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.poke-name {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-main);
  text-transform: uppercase;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-shiny-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #FFD700;
  font-size: 8px;
}

/* --- Settings & iOS Banner --- */
.settings-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: bold;
}

.card-body {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
}

.ios-step {
  display: flex;
  gap: 10px;
  margin: 8px 0;
  align-items: flex-start;
}

.step-num {
  font-family: var(--font-ndot);
  font-size: 11px;
  background: #222;
  color: #FFF;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-badge {
  font-family: var(--font-ndot);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-sub);
  border: 1px solid var(--border-hairline);
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 12px;
  background: #FFFFFF;
  color: #000000;
  border: none;
  border-radius: 6px;
  font-family: var(--font-ndot);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.8;
}

.btn-secondary {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid var(--border-hairline);
}

.btn-danger {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #0c0c0c;
  border: 1px solid var(--border-active);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.modal-sprite {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
}

.modal-title {
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal-types {
  display: flex;
  gap: 8px;
}

.type-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-hairline);
  text-transform: uppercase;
}

/* Bottom Navigation Bar */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--border-hairline);
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.nav-inner {
  display: flex;
  width: 100%;
  max-width: 500px;
  justify-content: space-around;
  padding: 8px 0;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-ndot);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 14px;
}

.nav-tab.active {
  color: #FFFFFF;
}

.nav-tab.active .nav-icon {
  stroke: #FFFFFF;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

/* --- PWA Installation Gate Screen --- */
#pwa-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-oled);
  color: var(--text-main);
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top, 20px) 18px env(safe-area-inset-bottom, 20px);
}

.gate-container {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 30px;
}

.gate-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 24px;
}

.gate-badge {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.gate-glyph-symbol {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.06);
}

.gate-title {
  font-size: 18px;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.gate-subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

.gate-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.gate-step-card {
  display: flex;
  gap: 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 14px;
  align-items: flex-start;
}

.gate-step-num {
  font-family: var(--font-ndot);
  font-size: 14px;
  font-weight: bold;
  color: var(--accent-red);
  padding-top: 2px;
}

.gate-step-content {
  flex: 1;
}

.gate-step-heading {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--text-main);
}

.gate-step-text {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}

.gate-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
EOF
