html {
  margin:0;
  padding:0;  
}
:root[data-theme="dark"] .pagination a {
  color: #eacfee;
  background: #2a1b22;
  font-weight: bold;
  border: 1.5px solid #a34c6b;
}
:root[data-theme="dark"] .pagination a:hover,
:root[data-theme="dark"] .pagination a:focus {
  background: #a34c6b;
  color: #fff;
  border-color: #eacfee;
}
:root[data-theme="light"] .pagination a {
  color: #7c2a4d;
  background: #ffe6e0;
  font-weight: bold;
  border: 1.5px solid #b12e7a;
}
:root[data-theme="light"] .pagination a:hover,
:root[data-theme="light"] .pagination a:focus {
  background: #b12e7a;
  color: #fff;
  border-color: #7c2a4d;
}
:root[data-theme="light"] .hover-glow-btn {
  color: #2a1a1a !important;
}
:root[data-theme="light"] {
  --main-bg-img: url('/img/bg.png');
  --bg: #ffe6e0;
  --fg: #1a1a1a;
  --accent: #e0a6e8;
  --surface: #7c2a4d;
  --nav-link: #e0a6e8;
  --nav-link-hover: #eacfee;
  --toggle-icon: #e0a6e8;
  --pagination-accent: #b12e7a;
  --pagination-accent-hover: #fff;
  --link: #7c2a4d;
  --link-hover: #b12e7a;
}
:root[data-theme="dark"] {
  --main-bg-img: url('/img/bg-dark.png');
  --bg: #2a1b22;
  --fg: #f3e9e3;
  --accent: #C47AC0;
  --chat-bg: #2d232a;
  --link: #d18bbf;
  --link-hover: #b12e7a;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  background-image: var(--main-bg-img);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  color: var(--fg);
  margin: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s, background-image 0.2s;
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
  border-bottom: 0.5px solid #666;
  position: relative;
}
.navbar-links {
  display: flex;
  gap: 2.2rem;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
}
#theme-toggle {
  border: none;
  outline: none;
  margin-left: auto;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2em;
  border-radius: 50%;
  background: var(--surface);
  transition: background 0.18s;
  height: 36px;
  width: 36px;
  cursor: pointer;
}
#theme-toggle svg {
  fill: var(--accent);
  transition: fill 0.18s;
}
#theme-toggle:hover, #theme-toggle:focus {
  background: var(--bg);
}
#theme-toggle:hover svg, #theme-toggle:focus svg {
  fill: #fff;
  transition: fill 0.18s;
}
:root[data-theme="light"] .navbar {
  background: var(--surface);
  border-bottom: 1px solid #a34c6b;
}

:root[data-theme="light"] #theme-toggle {
  background: var(--surface);
}

:root[data-theme="dark"] #theme-toggle {
  background: var(--bg);
}
.navbar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  position: relative;
  display: inline-block;
  transition: color 0.18s;
}
.navbar a::after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  opacity: 0.85;
}
.navbar a:hover::after,
.navbar a:focus::after {
  transform: scaleX(1);
}
main {
  max-width: 900px;
  margin: 2em auto;
  padding: 1em;
  background: none;
  border-radius: 0;
  box-shadow: none;
  display: block;
  backdrop-filter: none;
}
h1 {
  font-size: 1.5em;
  margin: 0.5em 0 0.5em 0;
}
h2 {
  font-size: 1.3em;
  margin: 0.5em 0 0.5em 0;
}
p {
  margin: 0.3em 0;
  line-height: 1.5em;
}
a {
  color: var(--link);
}
a:hover, a:focus {
  color: var(--link-hover);
}

.btn {
  display: inline-block;
  padding: 0.5em 1em;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}
.cta-btns {
  display: flex;
  gap: 1.2em;
  margin-top: 0.8em;
  margin-bottom: 0.5em;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.intro, .jokes-list {
  background: #ffe6e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin: 0 0 2em 0;
  padding: 1em;
  max-width: 100%;
  backdrop-filter: none;
}
:root[data-theme="dark"] .intro, :root[data-theme="dark"] .jokes-list {
  background: #2a1b22;
}
.about {
  background: #ffe6e0;
  backdrop-filter: none;
}
:root[data-theme="dark"] .about {
  background: #2a1b22;
}

.joke-box {
  background: #ebcdd4;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.10);
  border: 1.5px solid #e06a8b;
}
:root[data-theme="dark"] .joke-box {
  background: #3a2230;
  border: 1.5px solid #a34c6b;
}

.intro-split {
  display: flex;
  flex-direction: row;
  gap: 2.5em;
  align-items: stretch;
}
.intro-img-col {
  flex: 2 1 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-top: 1em;
}
.intro-img {
  width: 100%;
  height: 420px;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
  object-fit: cover;
  object-position: center;
  transition: height 0.2s, object-fit 0.2s;
}
.intro-content-col {
  flex: 3 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 900px) {
  .intro-split {
    gap: 1em;
  }
  .intro-img {
    max-height: 200px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
  }
}

@media (max-width: 700px) {
  .intro-split {
    flex-direction: column;
    gap: 0.5em;
    align-items: stretch;
  }
  .intro-img-col, .intro-content-col {
    width: 100%;
    min-width: 0;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
  .intro-img {
    max-width: 90vw;
    max-height: 160px;
    margin-bottom: 0.5em;
    border-radius: 10px;
    height: auto;
    object-fit: cover;
    overflow: hidden;
    display: block;
  }
  .intro-content-col h1 {
    margin-top: 0.2em;
  }
}
blockquote {
  border-left: 4px solid var(--accent);
  margin: 1em 0;
  padding: 0.5em 1em;
  background: rgba(0,0,0,0.02);
}
.rating {
  font-size: 0.9em;
  color: var(--accent);
}
footer {
  text-align: center;
  padding: 2em 0 1em 0;
  font-size: 0.9em;
  color: #888;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background: var(--bg);
  border-top: 0.5px solid #666;
}

:root[data-theme="light"] footer {
  background: var(--surface);
  color: #f3e9e3;
  border-top: 1px solid #a34c6b;
}

/* Joke box: light and dark mode backgrounds */
.joke-box {
  margin-bottom: 1.2em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  background: var(--chat-bg, #f5f5f5);
  padding: 0.7em 1em 0.7em 1em;
  transition: background 0.2s, color 0.2s;
}
.joke-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92em;
  color: #888;
  margin-bottom: 0.3em;
}
.joke-chat {
  font-family: 'Fira Mono', 'Consolas', monospace;
  background: none;
  border-radius: 6px;
  padding: 0.3em 0.7em;
  margin-bottom: 0.1em;
  white-space: pre-line;
  font-size: 1em;
  color: var(--fg);
}
.joke-chat p {
  margin: 0.2em 0;
}
@media (max-width: 700px) {
  html {
    font-size: 15px;
  }
  .navbar {
    padding: 0.5em 0.2em;
    font-size: 1em;
  }
  .navbar-links {
    gap: 1.1rem;
  }
  #theme-toggle {
    height: 30px;
    width: 30px;
  }
  main {
    max-width: 98vw;
    margin: 0.5em 0.6vw 0.5em 0.6vw;
    padding: 0.4em 0.1em 4.5em 0.1em;
    background: none;
    min-height: 100vh;
    box-sizing: border-box;
  }
  .intro, .jokes-list, .about {
    background: #ffe6e0;
    backdrop-filter: none;
  }
  .joke-box {
    background: #ffe6e0 !important;
    backdrop-filter: none;
  }
  :root[data-theme="dark"] .intro, :root[data-theme="dark"] .jokes-list, :root[data-theme="dark"] .about, :root[data-theme="dark"] .joke-box {
    background: #2a1b22 !important;
  }
  .intro, .jokes-list {
    margin: 0 0 0.7em 0;
    padding: 0.4em;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  }
  h1, h2 {
    font-size: 1.2em;
    margin-bottom: 0.4em;
    margin-top: 0.6em;
  }
  .joke-box {
    padding: 0.5em 0.5em 0.5em 0.5em;
    font-size: 0.98em;
  }
  .joke-meta {
    font-size: 0.95em;
  }
  .btn, .hover-glow-btn {
    font-size: 1em;
    padding: 0.7em 1em;
    min-width: 120px;
    border-radius: 10px;
  }
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  margin: 2em 0 1em 0;
}
.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  padding: 0.3em 0.7em;
  border-radius: 4px;
  background: rgba(0,0,0,0.04);
  transition: background 0.2s;
}
.pagination a:hover {
  background: var(--accent);
  color: #fff;
}
.hover-glow-btn {
  width: auto;
  padding: 0.85em 3em;
  border: 2.5px solid #fff;
  outline: none;
  color: #eee;
  background: var(--accent);
  cursor: pointer;
  position: relative;
  z-index: 0;
  border-radius: 14px;
  font-size: 1.15em;
  font-weight: bold;
  letter-spacing: 0.03em;
  box-shadow: 0 0 16px 4px var(--accent), 0 0 32px 8px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s, background 0.2s, color 0.2s, border 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
@media (max-width: 500px) {
  .hover-glow-btn {
    width: auto;
    font-size: 1em;
    padding: 0.9em 2em;
  }
}
.hover-glow-btn:before {
  content: '';
  background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  position: absolute;
  top: -6px;
  left: -6px;
  background-size: 400%;
  z-index: -1;
  filter: blur(12px);
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  animation: glowing 12s linear infinite;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  border-radius: 16px;
}
.hover-glow-btn:active {
  color: #000;
  background: #fffbe6;
}
.hover-glow-btn:active:after {
  background: transparent;
}
.hover-glow-btn:hover:before,
.hover-glow-btn:focus:before {
  opacity: 1;
}
.hover-glow-btn:after {
  z-index: -1;
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--accent);
  left: 0;
  top: 0;
  border-radius: 14px;
}
@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}
#footer-link {
  color: inherit;
  text-decoration: none;
}
#footer-link:hover {
  color: var(--accent);
}