/* Mailbox (#/mail, screens/mail.js) + gift sheets (gift-sheets.js: gift code, share / invite). Frames come from the UI kit
   (gameui.js framed → .gu-f-*); the gu-flat-* fallbacks below only matter while art is missing. Portrait first (375 px). */

/* ---------- reward tiles + chips (shared) ---------- */
.gf-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.gf-item { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.gf-item-n { font-size: 13px; font-weight: 600; color: #F6D77A; text-shadow: 0 1px 0 #000; }
.gf-item-l { font-size: 11px; color: var(--text-2); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-item.title .gf-item-l { white-space: normal; color: #F6D77A; }
.gf-chips { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.gf-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-1); }

/* ---------- sheets ---------- */
.gf-sheet { display: grid; gap: 10px; padding: 10px; margin: -2px -4px 0; }
.gf-sheet.gu-flat-dialog { background: linear-gradient(180deg, #1B2230, #12161D); border: 2px solid #3A4456; }
.gf-plate { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 10px; }
.gf-plate.gu-flat-plate { background: linear-gradient(180deg, #2A3242, #1A1F29); border-bottom: 2px solid #E3A72F; }
.gf-plate-ic { display: flex; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.gf-plate-t { margin: 0; font-size: 19px; text-shadow: 0 2px 0 rgba(0,0,0,.7); }
.gf-lead { margin: 0; }
.gf-code-box { display: flex; padding: 6px 10px; }
.gf-code-box.gu-flat-slot { background: #0B0E13; border: 2px solid #3A4456; }
.gf-code-in { width: 100%; min-height: 48px; background: transparent; border: 0; outline: none; color: #F6D77A; text-align: center;
  font: 600 22px var(--font-num); letter-spacing: .14em; text-transform: uppercase; }
.gf-code-in::placeholder { color: #5D6573; letter-spacing: .06em; font-size: 16px; }
.gf-msg { min-height: 20px; font-size: 13px; text-align: center; }
.gf-msg.warn { color: #F08A5D; }
.gf-go { min-height: 48px; font-size: 16px; }
.gf-win { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 12px 10px; animation: gf-pop .35s ease-out; }
.gf-win .gf-items { width: 100%; }
.gf-win-t { font: 600 18px var(--font-head); letter-spacing: .06em; color: #F6D77A; }
.gf-win p { margin: 0; }
@keyframes gf-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
:root.reduced .gf-win { animation: none; }

.gf-card { display: grid; gap: 8px; padding: 10px 12px; }
.gf-card p { margin: 0; }
.gf-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gf-claim { min-height: 44px; }
.gf-sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gf-sbtn { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 48px; padding: 4px 10px; font-weight: 600; }
.gf-brand { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 2px solid rgba(0,0,0,.55); border-radius: 6px;
  color: #fff; font: 700 11px var(--font-head); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.2); }
.gf-sbtn[data-share="facebook"] .gf-brand { font-size: 18px; font-family: Georgia, serif; }
.gf-code-show { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 10px; background: rgba(0,0,0,.35); border: 1px dashed #5D6573; }
.gf-code-show b { font-size: 20px; letter-spacing: .16em; color: #F6D77A; }
.gf-count { font-size: 15px; color: #6FDDFF; }
.gf-fine { margin: 0; text-align: center; }
.gf-loading { padding: 24px; text-align: center; }

/* ---------- mailbox screen ---------- */
.ml-screen { padding-bottom: 24px; }
.ml-all { min-height: 40px; padding: 0 12px; font-size: 13px; }
.ml-list { display: grid; gap: 8px; }
.ml-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 72px; padding: 8px 10px; text-align: left; color: var(--text-1); cursor: pointer; }
.ml-row.gu-flat-card { background: linear-gradient(180deg, #1E2532, #161B24); border: 2px solid #323B4B; }
.ml-row.unread.gu-flat-card { border-color: #E3A72F; }
.ml-row.claimed { opacity: .72; }
.ml-row:active { transform: scale(.985); }
.ml-row-b { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ml-row-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ml-row-t b { font: 600 15px/1.3 var(--font-head); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 0 #000; }
.ml-row.unread .ml-row-t b { color: #F6D77A; }
.ml-row-s { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-row-r { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.ml-row-go { flex: none; }
.ml-tag { font-size: 11px; color: #6FDDFF; white-space: nowrap; }
.ml-tag.warn { color: #F08A5D; }
.ml-tag.ok { color: #7EE0AE; }
.ml-env { position: relative; flex: none; display: inline-flex; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); }
.ml-env.read .sprite, .ml-env.read img { filter: saturate(.55) brightness(.85); }
.ml-env.done .sprite, .ml-env.done img { filter: grayscale(1) brightness(.7); }
.ml-env.new { animation: ml-bob 2.4s ease-in-out infinite; }
:root.reduced .ml-env.new { animation: none; }
@keyframes ml-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.ml-env-gift { position: absolute; right: -6px; bottom: -6px; display: flex; }
.ml-empty { display: grid; justify-items: center; gap: 6px; padding: 24px 12px; text-align: center; }
.ml-titles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ml-title { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 12px; color: #F6D77A; background: rgba(0,0,0,.4); border: 1px solid #6B5A2A; }
.ml-promo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ml-promo-c { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px; text-align: left; color: var(--text-1); cursor: pointer; }
.ml-promo-c.gu-flat-card { background: linear-gradient(180deg, #1E2532, #161B24); border: 2px solid #323B4B; }
.ml-promo-c > span:last-child { display: grid; gap: 1px; min-width: 0; }
.ml-promo-c b { font: 600 14px var(--font-head); }
.ml-foot { margin-top: 12px; text-align: center; }

.ml-letter { display: grid; gap: 10px; padding: 12px; margin: -2px -4px 0; }
.ml-letter.gu-flat-dialog { background: linear-gradient(180deg, #232B39, #151A22); border: 2px solid #3A4456; }
.ml-letter-top { display: flex; align-items: center; gap: 12px; }
.ml-letter-h { min-width: 0; display: grid; gap: 2px; }
.ml-letter-h h2 { font-size: 18px; color: #F6D77A; text-shadow: 0 2px 0 rgba(0,0,0,.7); }
.ml-letter-body { white-space: pre-line; line-height: 1.6; padding: 10px 12px; background: #E9DFC8; color: #2A2418; border: 2px solid #8A7650;
  box-shadow: inset 0 0 0 2px #F6EEDB, 0 3px 0 rgba(0,0,0,.45); font-size: 14.5px; }
.ml-att { display: grid; gap: 8px; padding: 8px 10px; }
.ml-att.gu-flat-slot { background: #0B0E13; border: 2px solid #3A4456; }
.ml-att-h { font: 600 13px var(--font-head); color: var(--text-2); }
.ml-note { margin: 0; }
.ml-exp { text-align: center; color: #6FDDFF; }
.ml-exp.warn { color: #F08A5D; }
.ml-claim { min-height: 50px; font-size: 16px; }
.ml-done { display: flex; justify-content: center; }

/* HUD mail button: five event buttons still fit at 375 px */
.hud-events:has(.hud-mail) .hud-ev { width: 44px; }
.gf-new { display: inline-flex; align-items: center; flex: none; padding: 0 6px; min-height: 18px; font: 700 10px var(--font-head); letter-spacing: .06em;
  color: #2A1A00; background: linear-gradient(180deg, #FFE08A, #E3A72F); border: 1px solid #7A5410; box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.set-gifts { margin-bottom: 12px; }
