* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(1200px 600px at 50% -10%, #16233b 0%, rgba(22, 35, 59, 0) 60%), #0b0e14;
  color: #e8edf5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

.game-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
}

.brand {
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .logo {
  color: #2f80ed;
}

.back-link {
  color: #8a97ab;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.back-link:hover {
  color: #e8edf5;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen[hidden] {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4cd787, #34c56f);
  color: #05130b;
  font-weight: 800;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-primary:active {
  transform: translateY(1px);
}

#screen-intro {
  justify-content: center;
}

.intro-card {
  background: #171d29;
  border: 1px solid #262f3f;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
}

.intro-emoji {
  font-size: 46px;
}

.intro-card h1 {
  font-size: 30px;
  margin: 6px 0 12px;
}

.intro-lead {
  color: #8a97ab;
  line-height: 1.6;
  font-size: 15px;
}
.intro-lead strong {
  color: #e8edf5;
}
.intro-lead .hot {
  color: #4cd787;
  font-weight: 700;
}
.intro-lead .cold {
  color: #f0616b;
  font-weight: 700;
}

.intro-rules {
  list-style: none;
  text-align: left;
  margin: 20px auto;
  max-width: 340px;
  display: grid;
  gap: 10px;
  color: #8a97ab;
  font-size: 14px;
}
.intro-rules strong {
  color: #e8edf5;
}

.lifetime {
  color: #5f6b7e;
  font-size: 12px;
  margin-bottom: 18px;
  min-height: 16px;
}

.play-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 14px;
}

.wallet {
  font-size: 28px;
  font-weight: 900;
  color: #4cd787;
  letter-spacing: -0.02em;
}

.spent {
  color: #8a97ab;
  font-size: 13px;
  font-weight: 600;
}

.deck {
  position: relative;
  height: 460px;
  margin-bottom: 20px;
}

.gcard {
  position: absolute;
  inset: 0;
  background: #171d29;
  border: 1px solid #262f3f;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  user-select: none;
  touch-action: none;
  will-change: transform;
  overflow: hidden;
}
.gcard.leaving {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gcard-cat {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a97ab;
  background: #1e2532;
  border: 1px solid #262f3f;
  border-radius: 20px;
  padding: 5px 12px;
}

.gcard-emoji {
  font-size: 78px;
  text-align: center;
  margin: 26px 0 18px;
}

.gcard-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.gcard-teaser {
  color: #8a97ab;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  margin-top: 14px;
}

.gcard-foot {
  margin-top: auto;
  text-align: center;
  color: #5f6b7e;
  font-size: 13px;
  font-weight: 600;
}

.stamp {
  position: absolute;
  top: 26px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 10px;
  border: 3px solid;
  opacity: 0;
  text-transform: uppercase;
}

.stamp.donate {
  left: 22px;
  transform: rotate(-14deg);
  color: #4cd787;
  border-color: #4cd787;
}

.stamp.skip {
  right: 22px;
  transform: rotate(14deg);
  color: #f0616b;
  border-color: #f0616b;
}

.amount-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.amount-btn {
  border: 2px solid #262f3f;
  background: #171d29;
  color: #e8edf5;
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.amount-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #4cd787;
}
.amount-btn:active:not(:disabled) {
  transform: translateY(0);
}
.amount-btn.skip {
  color: #8a97ab;
}
.amount-btn.skip:hover:not(:disabled) {
  border-color: #8a97ab;
}
.amount-btn.big {
  color: #e2b93b;
}
.amount-btn.big:hover:not(:disabled) {
  border-color: #e2b93b;
  background: rgba(226, 185, 59, 0.08);
}
.amount-btn:not(.skip):not(.big):hover:not(:disabled) {
  background: rgba(76, 215, 135, 0.1);
}
.amount-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.swipe-hint {
  text-align: center;
  color: #5f6b7e;
  font-size: 12px;
  margin-top: 12px;
}

#screen-results {
  justify-content: flex-start;
  padding-top: 8px;
}

.results {
  text-align: center;
}

.result-verdict {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.result-verdict.good {
  color: #4cd787;
  background: rgba(76, 215, 135, 0.14);
}

.result-verdict.meh {
  color: #e2b93b;
  background: rgba(226, 185, 59, 0.14);
}

.result-verdict.bad {
  color: #f0616b;
  background: rgba(240, 97, 107, 0.14);
}

.result-headline {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.1;
}

.result-headline.good {
  color: #4cd787;
}

.result-headline.bad {
  color: #f0616b;
}

.result-sub {
  color: #8a97ab;
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.5;
}

.accrual {
  background: #171d29;
  border: 1px solid #262f3f;
  border-radius: 14px;
  padding: 16px;
  margin: 22px 0;
}

.accrual-title {
  font-size: 12px;
  color: #8a97ab;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: left;
}

.accrual-chart {
  position: relative;
}
.accrual-chart svg {
  width: 100%;
  height: 150px;
  display: block;
  overflow: visible;
}
.accrual-chart .zero-line {
  stroke: #5f6b7e;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.accrual-chart .accrual-area-good {
  fill: rgba(76, 215, 135, 0.16);
}
.accrual-chart .accrual-area-bad {
  fill: rgba(240, 97, 107, 0.16);
}
.accrual-chart .accrual-line-good {
  fill: none;
  stroke: #4cd787;
  stroke-width: 2.5;
}
.accrual-chart .accrual-line-bad {
  fill: none;
  stroke: #f0616b;
  stroke-width: 2.5;
}
.accrual-chart .accrual-axis {
  fill: #5f6b7e;
  font-size: 10px;
}

.breakdown {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  text-align: left;
}

.b-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #171d29;
  border: 1px solid #262f3f;
  border-left-width: 4px;
  border-radius: 12px;
  padding: 12px 14px;
}
.b-item.pos {
  border-left-color: #4cd787;
}
.b-item.neg {
  border-left-color: #f0616b;
}
.b-item.zero {
  border-left-color: #5f6b7e;
}
.b-item.skipped {
  opacity: 0.55;
  border-left-color: #262f3f;
}

.b-emoji {
  font-size: 26px;
  flex-shrink: 0;
}

.b-main {
  flex: 1;
  min-width: 0;
}

.b-name {
  font-weight: 700;
  font-size: 14px;
}

.b-note {
  color: #8a97ab;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 3px;
}

.b-study {
  font-size: 12px;
}

.b-study a {
  color: #2f80ed;
  text-decoration: none;
}
.b-study a:hover {
  text-decoration: underline;
}

.b-flow {
  text-align: right;
  flex-shrink: 0;
}

.b-in {
  color: #5f6b7e;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.b-amount {
  font-weight: 800;
  font-size: 15px;
  text-align: right;
  flex-shrink: 0;
}

.b-amount.pos {
  color: #4cd787;
}

.b-amount.neg {
  color: #f0616b;
}

.b-amount.zero {
  color: #8a97ab;
}

.b-amount.skipped {
  color: #5f6b7e;
}

@media (max-width: 400px) {
  .deck {
    height: 420px;
  }
  .gcard-emoji {
    font-size: 62px;
  }
  .result-headline {
    font-size: 36px;
  }
}