:root {
  --lilac:          #c8a2c8;
  --dark-lilac:     #6d526d;
  --violet:         #302044;
  --link:           #00ffcc;
  --link-visited:   #0099aa;
  --link-hover:     #006666;
  --link-active:    #004444;
  --dark-grey:      #414141;
  --light-grey:     #7e7e7e;

  --fg:         var(--lilac);
  --bg:         var(--violet);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.stamp{
  image-rendering: pixelated;
  position: relative;
  z-index: 0;
  margin: 1px 1px 0px 0px;
  filter: drop-shadow(0 0 0px rgba(0, 0, 0, 1));
  transition: .5s;
  max-width: none;
  width: auto;
  height: auto;
}
.badge{
  image-rendering: pixelated;
  position: relative;
  z-index: 0;
  margin: 1px 1px 0px 0px;
  filter: drop-shadow(0 0 0px rgba(0, 0, 0, 1));
  transition: .5s;
  max-width: none;
  width: auto;
  height: auto;
}
.stamp:hover{
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  transform: scale(1.5);
  background-color: transparent;
  filter: drop-shadow(6px 6px 0px rgba(0, 0, 0, 0.2));
  transition: .1s;
}
.badge:hover{
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  transform: scale(1.2);
  background-color: transparent;
  filter: drop-shadow(6px 6px 0px rgba(0, 0, 0, 0.2));
  transition: .1s;
}

.home-boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.home-box {
  min-width: 0;
  min-height: 300px;
  padding: 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
}

.home-box h2 {
  margin-top: 0;
}
.home-box h3 {
  margin-top: 0;
}
.home-box ul {
  list-style: none;
}

.header-badges {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.header-badges img {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* Webrings: height is determined by the contents */
.home-box.webrings-box {
  min-height: 0;
  height: auto;
  align-items: stretch;
}

/* Updates: fill the row height and allow scrolling inside */
.home-box.updates-box {
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-items: stretch;
}

@media (max-width: 600px) {
  .home-boxes {
    grid-template-columns: 1fr;
  }
}

.site-nav {
  width: 100%;
  margin-top: 1rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.witching-hour-webring {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 16px;
  color: black;
  border: 1px solid black;
  border-radius: 3px;
  width: 400px;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 5px;
  box-shadow: 0 0 5px black;
  background-color: lightgray;
}

.witching-hour-webring .webring-link {
  color: purple;
}

.witching-hour-webring .webring-link span {
  padding: 3px;
}

#tablePaginated img {
  width: 75px;
  height: 75px;
  object-fit: cover;
}

magical-ring {
  max-width: 50ch;
  border:black 4px double;
  display:grid;
  grid-template-columns: 1fr 4fr 1fr;
  padding-top: 0.2em;
  background-color:antiquewhite;
}

magical-ring > * {
  box-sizing: border-box;
}

magical-ring div{
  display:flex;
  flex-direction:column;
  align-items: center;
  justify-content: center;
}

magical-ring a,magical-ring a:visited {
color:black;
text-decoration: none;
}

magical-ring .arrow {
  text-decoration:underline;
}

magical-ring h3, magical-ring .ring-name {
  font-family: 'IM Fell English SC', serif;
  
}
magical-ring p, magical-ring a {
  font-family: 'Benne', serif;
  font-size:0.9em;
}
magical-ring .picture {
  background-image: url(https://magical-ring.neocities.org/images/crow.png);
  width: 109px;
  height: 61px;
}
magical-ring .picture-noring {
  background-image: url(https://magical-ring.neocities.org/images/snakey.png);
  width: 50px;
  aspect-ratio: 1/1;
}
magical-ring p,magical-ring h3 {
  margin: 0;
  margin-bottom:0.1em;
}

body {
  background-color: var(--bg);
  background-image: url("/assets/misc/wallpaper.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: var(--fg);
  font-family: 'Consolas', monospace;
  min-height: 100vh;
}

.content-box {
  flex: 1;
  width: calc(100% - 2rem);
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 1.5rem;

  background-color: var(--bg);
  border: 1px solid var(--dark-lilac);
  border-radius: 8px;
}

#floating-image-br {
  position: fixed;
  bottom: -25px;
  right: 10px;
  width: 300px;
  height: auto;
  z-index: 1000;
}
#floating-image-top {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: auto;
  z-index: 1000;
}

.crystal-layout {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.crystal-info {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.crystal-image {
  flex: 0 0 300px;
  min-height: 0;
}

.crystal-image img {
  display: block;
  width: 100%;
  height: auto;
}

.crystal-info table {
  margin: 0 auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  font-weight: bold;
}

a:active {
  color: var(--link-active);
  text-decoration: underline;
  font-weight: bold;
}

.update-item {
  border-radius: 12px;
  overflow: hidden;
  background: var(--dark-grey);
  margin-bottom: 1em;
  border: 1px solid var(--light-grey);
}

.update-header {
  font-weight: bold;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--dark-grey);
  color: var(--off-white);
  border-radius: 12px 12px 0 0;
}

.update-header:hover {
  background: var(--light-grey);
}

.update-content {
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out, padding 0.2s ease-out;
  background: var(--dark-grey);
  color: var(--off-white);
  border-top: 1px solid var(--light-grey);
  border-radius: 0 0 12px 12px;
  padding: 0 12px;
}

.update-content.show {
  display: block;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.toggle-icon {
  float: right;
}

#tableContainer {
  overflow-x: auto;
}

#tablePaginated {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#tablePaginated th,
#tablePaginated td {
  padding: 0.5rem;
  text-align: center;
  font-size: 1rem;
}

#tablePaginatedCreator {
  width: 100%;
  table-layout: auto;
  margin-top: 1rem;
}

#tablePaginatedCreator th:nth-child(1),
#tablePaginatedCreator td:nth-child(1) {
  width: auto;
  text-align: left;
}

#tablePaginatedCreator th:nth-child(2),
#tablePaginatedCreator td:nth-child(2),
#tablePaginatedCreator th:nth-child(3),
#tablePaginatedCreator td:nth-child(3) {
  white-space: nowrap;
  width: 1%;
}

#tablePaginatedCreator th:nth-child(2),
#tablePaginatedCreator td:nth-child(2) {
  text-align: right;
}

#tablePaginatedCreator th:nth-child(3),
#tablePaginatedCreator td:nth-child(3) {
  text-align: left;
}

section {
  margin-bottom: 2rem;
}

h2, h3 {
  margin-top: 2rem;
}

ul, ol {
  margin-left: 1.5rem;
  padding-left: 1.5rem;
  list-style-type: disc;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  padding: 1rem;
  gap: 1rem;
}

.header-center{
  flex: 1 1 100%; /* Full width on small screens by default */
  text-align: center;
}


@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 1rem 0.5rem;
  }

  #tablePaginated th,
  #tablePaginated td,
  #tablePaginatedCreator th,
  #tablePaginatedCreator td {
    font-size: 14px;
  }

  .hover-button {
    width: 25%;
    font-size: 0.875rem;
  }

  img {
    max-width: 100%;
    height: auto;
  }
  
  ul, ol {
    margin-left: 1rem;
    padding-left: 1rem;
  }
}

header .home-boxes {
  margin: 0rem auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

header .home-box {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.75rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
}


header .home-box h2,
header .home-box h4 {
  margin-top: 0;
  margin-bottom: 0;
}

header {
  row-gap: 0;
}

header .home-boxes {
  margin: 0;
  gap: 1rem;
}

header .site-nav {
  margin-top: 0;
}

header .home-box:has(ws-widget) {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Full-screen dimmed overlay */
#witch-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.8);
}

/* Popup panel */
#witch-popup .popup-box {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--violet);
  color: var(--lilac);
  padding: 2rem;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 0 20px var(--link-visited);
  border: 1px solid var(--link);
  font-family: inherit;
}

#witch-popup .popup-box h2 {
  margin: 7px 0;
}

#witch-popup .popup-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

#witch-popup .popup-buttons button,
#witch-popup .popup-buttons a {
  display: inline-block;
  box-sizing: border-box;
  margin: 0;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: 0.2s ease;
}

#witch-popup #enter-site {
  background: var(--lilac);
  color: var(--violet);
  border: 1px solid var(--lilac);
}

#witch-popup #leave-site {
  background: transparent;
  color: var(--lilac);
  border: 1px solid var(--lilac);
}

#witch-popup #enter-site:hover {
  filter: brightness(1.15);
}

#witch-popup #leave-site:hover {
  background: var(--lilac);
  color: var(--violet);
}

.fixed-width {
  max-width: 100%;
  height: auto;
}

.fixed-height {
  height: 1em;
  width: auto;
}

.stretch-to-fill {
  width: 100%;
  height: auto;
  display: block;
}

.tiled {
  height: 16px;
  background-repeat: repeat-x;
  background-position: center;
}

.crystal-info #tablePaginated {
  table-layout: fixed;
}

.paper-bg {
  background-image: url("/assets/misc/paper.jpg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}