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

:root {
    /* FORCE DARK COLORS */
    --primary: #0A84FF;
    /* iOS Blue Light */
    --background: #000000;
    /* Pure Black */
    --card-bg: #1C1C1E;
    /* iOS Dark Gray */
    --card-bg-hover: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --separator: #38383A;
    --danger: #FF453A;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overflow-x: hidden;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Header */
.header {
    background: var(--background);
    /* Прозрачнее или черный */
    padding: 16px 20px 12px;
    padding-top: max(env(safe-area-inset-top), 16px);
    border-bottom: 0.5px solid var(--separator);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5px;
}

/* Home Button */
.home-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

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

.home-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}

.header h1 {
    font-size: 22px;
    /* iOS Human Interface Guidelines */
    font-weight: 600;
    letter-spacing: -0.4px;
}

/* Content */
.content {
    flex: 1;
    padding: 20px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.menu-card {
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    /* iOS style */
    padding: 20px;
    /* Чуть компактнее */
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
}

.menu-card:active {
    transform: scale(0.98);
    background-color: var(--card-bg-hover);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.menu-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    /* Синий заголовок как на скрине */
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.menu-card p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
}

/* List Group (GAMET items) */
.list-group {
    /* Убираем фон списка, чтобы элементы были просто на черном или объединяем их */
    /* background: var(--card-bg); */
    border-radius: 0;
    max-width: 600px;
    margin: 0 auto;
}

.list-item {
    padding: 20px 0;
    /* Больше отступы как в меню */
    margin: 0 4px;
    border-bottom: 0.5px solid var(--separator);
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;

    /* ШРИФТ КАК В МЕНЮ */
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);

    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item b {
    font-weight: 600;
    font-size: 20px;
    /* Как заголовки меню */
    color: var(--primary);
    /* Синий как в меню */
    letter-spacing: 0.3px;
}

.list-item small {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.list-item:active {
    opacity: 0.7;
}

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

/* Заголовки групп (FIR) */
.group-header {
    background-color: var(--background);
    color: var(--text-secondary);
    padding: 24px 0 8px;
    /* Больше отступ сверху */
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: -0.1px;
    font-weight: 500;
    margin: 0 4px;
}

/* Input */
.input-container {
    max-width: 600px;
    margin: 0 auto;
}

.input-container label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    margin-left: 12px;
}

.input-container input {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    border: none;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.primary-btn:active {
    opacity: 0.8;
}

.hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 16px;
}

/* Report (моноширинный) */
.report-text {
    background: var(--card-bg);
    padding: 16px;
    /* Меньше поля */
    border-radius: 12px;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'Courier New', monospace;
    font-size: 13px;
    /* Чуть мельче для вместимости */
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 800px;
    margin: 0 auto;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    /* BLUR EFFECT */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loader.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 40px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 14px;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 12px;
}

.modal-content button {
    margin-top: 16px;
    background: transparent;
    color: var(--primary);
    font-size: 17px;
    font-weight: 600;
    padding: 10px;
    width: 100%;
    border-top: 0.5px solid var(--separator);
}

/* Floating Back Button (Bottom) */
.floating-back-btn {
    position: fixed;
    bottom: 40px;
    bottom: max(40px, env(safe-area-inset-bottom, 40px));
    left: 20px;

    width: 56px;
    height: 56px;
    border-radius: 50%;

    background: var(--primary);
    color: white;
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.5);
    cursor: pointer;

    transition: transform 0.2s, opacity 0.3s;
    z-index: 999;
}

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

.floating-back-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.floating-back-btn svg {
    width: 28px;
    height: 28px;
}