/**
 * CSS Reset and Base Styles
 *
 * Box-sizing, scrollbar styling, touch handling, and body defaults.
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    touch-action: manipulation;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    line-height: 1.2;
}

/* ---- Global utility: profit coloring ---- */
.profit-positive { color: var(--winner-green); }
.profit-negative { color: var(--loser-red); }

/* ---- Emoji containment ---- */
/* Use on any <span> wrapping an emoji to prevent it from expanding line-height */
.emoji {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* Always show scrollbar to prevent layout shift when switching pages */
/* overscroll-behavior-x: none blocks horizontal scroll-chaining while leaving
   vertical overscroll (native pull-to-refresh) intact on mobile */
html {
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior-x: none;
    color-scheme: dark;
}

/* Custom Scrollbar Styling - WebKit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(233, 69, 96, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(233, 69, 96, 0.5) rgba(255, 255, 255, 0.05);
}

/* =====================================================================
   MOBILE TOUCH HANDLING - Prevent unintended zoom/selection
   ===================================================================== */

/* Global touch-action for all clickable elements */
button,
a,
.clickable,
[onclick],
input[type="button"],
input[type="submit"],
.btn,
.btn-primary,
.btn-secondary,
.nav-tab,
.mobile-nav-item,
.app-tile,
.lesson-card,
.hand-card,
.toggle-switch,
.filter-tag,
.calculator-card-slot,
.card-picker-flop-slot,
.card-picker-slot-remove,
.card-picker-confirm-btn,
.card-picker-clear-btn,
.card-picker-close,
.ranges-action-btn,
.bankroll-filter-toggle,
.reveal-street-btn,
.action-btn,
.modal-close,
.learn-modal-close {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on interactive elements during tap */
@media (max-width: 768px) {
    button,
    .btn,
    .nav-tab,
    .mobile-nav-item,
    .app-tile,
    .quiz-option,
    .card-picker-grid-card,
    .ranges-cell,
    .calculator-card-slot,
    .toggle-switch {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Body defaults */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Prevent orphaned words on all text content */
p, li, h1, h2, h3, h4, h5, h6, label, span, div {
    text-wrap: pretty;
}

/* Global select/dropdown styling for readability */
select {
    background-color: var(--bg-card);
    color: var(--text);
    padding-right: 28px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    color-scheme: dark;
}

select option {
    background-color: var(--bg-dark);
    color: var(--text);
    padding: 8px;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: var(--accent);
    color: white;
}


/* =====================================================
   EXPORT / SHARE MODE
   Applied transiently during client-side image capture.
   Hide UI chrome that should not appear in shared images.
   ===================================================== */
.exporting .checkbox-cell,
.exporting th[data-column="checkbox"],
.exporting .bankroll-mobile-actions,
.exporting .bankroll-batch-toolbar,
.exporting .in-progress-actions,
.exporting .calculator-remove-player,
.exporting .calculator-outs-button,
.exporting .outs-reveal-btn,
.exporting .calculator-results,
.exporting .calc-integrated-top,
.exporting .modal-close,
.exporting .summary-actions,
.exporting .summary-notes-section {
    display: none !important;
}

@media (hover: none) and (pointer: coarse) {
    .export-download-btn { display: none !important; }
}

