html,
body {
  min-height: 100%;
  height: auto;
}

:root {
  --bg: #050816;
  --bg-alt: #0b1220;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.15);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --card: #111827;
  --border: #1f2937;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #eab308;
  --radius: 12px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  --transition: 0.18s ease-out;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /*--font-main: 'Open Sans', sans-serif;*/
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #1d2438 0, var(--bg) 45%, #020617 100%);
  color: var(--text);
}

body.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.4rem;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(15px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.85), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #a5b4fc;
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
  border-radius: 999px; /* leichter runder Avatar-Look */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.logo-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a5b4fc;
  white-space: nowrap;
}

/*
.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #a5b4fc;
}

.logo img {
  height: 80px;
  width: auto;
  display: block;
  border-radius: 6px;
}
*/

.nav {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.nav-link.active {
  color: #e0e7ff;
  background: rgba(79, 70, 229, 0.25);
}

.page main {
  flex: 1 0 auto;
}

.page-home main {
  padding: 3.5rem 0 3rem;
}

.page-status main {
 padding: 3rem 0 2.5rem;
}

/* Legal pages (Impressum, Datenschutz) */
.page-legal main {
  padding: 3rem 0 3rem;
  flex: 1 0 auto;
}

.legal-wrapper {
  max-width: 800px;
  line-height: 1.7;
}

.legal-wrapper h1 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  margin: 0 0 2rem;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}

.legal-wrapper h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  font-weight: 600;
}

.legal-wrapper h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-weight: 600;
}

.legal-wrapper h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.legal-wrapper p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-wrapper strong {
  color: var(--text);
  font-weight: 600;
}

.legal-wrapper a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.legal-wrapper a:hover {
  color: #6366f1;
  text-decoration: underline;
}

.legal-wrapper ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.legal-wrapper li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.legal-wrapper .footer-links {
  margin-bottom: 0.5rem;
}

.legal-wrapper .footer-separator {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* Hero */

.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero-text {
  max-width: 620px;
}

.hero-logo {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.4));
  border-radius: 16px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0;
  margin-top: 0.3rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn.primary {
  background: linear-gradient(135deg, #4f46e5, #22c1c3);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Cards / Grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.96), rgba(15, 23, 42, 0.98));
  border-radius: var(--radius);
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 1.2rem 1.35rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.85);
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Status page */

.page-status main {
  padding: 3rem 0 2.5rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.status-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.status-name {
  font-weight: 600;
}

.status-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
}

.status-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.status-warn {
  background: rgba(234, 179, 8, 0.15);
  color: var(--warn);
}

.status-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-updated {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tools-Sektion */

.tools {
  margin-bottom: 3.5rem;
}

.tools-header {
  margin-bottom: 1.4rem;
}

.tools h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.tools-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem 1.1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
}

.tool-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.tool-desc {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-output-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.tool-buttons-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tool-buttons-vertical .btn {
  white-space: nowrap;
  min-width: 80px;
}

.tool-output {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.9rem;
}

.tool-textarea {
  resize: none;
  min-height: 80px;
  max-height: 200px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.tool-output:focus {
  outline: none;
  border-color: var(--accent);
}

.tool-output-separated {
  margin-top: 0.75rem;
}

.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.tool-hint {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tool-label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Passwort-Generator */
.password-length-row {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.password-length-row label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#passwordLengthValue {
  font-weight: 600;
  color: var(--text);
}

.password-length-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(55, 65, 81, 0.9);
  outline: none;
}

/* Emoji Picker */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
  gap: 6px;
  margin-top: 0.7rem;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-right: -0.5rem;
}

/* Custom scrollbar styling for emoji grid */
.emoji-grid::-webkit-scrollbar {
  width: 8px;
}

.emoji-grid::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* Firefox scrollbar */
.emoji-grid {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) rgba(15, 23, 42, 0.5);
}

.emoji-grid span {
  font-size: 22px;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.emoji-grid span:hover {
  background: rgba(255,255,255,0.08);
}

/* Vote Tool */
.vote-list {
  margin-top: 0.6rem;
  padding-left: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.vote-stats {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Thumb (Slider-Knopf) */
.password-length-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
}

.password-length-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
}

/* Footer */

.footer {
  border-top: 1px solid rgba(30, 64, 175, 0.4);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
  padding: 1.1rem 0 1.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.25rem;
}

.footer-link:hover {
  text-decoration: underline;
  color: var(--text-light, #ffffff);
}

.footer a,
.footer a:link,
.footer a:visited {
  color: var(--text-muted) !important;
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-light, #ffffff);
  text-decoration: underline;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--text);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .header .wrapper {
    padding-inline: 1rem;
  }
  .hero {
    padding-top: 3.2rem;
  }
}
