* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #05080a;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e8f2ec;
  padding: 30px 16px;
}

#wrap {
  width: 100%;
  max-width: 680px;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#topbar h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 1px;
  color: #34d399;
  text-shadow: 0 0 14px rgba(52, 211, 153, 0.5);
}

#coinsDisplay {
  font-size: 16px;
  font-weight: 700;
  background: #0d1712;
  border: 1px solid #1f3d2e;
  border-radius: 20px;
  padding: 6px 14px;
  color: #f4c430;
}

.screen.hidden {
  display: none;
}

.screen h2 {
  font-size: 16px;
  color: #9fd9bd;
  letter-spacing: 0.5px;
  margin: 18px 0 10px;
}

#progressRow {
  margin-bottom: 16px;
}

#progressBarTrack {
  height: 8px;
  border-radius: 4px;
  background: #10231a;
  overflow: hidden;
  margin-bottom: 6px;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f4c430, #ffe066);
  transition: width 0.4s ease;
}

#progressText {
  font-size: 12px;
  color: #8fb9a4;
}

#homeActions {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
}

.actionCol {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

button {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  color: #05080a;
  background: #34d399;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) {
  background: #6ee7b8;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.inlineMsg {
  min-height: 18px;
  font-size: 12px;
  color: #ff8a8a;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.inlineMsg.show {
  opacity: 1;
}

#countryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.countryCard {
  --c1: #34d399;
  --c2: #1f3d2e;
  position: relative;
  background: linear-gradient(155deg, color-mix(in srgb, var(--c1) 22%, #0d1712), #0d1712 65%);
  border: 2px solid var(--c1);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
  overflow: hidden;
}

.countryCard:hover {
  transform: translateY(-2px);
}

.countryCard.complete {
  box-shadow: 0 0 16px color-mix(in srgb, var(--c1) 70%, transparent);
}

.countryFlag {
  width: 36px;
  height: 24px;
  border-radius: 3px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.countryName {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.countryProgress {
  font-size: 12px;
  color: #9fd9bd;
}

.stickerGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.sticker {
  --c1: #34d399;
  --c2: #1f3d2e;
  position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c1) 20%, #0d1712), #0d1712 65%);
  border: 2px solid var(--c1);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  overflow: hidden;
}

.sticker::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent color-mix(in srgb, var(--c1) 55%, #0d1712) transparent transparent;
}

.sticker.missing {
  --c1: #3a4a42;
  opacity: 0.55;
}

.sticker.missing .stickerIcon {
  filter: grayscale(1);
}

.stickerIcon {
  font-size: 26px;
  margin-bottom: 6px;
}

.stickerName {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  min-height: 14px;
}

.stickerSub {
  font-size: 10px;
  color: #9fd9bd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stickerCount {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #f4c430;
}

.sellStickerBtn {
  width: 100%;
  margin-top: 8px;
  padding: 6px 4px;
  font-size: 11px;
}

#albumHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
}

#albumHeader h2 {
  margin: 0;
  flex: 1;
}

#albumBackBtn,
#dupesBackBtn {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  background: #12271c;
  color: #9fd9bd;
  border: 1px solid #1f3d2e;
}

#albumBackBtn:hover,
#dupesBackBtn:hover {
  background: #1a3527;
}

#albumCountryProgress {
  font-size: 13px;
  color: #9fd9bd;
}

#dupesBackBtn {
  margin-top: 16px;
  max-width: 160px;
}

#dupesHint {
  font-size: 12px;
  color: #8fb9a4;
  margin: 0 0 12px;
}

#emptyDupesMsg {
  color: #8fb9a4;
  font-size: 13px;
}

.packStickerRow {
  display: grid;
}

#packStickerRow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.peelSlot {
  position: relative;
  min-height: 120px;
}

.peelBack {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, #12271c, #0d1712 60%);
  border: 2px dashed #2a4a38;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #4a6a56;
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform-origin: top left;
}

.peelBack::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  to { transform: translateX(120%); }
}

.peelBack.peeled {
  opacity: 0;
  transform: rotate(-25deg) translate(-30%, -20%) scale(0.7);
}

.peelSlot .sticker {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.6) rotate(-6deg);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.peelSlot .sticker.landed {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.sticker.newFlash {
  animation: newPulse 1s ease 2;
}

@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 10px color-mix(in srgb, var(--c1) 60%, transparent); }
  50% { box-shadow: 0 0 26px color-mix(in srgb, var(--c1) 95%, transparent); }
}

.dupeTag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f4c430;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 5px;
  border-radius: 4px;
}

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 6, 0.9);
  z-index: 10;
}

#overlay.hidden {
  display: none;
}

#overlayCard {
  text-align: center;
  padding: 30px;
}

#overlayTitle {
  font-size: 28px;
  color: #f4c430;
  text-shadow: 0 0 18px rgba(244, 196, 48, 0.7);
  margin-bottom: 8px;
}

#overlayMsg {
  color: #c3e8d5;
  margin-bottom: 20px;
}

#overlayCloseBtn {
  max-width: 200px;
  margin: 0 auto;
}
