/**
 * Domino Online - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== CSS VARIABLES ===== */
:root {
    /* Palette - Amazon Orange */
    --primary-color: #FF9900;
    --secondary-color: #232F3E;
    --accent-color: #37475A;
    --surface-color: #FFFFFF;
    --text-color: #146EB4;
    
    /* Automatic variations */
    --primary-hover: color-mix(in srgb, var(--primary-color) 85%, black);
    --primary-light: color-mix(in srgb, var(--primary-color) 15%, white);
    --primary-alpha: rgba(255, 153, 0, 0.1);
    --bg-color: #f8f9fa;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    
    /* Status colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --spacing-unit: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    /* Board colors */
    --board-green: #2d5a27;
    --board-blue: #1a365d;
    --board-red: #742a2a;
    --board-purple: #44337a;
    --board-color: var(--board-green);
    
    /* Domino colors */
    --domino-bg: #f5f5f5;
    --domino-border: #d0d0d0;
    --domino-dot: #1a1a1a;

    /* Player colors */
    --player-0-color: #3b82f6; /* Blue - Human player */
    --player-1-color: #ef4444; /* Red - AI 1 */
    --player-2-color: #10b981; /* Green - AI 2 */
    --player-3-color: #f59e0b; /* Orange - AI 3 */
    
    /* Safe areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6c6c6c;
    --border-color: #333333;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #121212;
        --surface-color: #1e1e1e;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #6c6c6c;
        --border-color: #333333;
    }
}

/* ===== BASE STYLES ===== */
html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.header-logo h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 8px;
    }
    
    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: var(--border-radius-sm);
        color: var(--text-secondary);
        font-weight: 500;
        transition: var(--transition);
    }
    
    .desktop-nav .nav-link:hover {
        background: var(--primary-alpha);
        color: var(--primary-color);
    }
    
    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: var(--safe-bottom);
    /* Prevent browser from hiding the bottom nav on scroll */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* Ensure bottom nav always stays visible */
    contain: layout style paint;
    -webkit-contain: layout style paint;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    min-width: 64px;
    min-height: 48px;
    text-decoration: none;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.15);
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 20px;
    text-align: center;
}

.section-header h2,
.section-header h3 {
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-alpha);
    color: var(--primary-color);
}

/* ===== BENTO GRID ===== */
.bento-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}

.hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .bento-large {
        grid-row: span 2;
    }
}

.bento-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Hero Card */
.hero-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-card h2 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.hero-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    max-width: 300px;
}

.hero-visual {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

.floating-domino {
    width: 60px;
    height: 120px;
    background: white;
    border-radius: 8px;
    position: absolute;
    animation: float 3s ease-in-out infinite;
}

.domino-1 {
    right: 20px;
    top: -60px;
    animation-delay: 0s;
}

.domino-2 {
    right: 80px;
    top: 0;
    animation-delay: 0.5s;
    transform: rotate(15deg);
}

.domino-3 {
    right: 40px;
    top: 60px;
    animation-delay: 1s;
    transform: rotate(-10deg);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

/* Stats Preview Cards */
.stats-preview,
.games-preview,
.streak-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 20px;
}

.stat-icon.fire {
    background: rgba(255, 87, 34, 0.1);
    color: #ff5722;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Progress Ring */
.progress-ring {
    width: 56px;
    height: 56px;
    margin-left: auto;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 3;
}

.progress-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== GAME MODES ===== */
.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.mode-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
}

.mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.mode-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-alpha);
}

.mode-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    border-radius: 16px;
    color: var(--primary-color);
    font-size: 24px;
}

.mode-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.mode-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mode-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.mode-badge.new {
    background: var(--success-color);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.action-card:hover {
    background: var(--primary-alpha);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 24px;
    color: var(--primary-color);
}

.action-card span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* ===== ACHIEVEMENTS ===== */
.achievements-preview,
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, var(--primary-alpha), transparent);
    border: 1px solid var(--primary-color);
}

.achievement-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    border-radius: 50%;
    font-size: 20px;
}

.achievement-item.unlocked .achievement-icon {
    background: var(--primary-color);
    color: white;
}

.achievement-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== FAQ ===== */
.faq-container {
    margin-bottom: 32px;
}

.faq-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--primary-alpha);
}

.faq-icon {
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.faq-answer[hidden] {
    display: none;
}

/* ===== GAME CONTAINER ===== */
.game-container {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    display: flex;
    flex-direction: column;
}

.game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-screen.hidden {
    display: none;
}

/* Game Setup */
#game-setup {
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.setup-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-xl);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    margin: 8px 0;
}

.setup-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.setup-group {
    margin-bottom: 24px;
}

.setup-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .radio-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.radio-card {
    cursor: pointer;
}

.radio-card input {
    display: none;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.radio-card input:checked + .radio-content {
    border-color: var(--primary-color);
    background: var(--primary-alpha);
}

.radio-content i {
    font-size: 24px;
    color: var(--primary-color);
}

.radio-content span {
    font-size: 0.85rem;
    font-weight: 500;
}

.player-selector,
.points-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.player-btn,
.points-btn {
    flex: 1;
    min-width: 60px;
    padding: 12px 8px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

@media (max-width: 480px) {
    .player-selector,
    .points-selector {
        gap: 8px;
    }

    .player-btn,
    .points-btn {
        min-width: 50px;
        padding: 10px 6px;
        font-size: 0.8rem;
    }
}

.player-btn.active,
.points-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-alpha);
    color: var(--primary-color);
}

.setup-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-direction: column;
}

.setup-actions .btn {
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
}

@media (min-width: 480px) {
    .setup-actions {
        flex-direction: row;
    }
}

/* Game Board */
#game-board {
    background: var(--board-color);
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.game-info {
    display: flex;
    gap: 12px;
    color: white;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.game-actions {
    display: flex;
    gap: 8px;
}

.round-info {
    font-weight: 600;
}

.mode-info {
    opacity: 0.8;
}

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scoreboard::-webkit-scrollbar {
    display: none;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    min-width: 60px;
    flex-shrink: 0;
}

.score-item.hidden {
    display: none;
}

.player-score {
    background: rgba(255, 153, 0, 0.3);
    border: 2px solid var(--primary-color);
}

/* Player color indicators */
.score-item[data-player="0"] {
    --player-color: var(--player-0-color);
    border-color: var(--player-color);
    background: rgba(59, 130, 246, 0.2);
}

.score-item[data-player="1"] {
    --player-color: var(--player-1-color);
    border-color: var(--player-color);
    background: rgba(239, 68, 68, 0.2);
}

.score-item[data-player="2"] {
    --player-color: var(--player-2-color);
    border-color: var(--player-color);
    background: rgba(16, 185, 129, 0.2);
}

.score-item[data-player="3"] {
    --player-color: var(--player-3-color);
    border-color: var(--player-color);
    background: rgba(245, 158, 11, 0.2);
}

.score-item .score-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--player-color, var(--primary-color));
    margin-right: 6px;
    vertical-align: middle;
}

.score-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* Board Area */
.board-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: relative;
    min-height: 180px;
    overflow: hidden;
}

.board-area {
    width: 100%;
    max-width: calc(100vw - 16px);
    min-height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.board-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 16px 8px;
    overflow-x: auto;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
    min-height: 80px;
}

/* Touch-friendly navigation hints */
.board-scroll-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

.board-center:hover + .board-scroll-hint,
.board-scroll-hint.show {
    opacity: 1;
}

.board-center::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive board adjustments */
@media (max-width: 768px) {
    .board-wrapper {
        padding: 8px;
        position: relative;
    }

    .board-center {
        padding: 12px 4px;
        gap: 1px;
        justify-content: flex-start;
    }

    /* Auto-scroll to show recent moves on mobile */
    .board-center:focus-within {
        scroll-behavior: auto;
    }

    /* Add scroll hint for mobile */
    .board-wrapper::after {
        content: '← Arraste para ver mais →';
        position: absolute;
        bottom: -24px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 2px 8px;
        border-radius: 8px;
        font-size: 10px;
        white-space: nowrap;
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .board-center {
        padding: 8px 2px;
        gap: 0px;
        scroll-padding: 20px;
    }

    .domino-piece {
        width: 32px;
        min-width: 32px;
        height: 64px;
        touch-action: none;
    }

    .domino-piece.horizontal {
        width: 64px;
        min-width: 64px;
        height: 32px;
    }

    /* Improve touch targets */
    .end-indicator {
        min-width: 48px;
        min-height: 48px;
    }

    .board-wrapper::after {
        font-size: 9px;
        padding: 1px 6px;
    }
}

/* Auto-scroll to new pieces on mobile */
@media (max-width: 768px) {
    .board-piece:last-child {
        animation: slideIn 0.5s ease-out;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.board-center::-webkit-scrollbar {
    height: 6px;
}

.board-center::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.board-center::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* End Indicators Container */
.end-indicators-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 16px 0;
    min-height: 60px;
    flex-wrap: wrap;
}

/* End Indicators */
.end-indicator {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.end-indicator:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.end-indicator:active {
    transform: scale(0.95);
}

.end-indicator.hidden {
    display: none;
}

.end-indicator.highlight {
    animation: pulse 1.5s infinite;
    background: var(--success-color);
    border-color: white;
}

.end-indicator.highlight::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--success-color);
    border-radius: 50%;
    animation: ripple 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: translateY(-50%) scale(1);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
        transform: translateY(-50%) scale(1.1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Mobile improvements for end indicators */
@media (max-width: 768px) {
    .end-indicators-container {
        gap: 15px;
        margin: 12px 0;
    }

    .end-indicator {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .btn-pass {
        padding: 10px 14px;
        font-size: 0.8rem;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .end-indicators-container {
        gap: 10px;
        margin: 10px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .end-indicator {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .btn-pass {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-width: 65px;
        order: -1; /* Pass button comes first on mobile */
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Stock Indicator */
.stock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
}

.stock-indicator.hidden {
    display: none;
}

.stock-pile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.stock-pile i {
    font-size: 20px;
}

/* Turn Indicator */
.turn-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.turn-text {
    color: white;
    font-weight: 600;
}

.turn-indicator.player-turn .turn-text {
    color: var(--primary-color);
}

.turn-timer {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.turn-timer::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    animation: timer 30s linear;
}

@keyframes timer {
    from { width: 100%; }
    to { width: 0%; }
}

/* Player Hand */
.player-hand-area {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 12px;
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hand-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.player-hand {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 20px 4px 16px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(255, 255, 255, 0.1);
    cursor: grab;
}

.player-hand:active {
    cursor: grabbing;
}

.player-hand::-webkit-scrollbar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.player-hand::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 40px;
}

.player-hand::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.9);
}

.player-hand::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.player-hand::-webkit-scrollbar-corner {
    background: transparent;
}

@media (max-width: 480px) {
    .player-hand-area {
        padding: 8px 10px;
    }

    .hand-label {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .player-hand {
        gap: 4px;
        padding: 16px 4px 12px 4px;
    }

    .player-hand::-webkit-scrollbar {
        height: 6px;
    }

    .player-hand::-webkit-scrollbar-thumb {
        min-width: 30px;
    }
}

/* Domino Piece */
.domino-piece {
    display: flex;
    flex-direction: column;
    width: 40px;
    min-width: 40px;
    height: 80px;
    background: var(--domino-bg);
    border: 2px solid var(--domino-border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.domino-piece.horizontal {
    flex-direction: row;
    width: 80px;
    min-width: 80px;
    height: 40px;
}

.domino-piece:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.domino-piece.selected {
    transform: translateY(-12px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(255, 153, 0, 0.4);
}

.domino-piece.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.domino-piece.disabled:hover {
    transform: none;
}

.domino-half {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 4px;
    position: relative;
}

.domino-piece:not(.horizontal) .domino-half:first-child::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--domino-border);
}

.domino-piece.horizontal .domino-half:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    width: 2px;
    height: 80%;
    background: var(--domino-border);
}

.domino-dot {
    width: 6px;
    height: 6px;
    background: var(--domino-dot);
    border-radius: 50%;
    margin: auto;
}

/* Dot positions */
.dot-1 { grid-area: 1 / 1; }
.dot-2 { grid-area: 1 / 3; }
.dot-3 { grid-area: 2 / 2; }
.dot-4 { grid-area: 3 / 1; }
.dot-5 { grid-area: 3 / 3; }
.dot-6 { grid-area: 2 / 1; }
.dot-7 { grid-area: 2 / 3; }

/* Board pieces */
.board-piece {
    flex-shrink: 0;
    position: relative;
}

.board-piece:hover {
    transform: none;
}

.board-piece::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 2px;
    opacity: 0.8;
}

.board-piece[data-player="0"]::after {
    background: var(--player-0-color);
}

.board-piece[data-player="1"]::after {
    background: var(--player-1-color);
}

.board-piece[data-player="2"]::after {
    background: var(--player-2-color);
}

.board-piece[data-player="3"]::after {
    background: var(--player-3-color);
}

/* Pass Button - now positioned with end indicators */
.btn-pass {
    background: var(--danger-color);
    color: white;
    padding: 12px 16px;
    border: 2px solid white;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.btn-pass:hover {
    transform: translateY(-2px);
    background: #c82333;
}

.btn-pass:active {
    transform: translateY(0);
}

.btn-pass.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Game Over */
#game-over {
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--board-color);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.game-over-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-xl);
    padding: 24px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    margin: 8px 0;
}

@media (max-width: 480px) {
    .game-over-card {
        padding: 20px;
        margin: 4px 0;
    }
}

.game-over-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    font-size: 36px;
    color: white;
}

.game-over-icon.defeat {
    background: linear-gradient(135deg, var(--text-muted), var(--text-secondary));
}

.game-over-card h2 {
    margin-bottom: 8px;
}

.game-over-card p {
    margin-bottom: 24px;
}

.final-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.final-score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-radius: var(--border-radius-sm);
}

.final-score-item.winner {
    background: var(--primary-alpha);
    font-weight: 600;
}

.game-over-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.game-over-stats .stat-item {
    text-align: center;
}

.game-over-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-over-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface-color);
    border-radius: var(--border-radius-xl);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    margin: 8px 0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

@media (max-width: 480px) {
    .modal {
        padding: 12px;
        align-items: flex-start;
    }

    .modal-content {
        padding: 20px;
        margin: 4px 0;
    }
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== STATS SECTION ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
}

.stat-card.primary .stat-card-icon {
    background: var(--primary-alpha);
    color: var(--primary-color);
}

.stat-card.success .stat-card-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.stat-card.warning .stat-card-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.stat-card.fire .stat-card-icon {
    background: rgba(255, 87, 34, 0.1);
    color: #ff5722;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Detailed Stats */
.detailed-stats {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .detailed-stats {
        grid-template-columns: 1fr 1fr;
    }
}

.stats-section {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
}

.stats-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.mode-stat-name {
    font-weight: 500;
}

.mode-stat-value {
    font-weight: 700;
    color: var(--primary-color);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.history-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.history-icon.win {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.history-icon.loss {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.history-info {
    flex: 1;
}

.history-mode {
    font-weight: 500;
    font-size: 0.9rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-score {
    font-weight: 700;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Danger Zone */
.danger-zone {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* ===== SETTINGS ===== */
.settings-group {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.settings-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.setting-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.setting-control {
    flex-shrink: 0;
    margin-left: auto;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 4px;
    width: 100%;
    max-width: 200px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 6px;
    background: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Responsive settings */
@media (max-width: 768px) {
    .settings-group {
        padding: 16px;
        margin-bottom: 16px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 0;
    }

    .setting-control {
        margin-left: 0;
        align-self: stretch;
    }

    .toggle-group {
        max-width: none;
        width: 100%;
    }

    .toggle-btn {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .settings-group {
        padding: 12px;
        margin-bottom: 12px;
    }

    .settings-group h3 {
        font-size: 0.9rem;
        margin-bottom: 16px;
        padding-bottom: 8px;
    }

    .setting-item {
        padding: 10px 0;
        gap: 8px;
    }

    .setting-label {
        font-size: 0.9rem;
    }

    .setting-description {
        font-size: 0.75rem;
    }

    .toggle-btn {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .color-picker {
        flex-wrap: wrap;
        gap: 6px;
    }

    .color-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.color-btn.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Switch */
.switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.switch input:checked + .slider {
    background: var(--primary-color);
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

/* Select Control */
.select-control {
    padding: 10px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 120px;
    width: 100%;
    max-width: 200px;
}

@media (max-width: 480px) {
    .select-control {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: 100px;
        max-width: none;
    }
}

/* Setting Link */
.setting-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.setting-link:last-child {
    border-bottom: none;
}

.setting-link:hover {
    color: var(--primary-color);
}

.setting-link i:first-child {
    width: 24px;
    color: var(--primary-color);
}

.setting-link span {
    flex: 1;
}

.setting-link i:last-child {
    color: var(--text-muted);
}

/* Version Info */
.version-info {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.version-info a {
    color: var(--primary-color);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .toast-container {
        bottom: 20px;
    }
}

.toast {
    background: var(--secondary-color);
    color: white;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 24px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.app-footer p {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-color) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



/* ===== PRINT STYLES ===== */
@media print {
    .app-header,
    .bottom-nav,
    .btn,
    .toast-container {
        display: none !important;
    }

    body {
        padding: 0;
    }
}
