/* Gaaf's self-contained game surfaces. All styles stay inside the gg namespace. */
.gg-game {
  --gg-bg: #121419;
  --gg-panel: #1b1e25;
  --gg-panel-raised: #242830;
  --gg-border: rgba(255, 255, 255, .085);
  --gg-text: #f5f3ed;
  --gg-muted: #9298a6;
  --gg-orange: #ff7b3b;
  --gg-orange-light: #ffad78;
  --gg-green: #b9e88b;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 425px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 16px;
  overflow: hidden;
  border-radius: inherit;
  color: var(--gg-text);
  background: radial-gradient(ellipse at 50% 0, rgba(255, 123, 59, .045), transparent 58%), var(--gg-bg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  isolation: isolate;
}

.gg-game *, .gg-game *::before, .gg-game *::after { box-sizing: border-box; }
.gg-game button, .gg-game kbd { font-family: inherit; }
.gg-game button { -webkit-tap-highlight-color: transparent; }
.gg-game button:focus-visible, .gg-game [tabindex]:focus-visible {
  outline: 2px solid var(--gg-orange-light);
  outline-offset: 4px;
}
.gg-game [hidden] { display: none !important; }
.gg-toolbar { display: flex; align-items: center; gap: 13px; flex-shrink: 0; min-height: 44px; }
.gg-heading { min-width: 0; margin-right: auto; }
.gg-eyebrow { display: block; margin-bottom: 2px; color: var(--gg-orange-light); font-size: 9px; font-weight: 700; line-height: 1.25; letter-spacing: .14em; text-transform: uppercase; }
.gg-name { margin: 0; overflow: hidden; color: var(--gg-text); font-size: 19px; font-weight: 750; line-height: 1.2; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.gg-stats { display: flex; align-items: stretch; gap: 7px; flex-shrink: 0; }
.gg-stat { display: flex; flex-direction: column; justify-content: center; min-width: 64px; padding: 5px 11px; border: 1px solid var(--gg-border); border-radius: 8px; background: rgba(255, 255, 255, .035); text-align: center; }
.gg-stat-label { color: var(--gg-muted); font-size: 9px; font-weight: 600; line-height: 1.4; letter-spacing: .055em; text-transform: uppercase; }
.gg-stat-value { color: var(--gg-text); font-size: 17px; font-weight: 750; line-height: 1.25; font-variant-numeric: tabular-nums; }
.gg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 22px; border: 1px solid transparent; border-radius: 9px; background: var(--gg-orange); color: #1d160f; font-size: 13px; font-weight: 750; line-height: 1.3; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; }
.gg-btn:hover:not(:disabled) { background: #ff915b; box-shadow: 0 4px 20px rgba(255, 123, 59, .13); transform: translateY(-1px); }
.gg-btn:active:not(:disabled) { transform: translateY(1px); }
.gg-btn:disabled { cursor: default; opacity: .4; }
.gg-btn--ghost { min-height: 35px; padding: 8px 12px; border-color: var(--gg-border); background: transparent; color: #c9cbd1; font-size: 11px; font-weight: 600; }
.gg-btn--secondary { border-color: rgba(255, 255, 255, .11); background: var(--gg-panel-raised); color: var(--gg-text); }
.gg-btn--ghost:hover:not(:disabled), .gg-btn--secondary:hover:not(:disabled) { background: #30343e; box-shadow: none; }
.gg-btn--small { min-height: 34px; padding: 7px 13px; font-size: 11px; }
.gg-btn svg { display: block; width: 15px; height: 15px; flex: 0 0 auto; }
.gg-reset { flex-shrink: 0; }
.gg-reset-icon { font-size: 17px; line-height: 1; }
.gg-main { position: relative; display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-width: 0; min-height: 270px; }
.gg-status { min-height: 20px; flex-shrink: 0; margin: 0; color: #c7c9cf; font-size: 12px; line-height: 1.6; text-align: center; font-variant-numeric: tabular-nums; }
.gg-status--good { color: var(--gg-green); }
.gg-status--bad { color: var(--gg-orange-light); }
.gg-rules { flex-shrink: 0; margin: 0 auto; max-width: 660px; color: var(--gg-muted); font-size: 11px; line-height: 1.6; text-align: center; }
.gg-overlay { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: 12px; background: rgba(13, 15, 19, .78); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.gg-overlay-card { max-width: 350px; text-align: center; }
.gg-overlay-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 13px; border: 1px solid rgba(255, 123, 59, .22); border-radius: 14px; background: rgba(255, 123, 59, .09); color: var(--gg-orange-light); font-size: 25px; }
.gg-overlay-title { margin: 0 0 8px; color: var(--gg-text); font-size: clamp(23px, 3vw, 30px); font-weight: 750; line-height: 1.12; letter-spacing: -.04em; }
.gg-overlay-copy { margin: 0 auto 20px; max-width: 300px; color: #aeb2bd; font-size: 13px; line-height: 1.65; }
.gg-overlay-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.gg-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Slide and merge */
.gg-tiles-layout { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 5vw, 54px); width: 100%; }
.gg-tiles-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 7px; width: 280px; height: 280px; flex: 0 0 280px; padding: 8px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 13px; background: #20232a; touch-action: none; user-select: none; }
.gg-tile-row { display: contents; }
.gg-tile { display: flex; align-items: center; justify-content: center; min-width: 0; border-radius: 7px; background: #2b2e36; color: #eee9df; font-size: 27px; font-weight: 750; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.gg-tile[data-value="0"] { color: transparent; }
.gg-tile[data-value="2"] { background: #3e4148; color: #eeeae1; }
.gg-tile[data-value="4"] { background: #6c6255; color: #fff3de; }
.gg-tile[data-value="8"] { background: #c36b3d; color: #fff8ef; }
.gg-tile[data-value="16"] { background: #e27d3e; color: #fff9ed; }
.gg-tile[data-value="32"] { background: #ef9951; color: #2a1c13; }
.gg-tile[data-value="64"] { background: #ffa56b; color: #2d1b12; }
.gg-tile[data-value="128"] { background: #ceb65b; color: #292413; font-size: 24px; }
.gg-tile[data-value="256"] { background: #e0c45d; color: #292413; font-size: 24px; }
.gg-tile[data-value="512"] { background: #efd46c; color: #292413; font-size: 24px; }
.gg-tile[data-value="1024"], .gg-tile[data-value="2048"] { background: #ffdf7b; color: #322710; box-shadow: 0 0 20px rgba(255, 219, 106, .18); }
.gg-tile--large { font-size: 20px; letter-spacing: -.055em; }
.gg-tile--new { animation: gg-tile-enter .18s ease-out both; }
.gg-tile--merged { animation: gg-tile-merge .2s ease-out both; }
.gg-game-aside { width: 185px; flex: 0 1 185px; }
.gg-aside-title { margin: 0 0 10px; color: #f1ede4; font-size: 23px; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.gg-aside-copy { margin: 0; color: var(--gg-muted); font-size: 12px; line-height: 1.75; }
.gg-key-hints { display: flex; gap: 5px; margin-top: 18px; }
.gg-key { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #3b3e47; border-bottom-width: 3px; border-radius: 5px; background: #21242b; color: #b9bdc7; font-size: 14px; }

/* Match pairs */
.gg-memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 280px; max-width: 100%; perspective: 700px; }
.gg-memory-card { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid #343943; border-radius: 10px; background: #242831; color: #687080; cursor: pointer; transition: background .2s, border-color .2s, transform .2s, opacity .2s; }
.gg-memory-card:hover:not(:disabled):not(.gg-memory-card--flipped) { border-color: #6b574c; background: #2e3038; transform: translateY(-2px); }
.gg-memory-front, .gg-memory-face { grid-area: 1 / 1; display: grid; place-items: center; width: 100%; height: 100%; transition: transform .22s, opacity .16s; user-select: none; }
.gg-memory-front { color: #647080; font-size: 21px; font-weight: 650; }
.gg-memory-face { transform: scale(.55) rotate(-20deg); opacity: 0; color: #ffad78; font-size: 31px; line-height: 1; }
.gg-memory-card--flipped, .gg-memory-card--matched { border-color: rgba(255, 173, 120, .42); background: #342a25; }
.gg-memory-card--flipped .gg-memory-front, .gg-memory-card--matched .gg-memory-front { transform: scale(.5); opacity: 0; }
.gg-memory-card--flipped .gg-memory-face, .gg-memory-card--matched .gg-memory-face { transform: scale(1) rotate(0); opacity: 1; }
.gg-memory-card--matched { cursor: default; border-color: rgba(185, 232, 139, .32); background: #252e27; }
.gg-memory-card--flipped:hover:not(:disabled) { background: #342a25; box-shadow: none; transform: none; }
.gg-memory-card--matched .gg-memory-face { color: #b9e88b; }
.gg-memory-card[data-tone="1"] .gg-memory-face { color: #c4b4ed; }
.gg-memory-card[data-tone="2"] .gg-memory-face { color: #8ddbd8; }
.gg-memory-card[data-tone="3"] .gg-memory-face { color: #f1cc77; }
.gg-memory-card[data-tone="4"] .gg-memory-face { color: #b2d28e; }
.gg-memory-card[data-tone="5"] .gg-memory-face { color: #ed9fba; }
.gg-memory-card[data-tone="6"] .gg-memory-face { color: #a9bffc; }
.gg-memory-card[data-tone="7"] .gg-memory-face { color: #e5cbb3; }

/* Higher or lower */
.gg-cards-layout { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 16px; }
.gg-card-table { display: flex; align-items: center; justify-content: center; gap: 30px; }
.gg-card-stack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gg-card-caption { color: #888f9d; font-size: 9px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.gg-playing-card { position: relative; display: flex; align-items: center; justify-content: center; width: 119px; height: 158px; overflow: hidden; border: 1px solid #e2e0d7; border-radius: 10px; background: #f3f0e7; color: #252a31; box-shadow: 0 8px 18px rgba(0, 0, 0, .18); user-select: none; }
.gg-card-corner { position: absolute; top: 10px; left: 11px; display: flex; flex-direction: column; align-items: center; font-size: 19px; font-weight: 750; line-height: 1.05; white-space: pre-line; }
.gg-card-suit { font-size: 56px; line-height: 1; }
.gg-playing-card--red { color: #d15d3d; }
.gg-playing-card--back { border: 5px solid #30343e; outline: 1px solid #464a56; outline-offset: -1px; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, .035) 8px 9px), repeating-linear-gradient(-45deg, #272b35 0 8px, #353943 8px 9px); color: #9ba0ac; }
.gg-card-backmark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #646775; border-radius: 13px; background: #2d313b; color: var(--gg-orange-light); font-size: 27px; font-weight: 750; letter-spacing: -.07em; }
.gg-playing-card--reveal { animation: gg-card-reveal .25s ease-out; }
.gg-cards-controls { display: flex; justify-content: center; gap: 10px; }
.gg-cards-controls .gg-btn { min-width: 133px; }
.gg-cards-tip { margin: 0; color: var(--gg-muted); font-size: 11px; text-align: center; }

/* Thirty-second target game */
.gg-reaction-arena { position: relative; width: 100%; max-width: 680px; height: 100%; min-height: 270px; overflow: hidden; border: 1px solid #2c3039; border-radius: 12px; background: radial-gradient(ellipse at center, rgba(255, 123, 59, .03), transparent 65%), radial-gradient(circle, rgba(255, 255, 255, .10) 1px, transparent 1px); background-size: auto, 22px 22px; touch-action: manipulation; }
.gg-reaction-label { position: absolute; inset: 12px 0 auto; color: #737b8b; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-align: center; text-transform: uppercase; pointer-events: none; }
.gg-target { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0; border: 1px solid rgba(255, 188, 142, .85); border-radius: 50%; background: rgba(255, 123, 59, .12); box-shadow: 0 0 27px rgba(255, 123, 59, .2), inset 0 0 15px rgba(255, 123, 59, .16); cursor: crosshair; transform: translate(-50%, -50%); touch-action: manipulation; }
.gg-target::before { position: absolute; inset: 7px; border: 1px solid rgba(255, 173, 120, .45); border-radius: 50%; content: ""; }
.gg-target::after { position: absolute; inset: -5px; border: 1px solid rgba(255, 173, 120, .18); border-radius: 50%; animation: gg-target-pulse 1s ease-in-out infinite; content: ""; }
.gg-target-core { width: 19px; height: 19px; border-radius: 50%; background: #ff955a; box-shadow: 0 0 16px rgba(255, 123, 59, .65); }
.gg-target:hover:not(:disabled), .gg-target:active:not(:disabled) { background: rgba(255, 123, 59, .23); transform: translate(-50%, -50%); }
.gg-target--hit, .gg-target--hit:hover:not(:disabled), .gg-target--hit:active:not(:disabled) { pointer-events: none; opacity: .2; transform: translate(-50%, -50%) scale(.75); transition: opacity .1s, transform .1s; }
.gg-score-pop { position: absolute; z-index: 2; color: var(--gg-orange-light); font-size: 15px; font-weight: 750; text-shadow: 0 2px 8px #121419; pointer-events: none; animation: gg-score-float .65s ease-out forwards; }
.gg-reaction-goal { position: absolute; right: 13px; bottom: 11px; color: #737b8b; font-size: 10px; pointer-events: none; }

/* Free fruit reels */
.gg-reels-layout { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.gg-reels-machine { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: 1px solid #49403b; border-radius: 17px; background: linear-gradient(150deg, #39312c, #22252c 55%); box-shadow: 0 10px 28px rgba(0, 0, 0, .22); }
.gg-reel { position: relative; display: flex; align-items: center; justify-content: center; width: 91px; height: 114px; overflow: hidden; border: 1px solid #4b4c50; border-radius: 8px; background: linear-gradient(#282c33, #343740 45%, #343740 55%, #282c33); box-shadow: inset 0 7px 14px rgba(0, 0, 0, .25); }
.gg-reel::after { position: absolute; inset: 50% 0 auto; height: 1px; background: rgba(255, 173, 120, .14); content: ""; pointer-events: none; }
.gg-reel-symbol { display: block; font-size: 48px; line-height: 1.2; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .2)); }
.gg-reel--spinning .gg-reel-symbol { animation: gg-reel-bounce .12s linear infinite; filter: blur(1px); }
.gg-reels-paytable { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 17px; color: #b2b5bf; font-size: 10px; }
.gg-reels-paytable strong { color: #ffe1a9; font-weight: 650; }
.gg-reels-controls { display: flex; justify-content: center; }
.gg-reels-controls .gg-btn { min-width: 163px; }
.gg-virtual-note { margin: 0; color: #818998; font-size: 10px; text-align: center; }

@keyframes gg-tile-enter { from { transform: scale(.5); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@keyframes gg-tile-merge { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes gg-card-reveal { from { transform: rotateY(70deg); opacity: .4; } to { transform: rotateY(0); opacity: 1; } }
@keyframes gg-target-pulse { 50% { transform: scale(1.08); opacity: .4; } }
@keyframes gg-score-float { from { transform: translate(-50%, -50%); opacity: 1; } to { transform: translate(-50%, -170%); opacity: 0; } }
@keyframes gg-reel-bounce { from { transform: translateY(-5px); } to { transform: translateY(5px); } }

@media (max-width: 600px) {
  .gg-game { padding: 15px; gap: 9px; }
  .gg-game-aside { display: none; }
  .gg-toolbar { gap: 8px; }
  .gg-stat { min-width: 53px; padding-inline: 8px; }
  .gg-name { font-size: 17px; }
  .gg-reaction-arena { min-height: 280px; }
}

@media (max-width: 390px) {
  .gg-game { padding: 13px 12px; min-height: 430px; }
  .gg-toolbar { gap: 7px; }
  .gg-eyebrow { font-size: 8px; letter-spacing: .08em; }
  .gg-name { max-width: 105px; font-size: 16px; }
  .gg-stats { gap: 5px; }
  .gg-stat { min-width: 43px; padding: 5px 6px; }
  .gg-stat-label { font-size: 8px; letter-spacing: 0; }
  .gg-stat-value { font-size: 15px; }
  .gg-reset { width: 32px; min-height: 34px; padding: 0; }
  .gg-reset-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .gg-reset-icon { font-size: 19px; }
  .gg-rules { font-size: 10px; }
  .gg-status { font-size: 11px; }
  .gg-overlay { padding: 13px; }
  .gg-overlay-title { font-size: 24px; }
  .gg-overlay-copy { font-size: 12px; }
  .gg-card-table { gap: 22px; }
  .gg-playing-card { width: 110px; height: 150px; }
  .gg-cards-controls .gg-btn { min-width: 119px; }
  .gg-reels-machine { gap: 6px; padding: 10px; }
  .gg-reel { width: 80px; height: 108px; }
  .gg-reel-symbol { font-size: 43px; }
  .gg-reels-paytable { gap: 7px 12px; font-size: 9px; }
}

@media (max-width: 320px) {
  .gg-tiles-board { width: 252px; height: 252px; flex-basis: 252px; gap: 6px; padding: 7px; }
  .gg-memory-grid { width: 252px; gap: 7px; }
  .gg-name { max-width: 76px; }
  .gg-reel { width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .gg-game *, .gg-game *::before, .gg-game *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
