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

html, body {
  height: 100%;
  font-family: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  overflow: hidden;
  background: #2d4a1e;
  user-select: none;
}

.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url("assets/bg.jpg") center / cover no-repeat, #3f6b2c;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Logo ---------- */
.logo {
  position: absolute;
  top: 2vh;
  left: 2vw;
  width: clamp(56px, 8vw, 96px);
  height: clamp(56px, 8vw, 96px);
  border-radius: 24%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
  z-index: 6;
  transition: transform .2s;
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08); /* hide the white corners of the source icon */
}
.logo:hover { transform: scale(1.06) rotate(-3deg); }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  top: 2.2vh;
  right: 2vw;
  display: flex;
  align-items: center;
  gap: 2.4vw;
  z-index: 5;
}

.res {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(20, 20, 20, 0.72);
  border-radius: 999px;
  height: clamp(30px, 6vh, 44px);
  min-width: clamp(110px, 12vw, 170px);
  padding: 0 18px 0 clamp(34px, 4.5vw, 54px);
  color: #fff;
  font-size: clamp(16px, 2.2vw, 24px);
}

.res-icon {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(40px, 5vw, 58px);
  height: clamp(40px, 5vw, 58px);
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.4));
}

.plus {
  position: absolute;
  left: clamp(14px, 2vw, 26px);
  bottom: -4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(#7be043, #2fa31a);
  border: 2px solid #fff;
  color: #fff;
  font-size: 16px;
  line-height: 15px;
  text-align: center;
  z-index: 2;
}

.res-val { margin-left: auto; letter-spacing: 1px; }

.timer {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-30%);
  background: rgba(20,20,20,.75);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: clamp(11px, 1.3vw, 15px);
}

.close {
  width: clamp(36px, 5vw, 50px);
  height: clamp(36px, 5vw, 50px);
  border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 40% 35%, #fff1e2, #f2d4b6);
  color: #9b5236;
  font-family: inherit;
  font-size: clamp(18px, 2.4vw, 26px);
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.35);
  transition: transform .15s;
}
.close:hover { transform: scale(1.08) rotate(90deg); }

/* ---------- Shop ---------- */
.shop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 13vh;
  padding-bottom: 12vh;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, clamp(140px, 14.2vw, 220px));
  gap: clamp(10px, 1.8vw, 24px);
}

.card {
  position: relative;
  aspect-ratio: 145 / 160;
  background: linear-gradient(#fff8ec 0%, #fdeedd 45%, #f9dcbc 100%);
  border-radius: 18px;
  border: 2px solid #f3c99b;
  box-shadow:
    inset 0 -4px 0 #eebc8a,
    inset 0 2px 0 #fff,
    0 5px 10px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8% 8%;
  animation: pop .45s cubic-bezier(.3,1.6,.5,1) both;
  overflow: visible;
}

/* the curved "pocket" line seen in the reference */
.card::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 31%;
  height: 22%;
  border-top: 2px solid #f1d2ad;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  pointer-events: none;
}

.card-img {
  height: 38%;
  width: 92%;
  margin-top: -6%;
  object-fit: contain;
  filter: saturate(1.15);
  position: relative;
  z-index: 1;
}

.amount {
  display: flex;
  align-items: center;
  gap: 6%;
  margin-top: 6%;
  font-size: clamp(20px, 2.5vw, 34px);
  color: #c128c9;
  -webkit-text-stroke: 1px #fff;
  text-shadow: 0 2px 0 #7a1580, 0 3px 3px rgba(0,0,0,.2);
  position: relative;
  z-index: 1;
}
.amount img {
  width: clamp(26px, 3vw, 40px);
}

.free-btn {
  margin-top: auto;
  width: 100%;
  height: 27%;
  border: none;
  border-radius: 14px;
  background: linear-gradient(#8dee4a 0%, #49c41f 50%, #2c9c12 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.6),
    inset 0 -4px 0 #1e7a0b,
    0 3px 0 #1a6509;
  color: #fff;
  font-family: inherit;
  font-size: clamp(20px, 2.5vw, 34px);
  text-shadow: 0 2px 0 #1c6c0a, 0 0 2px #1c6c0a;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .1s, filter .2s;
}
.free-btn::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shine 3s infinite;
}
.free-btn:hover { filter: brightness(1.08); }
.free-btn:active { transform: translateY(3px) scale(.97); }
.free-btn.claimed {
  background: linear-gradient(#cfcfcf, #9d9d9d);
  box-shadow: inset 0 -4px 0 #7d7d7d, 0 3px 0 #666;
  text-shadow: 0 2px 0 #666;
  cursor: default;
}
.free-btn.claimed::after { display: none; }

/* ---------- Tabs ---------- */
.tabs {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 4;
}

.tab {
  width: clamp(120px, 13vw, 200px);
  height: clamp(44px, 9vh, 64px);
  border: none;
  border-radius: 16px 16px 0 0;
  font-family: inherit;
  font-size: clamp(16px, 2vw, 24px);
  text-transform: uppercase;
  font-variant: small-caps;
  cursor: pointer;
  background: linear-gradient(#d7ad8a, #b98a68);
  color: #5a3320;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35);
  transition: background .2s;
}
.tab.active {
  background: linear-gradient(#fff9ef, #fbe9d4);
  color: #c8781c;
  -webkit-text-stroke: .5px #8a4a10;
  text-shadow: 0 2px 0 #f5c56a;
}

/* ---------- Toast & fly ---------- */
.toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.5);
  background: rgba(30,10,40,.85);
  color: #fff;
  padding: 16px 32px;
  border-radius: 20px;
  font-size: clamp(22px, 3vw, 36px);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.3,1.6,.5,1);
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.fly {
  position: fixed;
  width: 34px;
  z-index: 20;
  pointer-events: none;
  transition: transform .8s cubic-bezier(.5,-0.3,.7,1), opacity .8s;
}

.bump { animation: bump .3s; }

@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shine { 0% { left: -60%; } 40%, 100% { left: 130%; } }
@keyframes bump { 50% { transform: scale(1.25); } }

/* ---------- Mobile portrait ---------- */
@media (max-width: 640px) {
  .logo { width: 44px; height: 44px; top: 6px; left: 6px; border-width: 2px; }
  .topbar {
    left: 0; right: 0; top: 12px;
    padding-left: 60px !important;
    justify-content: center;
    gap: 22px;
    padding: 0 52px 0 18px;
  }
  .res { min-width: 0; flex: 1; max-width: 120px; padding: 0 10px 0 30px; font-size: 15px; height: 30px; }
  .res-icon { width: 38px; height: 38px; left: -12px; }
  .plus { width: 16px; height: 16px; font-size: 13px; line-height: 12px; left: 10px; }
  .close { position: absolute; right: 8px; top: -4px; width: 36px; height: 36px; font-size: 18px; }
  .scene { height: 100dvh; }
  .shop {
    width: 100%;
    padding: 70px 0 90px;
    overflow-y: auto;
    align-items: flex-start;
  }
  .grid { grid-template-columns: repeat(2, 43vw); gap: 12px; }
  .amount, .free-btn { font-size: 22px; }
  .tabs { position: fixed; }
}

