/* gift button beside an avatar */
.gbtn{--gs:clamp(30px,calc(var(--av,60px) * .76),46px);position:absolute;z-index:4;box-sizing:border-box;width:var(--gs);height:var(--gs);padding:0;display:grid;place-items:center;pointer-events:auto;border-radius:33%;color:#ffe3a0;background:radial-gradient(circle at 50% 28%,#1f326e,#050818);border:2px solid #d9a94e;box-shadow:0 4px 10px #000b}
#game .gbtn,#lobby .gbtn{padding:0;min-width:0;min-height:0}
#game .gbtn svg,#lobby .gbtn svg{width:calc(var(--gs) * .62);height:calc(var(--gs) * .62);flex:none;padding:0;margin:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.gbtn i,.gfly,.gitem i,.gspark{font-style:normal;font-family:"Apple Color Emoji",TLEmoji,"Noto Color Emoji","Segoe UI Emoji",sans-serif;font-weight:400}
.gbtn i{font-size:calc(var(--gs) * .6);line-height:1}
.gbtn.has{box-shadow:0 0 14px #ffd86b99,0 4px 10px #000b}
#game .opp .gbtn{top:max(2px,calc(var(--av) / 2 + var(--u) * 4 - var(--gs) / 2));left:calc(50% - var(--av) / 2 - var(--gs) - 6px)}
#game #myseat .gbtn{top:max(0px,calc(var(--av) / 2 + var(--u) * 4 - var(--gs) / 2));left:calc(50% - var(--av) / 2 - var(--gs) - 6px)}

/* lobby: left of the account badge, which makes room for it */
#gift-lobby{--gs:46px;left:max(14px,env(safe-area-inset-left,0px));bottom:calc(34px + env(safe-area-inset-bottom,0px))}
#lobby #myaccount{left:calc(max(14px,env(safe-area-inset-left,0px)) + 54px);width:calc(50% - 194px)}
@media (max-width:1199px){#gift-lobby{bottom:calc(23px + env(safe-area-inset-bottom,0px))}}
@media (max-width:760px){#gift-lobby{--gs:34px;left:6px;bottom:calc(29px + env(safe-area-inset-bottom,0px))}#lobby #myaccount{left:44px;width:calc(50% - 162px)}}
@media (max-width:600px){#gift-lobby{bottom:calc(76px + env(safe-area-inset-bottom,0px));left:19px}#lobby #myaccount{left:8px;width:calc(50% - 124px)}}

/* the box: dark blue, black and gold */
#gdim{position:fixed;inset:0;z-index:60;background:#01030ab8}
#gbox{position:fixed;z-index:61;left:50%;top:50%;translate:-50% -50%;width:600px;height:398px;display:flex;flex-direction:column;box-sizing:border-box;padding:16px 18px;border-radius:22px;color:#f3ead6;font:700 14px Inter,system-ui,sans-serif;text-align:center;border:1px solid transparent;background:radial-gradient(120% 75% at 50% 0%,#17265a 0%,#0b1230 45%,#04060f 100%) padding-box,linear-gradient(160deg,#fff0bd,#a9772a 25%,#3a3320 50%,#a9772a 75%,#ffe7a3) border-box;box-shadow:0 30px 80px #000,0 0 40px #c99a4533}
#gbox[hidden],#gdim[hidden]{display:none}
#gbox *{box-sizing:border-box}
#gbox button{font:700 12px Inter,system-ui,sans-serif;margin:0;cursor:pointer}
#gbox button:disabled{cursor:default}
#gbox .gx{position:absolute;right:14px;top:17px}
.ghead{flex:none;display:flex;align-items:center;gap:8px;margin-right:42px;height:34px}
.ghead h2{margin:0 auto 0 0;font:700 21px Inter,system-ui,sans-serif;letter-spacing:0;color:#ecc873;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#gbox .gpill{padding:8px 14px;border-radius:99px;border:1px solid #6e5628;background:#070c20;color:#d9c79a;font-size:12px;line-height:1.2;white-space:nowrap}
#gbox .gpill.on{background:linear-gradient(#fbe3a4,#d9a94e 55%,#a8761f);border-color:#fff0bf;color:#1d1304}
.gsub{flex:none;display:flex;align-items:center;justify-content:space-between;height:28px;margin:6px 0 8px;color:#aab2d4;font-size:12px}
.gsub>span{display:flex;align-items:center;gap:6px}
#gbox .gremove{padding:5px 12px;font-size:11px}
.gtabs{flex:none;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:10px}
.gbody{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#a9803a #0b1230}
.ggrid{display:grid;grid-template-columns:repeat(5,1fr);grid-auto-rows:92px;gap:8px}
#gbox .gitem{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;padding:0;color:#f3ead6;border-radius:14px;border:1px solid #6f5c3466;background:radial-gradient(circle at 50% 28%,#18265a,#080d22 72%)}
#gbox .gitem.on{border:1.5px solid #f0c66c;background:radial-gradient(circle at 50% 28%,#2a3f87,#0e1638 72%);box-shadow:inset 0 0 14px #e0ac4833}
.gitem i{font-size:28px;line-height:34px}
.gitem b{font-size:11px;white-space:nowrap;margin:1px 0}
.gitem small{display:flex;align-items:center;gap:4px;font-size:12px;color:#f0d58e}
.gitem em{font-style:normal;font-size:9px;line-height:11px;color:#c9b98f}
#gbox .gold-coins{display:inline-block;width:15px;height:15px;flex:none}
#gbox .ggo{flex:none;margin-top:10px;padding:11px;border:0;border-radius:14px;background:linear-gradient(#fbe3a4,#d9a94e 55%,#a8761f);color:#1d1304;font-size:15px}
#gbox .ggo:disabled{filter:grayscale(.7) brightness(.7);opacity:1}
@media (max-width:640px){
  #gbox{width:calc(100vw - 20px);height:min(560px,calc(100dvh - 24px));padding:14px 12px}
  .ghead h2{font-size:17px}
  #gbox .ghead .gpill{padding:7px 10px;font-size:11px}
  #gbox .gtabs{gap:5px}#gbox .gtabs .gpill{padding:7px 10px}
  .ggrid{grid-template-columns:repeat(3,1fr)}
}

/* flight and message */
.gfly{position:fixed;left:0;top:0;z-index:70;pointer-events:none;font-size:46px;line-height:1.2;filter:drop-shadow(0 8px 12px #000c)}
.gspark{position:fixed;z-index:70;pointer-events:none;font-size:17px;color:#ffe3a0}
.gnote{position:fixed;z-index:55;pointer-events:none;box-sizing:border-box;max-width:calc(100vw - 12px);padding:9px 15px;border-radius:14px;border:1.5px solid #b98f45;background:#0b1230;color:#ffe3a0;font:700 14px Inter,system-ui,sans-serif;box-shadow:0 6px 16px #000b}
/* narrower screens: no room at the edge, so yours sits just above your avatar */
@container (max-width:1099px){#game #myseat .gbtn{top:calc(-1 * var(--gs) - 2px);left:max(0px,calc(50% - var(--gs) / 2))}}
