:root {
  --kol-card: rgba(255, 255, 255, 0.92);
  --kol-line: rgba(255, 255, 255, 0.18);
  --kol-ink: rgba(31, 26, 36, 0.95);
  --kol-muted: rgba(31, 26, 36, 0.72);
  --kol-accent: #6b2d4a;
  --kol-accent-soft: rgba(107, 45, 74, 0.14);
  --kol-gold: #d4a853;
  --kol-wheel-bg: #1a1218;
}

.page--kol {
  width: 100%;
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kol-stage {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.kol-stage--game {
  max-width: min(100%, 820px);
}

.kol-stage--trophies {
  max-width: 920px;
}

.section--kol {
  width: 100%;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.section--kol-trophies {
  width: 100%;
  padding-top: 0.5rem;
  padding-bottom: 2.25rem;
  display: flex;
  justify-content: center;
}

.kol-head {
  margin-bottom: 1rem;
}

.kol-head .section__title {
  margin: 0 auto 0.35rem;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
}

.kol-subtitle {
  margin: 0 auto;
  max-width: 36rem;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
  line-height: 1.45;
}

.kol-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}

.kol-stat {
  min-width: 5.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--kol-accent-soft);
  border: 1px solid var(--kol-line);
}

.kol-stat__k {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.kol-stat__v {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--kol-gold);
}

.kol-empty {
  margin: 2rem auto;
  opacity: 0.8;
}

.kol-empty[hidden],
.kol-play[hidden],
.kol-result[hidden] {
  display: none !important;
}

.kol-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.kol-wheel-wrap {
  position: relative;
  width: min(92vw, 400px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.kol-wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px var(--kol-gold),
    0 0 0 8px rgba(212, 168, 83, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.45);
  background: var(--kol-wheel-bg);
}

.kol-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--kol-gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 2;
}

.kol-spin-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--kol-accent), #8f3d5e);
  box-shadow: 0 4px 18px rgba(107, 45, 74, 0.45);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.kol-spin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.kol-spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kol-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: var(--kol-card);
  color: var(--kol-ink);
  text-align: left;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  animation: kol-fade-in 0.35s ease;
}

@keyframes kol-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kol-result__cover {
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 0.65rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.kol-result__body {
  flex: 1;
  min-width: 10rem;
}

.kol-result__label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kol-muted);
}

.kol-result__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.3;
}

.kol-result__author {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--kol-muted);
}

.kol-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.kol-pill--link {
  background: var(--kol-accent);
  color: #fff;
}

.kol-pill--link:hover {
  background: #8f3d5e;
  color: #fff;
}

.kol-pill--secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--kol-line);
  color: inherit;
}

.kol-pill--secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.kol-trophies__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.kol-trophies__sub {
  margin: 0 auto 1rem;
  max-width: 32rem;
  font-size: 0.88rem;
  opacity: 0.78;
  line-height: 1.45;
}

.kol-trophies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.kol-trophy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--kol-line);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.kol-trophy:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 168, 83, 0.45);
}

.kol-trophy__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.kol-trophy__meta {
  padding: 0.45rem 0.5rem 0.55rem;
  text-align: left;
}

.kol-trophy__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kol-trophy__author {
  margin: 0.2rem 0 0;
  font-size: 0.65rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kol-trophies-empty {
  grid-column: 1 / -1;
  padding: 1.5rem;
  opacity: 0.75;
  font-size: 0.9rem;
}

.kol-trophies-nav[hidden] {
  display: none !important;
}

.kol-trophies-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kol-trophies-nav__info {
  font-size: 0.85rem;
  opacity: 0.8;
  min-width: 4rem;
}

@media (max-width: 768px) {
  .section--kol,
  .section--kol-trophies {
    align-items: stretch;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .section--kol-trophies {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .kol-stage,
  .kol-stage--game,
  .kol-stage--trophies {
    padding-left: 0;
    padding-right: 0;
  }

  .kol-head {
    margin-bottom: 0.75rem;
    padding: 0 0.15rem;
  }

  .kol-head .section__title {
    white-space: normal;
    font-size: clamp(1rem, 4.8vw, 1.35rem);
    line-height: 1.28;
    hyphens: auto;
  }

  .kol-subtitle {
    padding: 0 0.25rem;
    font-size: clamp(0.86rem, 3.6vw, 0.95rem);
  }

  .kol-stats {
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .kol-stat {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 0;
    padding: 0.4rem 0.5rem;
  }

  .kol-stat__v {
    font-size: 1.05rem;
  }

  .kol-wheel-wrap {
    width: min(94vw, 360px);
  }

  .kol-spin-btn {
    width: 100%;
    max-width: 20rem;
    min-height: 2.85rem;
  }

  .kol-result {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .kol-trophies {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .kol-trophies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }

  .kol-result {
    flex-direction: column;
    text-align: center;
  }

  .kol-result__body {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .section--kol {
    padding-top: 0.85rem;
  }

  .kol-play {
    gap: 1rem;
  }

  .kol-wheel-wrap {
    width: min(96vw, 320px);
  }

  .kol-pointer {
    border-left-width: 12px;
    border-right-width: 12px;
    border-top-width: 22px;
    top: -4px;
  }

  .kol-spin-btn {
    max-width: 100%;
    min-height: 2.75rem;
    font-size: 1rem;
    padding: 0.8rem 1.25rem;
  }

  .kol-result {
    padding: 0.9rem 0.85rem;
    border-radius: 0.85rem;
  }

  .kol-result__cover {
    width: 6.5rem;
    height: 6.5rem;
  }

  .kol-pill {
    width: 100%;
    min-height: 2.65rem;
  }

  .kol-trophies {
    gap: 0.55rem;
  }

  .kol-trophies-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .kol-trophies-nav__btn {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
  }

  .kol-trophies-nav__info {
    flex: 1 0 100%;
    order: -1;
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 360px) {
  .kol-stat__k {
    font-size: 0.62rem;
  }

  .kol-stat__v {
    font-size: 0.98rem;
  }

  .kol-wheel-wrap {
    width: min(98vw, 290px);
  }
}

@media (min-width: 721px) {
  .kol-trophies {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
