* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #0D0D14;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#loginScreen { text-align: center; animation: fadeIn 0.5s ease; }
#loginScreen h1 { font-size: 36px; color: #58A6FF; margin-bottom: 30px; }
#loginScreen input {
    padding: 12px 20px; font-size: 18px; border-radius: 8px;
    border: 2px solid #58A6FF; background: #1A1A2E; color: white;
    text-align: center; letter-spacing: 5px; outline: none; width: 200px;
}
#loginScreen button {
    display: block; margin: 15px auto 0; padding: 12px 40px;
    font-size: 18px; font-weight: bold; border: none; border-radius: 8px;
    background: #58A6FF; color: white; cursor: pointer; transition: transform 0.1s;
}
#loginScreen button:active { transform: scale(0.95); }
#loginError { color: #FF5555; font-size: 14px; margin-top: 10px; min-height: 20px; }

#mainScreen {
    display: none; flex-direction: column; width: 100%;
    height: 100vh; max-width: 500px; padding: 15px; animation: fadeIn 0.5s ease;
}
.header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.header h1 { color: #58A6FF; font-size: 24px; }
.header .status { font-size: 18px; transition: transform 0.3s; }

.greeting {
    text-align: center; color: #58A6FF; font-size: 16px;
    margin-bottom: 10px; animation: pulse 2s infinite; min-height: 24px;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
}

.log {
    background: #1A1A2E; border-radius: 8px; padding: 10px;
    font-size: 13px; color: #B0B0B0; min-height: 30px; margin-bottom: 10px; flex-shrink: 0;
}

.current-lesson {
    background: #1A2E3A; border-radius: 8px; padding: 10px;
    margin-bottom: 10px; font-size: 13px; color: #58A6FF;
    display: none; cursor: pointer; transition: background 0.2s;
}
.current-lesson:hover { background: #1E3A4A; }
.current-lesson .lesson-subject { font-size: 16px; font-weight: bold; color: #FFD700; }
.current-lesson .lesson-details { color: #B0B0B0; margin-top: 4px; }

.tab-content { flex: 1; overflow-y: auto; margin-bottom: 10px; }
.section-title {
    font-size: 11px; color: #666; margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 1px;
}
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
    padding: 12px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: bold; color: white;
    cursor: pointer; transition: all 0.15s; animation: fadeInUp 0.3s ease both;
}
.btn:active {
    transform: scale(0.92);
    filter: brightness(1.4);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.btn-ping { background: #2D8A4E; }
.btn-status { background: #2D5F8A; }
.btn-weather { background: #5B8A2D; }
.btn-news { background: #6B4C8A; }
.btn-ue5 { background: #C75B2A; }
.btn-shutdown { background: #C72A2A; }
.btn-cancel { background: #555; }
.btn-music { background: #8A2D8A; }
.btn-music-next { background: #6B3A8A; }
.btn-music-prev { background: #6B3A8A; }
.btn-calc { background: #2D6B8A; }
.btn-schedule { background: #3A6B5A; }
.btn-cheatsheet { background: #8A6B2D; }
.btn-tram { background: #8A2D4E; }
.btn-wip { background: #444; }

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

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.8);
    z-index: 100; justify-content: center; align-items: center;
}
.modal {
    background: #1A1A2E; border-radius: 12px; padding: 20px;
    width: 90%; max-width: 450px; max-height: 80vh;
    overflow-y: auto; color: white;
}
.modal h2 { color: #58A6FF; margin-bottom: 15px; text-align: center; }
.modal .day-block { margin-bottom: 15px; }
.modal .day-title { color: #FFD700; font-weight: bold; margin-bottom: 5px; }
.modal .lesson-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 5px; border-bottom: 1px solid #2A2A3E;
    font-size: 13px; cursor: pointer; transition: background 0.15s;
}
.modal .lesson-row:hover { background: #2A2A3E; border-radius: 4px; }
.modal .lesson-num { color: #666; width: 30px; }
.modal .lesson-subj { flex: 1; }
.modal .lesson-time { color: #888; width: 60px; text-align: center; }
.modal .lesson-room { color: #B0B0B0; width: 50px; text-align: right; }
.modal-close {
    display: block; margin: 15px auto 0; padding: 10px 30px;
    background: #C72A2A; border: none; border-radius: 8px;
    color: white; font-size: 16px; cursor: pointer;
}

.detail-row {
    padding: 10px 0; border-bottom: 1px solid #2A2A3E;
    font-size: 14px;
}
.detail-label { color: #888; font-size: 11px; text-transform: uppercase; }
.detail-value { color: #FFD700; font-size: 16px; margin-top: 2px; }
.detail-link {
    display: inline-block; margin-top: 10px; padding: 8px 16px;
    background: #3A6B5A; color: white; border-radius: 6px;
    text-decoration: none; font-size: 13px; cursor: pointer;
}

.cmd-bar { display: flex; gap: 8px; flex-shrink: 0; }
.cmd-bar input {
    flex: 1; padding: 10px; border-radius: 8px; border: none;
    background: #1A1A2E; color: white; font-size: 14px;
}
.cmd-bar button {
    padding: 10px 20px; border: none; border-radius: 8px;
    background: #58A6FF; color: white; font-size: 18px;
    cursor: pointer; transition: transform 0.1s;
}
.cmd-bar button:active { transform: scale(0.95); }

.bottom-nav {
    display: flex; justify-content: space-around;
    background: #1A1A2E; border-radius: 12px; padding: 10px 0; flex-shrink: 0;
}
.nav-btn {
    background: none; border: none; color: #666; font-size: 22px;
    cursor: pointer; transition: all 0.2s; padding: 5px 15px; border-radius: 8px;
}
.nav-btn.active { color: #58A6FF; background: rgba(88, 166, 255, 0.1); }
.nav-btn:active { transform: scale(0.9); }
.music-hint { color: #666; font-size: 11px; text-align: center; margin-top: 15px; }
.wip-badge {
    display: inline-block; background: #FFAA00; color: #000;
    font-size: 9px; padding: 2px 6px; border-radius: 4px;
    margin-left: 5px; font-weight: bold;
}
/* Шпаргалки */
.cheatsheet-section {
    margin-bottom: 15px;
    background: #111122;
    border-radius: 8px;
    padding: 12px;
}
.cheatsheet-section-title {
    color: #FFD700;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
    border-bottom: 1px solid #2A2A3E;
    padding-bottom: 5px;
}
.cheatsheet-item {
    padding: 6px 0;
    border-bottom: 1px solid #1A1A2E;
}
.cheatsheet-item:last-child { border-bottom: none; }
.cheatsheet-item-name {
    color: #888;
    font-size: 11px;
}
.cheatsheet-item-formula {
    color: #58A6FF;
    font-size: 15px;
    font-weight: bold;
    margin-top: 2px;
}
/* Калькулятор v3 */
.calc-modal { max-width: 420px; }
.calc-mode-bar {
    display: flex; gap: 4px; margin-bottom: 10px; justify-content: center;
}
.calc-mode-btn {
    padding: 6px 10px; border: none; border-radius: 6px;
    font-size: 16px; cursor: pointer; background: #2A2A3E;
    color: #888; transition: all 0.15s; min-width: 36px;
}
.calc-mode-btn.active { background: #58A6FF; color: white; }
.calc-display {
    background: #0A0A14; border-radius: 8px 8px 0 0; padding: 15px;
    font-size: 28px; font-weight: bold; color: #58A6FF;
    text-align: right; min-height: 40px; word-break: break-all;
    font-family: 'Courier New', monospace; user-select: text; cursor: text;
}
.calc-result {
    background: #0A0A14; border-radius: 0 0 8px 8px; padding: 5px 15px 12px;
    font-size: 14px; color: #B0B0B0; text-align: right;
    min-height: 22px; max-height: 200px; overflow-y: auto;
    margin-bottom: 8px; font-family: 'Courier New', monospace;
    white-space: pre-line; line-height: 1.4;
}
.calc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.calc-btn {
    padding: 14px 5px; border: none; border-radius: 6px;
    font-size: 16px; font-weight: bold; cursor: pointer;
    background: #2A2A3E; color: white; transition: all 0.1s;
}
.calc-btn:active { transform: scale(0.93); filter: brightness(1.4); }
.calc-btn-op { background: #3A5A6B; }
.calc-btn-func { background: #4A3A5A; font-size: 12px; }
.calc-btn-eq { background: #2D8A4E; }
.calc-btn-clear { background: #8A3A3A; }
.calc-input {
    padding: 8px; border-radius: 6px; border: 1px solid #3A5A6B;
    background: #1A1A2E; color: white; font-size: 14px;
    margin: 3px; outline: none;
}
.calc-select {
    padding: 8px; border-radius: 6px; border: 1px solid #3A5A6B;
    background: #1A1A2E; color: white; font-size: 14px;
    width: 100%; margin-bottom: 5px; outline: none;
}
.calc-history {
    margin-top: 8px; max-height: 150px; overflow-y: auto;
    font-size: 12px; color: #888;
}
.calc-history-clear {
    background: #8A3A3A; border: none; color: white;
    padding: 5px 10px; border-radius: 4px; cursor: pointer;
    font-size: 11px; margin-bottom: 5px; display: block; width: 100%;
}
.calc-history-item {
    padding: 4px 0; border-bottom: 1px solid #1A1A2E; cursor: pointer;
}
.calc-history-item:hover { color: #58A6FF; }
/* Геометрия */
.geo-table {
    width: 100%; border-collapse: collapse; margin-bottom: 8px;
    font-size: 13px;
}
.geo-table th {
    color: #888; font-size: 10px; text-transform: uppercase;
    padding: 6px 4px; border-bottom: 1px solid #2A2A3E; text-align: left;
}
.geo-table td {
    padding: 8px 4px; border-bottom: 1px solid #1A1A2E;
}
.geo-val { color: #B0B0B0; }
.geo-computed { font-weight: bold; }
.geo-info-btn {
    background: #2A2A3E; border: none; color: #58A6FF;
    border-radius: 50%; width: 22px; height: 22px; font-size: 11px;
    cursor: pointer; font-weight: bold; opacity: 0.6; transition: opacity 0.2s;
}
.geo-info-btn:hover { opacity: 1; }

/* Геометрия */
.geo-table {
    width: 100%; border-collapse: collapse; margin-bottom: 8px;
    font-size: 12px;
}
.geo-table th {
    color: #888; font-size: 10px; text-transform: uppercase;
    padding: 6px 4px; border-bottom: 2px solid #2A2A3E; text-align: left;
}
.geo-table td {
    padding: 4px 6px; border-bottom: 1px solid #1A1A2E;
    border-right: 1px solid #1A1A2E;
}
.geo-table td:last-child { border-right: none; }
.geo-val { color: #CCC; }
.geo-computed { font-weight: bold; }
.geo-info-btn {
    background: #2A2A3E; border: none; color: #58A6FF;
    border-radius: 50%; width: 22px; height: 22px; font-size: 11px;
    cursor: pointer; font-weight: bold; opacity: 0.6; transition: opacity 0.2s;
}
.geo-info-btn:hover { opacity: 1; }
.calc-select {
    padding: 8px; border-radius: 6px; border: 1px solid #3A5A6B;
    background: #1A1A2E; color: white; font-size: 14px;
    width: auto; min-width: 120px; margin-bottom: 8px; outline: none;
    cursor: pointer;
}
.calc-select option { background: #1A1A2E; color: white; }
.geo-active-cell {
    outline: 2px solid rgba(255, 215, 0, 0.5);
    outline-offset: -2px;
    border-radius: 3px;
    background: rgba(255, 215, 0, 0.05);
}
/* Карточка "Сейчас играет" */
.now-playing-card {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid #2A2A4A;
}

.np-art {
    width: 64px;
    height: 64px;
    background: #2A2A4A;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.np-info {
    flex: 1;
    min-width: 0;
}

.np-title {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-artist {
    color: #58A6FF;
    font-size: 14px;
    margin-top: 4px;
}

.np-time {
    color: #888;
    font-size: 12px;
    margin-top: 6px;
}

.np-progress-bar {
    width: 100%;
    height: 4px;
    background: #2A2A4A;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.np-progress-fill {
    height: 100%;
    background: #58A6FF;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}
/* Плеер */
.music-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.music-art {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    background: #1E1E3A;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.music-controls {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    margin-bottom: 8px;
}

.ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.3);
}

.ctrl-play {
    width: 44px;
    height: 44px;
    background: #fff;
    color: #000;
    font-size: 18px;
}

.ctrl-play:hover {
    background: #FFD700;
}

.music-info {
    text-align: center;
    width: 100%;
}

.np-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.np-artist {
    color: #58A6FF;
    font-size: 14px;
    margin-bottom: 8px;
}

.np-time {
    color: #888;
    font-size: 13px;
}
