* { box-sizing: border-box; }
body { margin: 0; background: #f2f2f2; color: #171717; font: 16px/1.5 Arial, sans-serif; }
header { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 20px 28px; }
header a { color: #171717; }
h1 { margin: 0; font-size: 28px; }
main { max-width: 1060px; margin: 0 auto; padding: 24px 28px 48px; }
.balance { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #5c331d; font-weight: bold; }
.coopenny-coin { display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border: 2px solid #c29563; border-radius: 50%; background: #925c35; color: #86ef7b; font-weight: 900; }
.pet-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pet-toolbar p { margin: 0; }
.pet-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 2px solid #3b2114; border-radius: 8px; background: #5c331d; color: #f0cfaa; font: bold 16px Arial, sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
.pet-button:hover { background: #78482b; }
.pet-button:disabled { cursor: default; opacity: .6; }
.pet-button.secondary { background: #fff; color: #171717; border-color: #171717; }
.pet-message { min-height: 24px; margin: 16px 0; }
.pet-packs, .pet-collection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.pet-card { min-width: 0; padding: 24px; border: 3px solid #171717; border-radius: 12px; background: #fff; text-align: center; }
.pet-card h2 { margin: 0 0 14px; font-size: 26px; }
.tier-standard { color: #16803b; }
.tier-unique { color: #2563eb; }
.tier-magic { color: #9333ea; }
.tier-mystic { color: #ea580c; }
.tier-kitty, .pet-pack-nav .tier-kitty { color: #d9bf32; text-shadow: 0 1px 0 #756320; }
.tier-beach, .pet-pack-nav .tier-beach { color: #b5efff; text-shadow: 0 1px 1px #3c6a7f; }
.tier-space, .pet-pack-nav .tier-space { color: #69e7ee; text-shadow: 0 1px 1px #316d7a; }
.tier-emoji, .pet-pack-nav .tier-emoji { color: #ffde32; -webkit-text-stroke: .6px #111; paint-order: stroke fill; text-shadow: 1px 0 #111,-1px 0 #111,0 1px #111,0 -1px #111; }
#rotating-pet-shop { margin-top:32px; padding-top:20px; border-top:3px solid #d8c8ac; text-align:center; scroll-margin-top:16px; }
#rotating-pet-shop > p { line-height:1.6; }
#rotating-pet-shop > p span[class^="tier-"] { font-weight:bold; }
#rotating-packs { grid-template-columns:minmax(0,1fr);max-width:520px;margin:24px auto 0; }
.rotation-timer { padding:16px; background:#fff4bd; border:2px solid #25231e; border-radius:12px; }
#rotation-countdown { white-space:nowrap;font-variant-numeric:tabular-nums;font-size:24px; }
.pack-pool li { min-width: 0; }
.pack-pool li span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.pet-pack-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.pet-pack-nav a { padding: 8px 12px; border: 2px solid currentColor; border-radius: 8px; background: #fff; color: #171717; font-weight: bold; text-decoration: none; }
.pet-pack-nav .tier-magic { color: #9333ea; }
.pet-pack-nav .tier-mystic { color: #ea580c; }
.tier-celestial, .pet-pack-nav .tier-celestial {
  color: #7c3aed;
  background-image: linear-gradient(90deg, #dc2626, #ea580c, #a16207, #16803b, #2563eb, #9333ea);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.pet-pack-nav .tier-celestial { margin: 0; }
.pet-card .tier-celestial { margin-left: auto; margin-right: auto; }
.pet-card { scroll-margin-top: 16px; }
.pack-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px auto; max-width: 320px; }
.pet-image { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.pack-preview .pet-image { height: auto; }
.pack-buy { width: 100%; margin: 14px 0; }
.pack-odds { color: #555; font-size: 14px; }
.pet-card details { margin-top: 8px; text-align: left; }
.pet-card summary { cursor: pointer; }
.pack-pool { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 12px 0 0; }
.pack-pool li { display: flex; align-items: center; gap: 8px; }
.pack-pool .pet-image { width: 38px; height: 38px; flex-shrink: 0; }
.pet-won { width: 440px; max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border: 3px solid #171717; border-radius: 18px; background: #fff; color: #171717; text-align: center; }
.pet-won::backdrop { background: rgb(0 0 0 / 60%); }
.pet-won h2 { margin: 0 0 18px; font-size: 42px; }
.pet-won h3 { margin: 14px 0 4px; font-size: 28px; }
.pet-won p { margin: 8px 0; }
.won-image { width: 180px; height: 180px; margin: 0 auto; }
.pack-actions{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.pack-actions .pack-buy{flex:1}.infect-open{font-size:13px;padding:9px 12px}.infect-dialog h2{font-size:28px}.infect-table{width:100%;border-collapse:collapse;margin:16px 0}.infect-table td{width:50%;padding:8px;border:1px solid #bbb;vertical-align:top}.infect-table h3{font-size:20px}.infect-table button{font-size:13px;padding:10px}.infect-warning{color:#bc1733;font-weight:bold}.infect-squares{display:grid;grid-template-columns:repeat(2,1fr);gap:15px;padding:16px}.infect-square{aspect-ratio:1;display:grid;place-items:center;font:bold 40px system-ui;border:6px solid transparent;border-radius:14px;color:#fff}.infect-square.red{background:#d83e52}.infect-square.green{background:#37ad58}.infect-square.highlight{border-color:#ffe600;box-shadow:0 0 18px #ffe600}
.tier-nuclear{color:#548000;font-weight:bold;text-shadow:0 0 5px #e9ff12}
.pack-reel { position: relative; overflow: hidden; height: 160px; border: 2px solid #49337c; border-radius: 12px; background: #e9e2ff; margin: 18px 0; }
.pack-reel::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: #e79d13; box-shadow: 0 0 9px #e79d13; }
.pack-reel-strip { display: flex; height: 100%; width: max-content; will-change: transform; }
.reel-pet { box-sizing: border-box; width: 120px; flex: 0 0 120px; padding: 16px 8px; display: flex; align-items: center; flex-direction: column; gap: 8px; border-right: 1px solid #c5b9e4; font-size: 13px; font-weight: bold; }
.reel-pet img { width: 90px; height: 90px; object-fit: contain; }
.won-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pet-collection { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.pet-collection .pet-image { width: 120px; height: 120px; margin: 0 auto 14px; }
.pet-collection .pet-card { padding: 18px; }
.pet-collection h2 { font-size: 20px; margin-bottom: 4px; }
.pet-collection .pet-button { width: 100%; margin-top: 14px; }
.pet-count { font-weight: normal; color: #555; }
.pet-tier { margin: 0; font-weight: bold; }
.equipped-pet { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 18px; border: 2px solid #171717; border-radius: 10px; background: #fff; margin-bottom: 24px; }
.equipped-pet .pet-image { width: 64px; height: 64px; }
.equipped-pet .pet-button { margin-left: auto; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  header { padding: 16px; gap: 14px; }
  main { padding: 16px 16px 40px; }
  .balance { font-size: 14px; }
  .pet-packs { grid-template-columns: 1fr; }
  .pet-collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pet-collection .pet-card { padding: 12px; }
  .pet-collection .pet-image { width: 100%; max-width: 120px; height: auto; }
}

.tier-hot{color:#c7350c;font-weight:bold;text-shadow:0 0 5px #ff9a36}
.infect-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.infect-table td{min-width:0;width:auto}.infect-table .pet-button{max-width:100%;white-space:normal}

.infect-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.infect-table td{width:auto;min-width:0}.infect-table button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
