/* NextBall - gift window (gifts.js). Menu: centred window. Room / match: a small corner card that never blocks the game. */
.gw { position: fixed; z-index: 9000; pointer-events: none; }
.gw:empty { display: none; }
.gw--modal { inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 7, 10, 0); transition: background .2s ease-out; }
.gw--modal.is-on { background: rgba(5, 7, 10, .62); pointer-events: auto; }
.gw-card {
    pointer-events: auto; width: min(440px, 100%); box-sizing: border-box; display: flex; flex-direction: column;
    background: #14181F; border: 1px solid rgba(233, 199, 123, .45); border-radius: 8px; color: #DDE0E6;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4);
    opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .2s ease-out, transform .2s ease-out;
    font-family: var(--f-body, 'Exo 2', sans-serif);
}
.gw.is-on .gw-card { opacity: 1; transform: none; }
.gw-hd { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07);
    font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #E9C77B; }
.gw-hd .nbi { font-size: 16px; color: #E9C77B; }
.gw-hd span { flex: 1; min-width: 0; }
.gw-x { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 4px; background: transparent; color: #9BA1AC; cursor: pointer; }
.gw-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.gw-list { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; max-height: min(56vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.gw-item { display: flex; flex-direction: column; gap: 10px; padding: 10px 6px; }
.gw-item + .gw-item { border-top: 1px solid rgba(255, 255, 255, .06); }
.gw-vis { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 64px; border-radius: 6px; background: #0D1016; padding: 12px; overflow: hidden; }
.gw-vis--coins { font: 700 30px/1 var(--f-display, 'Chakra Petch', sans-serif); color: #fff; }
.gw-vis--coins .nbc { font-size: 34px; }
.gw-vis--banner { flex-direction: column; gap: 10px; }
.gw-vis--banner .banner-preview { white-space: nowrap; max-width: 100%; }
.gw-vis--fx { padding: 0; }
.gw-vis--fx img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gw-vis--box .nbi { font-size: 34px; }
.gw-vis--title .gw-title { font-size: 18px; padding: 6px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gw-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gw-tx b { font: 700 17px/1.2 var(--f-display, 'Chakra Petch', sans-serif); color: #fff; }
.gw-tx small { font-size: 12px; color: #9BA1AC; }
.gw-tx p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: #DDE0E6; white-space: pre-line; overflow-wrap: anywhere; }
.gw-ft { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.gw-note { flex: 1; min-width: 0; font-size: 12px; color: #9BA1AC; }
.gw-ok { flex: none; min-height: 40px; padding: 0 20px; border: 0; border-radius: 4px; cursor: pointer; background: #FF6A13; color: #1A0900;
    font: 700 13px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .1em; text-transform: uppercase; }
.gw-ok:hover { background: #FF8A45; }
.gw-ok:focus-visible, .gw-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* in a room or a match: a compact card in the top-right corner, no backdrop, the game keeps the keyboard */
.gw--dock { top: 76px; right: 12px; width: min(330px, calc(100vw - 24px)); }
.gw--dock .gw-card { width: 100%; transform: translateX(16px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.gw--dock.is-on .gw-card { transform: none; }
.gw--dock .gw-hd { padding: 9px 6px 8px 12px; font-size: 11px; }
.gw--dock .gw-list { max-height: 38vh; padding: 6px 8px; }
.gw--dock .gw-item { flex-direction: row; align-items: center; gap: 10px; padding: 6px 2px; }
.gw--dock .gw-vis { flex: 0 0 96px; min-height: 52px; padding: 6px; }
.gw--dock .gw-vis--coins { font-size: 18px; gap: 6px; }
.gw--dock .gw-vis--coins .nbc { font-size: 20px; }
.gw--dock .gw-vis--banner .banner-preview { transform: scale(.62); transform-origin: center; }
.gw--dock .gw-vis--banner .gw-title { display: none; }
.gw--dock .gw-vis--title .gw-title { font-size: 10.5px; line-height: 1.2; padding: 3px 6px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.gw--dock .gw-tx b { font-size: 14px; }
.gw--dock .gw-tx p { font-size: 12.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.gw--dock .gw-ft { padding: 8px 8px 8px 12px; }
.gw--dock .gw-ok { min-height: 34px; padding: 0 14px; font-size: 12px; }

/* phones / small screens: the card sits at the top in the middle, narrow, clear of the touch controls */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
    .gw--dock { top: 8px; right: auto; left: 50%; transform: translateX(-50%); width: min(320px, calc(100vw - 16px)); }
    .gw--dock .gw-card { transform: translateY(-12px); }
    .gw--dock.is-on .gw-card { transform: none; }
    .gw--dock .gw-list { max-height: 30vh; }
}
@media (prefers-reduced-motion: reduce) { .gw-card, .gw--modal { transition: none; } }
