/* ===============================
   GONG APP WRAPPER
   =============================== */
#gong-app,
#gong-embed {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    color: #333;
}


/* ===============================
   GONG BUTTON (Ramapani style)
   =============================== */
#gong-app .gong-button,
#gong-embed .gong-button {
    background: linear-gradient(180deg, #f7d9a8, #e8b97a);
    color: #4a3b1f;
    border: 1px solid #d8b47a;
    padding: 1rem 2rem;
    font-size: 1.4rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#gong-app .gong-button:hover,
#gong-embed .gong-button:hover {
    background: linear-gradient(180deg, #fbe3bd, #eac089);
}

#gong-app .gong-button:active,
#gong-embed .gong-button:active {
    transform: scale(0.96);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


/* ===============================
   SCOREBOARD (classic cricket style)
   =============================== */
#gong-app .scoreboard,
#gong-embed .scoreboard {
    display: inline-flex;
    gap: 4px;
    background: #000;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 1rem;
    border: 1px solid #222;
}

/* Each digit wheel */
#gong-app .score-wheel,
#gong-embed .score-wheel {
    width: 24px;
    height: 32px;
    overflow: hidden;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    position: relative;
}

/* The strip of numbers inside each wheel */
#gong-app .score-wheel-inner,
#gong-embed .score-wheel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.9s cubic-bezier(0.25, 0.6, 0.3, 1.2);
}

/* Each number */
#gong-app .score-digit,
#gong-embed .score-digit {
    height: 32px;
    line-height: 32px;
    text-align: center;
    color: #fff;
    font-size: 24px;
}


/* ===============================
   BOUNCE ANIMATION
   =============================== */
#gong-app .score-wheel-inner.bounce,
#gong-embed .score-wheel-inner.bounce {
    animation: gongWheelBounce 0.25s ease-out;
}

@keyframes gongWheelBounce {
    0%   { transform: translateY(var(--target)); }
    60%  { transform: translateY(calc(var(--target) + 4px)); }
    100% { transform: translateY(var(--target)); }
}


/* ===============================
   TITLE
   =============================== */
#gong-app .gong-title,
#gong-embed .gong-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #4a3b1f;
}


/* ===============================
   GONG IMAGE WRAPPER
   =============================== */
#gong-app .gong-image-wrapper,
#gong-embed .gong-image-wrapper {
    display: flex;
    justify-content: center;
    margin: 1rem 0 1.5rem 0;
}


/* ===============================
   GONG IMAGE
   =============================== */
#gong-app .gong-image,
#gong-embed .gong-image {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);

    /* Animation variables */
    --rot: 0deg;
    --swing: 0px;
    --sway: 0px;
    --microX: 0px;
    --microR: 0deg;

    transform-origin: 50% 8%;
    transform:
        rotate(var(--rot))
        translateX(calc(var(--swing) + var(--sway) + var(--microX)))
        rotate(var(--microR));
}

#gong-app .gong-image.disabled,
#gong-embed .gong-image.disabled {
    opacity: 0.3;
    pointer-events: none;
}


/* ===============================
   LEGEND
   =============================== */
#gong-app .gong-legend,
#gong-embed .gong-legend {
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
    font-size: 1rem;
    color: #6a5a3a;
    letter-spacing: 0.5px;
}


/* ===============================
   BUTTON COOLDOWN
   =============================== */
#gong-app .gong-button.cooldown,
#gong-embed .gong-button.cooldown {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#gong-app .gong-button.cooldown-end,
#gong-embed .gong-button.cooldown-end {
    opacity: 1;
    transition: opacity 0.4s ease;
}

#gong-app .gong-button.disabled,
#gong-embed .gong-button.disabled {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}


/* ============================================
   FULL CEREMONIAL GONG ANIMATION
   Macro wobble + sway + micro-vibrations
   ============================================ */

#gong-app .gong-image.vibrate,
#gong-embed .gong-image.vibrate {
    animation:
        macroWobble 8s cubic-bezier(0.25, 0.1, 0.1, 1),
        sway 8s ease-in-out,
        micro 0.12s linear infinite;
}


/* ============================================
   1. MACRO WOBBLE — huge rotation + huge swing
   ============================================ */
@keyframes macroWobble {
    0%   { --rot: 0deg;  --swing: 0px; }

    3%   { --rot: 20deg;  --swing: 50px; }
    7%   { --rot: -20deg; --swing: -50px; }

    12%  { --rot: 17deg;  --swing: 40px; }
    17%  { --rot: -17deg; --swing: -40px; }

    22%  { --rot: 14deg;  --swing: 32px; }
    27%  { --rot: -14deg; --swing: -32px; }

    33%  { --rot: 11deg;  --swing: 24px; }
    39%  { --rot: -11deg; --swing: -24px; }

    45%  { --rot: 8deg;   --swing: 16px; }
    51%  { --rot: -8deg;  --swing: -16px; }

    58%  { --rot: 6deg;   --swing: 10px; }
    65%  { --rot: -6deg;  --swing: -10px; }

    72%  { --rot: 4deg;   --swing: 6px; }
    79%  { --rot: -4deg;  --swing: -6px; }

    87%  { --rot: 2deg;   --swing: 3px; }
    94%  { --rot: -1deg;  --swing: -2px; }

    100% { --rot: 0deg;   --swing: 0px; }
}


/* ============================================
   2. SWAY — slow pendulum motion
   ============================================ */
@keyframes sway {
    0%   { --sway: 0px; }
    25%  { --sway: 12px; }
    50%  { --sway: 0px; }
    75%  { --sway: -12px; }
    100% { --sway: 0px; }
}


/* ============================================
   3. MICRO-VIBRATIONS — tiny jitter
   ============================================ */
@keyframes micro {
    0%   { --microX: 0.4px;  --microR: 0.2deg; }
    25%  { --microX: -0.4px; --microR: -0.2deg; }
    50%  { --microX: 0.3px;  --microR: 0.15deg; }
    75%  { --microX: -0.3px; --microR: -0.15deg; }
    100% { --microX: 0.4px;  --microR: 0.2deg; }
}
