/* Hammer Guess — mobile-first game surface */

:root {
    --hg-bg0: #0c0a09;
    --hg-bg1: #1c1917;
    --hg-card: rgba(28, 25, 23, 0.92);
    --hg-border: rgba(245, 158, 11, 0.22);
    --hg-amber: #f59e0b;
    --hg-amber-dim: #b45309;
    --hg-gold: #fcd34d;
    --hg-text: #fafaf9;
    --hg-muted: #a8a29e;
    --hg-accent: #34d399;
    --hg-danger: #f87171;
    --hg-header-offset: max(88px, calc(env(safe-area-inset-top, 0px) + 72px));
}

.hg-app {
    min-height: calc(100vh - var(--hg-header-offset));
    padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
    padding-top: calc(var(--hg-header-offset) + 0.75rem);
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(245, 158, 11, 0.15), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 50%, rgba(52, 211, 153, 0.06), transparent 45%),
        linear-gradient(180deg, var(--hg-bg0) 0%, var(--hg-bg1) 100%);
    color: var(--hg-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.hg-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hg-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.hg-share-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: var(--hg-gold);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.hg-share-chip:active {
    transform: scale(0.98);
}

.hg-share-chip-wide {
    border-radius: 12px;
}

@media (max-width: 380px) {
    .hg-share-chip-label {
        display: none;
    }
    .hg-share-chip {
        min-width: 44px;
        padding: 0 0.6rem;
    }
}

.hg-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--hg-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-brand i {
    font-size: 1.25rem;
    color: var(--hg-amber);
}

.hg-score-pill {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hg-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
}

.hg-score-pill strong {
    color: var(--hg-accent);
    font-weight: 700;
}

.hg-mode-toggle {
    display: flex;
    gap: 0.35rem;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 1rem;
}

.hg-mode-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--hg-muted);
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hg-mode-btn[aria-pressed="true"] {
    border-color: var(--hg-border);
    background: rgba(245, 158, 11, 0.12);
    color: var(--hg-gold);
}

.hg-mode-btn:active {
    transform: scale(0.98);
}

.hg-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--hg-card);
    border: 1px solid var(--hg-border);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.hg-bottle-wrap {
    position: relative;
    aspect-ratio: 1;
    max-height: 280px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #292524, #1c1917);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.hg-bottle-wrap.hg-bottle-wrap--loading {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.2),
        0 0 28px rgba(245, 158, 11, 0.18),
        inset 0 0 40px rgba(245, 158, 11, 0.06);
    animation: hgBottleWrapPulse 1.6s ease-in-out infinite;
}

@keyframes hgBottleWrapPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15), 0 0 20px rgba(245, 158, 11, 0.12), inset 0 0 40px rgba(245, 158, 11, 0.05); }
    50% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35), 0 0 36px rgba(245, 158, 11, 0.22), inset 0 0 50px rgba(245, 158, 11, 0.09); }
}

.hg-bottle-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 1;
    pointer-events: none;
}

.hg-bottle-wrap img.hg-loaded {
    opacity: 1;
    z-index: 4;
}

.hg-skeleton {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.09) 45%,
        rgba(255, 255, 255, 0.03) 90%
    );
    background-size: 200% 100%;
    animation: hgShimmer 1.4s ease-in-out infinite;
}

.hg-bottle-searching {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(12, 10, 9, 0.88), rgba(28, 25, 23, 0.94));
    backdrop-filter: blur(2px);
}

.hg-bottle-searching-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem;
    text-align: center;
}

.hg-bottle-searching-icon {
    font-size: 2rem;
    color: var(--hg-amber);
    animation: hgSearchIcon 1.1s ease-in-out infinite;
}

.hg-bottle-searching-text {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hg-gold);
    max-width: 12rem;
    line-height: 1.35;
}

@keyframes hgSearchIcon {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.85; }
    40% { transform: rotate(180deg) scale(1.08); opacity: 1; }
    60% { transform: rotate(180deg) scale(1.08); opacity: 1; }
}

.hg-bottle-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(160deg, rgba(41, 37, 36, 0.97), rgba(28, 25, 23, 0.99));
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.hg-bottle-placeholder-icon {
    font-size: 2.5rem;
    color: rgba(245, 158, 11, 0.35);
    animation: hgPlaceholderFloat 2.4s ease-in-out infinite;
}

.hg-bottle-placeholder-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hg-muted);
}

@keyframes hgPlaceholderFloat {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-6px); opacity: 0.85; }
}

@keyframes hgShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.hg-name {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--hg-text);
    min-height: 3em;
}

.hg-slider-block {
    margin-bottom: 1rem;
}

.hg-slider-block label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--hg-muted);
    margin-bottom: 0.5rem;
}

.hg-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hg-range {
    flex: 1;
    height: 48px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    touch-action: none;
}

.hg-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #44403c, var(--hg-amber-dim), var(--hg-gold));
}

.hg-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    margin-top: -12px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fef3c7, var(--hg-amber));
    border: 3px solid #1c1917;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45);
    cursor: pointer;
}

.hg-range::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #44403c, var(--hg-amber-dim), var(--hg-gold));
}

.hg-range::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fef3c7, var(--hg-amber));
    border: 3px solid #1c1917;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45);
    cursor: pointer;
}

.hg-guess-readout {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--hg-gold);
    min-width: 7.5rem;
    text-align: right;
}

.hg-mag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.hg-mag-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 0 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--hg-text);
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.15s ease, background 0.15s ease;
}

.hg-mag-btn:active {
    transform: scale(0.96);
}

.hg-step-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.hg-step-btn {
    min-width: 52px;
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--hg-text);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.hg-step-btn:active {
    transform: scale(0.95);
}

.hg-primary {
    width: 100%;
    min-height: 54px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--hg-amber) 0%, var(--hg-amber-dim) 100%);
    color: #1c1917;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hg-primary:active {
    transform: scale(0.98);
}

.hg-primary:disabled {
    opacity: 0.45;
    transform: none;
    box-shadow: none;
}

.hg-secondary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hg-secondary {
    flex: 1;
    min-width: 140px;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--hg-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.hg-reveal-overlay {
    overflow: hidden;
}

.hg-reveal-phase {
    text-align: center;
    padding: 0.5rem 0;
}

.hg-reveal-phase.hg-anim-pulse {
    animation: hgCommitPulse 0.6s ease-out;
}

@keyframes hgCommitPulse {
    0% { transform: scale(1); opacity: 1; }
    40% { transform: scale(1.03); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.hg-result-actual {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--hg-gold);
    margin: 0.5rem 0;
    text-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
}

.hg-result-actual.hg-pop {
    animation: hgPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hgPop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.hg-band {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hg-accent);
    margin: 0.35rem 0 0.75rem;
}

.hg-points {
    font-size: 2rem;
    font-weight: 800;
    color: var(--hg-text);
}

.hg-meta {
    font-size: 0.8125rem;
    color: var(--hg-muted);
    margin-top: 0.5rem;
}

.hg-error {
    text-align: center;
    color: var(--hg-danger);
    font-size: 0.9rem;
    padding: 0.5rem;
}

.hg-foot {
    max-width: 520px;
    margin: 1.5rem auto 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--hg-muted);
    text-align: center;
    padding: 0 0.5rem;
}

.hg-foot a {
    color: var(--hg-amber);
}

.hg-hidden {
    display: none !important;
}

.hg-daily-login-gate,
.hg-daily-played-card {
    padding: 0.5rem 0 1rem;
    max-width: 100%;
}

.hg-daily-played-card .hg-name {
    min-height: auto;
    font-size: 1rem;
}

.hg-keypad {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hg-keypad-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hg-muted);
    margin-bottom: 0.65rem;
    text-align: center;
}

.hg-keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
}

.hg-keypad-btn {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: var(--hg-text);
    font-weight: 600;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    padding: 0;
    transition: transform 0.12s ease, background 0.12s ease;
}

.hg-keypad-btn:active {
    transform: scale(0.97);
}

.hg-keypad-btn:disabled {
    opacity: 0.35;
}

.hg-keypad-btn.hg-keypad-wide {
    grid-column: span 1;
}

.hg-keypad-000 {
    width: 100%;
    min-height: 44px;
    margin-top: 0.45rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: var(--hg-gold);
    font-weight: 600;
    font-size: 0.9rem;
}

.hg-keypad-000:disabled {
    opacity: 0.35;
}

@media (min-width: 380px) {
    .hg-keypad-grid {
        gap: 0.55rem;
    }
    .hg-keypad-btn {
        min-height: 52px;
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hg-bottle-wrap.hg-bottle-wrap--loading {
        animation: none;
    }
    .hg-skeleton {
        animation: none;
        background: rgba(255, 255, 255, 0.06);
    }
    .hg-bottle-searching-icon {
        animation: none;
    }
    .hg-bottle-placeholder-icon {
        animation: none;
    }
    .hg-bottle-wrap img {
        transition: none;
    }
    .hg-result-actual.hg-pop,
    .hg-reveal-phase.hg-anim-pulse {
        animation: none;
    }
    .hg-mode-btn,
    .hg-primary,
    .hg-mag-btn,
    .hg-step-btn {
        transition: none;
    }
}

/* Site header: two-row mobile layout so search + hamburger stay on-screen (direct link to mobile_responsive + fallback). */
@media (max-width: 992px) {
    html body .header .header-content {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto !important;
        column-gap: 0.5rem !important;
        row-gap: 0.35rem !important;
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px)) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    html body .header .header-content > a:first-of-type {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    html body .header .header-content .search-container {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    html body .header .header-content #mobileMenuToggleBtn,
    html body .header .header-content .mobile-menu-toggle {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        flex-shrink: 0 !important;
    }

    .hg-app {
        --hg-header-offset: max(104px, calc(env(safe-area-inset-top, 0px) + 96px));
    }
}
