:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body.pcMode {
  background: #fff;
}

.pcNotice {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}

.pcNoticeBox {
  width: min(520px, 100%);
  padding: 22px 18px;
  border: 2px solid #2563eb;
  border-radius: 14px;
  color: #2563eb;
  text-align: center;
  background: #fff;
}

.pcNoticeMain {
  font-size: 18px;
  font-weight: 800;
}

.pcNoticeSub {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(37, 99, 235, 0.75);
  line-height: 1.4;
}

button {
  font: inherit;
  touch-action: manipulation;
}

.app {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.screen {
  position: relative;
  height: 100%;
  width: 100%;
}

.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}

.overlay {
  position: absolute;
  inset: 0;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom))
    calc(16px + var(--safe-left));
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.enterButton {
  position: absolute;
  left: calc(50% - 10px);
  top: calc(62% + -5px);
  transform: translate(-50%, -50%);
  z-index: 20;
  border: 0;
  background: transparent;
  color: #000000;
  padding: 0;
  border-radius: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: none;
}

.enterButton.blink {
  animation: enterBlink 350ms ease-in-out 3;
}

@keyframes enterBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.lotteryBtn {
  width: 100%;
  border: 0;
  background: #fff;
  color: #111;
  padding: 14px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.lotteryBtn:active {
  transform: scale(0.99);
}

.rankBtn {
  width: 100%;
  border: 0;
  background: #fff;
  color: #111;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.rankBtn:active {
  transform: scale(0.99);
}

.resultActions {
  width: min(520px, calc(100% - 100px));
  margin-bottom: 50px;
  display: flex;
  gap: 12px;
}

.resultActions > button {
  flex: 1 1 0;
}

.resultText {
  display: none;
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-align: center;
  max-width: calc(100% - 40px);
}

.rankOverlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
}

.rankBox {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 18px 16px 14px;
}

.rankTitle {
  font-size: 18px;
  font-weight: 900;
  color: #111;
  text-align: center;
  margin-bottom: 14px;
  cursor: pointer;
}

.rankList {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.rankItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 700;
}

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

.rankItemIcon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.rankItem.active {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.rankItemRight {
  color: rgba(17, 17, 17, 0.55);
  font-weight: 700;
  font-size: 13px;
}

.rankItem.active .rankItemRight {
  color: rgba(37, 99, 235, 0.9);
}

.rankClose {
  width: 100%;
  border: 0;
  background: #2563eb;
  color: #fff;
  padding: 12px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
}

.rankClose:active {
  transform: scale(0.99);
}

.card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 14px 14px 10px;
  backdrop-filter: blur(6px);
}

#quizOverlay .card {
  transform: translateY(-100px);
}

.progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #333;
  margin-bottom: 10px;
}

.questionTitle {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: #111;
  margin: 0 0 12px;
}

.options {
  display: grid;
  gap: 10px;
}

.optionBtn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.3;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.optionKey {
  flex: 0 0 auto;
  min-width: 28px;
  font-weight: 800;
}

.optionText {
  flex: 1 1 auto;
  word-break: break-word;
}

.optionBtn:active {
  transform: scale(0.99);
}

.optionBtn.selected {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.optionBtn:disabled {
  opacity: 0.95;
}

.quizBrand {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(17, 17, 17, 0.55);
}

.hidden {
  display: none !important;
}

.centerOverlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.loadingBox {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  color: #111;
  text-align: center;
}
