:root {
  color-scheme: dark;
  --ink: #f8f5ed;
  --ink-dark: #111111;
  --muted: #d8d0c5;
  --paper: #fff7e6;
  --line: #111111;
  --red: #e51024;
  --red-dark: #8d0714;
  --yellow: #ffd447;
  --green: #00a36c;
  --blue: #55d8ff;
  --violet: #b676ff;
  --shadow: 10px 10px 0 #111111;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background:
    linear-gradient(132deg, transparent 0 12%, rgba(255, 255, 255, 0.08) 12% 13%, transparent 13% 100%),
    linear-gradient(22deg, transparent 0 46%, rgba(255, 255, 255, 0.09) 46% 47%, transparent 47% 100%),
    radial-gradient(circle at 86% 12%, rgba(255, 212, 71, 0.26), transparent 15rem),
    linear-gradient(145deg, #050505 0%, #171717 42%, #bd0718 42% 68%, #080808 68% 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  inset: -12vh -10vw auto auto;
  width: 52vw;
  height: 70vh;
  background: var(--red);
  clip-path: polygon(18% 0, 100% 0, 78% 100%, 0 70%);
  opacity: 0.88;
}

body::after {
  left: -8vw;
  bottom: -14vh;
  width: 52vw;
  height: 52vh;
  background: #ffffff;
  clip-path: polygon(0 10%, 100% 36%, 70% 100%, 0 82%);
  opacity: 0.09;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 16px clamp(16px, 4vw, 42px);
  border-bottom: 4px solid #111111;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 18px 8px;
  color: #ffffff;
  background: var(--red);
  border: 3px solid #111111;
  box-shadow: 5px 5px 0 #ffffff;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  font-size: 1.02rem;
  font-weight: 1000;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  min-height: 38px;
  padding: 8px 14px;
  color: #111111;
  background: #ffffff;
  border: 3px solid #111111;
  border-radius: 3px;
  box-shadow: 4px 4px 0 var(--red);
  font-size: 0.92rem;
  font-weight: 1000;
  transform: skew(-9deg);
  white-space: nowrap;
}

.nav a:hover {
  color: #ffffff;
  background: var(--red);
  box-shadow: 4px 4px 0 #ffffff;
}

.form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 390px);
  gap: 28px;
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto;
}

.wish-panel,
.comment-panel,
.latest-panel,
.ranking-strip {
  position: relative;
  border: 4px solid #111111;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: #111111;
}

.wish-panel::before,
.comment-panel::before,
.latest-panel::before,
.ranking-strip::before {
  position: absolute;
  top: -16px;
  left: 18px;
  z-index: -1;
  width: 42%;
  height: 32px;
  background: var(--red);
  border: 4px solid #111111;
  transform: rotate(-2deg);
  content: "";
}

.wish-panel {
  padding: clamp(20px, 4vw, 38px);
}

.panel-heading,
.ranking-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.panel-heading > div,
.ranking-hero > div {
  min-width: 0;
  width: 100%;
}

.minya-avatar,
.ranking-minya {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 5px;
  border: 4px solid #111111;
  background: #ffffff;
  box-shadow: 6px 6px 0 var(--red);
  transform: rotate(-4deg);
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 7px;
  padding: 3px 9px;
  color: #ffffff;
  background: #111111;
  font-size: 0.75rem;
  font-weight: 1000;
  text-transform: uppercase;
  transform: skew(-8deg);
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 1000;
}

h1 {
  color: #111111;
  font-size: clamp(2.2rem, 4vw, 4rem);
  text-shadow: 4px 4px 0 rgba(229, 16, 36, 0.35);
}

h2 {
  color: #111111;
  font-size: 1.45rem;
}

.wish-form {
  display: grid;
  gap: 17px;
}

.wish-form label {
  display: grid;
  gap: 7px;
  color: #111111;
  font-weight: 1000;
}

.wish-form input,
.wish-form textarea {
  width: 100%;
  border: 3px solid #111111;
  border-radius: 3px;
  padding: 12px 13px;
  color: #111111;
  background: #ffffff;
  outline: none;
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.16);
}

.wish-form input:focus,
.wish-form textarea:focus {
  border-color: var(--red);
  box-shadow: 6px 6px 0 #111111;
}

.wish-form textarea {
  resize: vertical;
}

.toggle-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
  box-shadow: none;
}

.primary-button,
.star-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 3px solid #111111;
  border-radius: 3px;
  font-weight: 1000;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--red);
  box-shadow: 7px 7px 0 #111111;
  transform: skew(-8deg);
}

.primary-button:hover:not(:disabled) {
  background: #111111;
  box-shadow: 7px 7px 0 var(--red);
  transform: translateY(-2px) skew(-8deg);
}

.primary-button:disabled,
.star-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.comment-panel {
  align-self: stretch;
  overflow: hidden;
  padding: 26px;
}

.comment-panel::after {
  position: absolute;
  right: -42px;
  bottom: -30px;
  width: 160px;
  height: 100px;
  background: var(--red);
  clip-path: polygon(0 24%, 100% 0, 80% 100%, 22% 78%);
  content: "";
}

.comment-minya {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  margin: 0 auto 14px;
  filter: drop-shadow(8px 8px 0 #111111);
}

.comment-panel p:last-of-type {
  color: #252525;
  line-height: 1.75;
}

.comment-panel.is-active p:last-of-type {
  color: #111111;
  font-weight: 1000;
}

.comment-panel.is-error p:last-of-type {
  color: var(--red-dark);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 12px;
  padding: 6px 10px;
  color: #ffffff;
  background: #111111;
  border: 3px solid #111111;
  border-radius: 3px;
  box-shadow: 5px 5px 0 var(--red);
  font-weight: 1000;
}

.list-shell,
.ranking-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 34px auto;
}

.section-title {
  margin-bottom: 24px;
}

.section-title h1,
.ranking-hero h1 {
  color: #ffffff;
  text-shadow: 5px 5px 0 #111111, 8px 8px 0 var(--red);
}

.wish-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.wish-card,
.latest-item,
.rank-row {
  position: relative;
  border: 4px solid #111111;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 7px 7px 0 #111111;
  color: #111111;
}

.wish-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  transform: rotate(-0.4deg);
}

.wish-card:nth-child(2n) {
  transform: rotate(0.6deg);
}

.wish-card::before {
  position: absolute;
  top: -13px;
  right: 16px;
  width: 64px;
  height: 22px;
  background: var(--red);
  border: 3px solid #111111;
  transform: rotate(5deg);
  content: "";
}

.wish-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team {
  color: var(--red);
  font-weight: 1000;
}

.name {
  color: #444444;
  font-size: 0.9rem;
  font-weight: 800;
}

.wish-text {
  margin: 0;
  min-height: 3.5rem;
  line-height: 1.62;
  font-size: 1.05rem;
  font-weight: 1000;
}

.ai-comment {
  margin: 0;
  padding: 12px;
  border: 3px solid #111111;
  border-left: 10px solid var(--red);
  border-radius: 3px;
  color: #111111;
  background: #ffffff;
  line-height: 1.6;
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.16);
}

.star-button {
  justify-self: start;
  min-width: 116px;
  padding: 9px 14px;
  color: #111111;
  background: var(--yellow);
  box-shadow: 5px 5px 0 #111111;
}

.star-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--red);
  transform: translateY(-2px) rotate(-2deg);
}

.page-board {
  overflow: hidden;
  background: #070707;
}

.board-topbar {
  position: fixed;
  right: 0;
  left: 0;
  color: #ffffff;
  border-bottom-color: #111111;
  background: rgba(7, 7, 7, 0.94);
}

.board-topbar .brand,
.board-topbar .nav a {
  color: #ffffff;
}

.board-topbar .nav a {
  background: var(--red);
  box-shadow: 4px 4px 0 #ffffff;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  height: 100vh;
  padding-top: 78px;
}

.bamboo-stage {
  position: relative;
  overflow: hidden;
  border-right: 5px solid #111111;
  background:
    linear-gradient(125deg, transparent 0 18%, rgba(255, 255, 255, 0.12) 18% 20%, transparent 20% 100%),
    linear-gradient(24deg, transparent 0 52%, var(--red) 52% 70%, transparent 70% 100%),
    radial-gradient(circle at 78% 14%, rgba(255, 212, 71, 0.35), transparent 10rem),
    linear-gradient(180deg, #070707 0%, #191919 58%, #2d070c 100%);
}

.moon {
  position: absolute;
  top: 56px;
  right: 86px;
  width: 88px;
  aspect-ratio: 1;
  border: 4px solid #111111;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 7px 7px 0 #ffffff, 0 0 34px rgba(255, 212, 71, 0.58);
}

.starscape::before,
.starscape::after {
  position: absolute;
  inset: 8% 8% auto auto;
  width: 7px;
  height: 7px;
  background: #ffffff;
  box-shadow:
    -42vw 8vh #ffffff,
    -28vw 18vh var(--yellow),
    -12vw 9vh #ffffff,
    -52vw 42vh #ffffff,
    -22vw 54vh var(--yellow),
    -64vw 24vh #ffffff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  content: "";
}

.starscape::after {
  transform: translate(-110px, 80px) scale(0.72);
  opacity: 0.72;
}

.bamboo {
  position: absolute;
  bottom: -8vh;
  width: 22px;
  height: 92vh;
  border: 3px solid #111111;
  border-radius: 999px;
  background: linear-gradient(90deg, #005f43, #11ca82 48%, #004d36);
  box-shadow: 8px 0 0 rgba(0, 0, 0, 0.26);
  transform-origin: bottom;
}

.bamboo::before,
.bamboo::after {
  position: absolute;
  width: 190px;
  height: 36px;
  border: 3px solid #111111;
  border-radius: 100% 0;
  background: linear-gradient(90deg, #13d783, #00744d);
  content: "";
}

.bamboo::before {
  top: 18%;
  left: 7px;
  transform: rotate(-22deg);
}

.bamboo::after {
  top: 42%;
  right: 8px;
  transform: rotate(202deg);
}

.bamboo-one {
  left: 20%;
  transform: rotate(-7deg);
}

.bamboo-two {
  left: 47%;
  height: 102vh;
  transform: rotate(5deg);
}

.bamboo-three {
  left: 68%;
  height: 88vh;
  transform: rotate(-2deg);
}

.bamboo-wishes {
  position: absolute;
  inset: 0;
}

.bamboo-note {
  position: absolute;
  display: grid;
  gap: 4px;
  width: clamp(122px, 13vw, 172px);
  min-height: 86px;
  padding: 10px;
  border: 4px solid #111111;
  border-radius: 3px;
  color: #111111;
  box-shadow: 7px 7px 0 #111111;
  transform: rotate(-3deg);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 8% 100%);
}

.bamboo-note::before {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 3px;
  height: 20px;
  background: #ffffff;
  content: "";
}

.bamboo-note strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 1000;
}

.bamboo-note span {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.38;
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.bamboo-note.pink {
  background: #ff5a7a;
}

.bamboo-note.blue {
  background: var(--blue);
}

.bamboo-note.yellow {
  background: var(--yellow);
}

.bamboo-note.green {
  background: #35e38d;
}

.bamboo-note.violet {
  background: var(--violet);
}

.float-in {
  animation: floatIn 820ms cubic-bezier(0.2, 1.2, 0.22, 1) both;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(-36px) rotate(10deg) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-3deg) scale(1);
  }
}

.board-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(146deg, var(--red) 0 24%, transparent 24%),
    #ffffff;
}

.latest-panel,
.ranking-strip {
  box-shadow: 7px 7px 0 #111111;
  padding: 18px;
}

.latest-panel h1,
.ranking-strip h2 {
  display: inline-block;
  color: #ffffff;
  background: #111111;
  padding: 4px 10px;
  transform: skew(-6deg);
}

.latest-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.latest-item {
  padding: 13px;
  background: #ffffff;
}

.latest-item strong,
.latest-item span {
  color: var(--red);
}

.latest-item p {
  margin: 7px 0;
  line-height: 1.45;
  font-weight: 1000;
}

.latest-item span {
  display: block;
  line-height: 1.45;
  font-size: 0.9rem;
  font-weight: 800;
}

.ranking-hero {
  justify-content: center;
  margin: 38px 0 26px;
}

.ranking-list {
  display: grid;
  gap: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  background: #ffffff;
}

.rank-row:nth-child(odd) {
  transform: rotate(-0.35deg);
}

.rank-row:nth-child(even) {
  transform: rotate(0.35deg);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border: 3px solid #111111;
  border-radius: 3px;
  color: #ffffff;
  background: var(--red);
  box-shadow: 4px 4px 0 #111111;
  font-weight: 1000;
  transform: rotate(-8deg);
}

.large .rank-row:nth-child(1) .rank-number {
  color: #111111;
  background: var(--yellow);
}

.large .rank-row:nth-child(2) .rank-number {
  background: #555555;
}

.large .rank-row:nth-child(3) .rank-number {
  background: var(--red-dark);
}

.rank-main p {
  margin: 0 0 4px;
  line-height: 1.45;
  font-weight: 1000;
}

.rank-main span {
  color: #555555;
  font-size: 0.92rem;
  font-weight: 800;
}

.rank-row strong {
  white-space: nowrap;
  color: var(--red);
  font-size: 1.1rem;
  font-weight: 1000;
}

.rank-compact {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 10px;
  box-shadow: 5px 5px 0 #111111;
}

.rank-compact .rank-number {
  width: 30px;
}

.rank-compact p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  margin: 0;
  color: #333333;
  font-weight: 900;
}

.list-shell .empty,
.ranking-shell .empty {
  color: #ffffff;
  text-shadow: 3px 3px 0 #111111;
}

.latest-list .empty,
.ranking-strip .empty {
  color: #333333;
  text-shadow: none;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-shell,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .board-layout {
    height: auto;
    min-height: 100vh;
  }

  .bamboo-stage {
    min-height: 64vh;
  }

  .board-side {
    overflow: visible;
  }

  .panel-heading,
  .ranking-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 12px;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav a {
    padding-inline: 9px;
  }

  .brand,
  .nav a,
  .primary-button {
    transform: none;
    clip-path: none;
  }

  .wish-panel h1,
  .section-title h1,
  .ranking-hero h1 {
    font-size: 2.05rem;
  }

  .rank-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .rank-row strong {
    grid-column: 2;
  }
}
