/* Korsordshjälpen — Clean Scandinavian Design */

:root {
  --background: #F2F2F2;
  --text: #000000;
  --boxes: #FFFFFF;
  --accent: #829DAB;
  --pale-accent: #D1DDE3;
  --vignette-color: rgba(220, 220, 220, 0.6);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
  font-size: 1.0rem;
  position: relative;
}

/* Paper texture overlay */
.paper-texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 60%, var(--vignette-color) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.3  0 0 0 0 0.3  0 0 0 0 0.3  0 0 0 0.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paperNoise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: auto, 100px 100px;
  z-index: -1;
}

main { width: 100%; max-width: 600px; margin: 0 auto; }

/* Header / Nav */
header {
  width: 100%; max-width: 600px;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--pale-accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
header h1 { font-family: 'Rampart One', Arial, sans-serif; font-size: 3rem; font-weight: 400; color: var(--text); letter-spacing: -0.02em; }
header h1 a { display: inline-block; }
.logo { color: inherit; text-decoration: none; }
.logo:hover { opacity: 0.8; }
nav { margin-top: 0.75rem; }
nav a {
  color: var(--text); text-decoration: none; font-size: 1.1rem;
  margin: 0 0.75rem; transition: color 0.2s;
}
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }

/* Hero */
.hero { text-align: center; margin-bottom: 1.5rem; color: var(--text); }
.tagline { 
  font-size: 1rem; 
  color: var(--text);
  margin: 0.5rem 0;
}

/* Form */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-weight: 500;
  color: var(--text); margin-bottom: 0.5rem;
}

.clue-input {
  width: 100%; padding: 0.875rem 1.125rem; font-size: 1.1rem;
  border: 1.5px solid var(--pale-accent); border-radius: 0.5rem;
  background: var(--boxes); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.clue-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 205, 227, 0.15);
}

/* Length row */
.length-row {
  display: flex; align-items: center; gap: 0.5rem;
  justify-content: center;
}
.length-input {
  width: 3.5rem; text-align: center; padding: 0.5rem;
  border: 1.5px solid var(--pale-accent); border-radius: 0.375rem;
  font-size: 1.1rem; background: var(--boxes); color: var(--text);
}
.length-input:focus { outline: none; border-color: var(--accent); }
.btn-sm {
  width: 2.25rem; height: 2.25rem; border: 1.5px solid var(--pale-accent); border-radius: 0.375rem;
  background: var(--boxes); color: var(--text); font-size: 1.2rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn-sm:hover { background: var(--pale-accent); border-color: var(--accent); }

/* Letter boxes */
.letter-boxes {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center;
}
.letter-box {
  width: 52px; height: 52px;
  border: 1.5px solid var(--pale-accent); border-radius: 0.375rem;
  text-align: center; font-size: 1.35rem; font-weight: 700;
  text-transform: uppercase; color: var(--text); background: var(--boxes);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.letter-box-immutable {
  width: 52px; height: 52px;
  border: 1.5px solid var(--pale-accent); border-radius: 0.375rem;
  text-align: center; font-size: 1.35rem; font-weight: 700;
  text-transform: uppercase; color: var(--text); background: var(--background);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.letter-box:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 205, 227, 0.15);
}

/* Primary button */
.btn-primary {
  display: inline-block; width: 100%; padding: 0.875rem; font-size: 1.1rem; font-weight: 600;
  color: var(--text); background: var(--accent); border: none; border-radius: 0.5rem;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  text-align: center; text-decoration: none;
  margin-top: 0.75rem;
}
.btn-primary:hover { background: var(--pale-accent); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { background: var(--pale-accent); cursor: not-allowed; }

/* Secondary button */
.btn-secondary {
  padding: 0.625rem 1.25rem; font-size: 1rem; font-weight: 500;
  color: var(--text); background: var(--accent); border: 1.5px solid var(--accent);
  border-radius: 0.375rem; cursor: pointer; transition: background 0.2s;
  margin: 0.375rem;
}
.btn-secondary:hover { background: var(--pale-accent); }

/* Status area */
.status {
  text-align: center; padding: 1.75rem 0;
  color: var(--text); font-size: 1.2rem;
}
.status:not(.hidden) { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Results */
.results { margin-top: 1.25rem; }
.results h2 { font-size: 1.3rem; color: var(--text); margin-bottom: 1rem; }
.results-header h2 { font-size: 1.3rem; color: var(--text); margin-bottom: 0.5rem; }
.big-clue { font-size: 2.25rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; text-align: center; }
.display-letter-boxes { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.5rem;
  justify-content: center;
  margin: 0 auto;
}
.results-list {
  list-style: none; padding: 0;
}
.results-list li {
  background: var(--boxes); border: 1px solid var(--pale-accent); border-radius: 0.5rem;
  padding: 0.875rem 1.25rem; margin-bottom: 0.75rem;
  font-size: 1.2rem; font-weight: 600; color: var(--text);
  counter-increment: result;
  display: flex; align-items: center; gap: 0.875rem;
}
.results-list li::before {
  content: counter(result) ".";
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  min-width: 2rem;
}
.results-list { counter-reset: result; }
.results-list .no-results {
  background: none; color: var(--text); font-weight: 400; font-style: italic; font-size: 1.2rem;
}
.results-list .no-results::before { content: none; }

.cache-note {
  font-size: 1rem; color: var(--text); font-style: italic;
  margin-bottom: 0.75rem;
}

.result-actions { text-align: center; padding: 1.25rem 0; }

/* Ad placeholder */
.ad-placeholder {
  text-align: center;
  margin: 1rem 0;
  width: 100%;
  max-width: 600px;
}

/* Description text */
.description {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* How it works section */
.how-it-works {
  margin: 1.5rem 0;
  padding: 1rem;
}
.how-it-works h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.how-it-works p {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

/* About results section */
.about-results {
  margin: 1.5rem 0;
  padding: 1rem;
}
.about-results h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.about-results p {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

/* About page */
.about-section { line-height: 1.8; }
.about-section h1 { font-size: 1.6rem; margin-bottom: 1.25rem; color: var(--text); }
.about-section h2 { font-size: 1.3rem; margin-top: 1.75rem; margin-bottom: 0.75rem; color: var(--text); }
.about-section p { margin-bottom: 1rem; color: var(--text); font-size: 1.2rem; }
.about-cta { text-align: center; margin-top: 2.5rem; }
.about-cta .btn-primary { width: auto; padding: 0.75rem 1.75rem; }

/* Footer */
footer {
  width: 100%; max-width: 600px;
  text-align: center; padding: 2rem 0;
  margin-top: auto;
  font-size: 1rem; color: var(--text);
  border-top: 1px solid var(--pale-accent);
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--boxes);
  border-top: 1px solid var(--pale-accent);
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.cookie-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.cookie-text {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  flex: 1 1 100%;
}

.cookie-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cookie-link {
  color: var(--text);
  text-decoration: underline;
  font-size: 0.95rem;
}

.cookie-link:hover {
  color: var(--accent);
}

.cookie-btn {
  flex: 0 0 auto;
  min-width: 100px;
}

/* Decoration image */
.decoration-image {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 1rem auto;
  border-radius: 0.5rem;
}

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 480px) {
  header h1 { font-family: 'Rampart One', Arial, sans-serif; font-size: 2.5rem; }
  .letter-box { width: 46px; height: 46px; font-size: 1.2rem; }
  .letter-boxes { gap: 0.4rem; }
  .clue-input { font-size: 1rem; padding: 0.75rem 1rem; }
  .btn-primary { font-size: 1rem; }
  .btn-secondary { font-size: 0.9rem; padding: 0.5rem 1rem; }
}

/* Page layout - show only one page at a time */
.page { display: none; }
.page.active { display: block; }

/* Search minimal section on results page */
.search-minimal {
  margin-bottom: 1.75rem;
  background: var(--boxes);
  padding: 1.25rem;
  border: 1px solid var(--pale-accent);
  border-radius: 0.5rem;
}
.search-minimal .form-group {
  margin-bottom: 1rem;
}

/* Edit mode indicator */
.search-minimal.visible {
  display: block !important;
}

/* Results actions buttons layout */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0;
  text-align: center;
}

.result-actions-top {
  margin-bottom: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.result-actions-bottom {
  padding-top: 1.25rem;
}

@media (max-width: 480px) {
  .decoration-image {
    max-width: 140px;
    margin: 0.75rem auto;
  }
  .result-actions {
    flex-direction: column;
    align-items: center;
  }
  .btn-secondary {
    width: 100%;
    margin: 0.25rem 0;
  }
}


