@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Caveat:wght@500;700&family=Cinzel+Decorative:wght@700&family=Cinzel:wght@600&family=IM+Fell+English:ital@0;1&display=swap');

/* ═══════════════════════════════════════════════════════════
   GIFT BASKET overlay
   Same comic look as the intro: cream dotted paper, black
   panel border, Bangers headings, hard drop shadows.
═══════════════════════════════════════════════════════════ */

#gift-basket {
  position: fixed;
  inset: 0;
  z-index: 1001;                 /* above #intro (1000) */
  background-color: #fff9e6;
  background-image: radial-gradient(circle, rgba(0,0,0,0.13) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s 0.35s;
  font-family: 'Georgia', serif;
  color: #000;
}

#gift-basket.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

/* Comic panel border */
#gift-basket::before {
  content: '';
  position: fixed;
  inset: 12px;
  border: 4px solid #000;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}

/* ── Shared comic button ────────────────────────────────── */
#gift-basket button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gb-back {
  position: fixed;
  top: 26px;
  left: 26px;
  z-index: 6;
  padding: 6px 16px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: 4px 4px 0 #000;
  font-family: 'Bangers', 'Impact', cursive !important;
  font-size: 22px !important;
  letter-spacing: 2px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.gb-back:hover  { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.gb-back:active { transform: translate(2px, 2px);   box-shadow: 1px 1px 0 #000; }

.gb-btn {
  padding: 12px 28px;
  background: #e53935;
  color: #fff !important;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: 5px 5px 0 #000;
  font-family: 'Bangers', 'Impact', cursive !important;
  font-size: 26px !important;
  letter-spacing: 2px;
  transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
}
.gb-btn:hover  { background: #ef5350; transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #000; }
.gb-btn:active { background: #b71c1c; transform: translate(3px, 3px);   box-shadow: 1px 1px 0 #000; }

.gb-btn-alt { background: #fff; color: #000 !important; }
.gb-btn-alt:hover  { background: #fff3c4; }
.gb-btn-alt:active { background: #ffe58a; }

/* ── Views ──────────────────────────────────────────────── */
.gb-view {
  display: none;
  min-height: 100%;
  padding: 80px 32px 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
}
.gb-view.is-active {
  display: flex;
  animation: gbViewIn 0.35s ease both;
}
@keyframes gbViewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Picker ─────────────────────────────────────────────── */
.gb-title {
  font-family: 'Bangers', 'Impact', cursive;
  font-weight: normal;
  line-height: 1;
  letter-spacing: 4px;
}
.gb-t-small {
  display: block;
  font-size: 26px;
}
.gb-t-big {
  display: block;
  font-size: 72px;
  color: #ffd600;
  -webkit-text-stroke: 3px #000;
  text-shadow: 5px 5px 0 #000;
}

.gb-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
}

.gb-option {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 22px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 10px;
  box-shadow: 7px 7px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}
.gb-option:nth-child(1) { animation: gbPop 0.45s 0.05s both; }
.gb-option:nth-child(2) { animation: gbPop 0.45s 0.15s both; }
.gb-option:nth-child(3) { animation: gbPop 0.45s 0.25s both; }
@keyframes gbPop {
  from { transform: scale(0.6) rotate(-4deg); opacity: 0; }
  70%  { transform: scale(1.05) rotate(1deg); opacity: 1; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.gb-option:hover {
  transform: translate(-4px, -4px) rotate(-1deg);
  box-shadow: 11px 11px 0 #000;
  background: #fffbea;
}
.gb-option:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 #000;
}

.gb-icon {
  width: 110px;
  height: 128px;
  overflow: visible;
}
.gb-option:hover .gb-icon { animation: gbWiggle 0.5s ease; }
@keyframes gbWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

.gb-option-label {
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 30px;
  letter-spacing: 2px;
  line-height: 1;
}
.gb-option-sub {
  font-family: 'Caveat', cursive;
  font-size: 21px;
  line-height: 1.1;
  color: #444;
}

/* ── Draw view ──────────────────────────────────────────── */
.gb-draw { gap: 14px; }

.gb-draw-title {
  font-family: 'Bangers', 'Impact', cursive;
  font-weight: normal;
  font-size: 48px;
  letter-spacing: 3px;
  line-height: 1;
  color: #e53935;
  -webkit-text-stroke: 2px #000;
  text-shadow: 4px 4px 0 #000;
}
.gb-draw-left {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: #444;
  min-height: 1.2em;
}

.gb-table {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 420px;
  display: grid;
  place-items: center;
}
.gb-table > * { grid-area: 1 / 1; }

/* Tappable source (jar / pile / deck) */
.gb-source {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  padding: 10px;
  transition: opacity 0.3s, transform 0.3s;
}
.gb-source .gb-icon {
  width: 180px;
  height: 210px;
  animation: gbBob 2.2s ease-in-out infinite;
}
.gb-source:hover .gb-icon  { animation: gbWiggle 0.5s ease; }
.gb-source:active .gb-icon { transform: scale(0.94); }
@keyframes gbBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.gb-source-prompt {
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 26px;
  letter-spacing: 2px;
  background: #ffd600;
  border: 3px solid #000;
  border-radius: 6px;
  padding: 6px 16px;
  box-shadow: 4px 4px 0 #000;
}

.gb-draw.revealed .gb-source {
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
}

.gb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s 0.3s, transform 0.4s 0.3s;
}
.gb-draw.revealed .gb-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Reveals (shared) ───────────────────────────────────── */
.gb-reveal {
  display: none;
}
.gb-reveal.show { display: block; }
.gb-reveal.leaving { animation: gbLeave 0.38s ease forwards !important; }
@keyframes gbLeave {
  to { opacity: 0; transform: translateY(-40px) rotate(6deg) scale(0.9); }
}

/* ── Note ───────────────────────────────────────────────── */
.gb-note {
  --tilt: -2deg;
  position: relative;
  width: min(92%, 380px);
  min-height: 220px;
  padding: 36px 30px 40px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 33px, rgba(70,130,200,0.25) 33px 34px),
    #fffbd1;
  background-position: 0 22px;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  transform: rotate(var(--tilt));
}
/* little strip of tape */
.gb-note::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 143, 177, 0.75);
  border: 2px solid rgba(0,0,0,0.5);
}
.gb-note.show { animation: gbUnfold 0.55s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes gbUnfold {
  0%   { opacity: 0; transform: translateY(80px) rotate(var(--tilt)) scale(0.3, 0.08); }
  45%  { opacity: 1; transform: translateY(-10px) rotate(var(--tilt)) scale(0.9, 0.2); }
  100% { opacity: 1; transform: translateY(0) rotate(var(--tilt)) scale(1, 1); }
}
.gb-note-text {
  font-family: 'Caveat', cursive;
  font-size: 30px;
  font-weight: 500;
  line-height: 34px;
  color: #1d2a6b;
  white-space: pre-line;
  text-align: left;
}
.gb-note-heart {
  position: absolute;
  right: 18px;
  bottom: 8px;
  font-size: 26px;
  color: #e53935;
}

/* ── Poem ───────────────────────────────────────────────── */
.gb-poem {
  width: min(94%, 500px);
  padding: 30px 32px 24px;
  background: #fff3d6;
  border: 3px solid #000;
  border-radius: 4px;
  box-shadow: 7px 7px 0 #000;
  text-align: left;
}
.gb-poem.show { animation: gbRise 0.55s ease both; }
@keyframes gbRise {
  from { opacity: 0; transform: translateY(50px) rotate(-3deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}
.gb-poem-title {
  font-family: 'Bangers', 'Impact', cursive;
  font-weight: normal;
  font-size: 34px;
  letter-spacing: 2px;
  line-height: 1.05;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid #000;
}
.gb-poem-body {
  font-family: 'Georgia', serif;
  font-size: 18px;
  line-height: 1.7;
  font-style: italic;
  white-space: pre-line;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 6px;
}
.gb-poem-sign {
  display: block;
  margin-top: 14px;
  text-align: right;
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: #e53935;
}

/* ── Poems page: always fits on one screen ──────────────── */
.gb-draw[data-type="poems"].is-active {
  height: 100%;
  min-height: 0;
  justify-content: flex-start;
  padding-top: 70px;
  padding-bottom: 28px;
  overflow: hidden;
}
.gb-draw[data-type="poems"] .gb-draw-left { display: none; }
.gb-draw[data-type="poems"] .gb-draw-title,
.gb-draw[data-type="poems"] .gb-actions { flex-shrink: 0; }
.gb-draw[data-type="poems"] .gb-table {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}
.gb-draw[data-type="poems"] .gb-poem.show {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
}
.gb-poem-title,
.gb-poem-sign { flex-shrink: 0; }

.gb-poem-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gb-draw[data-type="poems"] .gb-poem-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: #e53935 rgba(0,0,0,0.08);
}
/* Always-visible scrollbar so it's obvious the poem scrolls */
.gb-poem-body::-webkit-scrollbar { width: 8px; }
.gb-poem-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
}
.gb-poem-body::-webkit-scrollbar-thumb {
  background: #e53935;
  border: 1.5px solid #000;
  border-radius: 4px;
}

/* Fade + "scroll for more" pill while there's more below */
.gb-poem.has-more .gb-poem-body {
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.gb-poem-hint {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: #fff;
  background: #e53935;
  border: 2px solid #000;
  border-radius: 20px;
  box-shadow: 2px 2px 0 #000;
  padding: 2px 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.gb-poem.has-more .gb-poem-hint {
  opacity: 1;
  animation: gbHintBob 1.4s ease-in-out infinite;
}
@keyframes gbHintBob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 4px); }
}

/* ── Action card — wizarding edition (flips) ────────────── */
.gb-card {
  width: 270px;
  height: 400px;
  perspective: 1200px;
  position: relative;
  z-index: 2;
}
.gb-card.show { animation: gbDeal 0.6s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes gbDeal {
  from { opacity: 0; transform: translateY(120px) rotate(-12deg) scale(0.6); }
  to   { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
.gb-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.4,1.4,.5,1);
}
.gb-card.flipped .gb-card-inner { transform: rotateY(180deg); }

.gb-card-face {
  position: absolute;
  inset: 0;
  border: 4px solid #000;
  border-radius: 14px;
  box-shadow: 7px 7px 0 #000;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 20px;
  overflow: hidden;
}

/* Back: deep burgundy, gold filigree frame, lightning emblem */
.gb-card-back {
  background:
    radial-gradient(circle at 20% 15%, rgba(255,230,150,0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 30%, rgba(255,230,150,0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 80%, rgba(255,230,150,0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 85%, rgba(255,230,150,0.35) 0 1px, transparent 2px),
    radial-gradient(ellipse at center, #8a1620 0%, #5c0d14 65%, #3a070c 100%);
  color: #d4af37;
  gap: 4px;
}
.gb-card-back::before,
.gb-card-back::after {
  content: '';
  position: absolute;
  border: 2px solid #d4af37;
  border-radius: 8px;
  pointer-events: none;
}
.gb-card-back::before { inset: 10px; }
.gb-card-back::after  { inset: 16px; border-width: 1px; border-style: dashed; opacity: 0.7; }
.gb-card-back-emblem {
  width: 84px;
  height: 84px;
  border: 3px solid #d4af37;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: radial-gradient(circle, rgba(212,175,55,0.25), transparent 70%);
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.6));
}
.gb-card-back-emblem svg { width: 54px; height: 54px; fill: rgba(212,175,55,0.25); }
.gb-card-back-show {
  position: relative;
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
  color: #f3d77a;
  text-shadow: 0 0 10px rgba(255,215,0,0.55), 2px 2px 0 #000;
  word-break: break-word;
}
.gb-card-back-edition {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 14px;
  letter-spacing: 6px;
  color: #d4af37;
}
.gb-card-back-tag {
  position: relative;
  margin-top: 12px;
  font-family: 'IM Fell English', 'Georgia', serif;
  font-style: italic;
  font-size: 18px;
  color: #f0e0b0;
}

/* Front: aged parchment */
.gb-card-front {
  transform: rotateY(180deg);
  background:
    radial-gradient(ellipse at center, #f8ecc9 0%, #ecd9a8 70%, #d9bf82 100%);
  color: #3b2412;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
  padding: 18px 18px 14px;
}
.gb-card-front::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid #8a6a2a;
  border-radius: 9px;
  pointer-events: none;
}
.gb-card-show {
  position: relative;
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: #f3d77a;
  background: #6b1018;
  border: 1.5px solid #000;
  border-radius: 3px;
  padding: 3px 10px;
}
.gb-card-icon {
  width: 72px;
  height: 72px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid #8a6a2a;
  background: radial-gradient(circle, #fff8e0 0%, #f0dca8 80%);
  color: #6b1018;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.gb-card-icon svg { width: 48px; height: 48px; }
.gb-card-title {
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.1;
  color: #6b1018;
  margin-top: 2px;
}
.gb-card-spell {
  font-family: 'IM Fell English', 'Georgia', serif;
  font-style: italic;
  font-size: 14px;
  color: #7a5a22;
}
.gb-card-text {
  font-family: 'IM Fell English', 'Georgia', serif;
  font-size: 17px;
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 4px 6px;
  border-top: 1px solid rgba(138,106,42,0.5);
  width: 100%;
}
.gb-card-foot {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #6b1018;
  padding-top: 6px;
  width: 100%;
  border-top: 1px solid rgba(138,106,42,0.5);
}

/* Light sweeping across the parchment once it lands */
.gb-card-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.75) 50%, transparent 65%);
  background-size: 300% 100%;
  background-position: 150% 0;
  opacity: 0;
}
.gb-card.flipped .gb-card-shimmer { animation: gbShimmer 1.1s 0.55s ease-out; }
@keyframes gbShimmer {
  0%   { opacity: 1; background-position: 150% 0; }
  100% { opacity: 1; background-position: -50% 0; }
}

/* Magical glow while the card is showing */
.gb-card.glowing .gb-card-front { animation: gbGlow 2.4s ease-in-out infinite; }
@keyframes gbGlow {
  0%, 100% { box-shadow: 7px 7px 0 #000, 0 0 18px 4px rgba(255,215,0,0.45); }
  50%      { box-shadow: 7px 7px 0 #000, 0 0 34px 10px rgba(255,215,0,0.75); }
}

/* ── Night-sky backdrop for the Action Cards view ───────── */
.gb-draw[data-type="cards"],
.gb-mycards[data-type="cards"] {
  background:
    radial-gradient(circle at 12% 18%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 82% 12%, #fff 0 1.2px, transparent 2px),
    radial-gradient(circle at 70% 70%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 25% 75%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 50% 30%, #fff 0 0.8px, transparent 2px),
    radial-gradient(circle at 92% 50%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 6% 52%, #fff 0 0.8px, transparent 2px),
    radial-gradient(ellipse at 50% 40%, #24365e 0%, #111a33 55%, #070b18 100%);
}
.gb-draw[data-type="cards"] .gb-draw-title,
.gb-mycards[data-type="cards"] .gb-draw-title {
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  color: #f3d77a;
  -webkit-text-stroke: 0;
  text-shadow: 0 0 14px rgba(255,215,0,0.6), 3px 3px 0 #000;
  letter-spacing: 2px;
}
.gb-draw[data-type="cards"] .gb-draw-left,
.gb-mycards[data-type="cards"] .gb-draw-left { color: #d8cfa8; }
.gb-draw[data-type="cards"] .gb-source-prompt {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 18px;
  letter-spacing: 1px;
  background: #6b1018;
  color: #f3d77a;
  border-color: #d4af37;
  box-shadow: 0 0 16px rgba(255,215,0,0.4), 4px 4px 0 #000;
}
.gb-draw[data-type="cards"] .gb-source .gb-icon {
  filter: drop-shadow(0 0 14px rgba(255,215,0,0.55));
}
.gb-draw[data-type="cards"] .gb-btn,
.gb-mycards[data-type="cards"] .gb-btn {
  font-family: 'Cinzel', 'Georgia', serif !important;
  font-size: 17px !important;
  letter-spacing: 1px;
  background: #6b1018;
  color: #f3d77a !important;
  border-color: #d4af37;
}
.gb-draw[data-type="cards"] .gb-btn:hover,
.gb-mycards[data-type="cards"] .gb-btn:hover { background: #8a1620; }
.gb-draw[data-type="cards"] .gb-btn-alt { background: #1f3a5f; }
.gb-draw[data-type="cards"] .gb-btn-alt:hover { background: #2b4d7a; }

/* ── Wizard effects layer ───────────────────────────────── */
.gb-fx {
  position: relative;
  align-self: stretch;
  justify-self: stretch;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
  display: none;
}
.gb-draw[data-type="cards"] .gb-fx { display: block; }

/* Wand swish: a glowing arc drawn across the card */
.gb-swish {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 400px;
  transform: translate(-50%, -50%);
  overflow: visible;
  opacity: 0;
}
.gb-swish path {
  fill: none;
  stroke: #fff6c8;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  filter: drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 16px #ffb300);
}
.gb-fx.swishing .gb-swish { animation: gbSwishFade 0.75s ease-out forwards; }
.gb-fx.swishing .gb-swish path { animation: gbSwishDraw 0.45s ease-in forwards; }
@keyframes gbSwishDraw { to { stroke-dashoffset: 0; } }
@keyframes gbSwishFade {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Flash of light when the spell lands */
.gb-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, #fff 0%, rgba(255,230,140,0.9) 30%, rgba(255,200,60,0) 70%);
  animation: gbFlash 0.85s ease-out forwards;
}
@keyframes gbFlash {
  0%   { transform: translate(-50%, -50%) scale(0);  opacity: 1; }
  35%  { transform: translate(-50%, -50%) scale(7);  opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(11); opacity: 0; }
}

/* Sparks */
.gb-spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px 2px var(--c);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: gbSpark var(--dur) var(--delay) cubic-bezier(.15,.7,.3,1) forwards;
}
.gb-spark-star {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  color: var(--c);
  font-size: calc(var(--size) * 3);
  line-height: 1;
  text-shadow: 0 0 6px var(--c), 0 0 12px var(--c);
}
@keyframes gbSpark {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2) rotate(180deg); }
}
.gb-spark-drift { animation-name: gbDrift; animation-timing-function: ease-in-out; }
@keyframes gbDrift {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
  .gb-view { padding: 76px 22px 40px; gap: 20px; }
  .gb-t-small { font-size: 18px; letter-spacing: 2px; }
  .gb-t-big   { font-size: 46px; text-shadow: 3px 3px 0 #000; -webkit-text-stroke: 2px #000; }

  .gb-options { gap: 16px; flex-direction: column; align-items: center; width: 100%; }
  .gb-option {
    width: 100%;
    max-width: 340px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    column-gap: 14px;
    row-gap: 2px;
    padding: 12px 16px;
    box-shadow: 5px 5px 0 #000;
  }
  .gb-option .gb-icon { width: 58px; height: 68px; grid-row: span 2; }
  .gb-option-label { font-size: 26px; }
  .gb-option-sub   { font-size: 19px; }
  /* stack label + sub next to the icon */
  .gb-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .gb-option-label { align-self: end; }
  .gb-option-sub   { align-self: start; }

  .gb-draw-title { font-size: 34px; text-shadow: 3px 3px 0 #000; }
  .gb-source .gb-icon { width: 140px; height: 164px; }
  .gb-source-prompt { font-size: 22px; }
  .gb-table { min-height: 300px; }
  .gb-note-text { font-size: 26px; }
  .gb-poem { padding: 24px 22px 18px; }
  .gb-poem-title { font-size: 28px; }
  .gb-poem-body  { font-size: 16px; }
  .gb-btn { font-size: 22px !important; padding: 10px 20px; }
  .gb-back { top: 22px; left: 22px; font-size: 18px !important; padding: 4px 12px; }
}

/* Short landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .gb-view { padding: 64px 32px 32px; gap: 14px; }
  .gb-t-big { font-size: 42px; }
  .gb-options { flex-direction: row; flex-wrap: nowrap; }
  .gb-option { width: 180px; padding: 12px; }
  .gb-icon { width: 70px; height: 82px; }
  .gb-option-label { font-size: 24px; }
  .gb-poem-body { max-height: 40vh; }
  .gb-card { width: 230px; height: 340px; }
  .gb-card-icon { width: 54px; height: 54px; }
  .gb-card-icon svg { width: 36px; height: 36px; }
  .gb-card-text { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  #gift-basket *, #gift-basket { animation-duration: 0.01s !important; transition-duration: 0.01s !important; }
}

/* ═══════════════════════════════════════════════════════════
   ACTION CARDS — redeem, My Cards, toast
═══════════════════════════════════════════════════════════ */

.gb-actions { flex-direction: column; align-items: center; gap: 12px; }
.gb-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.gb-redeem { display: none; }
.gb-draw[data-type="cards"] .gb-redeem { display: flex; }

.gb-draw[data-type="cards"] .gb-btn.gb-btn-dl {
  background: #d4af37;
  color: #2a1a08 !important;
  border-color: #000;
}
.gb-draw[data-type="cards"] .gb-btn.gb-btn-dl:hover { background: #e6c45a; }
.gb-btn.is-loading { opacity: 0.75; cursor: progress !important; pointer-events: none; }

/* My Cards pill under the counter */
.gb-mycards-btn {
  display: none;
  font-family: 'Cinzel', 'Georgia', serif !important;
  font-size: 14px !important;
  letter-spacing: 1.5px;
  color: #f3d77a !important;
  background: rgba(107, 16, 24, 0.85);
  border: 2px solid #d4af37;
  border-radius: 20px;
  padding: 5px 16px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
  transition: transform 0.1s, background 0.1s;
}
.gb-mycards-btn:hover { background: #8a1620; transform: translateY(-1px); }
.gb-draw[data-type="cards"] .gb-mycards-btn.has-cards { display: inline-block; }

/* My Cards grid */
.gb-mycards { justify-content: flex-start; }
.gb-mycards-grid {
  width: 100%;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
.gb-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 12px;
  background: radial-gradient(ellipse at center, #f8ecc9 0%, #ecd9a8 75%, #d9bf82 100%);
  color: #3b2412 !important;
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 5px 5px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}
.gb-tile:hover  { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 8px 8px 0 #000, 0 0 18px rgba(255,215,0,0.45); }
.gb-tile:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.gb-tile-icon { color: #6b1018; width: 46px; height: 46px; }
.gb-tile-icon svg { width: 100%; height: 100%; }
.gb-tile-title {
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  color: #6b1018;
}
.gb-tile-status {
  margin-top: 2px;
  font-family: 'IM Fell English', 'Georgia', serif;
  font-size: 12px;
  font-style: italic;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px dashed #8a6a2a;
  color: #7a5a22;
}
.gb-tile.is-redeemed .gb-tile-status {
  font-style: normal;
  border: 1px solid #000;
  background: #6b1018;
  color: #f3d77a;
}

/* Toast */
.gb-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 20;
  max-width: min(90vw, 460px);
  padding: 12px 18px;
  font-family: 'Georgia', serif;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: #141a2e;
  border: 2px solid #d4af37;
  border-radius: 10px;
  box-shadow: 4px 4px 0 #000, 0 0 18px rgba(255,215,0,0.3);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.gb-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.gb-toast a { color: #7ee2a0; font-weight: bold; }

@media (max-width: 760px) {
  .gb-mycards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gb-draw[data-type="cards"] .gb-btn { font-size: 15px !important; padding: 9px 14px; }
}

/* ═══════════════════════════════════════════════════════════
   PDF LAYOUT — rendered off-screen, captured into the PDF.
   620 × 877 px  (A6 proportions)
═══════════════════════════════════════════════════════════ */
.gb-print {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 620px;
  height: 877px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #24365e 0%, #111a33 55%, #070b18 100%);
  color: #3b2412;
  font-family: 'IM Fell English', 'Georgia', serif;
  pointer-events: none;
}
.gbp-star {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 8px 3px rgba(255, 230, 140, 0.7);
}
.gbp-star-sm { width: 3px; height: 3px; box-shadow: 0 0 5px 2px rgba(255, 230, 140, 0.6); }

.gbp-frame {
  position: absolute;
  inset: 22px;
  border: 3px solid #d4af37;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 34px 24px;
}
.gbp-frame::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 11px;
}

.gbp-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}
.gbp-kicker {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 15px;
  letter-spacing: 6px;
  color: #d8cfa8;
}
.gbp-edition {
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 1px;
  color: #f3d77a;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.55), 2px 2px 0 #000;
}

.gbp-card {
  position: relative;
  width: 440px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 30px 20px;
  text-align: center;
  background: #16213f;
  border: 3px solid #d4af37;
  border-radius: 18px;
  box-shadow: 0 0 34px 8px rgba(255, 215, 0, 0.35);
}
.gbp-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 11px;
}
.gbp-band {
  position: relative;
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 13px;
  letter-spacing: 5px;
  color: #f3d77a;
  background: #6b1018;
  border: 2px solid #d4af37;
  border-radius: 4px;
  padding: 4px 16px;
}
.gbp-icon {
  position: relative;
  width: 116px;
  height: 116px;
  margin-top: 6px;
  border-radius: 50%;
  border: 3px solid #d4af37;
  background: rgba(212, 175, 55, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gbp-title {
  position: relative;
  font-family: 'Cinzel Decorative', 'Georgia', serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  color: #f3d77a;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.45), 2px 2px 0 #000;
  margin-top: 4px;
}
.gbp-spell {
  position: relative;
  font-style: italic;
  font-size: 20px;
  color: #e3cf96;
}
.gbp-divider {
  position: relative;
  font-size: 14px;
  letter-spacing: 8px;
  color: #d4af37;
}
.gbp-text {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1.45;
  padding: 0 6px;
  color: #f7f0dc;
}
.gbp-foot {
  position: relative;
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 13px;
  letter-spacing: 3px;
  color: #d4af37;
  border-top: 1px solid rgba(212, 175, 55, 0.6);
  padding-top: 10px;
  width: 100%;
}

.gbp-bottom {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gbp-date {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: #f3d77a;
}
.gbp-present {
  font-style: italic;
  font-size: 17px;
  color: #d8cfa8;
}

/* ═══════════════════════════════════════════════════════════
   JAR OF NOTES — My Notes button + note tiles
═══════════════════════════════════════════════════════════ */
.gb-draw[data-type="notes"] .gb-mycards-btn.has-cards {
  display: inline-block;
  font-family: 'Bangers', 'Impact', cursive !important;
  font-size: 20px !important;
  letter-spacing: 2px;
  color: #000 !important;
  background: #ff8fb1;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: 3px 3px 0 #000;
  padding: 3px 16px;
}
.gb-draw[data-type="notes"] .gb-mycards-btn.has-cards:hover {
  background: #ffa8c3;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

.gb-tile.gb-tile-note {
  align-items: stretch;
  justify-content: space-between;
  text-align: left;
  min-height: 150px;
  padding: 24px 14px 10px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 25px, rgba(70,130,200,0.22) 25px 26px),
    #fffbd1;
  background-position: 0 18px;
}
.gb-tile.gb-tile-note:nth-child(odd)  { transform: rotate(-1.5deg); }
.gb-tile.gb-tile-note:nth-child(even) { transform: rotate(1.2deg); }
.gb-tile.gb-tile-note:hover { transform: translate(-3px, -3px) rotate(0); box-shadow: 8px 8px 0 #000; }
.gb-tile.gb-tile-note::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 64px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 143, 177, 0.75);
  border: 2px solid rgba(0,0,0,0.5);
}
.gb-tile-note-text {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  line-height: 26px;
  color: #1d2a6b;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gb-tile-note-date {
  margin-top: 6px;
  font-family: 'Caveat', cursive;
  font-size: 17px;
  color: #e53935;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   LOADERS — fetching items, saving draws, error + retry
═══════════════════════════════════════════════════════════ */
@keyframes gbSpin { to { transform: rotate(360deg); } }

.gb-spinner {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 6px solid rgba(0, 0, 0, 0.12);
  border-top-color: #e53935;
  border-right-color: #ffd600;
  animation: gbSpin 0.85s linear infinite;
}

.gb-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 26px;
  letter-spacing: 2px;
  color: #000;
}
.gb-loader-text { animation: gbPulse 1.4s ease-in-out infinite; }
@keyframes gbPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.gb-error {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 340px;
  padding: 22px 24px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 6px 6px 0 #000;
  text-align: center;
}
.gb-error-text {
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 26px;
  letter-spacing: 1.5px;
  color: #e53935;
}
.gb-error-sub {
  font-family: 'Georgia', serif;
  font-size: 15px;
  color: #444;
  margin-bottom: 8px;
}

/* Draw view states */
.gb-draw.is-loading .gb-loader,
.gb-mycards.is-loading .gb-mycards-loader { display: flex; }
.gb-draw.has-error .gb-error { display: flex; }
.gb-draw.is-loading .gb-source,
.gb-draw.has-error .gb-source,
.gb-draw.is-loading .gb-mycards-btn,
.gb-draw.has-error .gb-mycards-btn { display: none !important; }
.gb-mycards.is-loading .gb-mycards-grid { display: none; }
.gb-mycards-loader { margin: 40px 0; }

/* Inline spinner on buttons that are saving / preparing */
.gb-btn.is-loading::before,
.gb-source.is-loading .gb-source-prompt::before {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 8px;
  vertical-align: -0.1em;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: gbSpin 0.7s linear infinite;
}
.gb-source.is-loading { pointer-events: none; }
.gb-source.is-loading .gb-icon { animation: gbWiggle 0.5s ease-in-out infinite; }

/* Harry Potter theme for the deck + My Cards loaders */
.gb-draw[data-type="cards"] .gb-spinner,
.gb-mycards[data-type="cards"] .gb-spinner {
  border-color: rgba(212, 175, 55, 0.18);
  border-top-color: #f3d77a;
  border-right-color: #d4af37;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
}
.gb-draw[data-type="cards"] .gb-loader,
.gb-mycards[data-type="cards"] .gb-loader {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 20px;
  color: #f3d77a;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.gb-draw[data-type="cards"] .gb-error {
  background: #16213f;
  border-color: #d4af37;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.3), 5px 5px 0 #000;
}
.gb-draw[data-type="cards"] .gb-error-text { font-family: 'Cinzel', 'Georgia', serif; font-size: 20px; color: #f3d77a; }
.gb-draw[data-type="cards"] .gb-error-sub { color: #d8cfa8; }

/* ═══════════════════════════════════════════════════════════
   STAY INSIDE THE COMIC BORDER
   Each screen is its own scroll area sitting just inside the
   black border, so nothing ever slides across or past it.
═══════════════════════════════════════════════════════════ */
#gift-basket { overflow: hidden; }

#gift-basket .gb-view.is-active {
  position: absolute;
  inset: 16px;                 /* 12px gap + 4px border */
  height: auto;
  min-height: 0;
  padding: 62px 28px 28px;     /* clear of the BACK button */
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Centre short screens vertically, but never cut off the top of tall ones */
#gift-basket .gb-view.is-active > :first-child { margin-top: auto; }
#gift-basket .gb-view.is-active > :last-child  { margin-bottom: auto; }

/* ═══════════════════════════════════════════════════════════
   ACTION CARDS: always one screen
   The card shrinks to whatever height is left after the title
   and buttons, and goes compact on short phone screens.
═══════════════════════════════════════════════════════════ */
#gift-basket .gb-draw[data-type="cards"].is-active {
  overflow: hidden;
  gap: 8px;
  padding-bottom: 20px;
}
.gb-draw[data-type="cards"] .gb-draw-title,
.gb-draw[data-type="cards"] .gb-draw-left,
.gb-draw[data-type="cards"] .gb-mycards-btn,
.gb-draw[data-type="cards"] .gb-actions { flex-shrink: 0; }

.gb-draw[data-type="cards"] .gb-table {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  container-type: size;        /* lets the card size itself to the space */
}
.gb-draw[data-type="cards"] .gb-card {
  height: min(400px, calc(100cqh - 14px));
  width: auto;
  aspect-ratio: 27 / 40;
  max-width: calc(100cqw - 10px);
}
.gb-draw[data-type="cards"] .gb-source .gb-icon {
  height: min(210px, 62cqh);
  width: auto;
}
.gb-draw[data-type="cards"] .gb-swish {
  height: min(400px, 100cqh);
  width: auto;
  aspect-ratio: 3 / 4;
}

/* Compact card when space is tight */
@container (max-height: 380px) {
  .gb-card-front { padding: 12px 12px 10px; gap: 3px; }
  .gb-card-front::before { inset: 6px; }
  .gb-card-show { font-size: 8.5px; padding: 2px 8px; letter-spacing: 2px; }
  .gb-card-icon { width: 44px; height: 44px; margin-top: 2px; }
  .gb-card-icon svg { width: 28px; height: 28px; }
  .gb-card-title { font-size: 17px; }
  .gb-card-spell { font-size: 12px; }
  .gb-card-text { font-size: 14px; line-height: 1.35; padding: 2px 4px; }
  .gb-card-foot { font-size: 8.5px; padding-top: 4px; letter-spacing: 2px; }
  .gb-card-back-emblem { width: 58px; height: 58px; margin-bottom: 6px; }
  .gb-card-back-emblem svg { width: 36px; height: 36px; }
  .gb-card-back-show { font-size: 21px; }
  .gb-card-back-edition { font-size: 11px; letter-spacing: 4px; }
  .gb-card-back-tag { font-size: 15px; margin-top: 6px; }
}
@container (max-height: 290px) {
  .gb-card-icon { display: none; }
  .gb-card-title { font-size: 15px; }
  .gb-card-text { font-size: 13px; }
}

@media (max-width: 760px) {
  #gift-basket .gb-view.is-active { padding: 54px 14px 16px; }
  #gift-basket .gb-draw[data-type="cards"].is-active { gap: 6px; padding-bottom: 14px; }
  .gb-draw[data-type="cards"] .gb-draw-title { font-size: 26px; }
  .gb-draw[data-type="cards"] .gb-draw-left { font-size: 18px; }
  .gb-draw[data-type="cards"] .gb-mycards-btn.has-cards { font-size: 12px !important; padding: 3px 12px; }
  .gb-draw[data-type="cards"] .gb-actions,
  .gb-draw[data-type="cards"] .gb-actions-row { gap: 8px; }
  .gb-draw[data-type="cards"] .gb-btn {
    font-size: 13px !important;
    padding: 8px 12px;
    box-shadow: 3px 3px 0 #000;
  }
  .gb-draw[data-type="cards"] .gb-source-prompt { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════
   JAR OF NOTES: always one screen
   The note fits the space left; a long note scrolls inside the
   paper instead of pushing the buttons off screen.
═══════════════════════════════════════════════════════════ */
#gift-basket .gb-draw[data-type="notes"].is-active {
  overflow: hidden;
  gap: 8px;
  padding-bottom: 20px;
}
.gb-draw[data-type="notes"] .gb-draw-title,
.gb-draw[data-type="notes"] .gb-draw-left,
.gb-draw[data-type="notes"] .gb-mycards-btn,
.gb-draw[data-type="notes"] .gb-actions { flex-shrink: 0; }

.gb-draw[data-type="notes"] .gb-table {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  container-type: size;
}
.gb-draw[data-type="notes"] .gb-source .gb-icon {
  height: min(210px, 62cqh);
  width: auto;
}
.gb-draw[data-type="notes"] .gb-note.show {
  display: flex;
  flex-direction: column;
  min-height: min(220px, calc(100cqh - 24px));
  max-height: calc(100cqh - 24px);   /* room for the tape on top */
}
.gb-draw[data-type="notes"] .gb-note-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ff8fb1 transparent;
  padding-right: 4px;
}
.gb-draw[data-type="notes"] .gb-note-text::-webkit-scrollbar { width: 6px; }
.gb-draw[data-type="notes"] .gb-note-text::-webkit-scrollbar-thumb {
  background: #ff8fb1;
  border-radius: 3px;
}

@media (max-width: 760px) {
  #gift-basket .gb-draw[data-type="notes"].is-active { gap: 6px; padding-bottom: 14px; }
  .gb-draw[data-type="notes"] .gb-draw-title { font-size: 30px; }
  .gb-draw[data-type="notes"] .gb-draw-left { font-size: 18px; }
  .gb-draw[data-type="notes"] .gb-mycards-btn.has-cards { font-size: 17px !important; padding: 2px 12px; }
  .gb-draw[data-type="notes"] .gb-note { padding: 28px 22px 30px; }
  .gb-draw[data-type="notes"] .gb-note-text { font-size: 25px; }
  .gb-draw[data-type="notes"] .gb-actions,
  .gb-draw[data-type="notes"] .gb-actions-row { gap: 8px; }
  .gb-draw[data-type="notes"] .gb-btn {
    font-size: 19px !important;
    padding: 8px 14px;
    box-shadow: 4px 4px 0 #000;
  }
  .gb-draw[data-type="notes"] .gb-source-prompt { font-size: 19px; }
}
