.home-grid {
  display: grid;
  grid-template-columns: 14rem minmax(32rem, 1fr) 18rem;
  grid-template-areas: "menu main aside";
  gap: 1rem;
  align-items: start;
  padding: 2rem 1.5rem 3rem;
}

.home-menu {
  grid-area: menu;
  background: #9b9b9b;
  color: #111;
  padding: 1.25rem 1rem;
  border-radius: 1rem;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

.home-main {
  grid-area: main;
}

.home-aside {
  grid-area: aside;
}

.home-menu h2 {
  margin: 0 0 1rem;
  padding: .5rem 0;
  font-size: 1.15rem;
  letter-spacing: .08em;
}

.home-menu a {
  display: block;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  margin: .7rem 0;
  padding: .5rem .7rem;
  border-radius: .75rem;
  transition: background .2s ease;
}

.home-menu a:hover {
  background: rgba(0,0,0,.08);
}

.home-main {
  display: grid;
  gap: 1rem;
}

.site-brand {
  background: #7ccb00;
  border-radius: 1rem;
  padding: 1.5rem 1.2rem;
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.site-brand .site-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.1;
}

.site-brand .site-subtitle {
  margin-top: .75rem;
  font-size: 1rem;
  opacity: .95;
}

.banner-module {
  display: grid;
  gap: 1rem;
}

.banner-card {
  width: 100%;
  max-width: 100%;
  background: #071f42;
  border-radius: 1rem;
  padding: .9rem .9rem 1rem;
  color: #e8f7ff;
  font-family: 'Courier New', monospace;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  box-sizing: border-box;
  overflow: hidden;
}

.banner-card h3 {
  margin: 0 0 .55rem;
  font-size: .9rem;
  letter-spacing: .06em;
  color: #9bd4ff;
}

.banner-marquee {
  position: relative;
  overflow: hidden;
  min-height: 2.8rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .85rem;
  background: linear-gradient(90deg, rgba(0,0,0,.75), rgba(8,20,56,.95));
}

.banner-marquee-inner {
  display: flex;
  align-items: center;
  height: 100%;
}

.banner-marquee-content {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(.75rem, 1.6vw, .9rem);
  color: #b3f3ff;
  padding-right: 1rem;
  transform: translateX(100%);
}

.banner-metadata {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  color: #b8d3ff;
  font-size: .8rem;
}

.banner-metadata span {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.counter-panel,
.chara-panel {
  background: rgba(255,255,255,.95);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.counter-panel h3,
.chara-panel h3 {
  margin: 0 0 .8rem;
  font-size: 1.1rem;
}

.counter-display {
  display: flex;
  flex-wrap: nowrap;
  gap: .4rem;
  justify-content: center;
  align-items: center;
  margin: .5rem 0 1rem;
  white-space: nowrap;
  overflow: hidden;
}

.counter-digit {
  /* allow digits to shrink on narrow sidebars while keeping legibility */
  flex: 0 1 auto;
  min-width: 1.8rem;
  min-height: 2.8rem;
  background: #062b7a;
  color: #fff;
  font-family: 'OCR A Std', 'Courier New', monospace;
  font-size: clamp(1.0rem, 2.6vw, 1.6rem);
  line-height: 2.8rem;
  padding: 0 .35rem;
  text-align: center;
  border-radius: .45rem;
  box-shadow: inset 0 -4px 0 rgba(255,255,255,.11);
}

.visitor-status {
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: center;
  justify-items: center;
  gap: .4rem;
  margin-bottom: .75rem;
}

.visitor-label {
  color: #0066ff;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
}

.visitor-message {
  font-size: .95rem;
  color: #b3f3ff;
  padding: .5rem .8rem;
  background: rgba(3,20,40,.7);
  border-radius: .6rem;
  min-height: 2.6rem;
  text-align: center;
}

.counter-asset {
  display: block;
  margin: 1rem auto 0;
  max-width: 100%;
  border-radius: 1rem;
}

.chara-panel {
  display: grid;
  gap: 1rem;
}

.chara-frame {
  background: #ffb300;
  min-height: auto;
  max-height: 28rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
}

.cat-gif-placeholder {
  width: 100%;
  max-width: 22rem;
  background: linear-gradient(135deg, #ffd66b 0%, #ffb45a 100%);
  border-radius: 1.25rem;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cat-gif-placeholder img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 28rem;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

.cat-gif-placeholder::before {
  content: none;
}

.post-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.post-card {
  display: block;
  background: #ff0c8a;
  border-radius: 1rem;
  min-height: 11rem;
  color: #fff;
  text-decoration: none;
  padding: 1.25rem;
  box-shadow: 0 20px 35px rgba(255, 30, 160, 0.2);
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 42px rgba(255, 30, 160, 0.28);
}

.post-card .post-date {
  font-size: .88rem;
  color: rgba(255,255,255,.8);
  margin-bottom: .5rem;
}

.post-card .post-title {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.post-card .post-summary {
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: .95rem;
  line-height: 1.5;
  opacity: .96;
}

.more-link {
  text-align: center;
  margin-top: .5rem;
}

.more-link a {
  color: #ff0c8a;
  font-size: 1.35rem;
  text-decoration: none;
  font-weight: bold;
}

@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 14rem minmax(24rem, 1fr);
    padding: 1rem;
  }

  .site-brand,
  .banner-module,
  .post-cards,
  .counter-panel,
  .chara-panel,
  .home-aside {
    width: 100%;
  }

  .post-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .home-aside {
    display: none;
  }
}

@media (max-width: 860px) {
  .banner-card {
    padding: .8rem .8rem .9rem;
  }

  .banner-card h3 {
    font-size: .85rem;
  }

  .banner-marquee {
    min-height: 2.4rem;
  }

  .banner-marquee-content {
    font-size: clamp(.7rem, 1.4vw, .85rem);
    padding-right: .9rem;
  }

  .banner-metadata {
    margin-top: .6rem;
    gap: .5rem;
    font-size: .78rem;
  }

  .post-cards {
    grid-template-columns: 1fr;
    gap: .85rem;
  }
}

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

  .home-menu {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .home-menu h2 {
    width: 100%;
    font-size: 1.05rem;
  }

  .home-menu a {
    flex: 1 1 45%;
    margin: .35rem .25rem;
    padding: .45rem .6rem;
  }

  .banner-card {
    display: none;
  }

  .chara-frame {
    min-height: 14rem;
  }
}
