:root {
    --bg-dark: #0f0f13;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-blue: #007aff;
    --accent-green: #34c759;
    --accent-purple: #af52de;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --font-family: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
}

/* UTILS */
.hidden { display: none !important; }

/* AUTH SCREEN */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at top right, #1a1a2e, #0f0f13);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 0 32px 32px 32px;
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-icon {
    font-size: 48px;
    margin-bottom: 20px;
    margin-top: 20px;
    filter: none;
    line-height: 0;
    padding: 0;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 24px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-left: 4px;
}

.input-group input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-game {
    background: var(--accent-purple);
    box-shadow: 0 4px 15px rgba(175, 82, 222, 0.3);
}

.auth-error {
    margin-top: 16px;
    color: #ff3b30;
    font-size: 14px;
    font-weight: 600;
}

.auth-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* APP LAYOUT */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 19, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
}

.btn-logout {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: none;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-main {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* UPLOAD SECTION */
.upload-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 20px;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    border: 2px dashed var(--glass-border);
    border-radius: 24px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.05);
}

.upload-visual {
    position: relative;
    margin-bottom: 16px;
    color: var(--accent-blue);
}

.pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}

.upload-texts {
    text-align: center;
}

.primary-text {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.secondary-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-full {
    width: 100%;
}

.status-msg {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
}

.buy-msg {
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

.buy-msg:hover {
    opacity: 0.8;
}

/* RESULT SECTION (NEW STYLES) */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.result-row {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, background 0.2s ease;
}

.result-row.glass-card {
    /* Дополнительные стили если нужны, но базовые уже в .result-row */
}

.result-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.result-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.high-prob {
    color: var(--accent-green);
    font-weight: 700;
}

.recommendation-highlight {
    color: var(--accent-blue);
    font-size: 18px;
    font-weight: 700;
}

/* MINES GAME */
.game-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 20px;
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    aspect-ratio: 1;
}

.mines-cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
}

.mines-cell.revealed {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: scale(0.95);
}

.signal-btn {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    width: 100%;
    transition: transform 0.1s;
}

.signal-btn:active {
    transform: scale(0.95);
}

.mines-chance {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(20, 20, 25, 0.9);
    padding: 8px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 100;
}

.nav-item {
    padding: 12px 24px;
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item.active {
    background: var(--accent-blue);
    color: white;
}

/* THEME MODIFIERS */
body.mode-game .nav-item.active {
    background: var(--accent-purple);
}

body.mode-game .upload-zone:hover {
    border-color: var(--accent-purple);
}

body.mode-game .pulse-ring {
    border-color: var(--accent-purple);
}

body.mode-game .upload-visual {
    color: var(--accent-purple);
}
