:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
  background: #101116;
  color: #f7f7fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #171923, #0d0e12);
}

.qr-app {
  width: min(100% - 28px, 680px);
  margin: auto;
  padding: 24px 0 calc(48px + env(safe-area-inset-bottom));
}

header { margin-bottom: 18px; }
h1 { margin: 8px 0; font-size: clamp(1.8rem, 7vw, 2.5rem); }
h2 { margin-top: 0; font-size: 1.16rem; }
p { line-height: 1.6; color: #c9cbd4; }

.panel {
  margin: 14px 0;
  padding: 20px;
  border: 1px solid #30333f;
  border-radius: 18px;
  background: #1b1d26;
  box-shadow: 0 12px 30px #0004;
}

.scan-guide {
  margin: 0 0 14px;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.reader {
  position: relative;
  display: none;
  overflow: hidden;
  width: 100%;
  min-height: 300px;
  border-radius: 16px;
  background: #000;
}

.reader.live { display: block; }

.reader video {
  display: block;
  width: 100%;
  min-height: 300px;
  max-height: 68vh;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(68%, 300px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 4px solid #ffd34e;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px #0007;
  pointer-events: none;
}

.status {
  min-height: 26px;
  margin-bottom: 0;
  text-align: center;
}

.status.error { color: #ffb0b0; font-weight: 800; }

.button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.primary { background: #ffd34e; color: #17120a; }

.game {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.game-label { color: #ffd34e; font-weight: 800; }
.balls { display: flex; flex-wrap: wrap; gap: 6px; }
.ball { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #343746; font-weight: 750; }
.ball.match { background: #ffe16e; color: #17120a; outline: 3px solid #fff; }
.ball.bonus { background: #b886ff; color: #160d20; outline: 3px solid #ead9ff; }
.game-result { color: #d9dbe4; font-size: .82rem; font-weight: 800; }
.game-result.prize { color: #ffe16e; }
.winning-line { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 10px 0; }
