@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/Nunito-latin-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: 'MaruGothic';
  src:
    url('/assets/fonts/DF-FutoMaruGothic-W9-CAB-18277f51d7ae7c3bd42f53247de2bb48--4329643920678357007.woff2') format('woff2'),
    url('/assets/fonts/DF-FutoMaruGothic-W9-CAB-18277f51d7ae7c3bd42f53247de2bb48--4329643920678357007.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'MaruGothic';
  src:
    url('/assets/fonts/DF-HeiSeiMaruGothic-W4-CAB-18277f51d7ae7c3bd42f53247de2bb48-2057771419379400601.woff2') format('woff2'),
    url('/assets/fonts/DF-HeiSeiMaruGothic-W4-CAB-18277f51d7ae7c3bd42f53247de2bb48-2057771419379400601.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

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

:root {
  --ink: #554739;
  --muted: #867362;
  --paper: #fffdf8;
  --paper-warm: #fff5e9;
  --line: #ead5c5;
  --rose: #e85a8e;
  --coral: #eb8b65;
  --gold: #ee8a3a;
  --teal: #4aa6a5;
  --blue: #4fb8d6;
  --violet: #9b78c6;
  --lime: #9ed03a;
  --shadow: rgba(151, 98, 62, 0.15);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-color: #fff8d8;
  background-image: url('/assets/chat_bg2.png');
  background-repeat: repeat;
  color: var(--ink);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.page-ground {
  flex: 1 0 auto;
  width: 100%;
  background: #8fc31e;
}

a {
  color: inherit;
}

.series-main {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 28px));
  margin: 18px auto 0;
}

.about-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 10px 22px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fef5fa 100%);
  border: 4px solid #f5a3c2;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px #ffffff, 0 4px 10px rgba(220, 130, 160, 0.22);
  text-align: center;
}

.about-box .about-copy {
  margin: 0 auto;
}

.news-panel {
  position: relative;
  background: linear-gradient(180deg, #8cd4df 0%, #6dc4d3 100%);
  border: 4px solid #4ca8b8;
  border-radius: 6px;
  padding: 22px;
  box-shadow: inset 0 0 0 3px #ffffff, 0 4px 14px rgba(80, 160, 180, 0.22);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: 'MaruGothic', 'Nunito', sans-serif;
}

.news-panel,
.news-panel * {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -22px -22px 0;
  padding: 6px 12px;
  background: linear-gradient(180deg, #5ec0d2 0%, #3a8a9a 100%);
  border-bottom: 2px solid #2a6a78;
  border-radius: 3px 3px 0 0;
  color: #ffffff;
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 0 rgba(0, 60, 80, 0.45);
  user-select: none;
}

.window-title-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.window-icon {
  width: 18px;
  height: auto;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.window-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.window-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  background: #e8e8e8;
  color: #5e2333;
  border: 1px solid #1f4e58;
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  box-shadow: inset -1px -1px 0 #888, inset 1px 1px 0 #ffffff;
  cursor: default;
}

.window-btn-close {
  background: #f0c2c2;
  color: #6a1f1f;
}

.window-tabs {
  position: absolute;
  left: 22px;
  bottom: calc(100% - 30px);
  display: flex;
  align-items: flex-end;
  gap: 6px;
  z-index: 2;
}

.window-tab {
  --accent: var(--rose);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 54px;
  padding: 6px 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 18%, #ffffff) 0%,
    color-mix(in srgb, var(--accent) 6%, #fdfaed) 100%);
  border: 2px solid var(--accent);
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #ffffff;
  transition: height 200ms ease, background 160ms ease;
}

.window-tab img {
  display: block;
  max-width: 100%;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
}

.window-tab:hover,
.window-tab:focus-visible {
  height: 66px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 28%, #ffffff) 0%,
    color-mix(in srgb, var(--accent) 12%, #fdfaed) 100%);
  outline: none;
}

/* Dynamic "coming soon": any series tab or character head whose link is still a
   dead "#" (or empty) is grayed + non-interactive. Add a real href -> un-grays. */
a.window-tab[href="#"],
a.window-tab[href=""],
a.window-tab:not([href]),
a.resource-head[href="#"],
a.resource-head[href=""],
a.resource-head:not([href]) {
  filter: grayscale(1);
  opacity: 0.5;
  pointer-events: none;
}

.news-panel .game-logo,
.news-panel .heroine-banner,
.news-panel .resource-heart,
.news-panel .resource-head img,
.news-panel .about-title img {
  image-rendering: auto;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 18px;
  align-items: stretch;
}

.hero-stage {
  position: relative;
  margin-top: 18px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent calc(100% - 70px),
    #8fc31e calc(100% - 70px),
    #8fc31e 100%
  );
}

.hero-stage > * {
  grid-column: 1;
  grid-row: 1;
}

.heroine-banner {
  display: block;
  width: 100%;
  max-width: 1600px;
  height: auto;
  margin: 0 auto;
  align-self: end;
  justify-self: center;
  z-index: 0;
  pointer-events: none;
}

.hero-stage .news-panel {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  align-self: start;
}

.about-copy {
  max-width: 720px;
}

.about-copy h1 {
  margin: 0 0 4px;
  color: var(--rose);
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 rgba(180, 60, 100, 0.18);
}

.about-title {
  margin: 0 auto 6px;
  padding: 0;
  line-height: 0;
  text-shadow: none;
}

.about-title img {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto;
  image-rendering: auto;
}

.about-copy p {
  margin: 0;
  color: var(--ink);
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
}

.about-copy em {
  color: var(--rose);
  font-style: normal;
  font-weight: 800;
}

.game-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  margin: 0;
}

.game-card {
  --accent: var(--rose);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 18px;
  border: 4px solid var(--accent);
  border-radius: 4px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 14%, #ffffff) 0%,
    color-mix(in srgb, var(--accent) 4%, #fefcfa) 100%);
  color: var(--ink);
  text-decoration: none;
  box-shadow: inset 0 0 0 2px #ffffff, 0 4px 10px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 90%, #000000);
  box-shadow: inset 0 0 0 2px #ffffff, 0 6px 14px color-mix(in srgb, var(--accent) 40%, transparent);
  outline: none;
}

.game-art {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  width: 100%;
  min-height: 130px;
}

.game-logo {
  position: relative;
  z-index: 1;
  width: 88%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(120, 80, 54, 0.2));
}

.news-board {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 18px 12px;
  border: 4px solid #f5a3c2;
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fef5fa 0%, #fde8f0 100%);
  box-shadow: inset 0 0 0 2px #ffffff, 0 4px 10px rgba(220, 130, 160, 0.22);
  text-align: left;
  display: flex;
  flex-direction: column;
}

.news-decor {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 2px 0;
}

.news-decor img {
  width: 14px;
  height: auto;
  opacity: 0.65;
  image-rendering: pixelated;
}

.news-decor-top {
  margin-bottom: 8px;
}

.news-decor-bottom {
  margin-top: 10px;
}

.news-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd0e1 0%, #f5a3c2 100%);
  color: #ffffff;
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(160, 50, 90, 0.4);
}

.news-title .title-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(160, 50, 90, 0.3));
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  min-height: 0;
}

.news-entry {
  display: grid;
  grid-template-columns: 32px 64px 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin-bottom: 0;
  border: 2px solid #fbdce8;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  color: #5e3a4a;
  min-height: 0;
}

.news-entry span {
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-entry:last-child {
  margin-bottom: 0;
}

.news-entry .mail-icon {
  width: 28px;
  height: auto;
  image-rendering: pixelated;
}

.news-entry time {
  color: #e85a8e;
  font-family: 'MaruGothic', 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.news-entry span {
  line-height: 1.35;
}

@media (max-width: 980px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

.resource-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  min-height: 0;
}

.resource-entry {
  --accent: var(--rose);
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 4px;
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 40%, #f7c8da);
}

.resource-entry:last-child {
  border-bottom: none;
}

.resource-heart {
  display: block;
  width: 44px;
  height: auto;
  flex-shrink: 0;
}

.resource-heads {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  flex: 1 1 0;
  min-width: 0;
}

.resource-head {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 50%, #f7c8da);
  background: #ffffff;
  flex-shrink: 0;
  transition: transform 160ms ease, border-color 160ms ease;
}

.resource-head img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.resource-head:hover,
.resource-head:focus-visible {
  transform: scale(1.18);
  border-color: var(--accent);
  outline: none;
  z-index: 1;
}

/* Coming-soon heads: grayed, non-clickable (page doesn't exist yet). */
.resource-head.coming-soon {
  cursor: default;
  opacity: 0.45;
  border-style: dashed;
}
.resource-head.coming-soon img {
  filter: grayscale(1);
}
.resource-head.coming-soon:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 50%, #f7c8da);
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .series-main {
    width: min(100% - 18px, 1180px);
  }

  .hero-stage {
    margin-top: 58px;
  }

  .window-tabs {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: -16px -16px 0;
    background: var(--blue);
    border: 5px solid var(--blue);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 10px 16px 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: none;
  }

  .window-tabs::-webkit-scrollbar {
    display: none;
  }

  .window-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    max-width: 160px;
    width: auto;
    height: 54px;
    min-width: 0;
    padding: 6px 14px;
    border: 2px solid color-mix(in srgb, var(--accent) 70%, #d8c2af);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
  }

  .window-tab:hover,
  .window-tab:focus-visible {
    height: 62px;
    border-color: var(--accent);
  }

  .window-tab img {
    max-height: 40px;
  }

  .news-panel {
    padding: 16px;
  }

  .window-bar {
    margin: 0 -16px;
    border-radius: 0;
  }

  .game-picker {
    grid-template-columns: 1fr;
  }
}
