/* Mobile-First Design for Lux Pixel War */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow-x: hidden;
}

.pixel-war-container {
    min-height: 100vh;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Animated Background */
.pixel-war-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: backgroundMove 30s linear infinite;
    pointer-events: none;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

/* Gesture Handler Confirmation Modal */
.pixel-confirmation-gesture {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    animation: fadeIn 0.2s ease !important;
}

.pixel-confirmation-gesture .confirmation-backdrop {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(2px) !important;
}

.pixel-confirmation-gesture .confirmation-card {
    position: relative !important;
    background: white !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    text-align: center !important;
    min-width: 280px !important;
    max-width: 90vw !important;
    transform: translateY(0) !important;
    animation: slideUp 0.3s ease !important;
}

.pixel-confirmation-gesture .confirmation-card h4 {
    margin: 0 0 16px 0 !important;
    color: #333 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.pixel-confirmation-gesture .confirmation-card p {
    margin: 8px 0 !important;
    color: #666 !important;
    font-size: 14px !important;
}

.pixel-confirmation-gesture .confirmation-actions {
    display: flex !important;
    gap: 12px !important;
    margin-top: 20px !important;
}

.pixel-confirmation-gesture .confirmation-actions button {
    flex: 1 !important;
    padding: 12px 16px !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.pixel-confirmation-gesture .btn-confirm {
    background: #4caf50 !important;
    color: white !important;
}

.pixel-confirmation-gesture .btn-confirm:hover {
    background: #45a049 !important;
    transform: translateY(-1px) !important;
}

.pixel-confirmation-gesture .btn-cancel {
    background: #f44336 !important;
    color: white !important;
}

.pixel-confirmation-gesture .btn-cancel:hover {
    background: #da190b !important;
    transform: translateY(-1px) !important;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header - Mobile First */
.pixel-war-header {
    text-align: center;
    padding: 0.75rem;
    color: white;
    position: relative;
    z-index: 10;
}

.pixel-war-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Mobile Layout Container */
.mobile-container {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Canvas Section - Mobile */
.canvas-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    position: relative;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: hidden; /* Contain canvas within wrapper bounds */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    width: 100%;
    flex: 1;
    min-height: 300px;
    overflow: hidden; /* Keep canvas contained within bounds */
    border-radius: 0;
    position: relative;
    background: white;
    touch-action: none;
    /* Remove -webkit-overflow-scrolling that can interfere with touch events */
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* border: 2px solid #e0e0e0; REMOVED - was causing canvas sizing issues */
}

#pixelCanvas {
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
    background: white;
    /* border: 1px solid #ddd; REMOVED - was causing 1002x1002 instead of 1000x1000 */
    touch-action: none;  /* Ensure touch events work on the canvas */
    user-select: none;   /* Prevent text selection on touch */
    -webkit-user-select: none;
    -webkit-touch-callout: none;  /* Disable iOS callout menu */
    /* Remove transition that might cause drift during pan gestures */
    /* transition: transform 0.05s ease-out; */
    will-change: transform; /* Optimize for animations */
    /* Ensure proper positioning to prevent drift */
    position: relative;
    margin: 0;
    padding: 0;
    transition: filter 0.1s ease;
}

#pixelCanvas:hover {
    /* Subtle brightness increase on hover to indicate interactivity */
    filter: brightness(1.02);
}

#pixelCanvas:active {
    cursor: grabbing;
}

/* Different cursor states for better feedback */
#pixelCanvas.draggable {
    cursor: grab;
}

#pixelCanvas.dragging {
    cursor: grabbing;
    filter: brightness(0.98); /* Slight dimming during drag */
}

/* Mobile Top Controls Bar */
.mobile-controls-bar {
    display: none;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .mobile-controls-bar {
        display: block !important;
    }
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.menu-toggle-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.quick-color-selector {
    display: flex;
    gap: 0.35rem;
    flex: 1;
    justify-content: center;
    max-width: 320px;
}

.quick-color {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.quick-color.selected {
    border-color: #667eea;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.quick-color-more {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px dashed #999;
    background: white;
    color: #666;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pixels-counter {
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Mobile Canvas Controls */
.mobile-canvas-controls {
    display: none;
    background: white;
    border-top: 2px solid #e0e0e0;
    padding: 0.75rem;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .mobile-canvas-controls {
        display: flex !important;
        flex-direction: column;
    }
}

.corner-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 200px;
    margin: 0 auto;
}

.corner-nav-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.corner-nav-btn:nth-child(2) {
    grid-column: 3;
}

.corner-nav-btn:nth-child(3) {
    grid-column: 2;
}

.corner-nav-btn:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

.corner-nav-btn:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
}

.corner-nav-btn:active {
    background: #667eea;
    color: white;
    transform: scale(0.95);
}

.zoom-control-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 0.5rem 1rem;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-radius: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

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

.zoom-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: white;
    color: #667eea;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.zoom-btn:active {
    transform: scale(0.95);
    background: #667eea;
    color: white;
}

.zoom-indicator {
    min-width: 60px;
    text-align: center;
    font-weight: bold;
    color: #333;
}

.canvas-tools {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.tool-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

/* Mobile Action Bar */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #e0e0e0;
    padding: 0.75rem;
    z-index: 200;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .mobile-action-bar {
        display: block !important;
    }
}

.action-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.selected-color-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #333;
    background: #000;
}

.place-pixel-btn {
    flex: 1;
    max-width: 200px;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.place-pixel-btn:disabled {
    background: #ccc;
    color: #666;
}

.place-pixel-btn:not(:disabled):active {
    transform: scale(0.95);
}

.cooldown-text {
    font-size: 0.75rem;
    opacity: 0.8;
}

.pixels-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.pixels-info .label {
    font-size: 0.75rem;
    color: #666;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Color Palette - Mobile Optimized */
.color-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.color-section h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.color-palette {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}

.color-btn {
    aspect-ratio: 1;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 40px;
    min-height: 40px;
}

.color-btn:active {
    transform: scale(0.9);
}

.color-btn.selected {
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #667eea, 0 2px 8px rgba(102, 126, 234, 0.5);
    transform: scale(1.1);
}

.custom-color {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.custom-color label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

#colorPicker {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Info Cards - Mobile */
.info-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 100%;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 0.85rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

.info-card h3 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.info-card p {
    margin: 0.4rem 0;
    color: #555;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.stat-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

/* User Tier Badges */
.user-tier {
    padding: 0.75rem;
    border-radius: 10px;
    margin: 0.5rem 0;
    text-align: center;
}

.user-tier.registered {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.user-tier.anonymous {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #666;
}

.tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Registration Incentive - Mobile */
.register-incentive {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    padding: 0.75rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    text-align: center;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 5px 15px rgba(255, 183, 0, 0.3); }
    50% { box-shadow: 0 5px 25px rgba(255, 183, 0, 0.5); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.incentive-text {
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.incentive-text .highlight {
    color: #d32f2f;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-top: 0.25rem;
}

.btn-register {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 0.65rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.btn-register:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

/* Activity Feed - Mobile */
.activity-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 0.75rem;
    max-width: 100%;
}

.activity-section h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.activity-list {
    max-height: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.25rem;
}

.activity-item {
    display: grid;
    grid-template-columns: 25px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
}

.activity-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.activity-user {
    font-weight: 500;
    color: #333;
}

.activity-time {
    color: #999;
    font-size: 0.75rem;
}

/* Notification Toast - Mobile */
.notification {
    position: fixed;
    top: auto;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    text-align: center;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.notification.info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

/* Mobile Pixel Selection UI */
.pixel-confirmation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 280px;
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }
    to {
        bottom: 20px;
        opacity: 1;
    }
}

.confirmation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.pixel-coords {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.pixel-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.confirmation-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
}

.btn-confirm {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

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

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

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

.confirmation-hint {
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* Pixel Magnifier */
.pixel-magnifier {
    position: fixed;
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: popIn 0.2s ease;
    pointer-events: none;
}

.pixel-magnifier canvas {
    display: block;
    border-radius: 10px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Canvas shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Pixel Tooltip - Enhanced with Better Visibility */
.pixel-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 180px;
    white-space: nowrap;
    transform: translateY(-100%);
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-90%);
    }
    to {
        opacity: 1;
        transform: translateY(-100%);
    }
}

.pixel-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 10px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

/* Pan Hint */
.pan-hint {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.pan-hint.hidden {
    opacity: 0;
}

.desktop-hint {
    display: none;
}

.mobile-hint {
    display: inline;
}

@media (min-width: 768px) {
    .desktop-hint {
        display: inline;
    }
    .mobile-hint {
        display: none;
    }
}

/* Desktop Canvas Controls */
.desktop-canvas-controls {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    gap: 10px;
}

@media (min-width: 768px) {
    .desktop-canvas-controls {
        display: flex;
        flex-direction: column;
    }
}

.desktop-canvas-controls .zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.desktop-canvas-controls .nav-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .desktop-only {
        display: flex;
    }
}

/* Pixel Crosshair */
.pixel-crosshair {
    display: none;
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

.pixel-crosshair.active {
    display: block;
}

.pixel-crosshair::before,
.pixel-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 0, 0, 0.5);
}

.pixel-crosshair::before {
    width: 100%;
    height: 1px;
    left: 0;
    top: 50%;
}

.pixel-crosshair::after {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}

/* Tablet Styles */
@media (min-width: 768px) {
    .pixel-war-header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .mobile-container {
        padding: 1rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .canvas-section {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        padding: 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    .canvas-wrapper {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 0.35rem;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    .canvas-container {
        height: 450px;
        border-radius: 10px;
    }
    
    .mobile-controls-bar,
    .mobile-canvas-controls,
    .mobile-action-bar,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .info-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .color-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .zoom-controls {
        flex-direction: column;
    }
    
    .activity-list {
        max-height: 300px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .pixel-war-header h1 {
        font-size: 2.5rem;
    }
    
    .pixel-war-header {
        padding: 0.75rem 1rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .mobile-container {
        padding: 1rem;
        display: grid;
        grid-template-columns: minmax(300px, 18%) 1fr minmax(280px, 16%);
        grid-template-rows: 1fr;
        gap: 1.5rem;
        max-width: 100%;
        height: calc(100vh - 100px);
        margin: 0;
    }
    
    
    .controls-sidebar {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        padding-right: 0.5rem;
    }
    
    .controls-sidebar .info-section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .controls-sidebar .info-card {
        width: 100%;
        box-sizing: border-box;
    }
    
    .main-content {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-height: calc(100vh - 140px);
        min-width: 0;
    }
    
    .canvas-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0.75rem;
        min-height: 0;
    }
    
    .canvas-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        position: relative;
        min-height: 0;
        padding: 0.5rem;
    }
    
    .canvas-container {
        flex: 1;
        height: calc(100vh - 200px);
        min-height: 500px;
        max-height: calc(100vh - 180px);
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f0f0f0;
        overflow: hidden; /* Keep content within container */
        position: relative;
    }
    
    #pixelCanvas {
        display: block;
        margin: 0 auto;
    }
    
    .activity-section {
        grid-column: 3;
        grid-row: 1;
        max-height: calc(100vh - 140px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .activity-list {
        flex: 1;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        display: block;
    }
    
    .activity-item {
        display: grid;
        grid-template-columns: 25px 1fr auto;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 0.85rem;
    }
    
    .zoom-btn:hover {
        background: #667eea;
        color: white;
        transform: scale(1.1);
    }
    
    .color-btn:hover {
        transform: scale(1.15);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .btn-register:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .pixel-war-header h1 {
        font-size: 3rem;
    }
    
    .mobile-container {
        max-width: 100%;
        padding: 1rem 1.5rem;
        grid-template-columns: minmax(280px, 14%) 1fr minmax(260px, 14%);
        height: calc(100vh - 90px);
    }
    
    .canvas-container {
        height: calc(100vh - 160px);
        max-height: calc(100vh - 160px);
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    
    .color-btn {
        min-width: 38px;
        min-height: 38px;
    }
}

/* Extra Large Desktop & Full HD */
@media (min-width: 1920px) {
    .mobile-container {
        grid-template-columns: minmax(300px, 12%) 1fr minmax(280px, 12%);
        gap: 1.5rem;
        padding: 1rem 2rem;
        height: calc(100vh - 80px);
    }
    
    .pixel-war-header {
        padding: 0.5rem 1rem;
    }
    
    .pixel-war-header h1 {
        font-size: 3.5rem;
    }
    
    .canvas-container {
        height: calc(100vh - 140px);
        max-height: calc(100vh - 140px);
    }
    
    .info-card {
        padding: 1.2rem;
    }
    
    .activity-item {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* Fullscreen Canvas Mode */
.pixel-war-container.fullscreen-canvas .mobile-container {
    grid-template-columns: 1fr;
    padding: 0.5rem;
}

.pixel-war-container.fullscreen-canvas .controls-sidebar,
.pixel-war-container.fullscreen-canvas .activity-section {
    display: none;
}

.pixel-war-container.fullscreen-canvas .main-content {
    grid-column: 1;
    max-height: calc(100vh - 80px);
}

.pixel-war-container.fullscreen-canvas .canvas-container {
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
}

.fullscreen-toggle {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.fullscreen-toggle:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.1);
}

@media (min-width: 1024px) {
    .fullscreen-toggle {
        display: block;
    }
}

@media (max-width: 1023px) {
    .fullscreen-toggle {
        display: none;
    }
}

/* Loading States */
.loading {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Grid Toggle Button */
.grid-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.grid-toggle-btn:active {
    transform: scale(0.95);
}

.grid-toggle-btn.active {
    background: #4caf50;
    color: white;
    border-color: #45a049;
}

/* Touch Mode Toggle */
.touch-mode-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
}

.touch-mode-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #667eea;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.touch-mode-btn:active {
    transform: scale(0.95);
}

.touch-mode-btn.precision {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #764ba2;
}

.mode-icon {
    font-size: 18px;
}

.mode-text {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Limit Reached Dialog */
.limit-reached-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    max-width: 90%;
    width: 320px;
    animation: popIn 0.3s ease;
}

.dialog-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

.dialog-content p {
    margin: 10px 0;
    color: #666;
}

.countdown {
    font-weight: bold;
    color: #ff6b6b;
    font-size: 18px;
}

.upgrade-prompt {
    background: #f0f8ff;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.upgrade-prompt ul {
    margin: 10px 0;
    padding-left: 20px;
}

.upgrade-prompt li {
    margin: 5px 0;
    color: #4caf50;
}

.btn-register, .btn-join {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}

.btn-close {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* Registration Prompt Mobile */
.registration-prompt-mobile {
    position: fixed;
    bottom: 80px;
    left: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    animation: slideUp 0.3s ease;
}

.prompt-content {
    position: relative;
    color: white;
}

.close-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.prompt-content h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.benefits {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.benefit .icon {
    font-size: 20px;
}

/* Enhanced Mobile Touch Targets */
@media (max-width: 768px) {
    .pixel-war-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .pixel-war-header {
        flex-shrink: 0;
    }
    
    .mobile-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .controls-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: white;
        z-index: 160;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 1rem;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }
    
    .controls-sidebar.open {
        left: 0;
    }
    
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .canvas-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .activity-section {
        display: none;
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .color-btn {
        min-width: 48px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .zoom-controls button {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
    }
    
    .confirmation-buttons button {
        min-height: 48px;
        font-size: 16px;
    }
    
    /* Better touch feedback and navigation */
    .canvas-container {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: none;
        /* Ensure proper positioning to prevent drift */
        position: relative;
        overflow: hidden; /* Keep canvas content within bounds */
    }
    
    /* Prevent iOS bounce scrolling but allow scrolling */
    .pixel-war-container {
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    /* Improve magnifier position on mobile */
    .pixel-magnifier {
        max-width: 90%;
        max-height: 200px;
    }
    
    /* Touch mode button improvements */
    .touch-mode-btn {
        min-height: 40px;
    }
    
    /* Grid toggle improvements */
    .grid-toggle-btn {
        min-height: 40px;
    }
    
    /* Mobile specific optimizations */
    .pixel-war-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .color-palette {
        max-width: 100%;
    }
    
    .custom-color {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #colorPicker {
        width: 45px;
        height: 32px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .info-card h3 {
        font-size: 0.95rem;
    }
    
    .activity-item {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .user-tier {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .incentive-text {
        font-size: 0.85rem;
    }
    
    .incentive-text .highlight {
        font-size: 1rem;
    }
}

/* Ultra-wide Monitor Support (2K, 4K) */
@media (min-width: 2560px) {
    .mobile-container {
        grid-template-columns: minmax(350px, 10%) 1fr minmax(320px, 10%);
        padding: 1rem 2.5rem;
        height: calc(100vh - 70px);
    }
    
    .pixel-war-header h1 {
        font-size: 4rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .canvas-container {
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    #pixelCanvas {
        image-rendering: pixelated;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
        transform-origin: top left;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .info-card h3 {
        font-size: 1.3rem;
    }
    
    .info-card p {
        font-size: 1rem;
    }
    
    .color-section h3,
    .activity-section h3 {
        font-size: 1.3rem;
    }
    
    .color-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 0.75rem;
    }
    
    .color-btn {
        min-width: 45px;
        min-height: 45px;
    }
    
    .activity-item {
        font-size: 1rem;
        padding: 1rem;
        grid-template-columns: 30px 1fr auto;
    }
    
    .zoom-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Minimap styles removed for performance */

/* Improved navigation controls */
.nav-controls {
    position: absolute;
    top: 60px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 50;
}

.nav-btn {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

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

/* Grid toggle for mobile */
.grid-toggle-btn {
    position: absolute;
    top: 10px;
    right: 60px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    z-index: 50;
}

.grid-toggle-btn.active {
    background: #333;
    color: white;
}

/* Mobile navigation mode */
.mobile-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.touch-mode-toggle,
.nav-mode-toggle {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-mode-toggle.active {
    background: #333;
    color: white;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .canvas-section,
    .color-section,
    .info-card,
    .activity-section {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .info-card h3,
    .color-section h3,
    .activity-section h3 {
        color: #9ca3ff;
    }
    
    .info-card p {
        color: #b0b0b0;
    }
    
    .canvas-wrapper {
        background: #1a1a1a;
    }
    
    .custom-color {
        background: #2a2a2a;
    }
    
    .activity-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Minimap dark mode styles removed */
    
    .nav-btn,
    .grid-toggle-btn {
        background: rgba(40, 40, 40, 0.9);
        border-color: #555;
        color: #e0e0e0;
    }
}

/* Mobile Onboarding System Styles */
.mobile-onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.onboarding-container {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.onboarding-step {
    padding: 1.5rem;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

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

.step-header h3 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Welcome Step Styles */
.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 15px;
    text-align: left;
}

.feature-icon {
    font-size: 2rem;
    min-width: 3rem;
}

.feature-text strong {
    color: #333;
    display: block;
    font-size: 1.1rem;
}

.feature-text span {
    color: #666;
    font-size: 0.9rem;
}

/* Gesture Demo Styles */
.gesture-demo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-canvas {
    position: relative;
    width: 200px;
    height: 150px;
    background: linear-gradient(135deg, #f0f2ff, #e8ecff);
    border-radius: 15px;
    margin: 0 auto;
    overflow: hidden;
    border: 2px dashed #667eea;
}

.demo-finger {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8), rgba(102, 126, 234, 0.3));
    border-radius: 50%;
    transition: all 0.5s ease;
    opacity: 0;
}

.demo-action-text {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.gesture-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gesture-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.gesture-item:hover,
.gesture-item.active {
    background: #f0f2ff;
    border-color: #667eea;
}

.gesture-icon {
    font-size: 1.5rem;
    min-width: 2rem;
}

.gesture-label {
    color: #333;
    font-weight: 500;
}

/* Mode Comparison Styles */
.mode-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-card {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

.mode-card:hover,
.mode-card.selected {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.mode-card.tap-mode.selected {
    border-color: #4caf50;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
}

.mode-card.precision-mode.selected {
    border-color: #2196f3;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.2);
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mode-header .mode-icon {
    font-size: 1.5rem;
}

.mode-header h4 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    flex: 1;
}

.mode-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-badge.fast {
    background: #e8f5e8;
    color: #4caf50;
}

.mode-badge.accurate {
    background: #e3f2fd;
    color: #2196f3;
}

.mode-description p {
    color: #666;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.mode-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mode-description li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.mode-select-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.mode-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

/* Step Action Buttons */
.step-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn-skip,
.btn-back,
.btn-next,
.btn-finish {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.btn-skip,
.btn-back {
    background: #f5f5f5;
    color: #666;
}

.btn-skip:hover,
.btn-back:hover {
    background: #e0e0e0;
}

.btn-next,
.btn-finish {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-next:hover,
.btn-finish:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-next:active,
.btn-finish:active {
    transform: translateY(0);
}

/* Progress Indicator */
.onboarding-progress {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.progress-dots {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: white;
    transform: scale(1.3);
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Touch Mode Indicator */
.touch-mode-indicator {
    position: fixed;
    top: 80px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 0.75rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 200px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.2);
    animation: slideInRight 0.3s ease-out;
}

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

.mode-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-icon-container {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.mode-info {
    flex: 1;
}

.mode-label {
    font-weight: 600;
    color: #333;
    display: block;
    font-size: 0.95rem;
}

.mode-description {
    color: #666;
    font-size: 0.8rem;
}

.switch-mode-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.switch-mode-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.switch-mode-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.mode-help-tip {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f0f8ff;
    border-radius: 10px;
    animation: tipSlideDown 0.3s ease-out;
}

@keyframes tipSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 0.75rem;
    }
    to {
        opacity: 1;
        max-height: 100px;
        padding: 0.75rem;
    }
}

.mode-help-tip p {
    margin: 0;
    font-size: 0.85rem;
    color: #333;
}

/* Enhanced Color Palette */
.enhanced-color-palette {
    position: fixed;
    bottom: 80px;
    left: 10px;
    right: 10px;
    background: white;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 200;
    animation: slideUp 0.3s ease-out;
    max-width: 400px;
    margin: 0 auto;
}

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

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.palette-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.palette-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 1.2rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.palette-close:hover {
    background: #e0e0e0;
    color: #333;
}

.color-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-colors-expanded {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.color-btn-enhanced {
    aspect-ratio: 1;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 48px;
}

.color-btn-enhanced:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.color-btn-enhanced:active {
    transform: scale(0.95);
}

.color-btn-enhanced.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.recent-colors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-colors-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}

.recent-color-btn {
    aspect-ratio: 1;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 35px;
}

.recent-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced Touch Feedback */
.touch-feedback {
    position: relative;
    overflow: hidden;
}

.touch-feedback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3), transparent);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.touch-feedback.active::after {
    width: 100px;
    height: 100px;
    opacity: 1;
}

/* Haptic feedback visual indicator */
.haptic-pulse {
    animation: hapticPulse 0.15s ease-out;
}

@keyframes hapticPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Mobile optimizations for new features */
@media (max-width: 768px) {
    .touch-mode-indicator {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: unset;
        border-radius: 12px;
        padding: 0.5rem 0.75rem;
    }
    
    .mode-display {
        gap: 0.5rem;
    }
    
    .mode-icon-container {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .mode-label {
        font-size: 0.9rem;
    }
    
    .mode-description {
        font-size: 0.75rem;
    }
    
    .enhanced-color-palette {
        bottom: 70px;
        left: 5px;
        right: 5px;
        padding: 0.75rem;
    }
    
    .quick-colors-expanded {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }
    
    .color-btn-enhanced {
        min-height: 42px;
    }
    
    .recent-colors-list {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.3rem;
    }
    
    .recent-color-btn {
        min-height: 32px;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .onboarding-container {
        max-width: 500px;
    }
    
    .mode-comparison {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .enhanced-color-palette {
        max-width: 500px;
        bottom: 100px;
    }
    
    .quick-colors-expanded {
        grid-template-columns: repeat(10, 1fr);
    }
}

/* Desktop hide mobile-only features */
@media (min-width: 1024px) {
    .mobile-onboarding-overlay,
    .touch-mode-indicator,
    .enhanced-color-palette {
        display: none !important;
    }
}