:root {
  --bg-1: #fff8e8;
  --bg-2: #ffd8b1;
  --ink: #182025;
  --paper: #fffdf7;
  --accent: #ff6b35;
  --accent-2: #0f8b8d;
  --line: #1d2a38;
  --ok: #2f9e44;
  --warn: #d9480f;
  --shadow: 0 14px 0 #1d2a38;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: radial-gradient(circle at 20% 20%, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border: 3px solid var(--line);
  border-radius: 18px;
  opacity: 0.2;
  z-index: -1;
}

.shape-a {
  width: 240px;
  height: 240px;
  left: -60px;
  top: 80px;
  transform: rotate(12deg);
}

.shape-b {
  width: 220px;
  height: 220px;
  right: -70px;
  bottom: 70px;
  transform: rotate(-16deg);
}

main {
  width: min(1100px, 92vw);
  margin: 16px auto 20px;
  animation: rise 350ms ease-out;
}

.debug-panel {
  margin-top: 16px;
  padding: 12px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: rgba(24, 32, 37, 0.94);
  color: #f8f9fa;
  box-shadow: 0 10px 0 rgba(29, 42, 56, 0.45);
}

.debug-panel h3 {
  margin-bottom: 8px;
  color: #ffd166;
}

.debug-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.debug-log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
}

.debug-entry {
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.debug-entry strong {
  display: block;
  margin-bottom: 4px;
  color: #8ecae6;
}

.global-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.global-title {
  margin-bottom: 4px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #4b2d1d;
  text-shadow: 0 1px 0 #e8d7bf;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-logo {
  width: 72px;
  height: 36px;
  object-fit: contain;
}

.global-title-wrap p {
  margin: 0;
}

.global-title-wrap .subtle {
  max-width: min(58vw, 320px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.volume-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.se-btn {
  min-width: 96px;
  color: #4f46e5;
  background: #f1f1f0;
}

.volume-line input[type="range"] {
  width: 110px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, #6a5ae0 0 var(--volume, 0%), #cfcfcf var(--volume, 0%) 100%);
}

.volume-line input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.volume-line input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  background: #6a5ae0;
  margin-top: -4px;
}

.volume-line input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.volume-line input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #6a5ae0;
}

.volume-line input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  background: #6a5ae0;
}

#audio-volume-value {
  min-width: 42px;
  text-align: right;
  font-weight: 700;
  color: #3b4db8;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

h1,
h2,
h3 {
  font-family: "Arial Black", "Impact", sans-serif;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

.panel {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.center {
  text-align: center;
}

.home-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.hero {
  grid-column: 1 / -1;
  background: linear-gradient(130deg, #ffeccf, #fff9ec 60%);
}

.hero-catalog {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(15, 139, 141, 0.14), transparent 42%),
    linear-gradient(130deg, #fff8e8, #fff3df 55%, #ffe8c9);
}

.hero-logo-wrap {
  position: relative;
}

.hero-logo {
  width: 100%;
  max-width: 540px;
  display: block;
  object-fit: contain;
  aspect-ratio: 2.35 / 1;
  margin: 0 auto;
}

.hero-copy h1 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: 0.06em;
  color: #4b2d1d;
  text-shadow: 0 1px 0 #e8d7bf;
  margin-bottom: 6px;
}

.hero-copy p {
  font-size: 0.96rem;
  line-height: 1.48;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hero-tags span {
  display: inline-block;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
}

.home-card {
  background: linear-gradient(160deg, #fffdf8, #fff6e8);
}

.home-card,
.hero {
  padding: 16px;
}

.hero p {
  margin: 8px 0;
}

.badge {
  display: inline-block;
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  margin-bottom: 10px;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 50px;
}

.pass-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid #9fb4c2;
  border-radius: 8px;
  background: #f8fbfd;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.pass-toggle-btn.is-hidden {
  background: #eef3f7;
}

.eye-icon {
  display: block;
  width: 18px;
  height: 12px;
  border: 2px solid #3d5968;
  border-radius: 999px;
  position: relative;
}

.eye-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3d5968;
  transform: translate(-50%, -50%);
}

.pass-toggle-btn.is-hidden .eye-icon::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 22px;
  height: 2px;
  background: #3d5968;
  transform: translateY(-50%) rotate(-28deg);
  transform-origin: center;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row > * {
  flex: 1;
  min-width: 100px;
}

.btn {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--accent);
}

.btn.secondary {
  background: var(--accent-2);
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 320px 1fr;
  align-items: start;
}

.sidebar .room-code {
  display: inline-block;
  max-width: 100%;
  font-size: 1.4rem;
  font-family: "Arial Black", "Impact", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.players {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.players li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #b7b7b7;
}

.phase-chip {
  display: inline-block;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.86rem;
}

.product {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.product img {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.timer {
  font-family: "Arial Black", "Impact", sans-serif;
  font-size: 1.3rem;
}

.warn {
  color: var(--warn);
}

.ok {
  color: var(--ok);
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.review-stars {
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: #f59f00;
  margin: 4px 0 6px;
}

.review-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.review-text {
  white-space: pre-wrap;
  margin: 0;
}

.star-input {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.star-btn {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #c0c4c8;
  cursor: pointer;
  padding: 2px;
}

.star-btn.active {
  color: #f59f00;
  text-shadow: 0 1px 0 #d89000;
}

.rating-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.rate-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.rate-btn.active {
  background: var(--accent);
  transform: translateY(-1px);
}

.helpful-btn {
  margin-top: 10px;
}

.helpful-btn.active {
  background: var(--accent-2);
  color: #fff;
  transform: translateY(-1px);
}

.mvp {
  border: 3px solid var(--accent);
  background: #fff4ea;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.rank-table th,
.rank-table td {
  border-bottom: 1px solid #b7b7b7;
  text-align: left;
  padding: 6px 4px;
}

.subtle {
  opacity: 0.75;
}

.alert {
  margin-top: 10px;
  color: var(--warn);
  min-height: 1.4rem;
}

@media (max-width: 860px) {
  .global-header {
    flex-direction: column;
    align-items: stretch;
  }

  .global-controls {
    justify-content: flex-start;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .hero-catalog {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .product {
    grid-template-columns: 1fr;
  }
}
