.gf-c-plain { --gf-box: #ececec; --gf-rib: #1b1b1b; }
.gf-c-party { --gf-box: #ffc21a; --gf-rib: #1b1b1b; }
.gf-c-heart { --gf-box: #e5383b; --gf-rib: #ffffff; }
.gf-c-night { --gf-box: #1d3fa8; --gf-rib: #ffffff; }

.gf-box { position: relative; display: block; width: 56px; height: 44px; margin-top: 10px; border-radius: 6px; background: var(--gf-box); }
.gf-box::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 18%; transform: translateX(-50%); background: var(--gf-rib); }
.gf-lid { position: absolute; left: -5px; right: -5px; top: -12px; height: 14px; border-radius: 4px; background: var(--gf-box); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.gf-lid::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 16.5%; transform: translateX(-50%); background: var(--gf-rib); }
.gf-lid::after { content: ""; position: absolute; left: 50%; top: -9px; width: 22px; height: 10px; margin-left: -11px; border: 3px solid var(--gf-rib); border-bottom: 0; border-radius: 12px 12px 0 0; }

.gf-tab { padding-bottom: 12px; }
.gf-tab .fr-h:first-child { margin-top: 6px; }
.gf-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.gf-sealed { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.gf-box-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 76px; padding: 0; border: 0; background: none; cursor: pointer; }
.gf-box-btn .gf-box { transition: transform .18s ease; }
.gf-box-btn:hover .gf-box, .gf-box-btn:focus-visible .gf-box { transform: translateY(-3px) rotate(-3deg); }
.gf-box-btn:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; border-radius: 10px; }
.gf-from { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; font-weight: 600; color: var(--white); text-decoration: none; }
.gf-from:hover { text-decoration: underline; }
.gf-sealed-acts { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.gf-sealed-acts .btn { width: 100%; justify-content: center; padding: 9px 12px; font-size: .9rem; }
.gf-ret { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font: 600 15px var(--body); cursor: pointer; }
.gf-ret:hover { color: var(--white); }

.gf-list { display: flex; flex-direction: column; }
.gf-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.gf-row:last-child { border-bottom: 0; }
.gf-art { position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--bg-raised); overflow: hidden; }
.gf-art img { width: 100%; height: 100%; object-fit: cover; }
.gf-art.is-deco img { width: 86%; height: 86%; object-fit: contain; }
.gf-art.is-coins img { width: 26px; height: 26px; object-fit: contain; }
.gf-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gf-row-n { font-size: .95rem; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gf-row-s { font-size: .82rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-row-s a { color: inherit; }
.gf-row-q { font-size: .86rem; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.gf-state { flex-shrink: 0; font-size: .82rem; color: var(--text-2); }

.gf-sw { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-2); cursor: pointer; user-select: none; }
.gf-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gf-sw i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #2a2a2a; transition: background .15s; }
.gf-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8a8a8a; transition: transform .15s, background .15s; }
.gf-sw input:checked + i { background: var(--btn); }
.gf-sw input:checked + i::after { transform: translateX(14px); background: #111; }
.gf-sw input:focus-visible + i { outline: 2px solid var(--text-2); outline-offset: 2px; }

.gf-modal { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .7); animation: gfFade .18s ease; }
.gf-modal[hidden] { display: none; }
@keyframes gfFade { from { opacity: 0; } }
.gf-dlg { width: 100%; max-width: 460px; max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.gf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.gf-title { min-width: 0; font-size: 1.1rem; font-weight: 700; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-x { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .06); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.gf-x:hover { color: var(--white); background: rgba(255, 255, 255, .12); }
.gf-seg { display: flex; }
.gf-seg .seg-btn { flex: 1; font-size: .9rem; padding: 8px 12px; }
.gf-pane { margin-top: 16px; }
.gf-pane[hidden], .gf-dlg > [hidden] { display: none; }
.gf-amt { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-input, var(--bg-raised)); }
.gf-amt:focus-within { border-color: var(--text-mute); }
.gf-amt input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--white); font-family: var(--display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.gf-amt input::-webkit-outer-spin-button, .gf-amt input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gf-amt input[type=number] { -moz-appearance: textfield; }
.gf-amt img { width: 22px; height: 22px; }
.gf-bal { margin-top: 8px; font-size: .84rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gf-bal.is-bad { color: #f87171; }
.gf-amt:has(+ .gf-bal.is-bad) { border-color: #ef4444; }

.gf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.gf-it { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 6px 6px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .14s, background .14s; }
.gf-it:hover { border-color: #3a3a3a; }
.gf-it.on { border-color: var(--white); background: #1a1a1a; }
.gf-it[disabled] { cursor: default; opacity: .5; }
.gf-it-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; background: #0b0b0b; overflow: hidden; }
.gf-it-art img { width: 100%; height: 100%; object-fit: cover; }
.gf-it.is-deco .gf-it-art img { width: 84%; height: 84%; object-fit: contain; }
.gf-it-n { margin-top: 3px; font-size: .8rem; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-it-s { font-family: var(--mono); font-size: .74rem; color: var(--text-2); }
.gf-it-f { font-size: .74rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gf-empty { padding: 18px 0 6px; font-size: .9rem; color: var(--text-2); line-height: 1.5; }
.gf-empty[hidden] { display: none; }

.gf-lbl { display: block; margin: 18px 0 8px; font-size: .86rem; font-weight: 600; color: var(--text); }
.gf-note { width: 100%; min-height: 64px; resize: none; font-size: .95rem; line-height: 1.45; }
.gf-note-c { margin-top: 4px; text-align: right; font-size: .76rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.gf-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gf-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised); color: var(--text-2); font: inherit; font-size: .8rem; cursor: pointer; }
.gf-card .gf-box { width: 30px; height: 22px; margin-top: 8px; border-radius: 4px; }
.gf-card .gf-lid { top: -7px; left: -3px; right: -3px; height: 8px; border-radius: 3px; }
.gf-card .gf-lid::after { display: none; }
.gf-card.on { border-color: var(--white); color: var(--white); }
.gf-sign { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: .9rem; color: var(--text); }
.gf-err { min-height: 20px; margin-top: 12px; font-size: .86rem; color: var(--danger); }
.gf-send { width: 100%; height: 48px; justify-content: center; margin-top: 4px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.gf-send img { width: 17px; height: 17px; filter: brightness(0); }
.gf-send[disabled] { opacity: 1; border-color: transparent; background: rgba(255, 255, 255, .08); color: var(--text-2); cursor: default; }
.gf-send[disabled] img { filter: brightness(0) invert(1); opacity: .5; }
.gf-dlg { position: relative; }
.gf-dlg.is-sent { height: auto; }
.gf-dlg.is-sent > :not(.gf-sentfx) { display: none; }
.gf-sentfx { padding: 70px 0 44px; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; border-radius: inherit; background: var(--bg-card); animation: gfFade .15s ease; }
.gf-sentfx .gf-box { width: 88px; height: 70px; border-radius: 9px; animation: gfFly .4s .1s cubic-bezier(.5, 0, .75, 0) forwards; }
.gf-sentfx .gf-lid { top: -18px; left: -7px; right: -7px; height: 20px; border-radius: 6px; }
.gf-sentfx .gf-lid::after { top: -14px; width: 32px; height: 15px; margin-left: -16px; border-width: 4px; }
.gf-sentfx-t { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; color: var(--white); animation: gfUp .25s .2s ease both; }
.gf-sentfx-t i { color: #22c55e; }
@keyframes gfFly { 0% { transform: none; } 30% { transform: translateY(8px) scale(1.06, .94); } 100% { transform: translateY(-170px) rotate(-14deg) scale(.6); opacity: 0; } }

.gf-open { position: fixed; inset: 0; z-index: 330; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .82); animation: gfFade .2s ease; }
.gf-stage { position: relative; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; }
.gf-stage > .gf-box { width: 150px; height: 118px; margin-top: 40px; border-radius: 12px; }
.gf-stage > .gf-box .gf-lid { top: -30px; left: -12px; right: -12px; height: 34px; border-radius: 8px; }
.gf-stage > .gf-box .gf-lid::after { top: -24px; width: 54px; height: 26px; margin-left: -27px; border-width: 7px; }
.gf-stage.is-shake > .gf-box { animation: gfShake .7s ease-in-out; }
.gf-stage.is-pop > .gf-box .gf-lid { animation: gfLid .55s cubic-bezier(.3, .7, .4, 1) forwards; }
.gf-stage.is-pop > .gf-box { animation: gfDrop .5s .25s ease forwards; }
@keyframes gfShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-7deg); }
    30% { transform: rotate(6deg); }
    45% { transform: rotate(-5deg); }
    60% { transform: rotate(4deg); }
    75% { transform: rotate(-2deg); }
}
@keyframes gfLid { to { transform: translate(40px, -140px) rotate(28deg); opacity: 0; } }
@keyframes gfDrop { to { transform: translateY(30px) scale(.9); opacity: 0; } }
.gf-conf { position: absolute; left: 50%; top: 90px; width: 0; height: 0; pointer-events: none; }
.gf-conf i { position: absolute; left: 0; top: 0; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: gfConf 1.1s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes gfConf {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}
.gf-rv { width: 100%; padding: 24px 20px 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); text-align: center; animation: gfUp .3s ease; }
.gf-rv[hidden] { display: none; }
@keyframes gfUp { from { opacity: 0; transform: translateY(14px); } }
.gf-rv-art { position: relative; display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; margin: 0 auto; border-radius: 18px; background: var(--bg-raised); overflow: hidden; }
.gf-rv-art.is-banner { width: 100%; height: auto; aspect-ratio: 3 / 1; }
.gf-rv-art img { width: 100%; height: 100%; object-fit: cover; }
.gf-rv-art.is-deco img { width: 88%; height: 88%; object-fit: contain; }
.gf-rv-art.is-coins img { width: 48px; height: 48px; object-fit: contain; }
.gf-rv-n { margin-top: 16px; font-family: var(--display); font-size: 1.35rem; font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gf-rv-s { margin-top: 4px; font-family: var(--mono); font-size: .86rem; color: var(--text-2); }
.gf-rv-s:empty { display: none; }
.gf-rv-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--white); font-size: .95rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; text-align: left; }
.gf-rv-note:empty { display: none; }
.gf-rv-from { margin-top: 12px; font-size: .88rem; color: var(--text-2); }
.gf-rv-acts { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.gf-rv-acts .btn { padding: 11px 26px; font-size: .92rem; }

.pf-gifts .gf-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 12px; }
.gf-tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gf-tile .gf-art { width: 100%; height: auto; aspect-ratio: 1; }
.gf-tile-n { font-size: .78rem; font-weight: 600; color: var(--pf-text, var(--white)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-tile-by { font-size: .74rem; color: var(--pf-text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-tile-by a { color: inherit; }
.gf-tile-x { position: absolute; top: 4px; right: 4px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #ddd; font-size: .72rem; cursor: pointer; opacity: 0; transition: opacity .14s; }
.gf-tile:hover .gf-tile-x, .gf-tile-x:focus-visible { opacity: 1; }
@media (hover: none) { .gf-tile-x { opacity: 1; width: 22px; height: 22px; background: rgba(0, 0, 0, .55); font-size: .7rem; } }

.iv-page { max-width: 560px; padding-top: 24px; padding-bottom: 24px; }
.iv-who { display: flex; align-items: center; gap: 18px; color: var(--white); text-decoration: none; }
.iv-av, .iv-av .top-av { width: 76px; height: 76px; }
.iv-who-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.iv-name { font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.iv-sub { font-size: 1rem; color: var(--text-2); }
.iv-reward { display: flex; align-items: center; gap: 18px; margin-top: 32px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-card); }
.iv-reward-av, .iv-reward-av .top-av { width: 64px; height: 64px; }
.iv-reward-av { flex-shrink: 0; margin: 8px; }
.iv-av-blank { display: block; background: #2a2a2a; }
.iv-reward-t { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.iv-reward-n { font-size: 1.05rem; font-weight: 700; color: var(--white); overflow-wrap: anywhere; }
.iv-reward-s { font-size: .9rem; color: var(--text-2); line-height: 1.45; }
.iv-reward-s a { color: var(--text); }
.iv-bar { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: #262626; overflow: hidden; }
.iv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--btn); }
.iv-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.iv-acts .btn { padding: 12px 24px; font-size: .95rem; }

.iv-tab { padding-top: 6px; }
.iv-link-row { display: flex; gap: 8px; }
.iv-link { flex: 1; min-width: 0; font-family: var(--mono); font-size: .88rem; color: var(--text); }
.iv-link-row .btn { flex-shrink: 0; padding: 10px 18px; font-size: .9rem; }
.iv-note { margin-top: 10px; font-size: .88rem; color: var(--text-2); }
.iv-tab .iv-reward { margin-top: 18px; }
.iv-nums { display: flex; gap: 36px; margin-top: 22px; }
.iv-nums div { display: flex; flex-direction: column; gap: 2px; }
.iv-nums b { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums; }
.iv-nums span { font-size: .86rem; color: var(--text-2); }

@media (max-width: 560px) {
    .gf-modal { padding: 0; align-items: stretch; }
    .gf-dlg { display: flex; flex-direction: column; max-width: none; max-height: none; height: 100dvh; border-radius: 0; border: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
    .gf-dlg > * { flex-shrink: 0; }
    .gf-send { margin-top: auto; }
    .gf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: none; }
    .gf-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gf-row { align-items: flex-start; }
    .gf-row-n { white-space: normal; overflow-wrap: anywhere; }
    .gf-row .gf-sw { gap: 4px; flex-direction: column; align-items: center; font-size: .76rem; }
    .iv-name { font-size: 1.55rem; }
    .iv-av, .iv-av .top-av { width: 64px; height: 64px; }
    .iv-acts { flex-direction: column; }
    .iv-link-row { flex-direction: column; }
    .iv-link-row .btn { justify-content: center; min-height: 44px; }
    .iv-acts .btn { justify-content: center; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    .gf-modal, .gf-open, .gf-rv { animation: none; }
    .gf-box-btn .gf-box { transition: none; }
}
