:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --surface2: #1a1a2a;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --accent: #4f8cff;
  --accent-glow: rgba(79,140,255,0.25);
  --danger: #ff4f6a;
  --success: #4fff8c;
  --warning: #ffb84f;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ===== Navbar ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 8px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent); color: #fff; }

/* Dropdown for overflow tools */
.nav-more {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-more-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}
.nav-more-btn:hover { color: var(--text); border-color: var(--accent); }
.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown.open { display: block; }
.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.15s;
}
.nav-dropdown a:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-dropdown a.active { color: var(--accent); }

/* Language switcher */
.nav-lang { position: relative; flex-shrink: 0; }
.nav-lang .nav-dropdown { right: 0; max-height: 320px; overflow-y: auto; min-width: 160px; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 40px 0 16px;
}
.hero-icon { font-size: 48px; margin-bottom: 12px; }
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); font-size: 15px; max-width: 480px; margin: 0 auto; }

/* ===== Ad Slot ===== */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 10px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 11px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.card h2 { font-size: 20px; margin-bottom: 8px; }
.card .subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

/* ===== Play Button ===== */
.play-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 40px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.play-btn:hover { background: var(--accent-glow); transform: scale(1.05); }
.play-btn.active {
  background: var(--accent);
  color: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 20px transparent; }
}

/* ===== Progress ===== */
.progress-wrap { margin-top: 20px; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s linear;
}
.progress-text { color: var(--text-dim); font-size: 13px; }

/* ===== Freq Display ===== */
.freq-display {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 12px 0;
  color: var(--accent);
}
.freq-display small { font-size: 16px; color: var(--text-dim); font-weight: 400; }

/* ===== Inline Buttons ===== */
.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { border-color: var(--accent); }
.btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.sm { padding: 6px 14px; font-size: 13px; }

/* ===== Status ===== */
.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.status.visible { display: block; }
.status.success { background: rgba(79,255,140,0.1); border: 1px solid rgba(79,255,140,0.3); color: var(--success); }
.status.error { background: rgba(255,79,106,0.1); border: 1px solid rgba(255,79,106,0.3); color: var(--danger); }
.status.info { background: rgba(79,140,255,0.1); border: 1px solid rgba(79,140,255,0.3); color: var(--accent); }

/* ===== Visualizer ===== */
.visualizer {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  background: var(--bg);
  margin: 16px 0;
}

/* ===== Video / Media ===== */
.media-box {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  position: relative;
}
.media-box video, .media-box canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Info Grid ===== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  text-align: left;
  margin: 16px 0;
}
.info-item {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.info-item .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-item .value { font-weight: 600; margin-top: 2px; }

/* ===== Keyboard Grid ===== */
.key-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 16px 0;
}
.key-cap {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  transition: all 0.15s;
}
.key-cap.pressed { background: var(--accent); color: #fff; border-color: var(--accent); }
.key-cap.wide { min-width: 60px; }
.key-cap.wider { min-width: 90px; }
.key-cap.space { min-width: 200px; }

/* ===== Fullscreen ===== */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  cursor: pointer;
  display: none;
}
.fullscreen-overlay.visible { display: block; }

/* ===== Click Counter ===== */
.click-area {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
  margin: 0 auto;
}
.click-area:active { transform: scale(0.95); background: var(--accent-glow); }
.click-count { font-size: 48px; font-weight: 700; color: var(--accent); }
.click-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; }

/* ===== SEO Content ===== */
.content { margin: 32px 0; }
.content h2 { font-size: 22px; margin: 28px 0 10px; }
.content h3 { font-size: 17px; margin: 18px 0 8px; }
.content p, .content li { color: var(--text-dim); font-size: 15px; margin-bottom: 10px; text-align: left; }
.content ul { padding-left: 20px; }

details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
  background: var(--surface);
}
summary { cursor: pointer; font-weight: 600; font-size: 15px; }
details p { margin-top: 10px; }

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 28px 0;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
footer a { color: var(--accent); }

/* ===== Tool Grid (home page) ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  display: block;
  color: var(--text);
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.tool-card .icon { font-size: 36px; margin-bottom: 10px; }
.tool-card h3 { font-size: 15px; margin-bottom: 4px; }
.tool-card p { font-size: 12px; color: var(--text-dim); }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 22px; }
  .card { padding: 24px 16px; }
  .info-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .nav-brand { font-size: 15px; }
}
