:root {
  --pkm-yellow: #fff6cc;
  --pkm-blue: #2a75bb;
  --pkm-red: #ff3b30;
  --pkm-white: #ffffff;
  --pkm-gray: #2b3a67;
  --pkm-light: #f7f9fc;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body.pkm-bg {
  min-height: 100svh;
  margin: 0;
  color: var(--pkm-gray);
  font-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif;
  background: linear-gradient(135deg, #eaf5ff 0%, #fff6f6 50%, #fffbe6 100%);
  background-attachment: fixed;
  position: relative;
}
@supports not (height: 100svh) {
  body.pkm-bg { min-height: 100vh; }
}
body.pkm-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      600px 300px at 20% 15%,
      rgba(42, 117, 187, 0.25),
      transparent 60%
    ),
    radial-gradient(
      500px 250px at 80% 85%,
      rgba(255, 59, 48, 0.2),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 50% 50%,
      rgba(255, 255, 255, 0.35),
      transparent 65%
    );
  mix-blend-mode: screen;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.logo {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ff9500;
  text-align: center;
  margin: 12px 0 20px;
  text-shadow: 0 2px 12px rgba(42, 117, 187, 0.25);
}

.card {
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 32px rgba(42, 117, 187, 0.18);
}

.card-title {
  font-size: 19px;
  font-weight: 500;
  color: #ffa6d0;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.22),
    rgba(173, 216, 230, 0.22)
  );
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  box-shadow: 0 6px 18px rgba(42, 117, 187, 0.18);
}

.btn-group {
  display: flex;
  margin-top: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.18),
    rgba(173, 216, 230, 0.18)
  );
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: 0 6px 18px rgba(42, 117, 187, 0.18);
  transition: transform 0.05s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:hover {
  box-shadow: 0 10px 24px rgba(173, 216, 230, 0.26);
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.18),
    rgba(173, 216, 230, 0.18)
  );
  color: #69b7ff;
}
.btn-secondary {
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.18),
    rgba(173, 216, 230, 0.18)
  );
  color: #8f83ff;
}
.btn-accent {
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.18),
    rgba(173, 216, 230, 0.18)
  );
  color: #ffbc5d;
}
.btn-ghost {
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.18),
    rgba(173, 216, 230, 0.18)
  );
  color: #1f2d3d;
}

.input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  font-size: 20px;
  outline: none;
  background: rgba(240, 244, 248, 0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
  border-color: rgba(42, 117, 187, 0.8);
  box-shadow: 0 0 0 3px rgba(42, 117, 187, 0.22);
}

.msg {
  font-size: 16px;
  color: var(--pkm-gray);
  line-height: 1.5;
  text-align: center;
}
.status {
  line-height: 1.8;
}
.hidden {
  display: none;
}

.image-wrap {
  display: grid;
  place-items: center;
  margin-top: 12px;
  min-height: 220px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 20px rgba(42, 117, 187, 0.16);
}
.image-wrap img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.image-wrap img.visible {
  opacity: 1;
}

.link {
  display: inline-block;
  margin-top: 16px;
  color: var(--pkm-blue);
  text-decoration: none;
  font-weight: 600;
}

/* Admin modal (glass, light pink) */
.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}
.link-back {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--pkm-blue);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(42, 117, 187, 0.12);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}
.icon-btn svg {
  width: 24px;
  height: 24px;
}
.icon-accent {
  color: var(--pkm-red);
}
.top-action {
  margin-left: auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
}
.modal-card {
  width: min(520px, 92%);
  border-radius: var(--radius);
  padding: 32px;
  background: #ffe1c1;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--pkm-blue);
  text-align: center;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .container {
    max-width: 96%;
    padding: 16px;
  }
  .card {
    padding: 16px;
  }
  .btn-group {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    padding: 14px 22px;
    font-size: 18px;
  }
  .logo {
    font-size: 24px;
  }
}

.big-round-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 32px);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 182, 193, 0.85),
    rgba(173, 216, 230, 0.75)
  );
  color: #ffbc5d;
  font-size: 20px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 36px rgba(42, 117, 187, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  z-index: 1001;
}
@media (max-width: 480px) {
  .big-round-btn {
    width: 100px;
    height: 100px;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    font-size: 18px;
  }
}
.big-round-btn:active {
  transform: translateX(-50%) scale(0.98);
}
.big-round-btn:disabled {
  opacity: 0.5;
  filter: grayscale(0.2);
  cursor: not-allowed;
  box-shadow: none;
}

/* Badges for status/info chips */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  box-shadow: 0 6px 16px rgba(42, 117, 187, 0.12);
}
.badge-btn {
  font-size: 18px;
}
.badge-primary {
  color: var(--pkm-blue);
  background: linear-gradient(
    135deg,
    rgba(173, 216, 230, 0.3),
    rgba(255, 182, 193, 0.25)
  );
}
.badge-info {
  color: #1f2d3d;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5),
    rgba(230, 237, 245, 0.45)
  );
}
.badge-success {
  color: #0f9d58;
  background: linear-gradient(
    135deg,
    rgba(200, 255, 220, 0.45),
    rgba(173, 216, 230, 0.25)
  );
}
.badge-warning {
  color: #ff9500;
  background: linear-gradient(
    135deg,
    rgba(255, 240, 200, 0.55),
    rgba(255, 182, 193, 0.2)
  );
}
.badge-danger {
  color: var(--pkm-red);
  background: linear-gradient(
    135deg,
    rgba(255, 210, 210, 0.55),
    rgba(255, 182, 193, 0.28)
  );
}
.badge-gray {
  color: var(--pkm-gray);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5),
    rgba(230, 237, 245, 0.45)
  );
}
.badge-status-started {
  background: linear-gradient(
    135deg,
    rgba(46, 204, 113, 0.55),
    rgba(173, 216, 230, 0.35)
  );
  color: #0f9d58;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 26px rgba(15, 157, 88, 0.28);
}

/* Glow card enhancement */
.glow-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 60px rgba(42, 117, 187, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Admin grid for two panels */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

/* Badge rows (split info by lines) */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}
.badge-row.compact {
  flex-wrap: nowrap;
  gap: 10px;
}
.winner-big {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 900;
  color: #ffbc5d;
  text-shadow: 0 2px 12px rgba(42, 117, 187, 0.18);
}
@media (max-width: 480px) {
  .winner-big {
    font-size: 24px;
  }
}
.card.flat {
  padding: 14px;
}

/* Large question display */
.question-lg {
  font-size: 28px;
  font-weight: 900;
  color: var(--pkm-blue);
  text-shadow: 0 2px 10px rgba(42, 117, 187, 0.18);
  margin-top: 10px;
}
@media (max-width: 480px) {
  .question-lg {
    font-size: 22px;
  }
}

/* Winner popup */
.win-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 240, 246, 0.45);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  z-index: 9999;
  animation: popFadeIn 0.25s ease;
}
.win-card-popup {
  width: min(520px, 92%);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 190, 210, 0.6);
  box-shadow: 0 18px 40px rgba(255, 105, 180, 0.18);
  text-align: center;
}
.win-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--pkm-blue);
  margin-bottom: 8px;
}
.win-name {
  font-size: 26px;
  font-weight: 900;
  color: #ffbc5d;
}

.pkm-bg.bg-151::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      600px 300px at 20% 15%,
      rgba(42, 117, 187, 0.25),
      transparent 60%
    ),
    radial-gradient(
      500px 250px at 80% 85%,
      rgba(255, 59, 48, 0.2),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 50% 50%,
      rgba(255, 255, 255, 0.35),
      transparent 65%
    );
  mix-blend-mode: normal;
}
body.pkm-bg.bg-151 {
  background: url("/img/bg_151.png") center/cover fixed no-repeat;
}
@keyframes popFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Page with bottom CTA safe area */
.has-bottom-cta .container {
  padding-bottom: 360px;
}
.bottom-spacer {
  height: 360px;
}
@media (max-width: 480px) {
  .has-bottom-cta .container {
    padding-bottom: 280px;
  }
  .bottom-spacer {
    height: 280px;
  }
}

/* Utilities & icons */
.gif-md {
  height: 28px;
  display: inline-block;
  vertical-align: middle;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.w-full {
  width: 100%;
}
.h-180 {
  height: 180px;
}
