:root {
    color-scheme: light dark;
    --bg: #f8fafc; --card: #ffffff; --text: #0f172a;
    --accent: #2563eb; --border: #e2e8f0; --highlight: #3b82f6;
    --danger: #ef4444; --input-bg: #f1f5f9; --tab-bg: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a; --card: #1e293b; --text: #f8fafc;
        --accent: #3b82f6; --border: #334155; --highlight: #2563eb; 
        --input-bg: #0f172a; --danger: #f87171; --tab-bg: #0f172a;
    }
}

body.light-mode { --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --accent: #2563eb; --border: #e2e8f0; --highlight: #3b82f6; --input-bg: #f1f5f9; --tab-bg: #f1f5f9; }
body.dark-mode { --bg: #0f172a; --card: #1e293b; --text: #f8fafc; --accent: #3b82f6; --border: #334155; --highlight: #2563eb; --input-bg: #0f172a; --danger: #f87171; --tab-bg: #0f172a; }

body.cyber-mode { --bg: #09090b; --card: #18181b; --text: #a78bfa; --accent: #d946ef; --border: #4c1d95; --highlight: #c026d3; --input-bg: #000000; --danger: #f43f5e; --tab-bg: #000000; }
body.cyber-mode .day-card { box-shadow: 0 0 20px rgba(192, 38, 211, 0.15); border: 1px solid var(--border); }
body.cyber-mode .tab.active { box-shadow: 0 0 15px rgba(217, 70, 239, 0.5); color: #fff; text-shadow: 0 0 5px #fff; }
body.cyber-mode .found-cell { background: #701a75 !important; color: #fdf4ff !important; text-shadow: 0 0 5px #e879f9; border-color: #d946ef !important; }

body, .day-card, .header, .tabs, .tab, .search-box input, .theme-btn, .footer, td, th, .doc-title, .announcement {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, text-shadow 0.4s ease;
}

body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); display: flex; flex-direction: column; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
.container { flex-grow: 1; max-width: 1200px; margin: 0 auto; padding: 10px; width: 100%; box-sizing: border-box; overflow-x: hidden; }

.header { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 15px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tabs { display: inline-flex; background: var(--tab-bg); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tab { padding: 10px 18px; border: none; background: transparent; color: var(--text); font-weight: 700; cursor: pointer; opacity: 0.6; border-radius: 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.tab.active { background: var(--accent); color: white; opacity: 1; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); transform: scale(1); }

.search-container { display: flex; gap: 8px; flex-grow: 1; justify-content: flex-end; }
.search-box { width: 100%; max-width: 300px; position: relative; }
.search-box input { width: 100%; background: var(--card); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; color: var(--text); outline: none; box-sizing: border-box; font-size: 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

.theme-btn { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 0 16px; border-radius: 10px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; user-select: none; }

.doc-title { color: var(--accent); font-size: 18px; font-weight: 800; margin: 25px 0 12px 0; padding-bottom: 8px; border-bottom: 2px solid var(--border); letter-spacing: -0.5px; word-wrap: break-word; white-space: normal; }
.announcement { background: color-mix(in srgb, var(--danger) 10%, transparent); border-left: 4px solid var(--danger); padding: 14px 16px; margin: 15px 0; border-radius: 0 12px 12px 0; font-weight: 600; color: var(--danger); font-size: 15px; line-height: 1.4; word-wrap: break-word; white-space: normal; }
.doc-title span, .announcement span, .doc-title p, .announcement p { white-space: normal !important; word-wrap: break-word; }

.day-card { background: var(--card); border-radius: 12px; margin-bottom: 24px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 10px 25px color-mix(in srgb, #000 4%, transparent); position: relative; }

.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.table-container::-webkit-scrollbar { display: none; }

table { width: 100% !important; border-collapse: collapse !important; margin: 0 !important; }
td, th { border: 1px solid var(--border) !important; padding: 12px 10px !important; font-size: 14px !important; text-align: center !important; vertical-align: top !important; color: var(--text) !important; background: transparent !important; white-space: nowrap !important; }
td span, th span, td p, th p { white-space: nowrap !important; }

#content p { margin: 0 !important; padding: 0 !important; background: transparent !important; line-height: 1.5 !important; font-family: inherit !important; min-height: 1.5em !important; }
#content span { background: transparent !important; font-family: inherit !important; }
.found-cell { background: var(--highlight) !important; font-weight: bold; color: #fff !important; }

tr.current-lesson-highlight td { background-color: color-mix(in srgb, var(--accent) 15%, transparent) !important; transition: 0.3s ease; }
tr.current-lesson-highlight td:first-child { border-left: 4px solid var(--accent) !important; }
tr.current-lesson-highlight td:last-child { border-right: 4px solid var(--accent) !important; }
body.cyber-mode tr.current-lesson-highlight td { background-color: color-mix(in srgb, var(--accent) 30%, transparent) !important; text-shadow: 0 0 5px var(--accent); }

.footer { margin-top: 40px; padding: 30px 20px; text-align: center; font-size: 13px; color: #64748b; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--card) 50%, transparent); line-height: 1.6; z-index: 2; position: relative; }
.footer p { margin: 5px 0; }
.footer a { color: var(--accent); text-decoration: none; font-weight: bold; }

.timer-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 5px; box-shadow: 0 4px 10px color-mix(in srgb, #000 3%, transparent); }
.timer-text { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 8px; }
.timer-bar-bg { width: 100%; height: 6px; background: var(--input-bg); border-radius: 4px; overflow: hidden; }
.timer-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width 1s linear, background-color 0.4s; }
.timer-off { opacity: 0.5; filter: grayscale(1); }

.easter-skuf { transform: rotate(180deg) !important; transition: transform 1s ease-in-out !important; }
body.easter-matrix { --bg: #000000 !important; --card: #050505 !important; --text: #00ff00 !important; --accent: #00ff00 !important; --border: #003300 !important; --highlight: #005500 !important; --input-bg: #000000 !important; --tab-bg: #000000 !important; }
body.easter-matrix .header, body.easter-matrix input, body.easter-matrix button { font-family: 'Courier New', Courier, monospace !important; text-shadow: 0 0 5px #00ff00; }
@keyframes rgb-glow { 0% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000; } 33% { border-color: #00ff00; box-shadow: 0 0 10px #00ff00; } 66% { border-color: #0000ff; box-shadow: 0 0 10px #0000ff; } 100% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000; } }
body.easter-disco .day-card, body.easter-disco input, body.easter-disco .tab.active { animation: rgb-glow 2s infinite linear !important; }
body.easter-sigma { filter: grayscale(1) contrast(1.2) !important; }
body.easter-sigma::after { content: "🗿 SIGMA RULE 🗿"; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; color: rgba(100, 100, 100, 0.2); font-weight: 900; z-index: 0; pointer-events: none; white-space: nowrap; text-align: center; }
@keyframes barrel-roll { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
body.easter-spin { animation: barrel-roll 3s infinite linear !important; overflow: hidden; }
/* --- НОВЫЕ ПАСХАЛКИ (V21) --- */

/* 6. Зеркало */
.easter-mirror { transform: scaleX(-1) !important; transition: transform 0.5s ease; }

/* 7. Майнкрафт */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body.easter-minecraft { 
    font-family: 'Press Start 2P', cursive !important; 
    letter-spacing: -1px;
    --bg: #4a3426; /* Земля */
    --card: #70462e; 
    --text: #ffffff;
    --accent: #5b8930; /* Трава */
    --border: #000000;
}
body.easter-minecraft input, body.easter-minecraft button, body.easter-minecraft .tab {
    border-radius: 0 !important; /* Квадратные блоки */
    box-shadow: 4px 4px 0px #000000 !important; /* Тени как в майне */
    border: 2px solid #000 !important;
}

/* 8. Глитч (Баг) */
@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}
body.easter-glitch {
    animation: glitch-anim 0.2s infinite;
    filter: hue-rotate(90deg) contrast(1.5);
}
body.easter-glitch .header {
    background: red !important;
}
body.easter-glitch input {
    background: black !important;
    color: lime !important;
    font-family: monospace;
}

@media (max-width: 600px) { 
    .nav { flex-direction: column; align-items: stretch; }
    .tabs { display: flex; width: 100%; box-sizing: border-box; }
    .tab { flex: 1; text-align: center; padding: 12px 0; }
    .search-container { max-width: none; justify-content: stretch; }
    .search-box { max-width: none; flex-grow: 1; }
}
