/* Controls row */
.pn-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.pn-filter{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pn-sort{
  display:flex;
  align-items:center;
  gap:10px;
  color: rgba(255,255,255,.9);
  font-weight: 900;
  position: relative;
}

.pn-sort-label{
  opacity: .92;
}

/* Filter chips */
.pn-chip{
  border: none;
  box-shadow:
    0 12px 22px rgba(0,0,0,.30),
    0 0 0 4px rgba(242, 211, 107, .18),
    inset 0 1px 0 rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(0,0,0,.42)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.06) 0px,
      rgba(255,255,255,.06) 8px,
      rgba(0,0,0,.06) 8px,
      rgba(0,0,0,.06) 16px
    ),
    linear-gradient(180deg, #1c5619, #76bd6a);
  color: rgba(255,255,255,.92);
  font-weight: 1000;
  border-radius: 14px;
  padding: 8px 14px;
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,.20);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.pn-chip:hover{
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.pn-chip.active{
  background: linear-gradient(180deg, rgba(78, 50, 14, 0.731), rgba(184, 103, 45, 0.58));
  box-shadow: 0 0 0 2px rgba(255, 210, 120, .22), 0 12px 24px rgba(0,0,0,.25);
}


/* Grid */
.pn-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

/* WOOD cards (sub-section vibe) */
.pn-card{
  border-radius: 18px;
  border: none;
  overflow:hidden;
  cursor:pointer;
  text-align:left;

  padding: 14px 14px 12px;

  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.20)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.06) 0px,
      rgba(255,255,255,.06) 8px,
      rgba(0,0,0,.06) 8px,
      rgba(0,0,0,.06) 16px
    ),
    linear-gradient(180deg, var(--pn-woodA), var(--pn-woodB));

  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  transition: transform .12s ease, filter .12s ease;
}
.pn-card:hover{
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.pn-card:focus{
  outline:none;
  box-shadow:
    0 0 0 2px var(--pn-glow),
    0 14px 34px rgba(0,0,0,.30);
}

.pn-card-title{
  margin:0;
  font-size: 18px;
  font-weight: 1000;
  color: rgba(255,255,255,.95);
  text-shadow: 0 10px 22px rgba(0,0,0,.55);
}

.pn-card-date{
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  opacity: .88;
  color: rgba(255,255,255,.88);
}

.pn-card-tags{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  margin-top: 10px;
}

.pn-tag{
  padding: 5px 10px;
  border-radius: 999px;
  
  font-weight: 1000;
  font-size: 12px;
  color: rgba(255,255,255,.92);
}

/* optional tag accents */
.pn-tag-game{ box-shadow: 0 0 0 2px rgba(255, 180, 80, .12) inset; 
background: linear-gradient(180deg, rgba(23, 65, 77, 0.42), rgba(17, 140, 174, 0.7));}
.pn-tag-wiki{ box-shadow: 0 0 0 2px rgba(120, 200, 255, .12) inset; 
background: linear-gradient(180deg, rgba(41, 23, 77, 0.42), rgba(77, 17, 174, 0.7));}
.pn-tag-other{ box-shadow: 0 0 0 2px rgba(200, 200, 200, .10) inset; 
background: linear-gradient(180deg, rgba(64, 77, 23, 0.42), rgba(174, 158, 17, 0.7));}

.pn-empty{
  opacity:.75;
  padding: 10px 6px;
}

/* Modal overlay + window */
.pn-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;

}

.pn-modal-overlay.hidden{
  display:none;
}

.pn-modal{
  width: min(920px, 96vw);
  max-height: min(82vh, 820px);
  overflow:hidden;
  z-index: 9999;

  border-radius: 18px;
  border: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.20)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.06) 0px,
      rgba(255,255,255,.06) 25px,
      rgba(0,0,0,.06) 25px,
      rgba(0,0,0,.06) 50px
    ),
    linear-gradient(180deg, var(--pn-woodA), var(--pn-woodB));
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  position: relative;
}

.pn-modal-close{
  position:absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(73, 42, 29, 0.65);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  color: rgba(255,255,255,.9);
  font-weight: 1000;
  font-size: 20px;
  cursor:pointer;
  
}
.pn-modal-close:hover{ filter: brightness(1.1); }

.pn-modal-head{
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.pn-modal-title{
  font-size: 20px;
  font-weight: 1000;
  color: rgba(255,255,255,.95);
  text-shadow: 0 10px 22px rgba(0,0,0,.55);
}

.pn-modal-meta{
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  opacity: .85;
  color: rgba(255,255,255,.88);
}

/* Discord-like text block */
.pn-modal-body{
  padding: 14px 16px 18px;
  overflow:auto;
  background: rgba(0,0,0,.18);
}

/* Modal text lines */
.pn-modal-text{
  display:flex;
  flex-direction:column;
  gap:6px;

  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
  text-shadow: 0 6px 16px rgba(0,0,0,.45);
}

.pn-modal-line{ white-space: pre-wrap; }
.pn-modal-bullet{ padding-left: 8px; white-space: pre-wrap; }
.pn-modal-text strong{ color: rgba(255,255,255,.96); }
.pn-modal-text em{ opacity: .92; }

/* Date + tag inline meta row */
.pn-card-meta{
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  opacity: .88;
  color: rgba(255,255,255,.88);

  display: flex;
  align-items: center;
  gap: 6px;
}

.pn-card-date,
.pn-card-tag{
  color: rgba(255,255,255,.88);
}

.pn-card-sep{
  opacity: .6;
}



/* ===== Patchnotes modal: sticky header + scrollable body ===== */

.pn-modal{
  display: flex;
  flex-direction: column;

  /* keep modal within viewport */
  max-height: min(82vh, 820px);
  height: min(82vh, 820px);          /* ensures body can scroll */
}

/* keep header visible */
.pn-modal-head{
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;

  /* make sure it covers content behind while scrolling */
  background: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* keep X visible too */
.pn-modal-close{
  position: sticky; /* instead of absolute */
  top: 10px;
  margin-left: auto;
  z-index: 3;
}

/* only content scrolls */
.pn-modal-body{
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0; /* IMPORTANT for flex scroll containers */
}

/* base look */
.spoiler-toggle{
  display: inline-block;
  cursor: pointer;
  user-select: none;

  padding: 4px 10px;
  border-radius: 10px;

  background: linear-gradient(67deg, #393939, #303030, #343434);
  box-shadow: 4px 6px 3px rgba(0,0,0,.3);
  color: #fff;

  line-height: 1.35;
  white-space: normal;      /* allow wrapping */
  max-width: 100%;
}

/* when revealed, make it feel like ONE box */
.spoiler-toggle.active{
  display: block;           /* <- key: one container */
  width: fit-content;
  max-width: 100%;
  margin: 6px 0;            /* spacing around it */
  padding: 10px 14px;       /* more “card” feel */
}

/* optional: nicer line spacing for <br> content */
.spoiler-toggle.active br{
  content: "";
  display: block;
  margin: 6px 0;
}