/* === FIXED POSITIONING - NO MOVEMENT === */
html,
body {
    overflow: hidden !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Disable ALL animations and transitions except app-layout centering */
*:not(.app-layout) {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    transform-style: flat !important;
    perspective: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    will-change: auto !important;
    backface-visibility: visible !important;
}

.app-layout {
    animation: none !important;
    transition: none !important;
    transform-style: flat !important;
    perspective: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    will-change: auto !important;
    backface-visibility: visible !important;
}

body {
    background-color: #f5f7fa;
    color: #1f2937;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.app-layout {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: fixed !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%) !important;
    overflow: hidden !important;
    pointer-events: auto;
}

/* Header */
.header {
    margin-bottom: 4px;
    position: static !important;
    transform: none !important;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: static !important;
}

h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.5px;
    position: static !important;
}

.subtitle {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    position: static !important;
}

/* Status Badge */
.badge {
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: static !important;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: static !important;
    transform: none !important;
}

.main-stats {
    text-align: center;
    padding: 24px 16px;
    min-height: 180px;
    height: 180px;
    position: static !important;
}

.main-stats .label {
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: static !important;
}

.big-value {
    font-size: 44px;
    font-weight: 800;
    color: #3b82f6;
    margin: 8px 0;
    letter-spacing: -2px;
    position: static !important;
    transform: none !important;
}

.unit {
    font-size: 20px;
    color: #9ca3af;
    font-weight: 600;
    margin-left: -5px;
    position: static !important;
}

.sub-value {
    font-size: 15px;
    color: #6b7280;
    font-family: monospace;
    background: #f3f4f6;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    position: static !important;
}

/* Grid */
.grid-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    position: static !important;
}

.stat-card .label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
    position: static !important;
}

.stat-card .value {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    position: static !important;
}

/* Buttons */
.actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
    min-height: 200px;
    height: 200px;
    position: static !important;
}

.btn {
    width: 100%;
    height: 50px;
    min-height: 50px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    position: static !important;
    transform: none !important;
}

/* Remove all button animations */
.btn:active {
    transform: scale(1) !important;
}

.primary-btn {
    background: #3b82f6;
    color: white;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.25);
}

.primary-btn.active {
    background: #ef4444;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.25);
}

.secondary-btn {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.danger-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.danger-btn:hover {
    background: #fecaca;
}

.danger-btn:active {
    background: #fca5a5;
}

/* Compact button for top placement */
.compact-btn {
    height: 40px;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 4px;
}

/* Buttons */
.actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
    min-height: auto;
    position: static !important;
}

/* Footer Log */
.footer-log {
    text-align: center;
    position: static !important;
}

#terminalLog {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 4px;
    position: static !important;
}

.id-text {
    font-size: 11px;
    color: #e5e7eb;
    position: static !important;
}

/* JS State Helpers */
.active .switch-icon {
    content: "aaa";
}

/* Prevent text selection and highlight */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Specifically lock dynamic elements */
#miningBalance,
#hashRate,
#rigTemp,
#boostTimer,
#terminalLog,
#userIdDisplay,
#rigStatus,
.switch-icon,
.switch-text {
    position: static !important;
    transform: none !important;
    display: inline-block !important;
    vertical-align: baseline !important;
}

/* Fixed widths for dynamic text to prevent reflow */
#miningBalance {
    min-width: 180px;
    text-align: center;
    display: inline-block !important;
}

#hashRate {
    min-width: 150px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

#rigTemp {
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
}

#boostTimer {
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
}

#rigStatus {
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

#terminalLog {
    min-width: 200px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#userIdDisplay {
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
}

.switch-text {
    min-width: 90px;
    text-align: center;
    display: inline-block !important;
}

/* Remove any pseudo-element animations */
*::before,
*::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* Ensure no scrollbars anywhere */
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Remove focus outlines that might cause movement */
*:focus,
*:focus-visible,
*:focus-within {
    outline: none !important;
    box-shadow: none !important;
}