:root {
  color-scheme: light;
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "Meiryo",
    system-ui,
    sans-serif;
  --ink: #1f2430;
  --muted: #667085;
  --panel: #fffdf7;
  --line: #d8dbe5;
  --read: #2f80ed;
  --thanks: #e05587;
  --next: #169b7e;
  --ban: #d04444;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 230, 132, 0.38), transparent 28%),
    linear-gradient(135deg, #f6f8ff 0%, #fff7ee 48%, #eefaf6 100%);
}

button {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game-card {
  width: min(100%, 500px);
  height: min(900px, calc(100vh - 36px));
  min-height: 620px;
  display: grid;
  grid-template-rows: auto minmax(110px, 18%) 1fr minmax(110px, 18%) auto;
  overflow: hidden;
  border: 2px solid #232838;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(31, 36, 48, 0.18);
}

.hud {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-bottom: 2px solid #232838;
  background: #ffffff;
}

.stat,
.meter-block {
  min-width: 0;
}

.stat span,
.meter-block span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 1.4rem;
  line-height: 1;
}

.meter {
  height: 12px;
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid #222838;
  border-radius: 999px;
  background: #f0f1f5;
}

.meter i {
  display: block;
  width: 78%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f36b6b, #ffd45f, #50c878);
  transition: width 0.18s ease;
}

.meter.ending i {
  width: 12%;
  background: linear-gradient(90deg, #7aa8ff, #48d3a3);
}

.arena {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.78)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(36, 40, 56, 0.04) 35px 36px);
  touch-action: none;
}

.streamer {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  pointer-events: none;
}

.avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #fff;
  box-shadow: 0 2px 8px rgba(36, 40, 56, 0.14);
}

.streamer p,
.streamer strong {
  margin: 0;
}

.streamer p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.streamer strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}

.comment {
  position: absolute;
  z-index: 3;
  min-width: 92px;
  max-width: 168px;
  min-height: 40px;
  padding: 8px 10px 11px;
  border: 2px solid #242838;
  border-radius: 8px;
  color: #1f2430;
  cursor: grab;
  text-align: left;
  background: #fff;
  box-shadow: 0 6px 0 rgba(36, 40, 56, 0.12);
  user-select: none;
  touch-action: none;
  will-change: transform;
}

.comment span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.comment i {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef4;
}

.comment i::after {
  content: "";
  display: block;
  width: var(--life, 100%);
  height: 100%;
  border-radius: inherit;
  background: #50c878;
}

.comment.dragging {
  z-index: 9;
  cursor: grabbing;
  scale: 1.04;
}

.comment.warning {
  animation: wiggle 0.32s linear infinite;
}

.comment.warning i::after {
  background: #f2b84b;
}

.comment.danger {
  border-color: #d04444;
  color: #8f1f1f;
}

.comment.danger i::after {
  background: #d04444;
}

.comment.normal {
  max-width: 138px;
  color: #3f4657;
  background: #f8f9fb;
}

.comment.otsu {
  border-color: #4a8fe7;
  background: #edf5ff;
}

.comment.superchat {
  min-width: 132px;
  border-color: #ff5a5f;
  background: linear-gradient(135deg, #ffe173, #ff8aa1);
  box-shadow: 0 0 18px rgba(255, 90, 95, 0.36), 0 7px 0 rgba(170, 45, 73, 0.22);
}

.comment.member {
  border-color: #7d61d4;
  background: #f1ecff;
}

.comment.late {
  border-style: dashed;
  border-color: #169b7e;
  background: #eafff8;
}

.comment.troll {
  border-color: #b3261e;
  color: #7d1212;
  background: repeating-linear-gradient(135deg, #ffe6e4 0 9px, #ffd2ce 9px 18px);
}

.good-pop,
.bad-pop,
.explode {
  pointer-events: none;
  animation: pop 0.18s ease forwards;
}

.bad-pop,
.explode {
  animation-name: burst;
}

.paused {
  opacity: 0.45;
}

.dropzone-row {
  background: #ffffff;
}

.dropzone {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 110px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 16px 18px;
  border: 0;
  color: #1f2430;
  background: #fff;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.top-dropzone {
  border-bottom: 2px solid #232838;
}

.top-dropzone .dropzone {
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.82)),
    url("./assets/ban-backdrop.png") center / cover;
}

.bottom-dropzone {
  border-top: 2px solid #232838;
}

.dropzone span {
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-weight: 900;
}

.dropzone.read.armed,
.dropzone.read:hover {
  background: color-mix(in srgb, var(--read) 16%, white);
  box-shadow: inset 0 0 0 3px var(--read);
}

.dropzone.ban.armed,
.dropzone.ban:hover {
  background: color-mix(in srgb, var(--ban) 16%, white);
  box-shadow: inset 0 0 0 3px var(--ban);
}

.dropzone small {
  max-width: 100%;
  color: var(--muted);
  font-size: clamp(0.72rem, 2.6vw, 0.82rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.dropzone.ban {
  color: var(--ban);
}

.dropzone.read {
  color: var(--read);
}

.footer-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #d8dbe5;
  color: #3d4353;
  font-size: 0.86rem;
  font-weight: 900;
  background: #fafbff;
}

.overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 253, 247, 0.92);
}

.overlay.hidden {
  display: none;
}

.overlay h1,
.overlay h2,
.overlay p {
  margin: 0;
}

.overlay h1,
.overlay h2 {
  font-size: clamp(1.45rem, 5.6vw, 2.15rem);
  line-height: 1.05;
}

.start-visual,
.result-image {
  width: min(100%, 310px);
  max-height: 118px;
  object-fit: cover;
  border: 2px solid #d8dbe5;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 36, 48, 0.12);
}

.result-image {
  max-height: 104px;
}

.overlay p {
  max-width: 330px;
  color: #4b5565;
  font-weight: 700;
  line-height: 1.45;
}

.difficulty-picker {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}

.difficulty-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.difficulty-picker label {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 6px;
  border: 2px solid #d8dbe5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.difficulty-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.difficulty-picker label:has(input:checked) {
  border-color: #232838;
  background: #f2f7ff;
  box-shadow: inset 0 0 0 2px #7aa8ff;
}

.difficulty-picker span {
  font-weight: 900;
}

.difficulty-picker small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.primary-button {
  min-width: 148px;
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid #232838;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  background: #232838;
  box-shadow: 0 5px 0 #0e111b;
}

.primary-button:active {
  translate: 0 3px;
  box-shadow: 0 2px 0 #0e111b;
}

.result-grid {
  width: min(100%, 340px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.result-grid div {
  padding: 10px;
  border: 1px solid #d8dbe5;
  border-radius: 8px;
  background: #fff;
}

.result-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.result-grid dd {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 900;
}

@keyframes wiggle {
  0%,
  100% {
    rotate: 0deg;
  }

  50% {
    rotate: 1.5deg;
  }
}

@keyframes pop {
  to {
    opacity: 0;
    scale: 1.22;
  }
}

@keyframes burst {
  to {
    opacity: 0;
    scale: 0.78;
    rotate: -5deg;
  }
}

@media (max-width: 420px) {
  .shell {
    padding: 0;
  }

  .game-card {
    width: 100%;
    height: 100vh;
    min-height: 560px;
    border-width: 0;
    border-radius: 0;
  }

  .hud {
    gap: 8px;
    padding: 12px;
  }

  .dropzone {
    min-height: 70px;
  }
}
