body { background: var(--cream); color: var(--green); min-height: 100dvh; }

.sticky { position: sticky; top: 0; z-index: 10; }
.top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--green); color: var(--cream);
}
.top .logo { width: 48px; height: 48px; }
.titles { flex: 1; min-width: 0; }
.titles h1 { margin: 0; font-size: 1.6rem; line-height: 1; }
.titles p { margin: 2px 0 0; font-size: .8rem; opacity: .8; }
.count { font-size: 2.2rem; line-height: 1; color: var(--giallo); }
.count small { font-size: 1rem; color: var(--cream); opacity: .7; }

.drawn-strip {
  background: var(--green-2); color: var(--cream);
  padding: 8px 16px 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 6px 12px rgba(24,48,41,.18);
}
.strip { display: flex; gap: 8px; flex: 1; overflow: hidden; min-height: 70px; }
.strip .chip { width: 58px; flex: none; text-align: center; }
.strip .chip img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--salvia); display: block; margin: 0 auto; }
.strip .chip:first-child img { border: 3px solid var(--giallo); width: 56px; height: 56px; }
.strip .chip span { font-family: var(--display); font-size: .62rem; line-height: 1; display: block; margin-top: 2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.strip .empty-msg { font-size: .85rem; opacity: .75; align-self: center; }
.chip.fresh { animation: pop .5s ease; }
.link { background: none; border: 1px solid var(--salvia); color: var(--cream); border-radius: 999px;
  padding: 6px 10px; font-size: .75rem; flex: none; }

.prizes { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.prize-chip { font-family: var(--display); font-size: .95rem; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px; background: var(--verdino); color: var(--green); }
.prize-chip.won { background: var(--salvia); color: var(--cream); text-decoration: line-through; }

main { padding: 12px 16px 32px; max-width: 760px; margin: 0 auto; }
.panel { background: var(--paper); border-radius: 16px; padding: 24px 20px; text-align: center; border: 2px solid var(--green); }
.panel h2 { font-size: 2.4rem; margin: 0 0 4px; }
.fine { font-size: .78rem; opacity: .75; }
.btn-primary { background: var(--ocra); color: var(--green); border: 0; border-radius: 14px; padding: 14px 22px;
  font-size: 1.5rem; width: 100%; max-width: 360px; margin: 10px 0; }
.btn-primary:disabled { opacity: .5; }
.btn-ghost { background: none; border: 2px solid var(--green); color: var(--green); border-radius: 12px; padding: 10px 16px; width: 100%; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 2px solid var(--green); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--green); padding: 6px 14px; font-weight: 600; font-size: .85rem; }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--cream); }
.hint { font-size: .78rem; opacity: .7; }

.cards { display: grid; gap: 14px; }
.claim-btn { background: var(--terra); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px;
  font-family: var(--display); font-size: 1.05rem; letter-spacing: .04em; }
.card.mine-win { box-shadow: 0 0 0 4px var(--giallo); }

.sheet { border: 0; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; margin: auto auto 0; background: var(--paper); color: var(--green); max-height: 85dvh; }
.sheet::backdrop { background: rgba(24,48,41,.55); }
.sheet h2 { margin: 0 0 6px; font-size: 1.8rem; }
.claim-list { display: grid; gap: 8px; margin: 12px 0; }
.claim-list button { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 12px; padding: 12px 14px; text-align: left; }
.claim-list button b { font-family: var(--display); font-size: 1.4rem; font-weight: 400; }
.claim-list button small { opacity: .7; }
.claim-list button:disabled { opacity: .45; }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; margin: 10px 0 14px; }
.all-grid div { text-align: center; opacity: .25; }
.all-grid div.on { opacity: 1; }
.all-grid img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.all-grid span { font-family: var(--display); font-size: .6rem; display: block; line-height: 1; }

.foot { text-align: center; font-size: .7rem; opacity: .5; padding: 0 0 20px; }

@media (min-width: 640px) {
  .card-grid.classic .cell .nm { font-size: .7rem; }
  .cell .nm { font-size: .9rem; }
}
