/* Светлая тема, цвета Geocaching.su (жёлтый, зелёный, синий, оранжевый) */
:root {
    --game-yellow: #F5C518;
    --game-green:  #2E9E47;
    --game-blue:   #1E88E5;
    --game-orange: #F57C00;
    --bg:         #f5f5f5;
    --card:       #ffffff;
    --text:       #1a1a1a;
    --muted:      #5f5f5f;
    --border:     #e0e0e0;
    --accent:     var(--game-blue);
    --green:      var(--game-green);
    --red:        #c62828;
}
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
}
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sidebar-title {
    padding: 0 1rem 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}
.sidebar-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--game-yellow), var(--game-green), var(--game-blue), var(--game-orange));
    border-radius: 0 0 2px 2px;
}
.sidebar nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color .15s, background .15s;
}
.sidebar nav a:hover {
    color: var(--game-blue);
    background: rgba(30, 136, 229, 0.08);
}
.sidebar nav a.active {
    color: var(--game-blue);
    font-weight: 600;
    border-left: 3px solid var(--game-blue);
    margin-left: -3px;
    padding-left: calc(1rem + 3px);
}
.sidebar .nav-divider { height: 1px; background: var(--border); margin: 0.5rem 1rem; }
.sidebar-impersonate { padding: 0.5rem 1rem; margin: 0.5rem 1rem; background: rgba(245, 124, 0, 0.12); border-radius: 8px; font-size: 0.85rem; }
.sidebar-impersonate-label { display: block; color: var(--muted); margin-bottom: 0.2rem; }
.sidebar-impersonate-name { font-weight: 600; color: var(--text); }
.sidebar-impersonate-stop { display: inline-block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--game-blue); }
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1rem 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}
.sidebar-footer a { color: var(--muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--game-blue); text-decoration: underline; }
.main { flex: 1; overflow: auto; min-width: 0; }
/* Адаптивная ширина: на телефоне — по экрану, на компе — шире для удобства */
.wrap {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
@media (min-width: 768px) {
    .wrap { max-width: 800px; padding: 2rem 2rem; }
}
@media (min-width: 1024px) {
    .wrap { max-width: 960px; padding: 2rem 2.5rem; }
}
@media (min-width: 1280px) {
    .wrap { max-width: 1120px; padding: 2rem 3rem; }
}
.wrap.wide { max-width: 900px; }
@media (min-width: 1024px) {
    .wrap.wide { max-width: 1040px; }
}
@media (min-width: 1280px) {
    .wrap.wide { max-width: 1200px; }
}

h1 { font-size: 1.75rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--text); }
.subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9375rem; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card h2 { font-size: 1rem; font-weight: 600; margin: 0 0 1rem; color: var(--muted); }
.card p, .card ul { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.card ul { padding-left: 1.25rem; }
.card li { margin-bottom: 0.25rem; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--game-blue);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background .15s, opacity .15s;
}
.btn:hover { opacity: 0.92; background: #1565c0; }
.btn-outline {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--game-blue); color: var(--game-blue); }
.stat { font-size: 2rem; font-weight: 700; color: var(--game-green); }
.cache-list { list-style: none; padding: 0; margin: 0; }
.cache-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.cache-list li:last-child { border-bottom: none; }
.cache-name { font-weight: 500; }
.cache-name a,
.road-starts-table a {
    color: var(--accent);
    text-decoration: none;
}
.cache-name a:hover,
.road-starts-table a:hover {
    text-decoration: underline;
}
.cache-meta { color: var(--muted); font-size: 0.875rem; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: var(--red);
}
.result-ok {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--game-green);
    font-weight: 500;
}
.result-fail {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--red);
}
.result-fail .missing { font-weight: 600; }
.result-info { color: var(--muted); margin-bottom: 1rem; font-size: 0.9375rem; }
.actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* Азбука */
.azbuka-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.azbuka-table th, .azbuka-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.azbuka-table th { color: var(--muted); font-weight: 600; }
.azbuka-table .letter { width: 2.5rem; font-weight: 700; font-size: 1.1rem; }
.azbuka-table .found .letter { color: var(--game-green); }
.azbuka-table .missing-row .letter { color: var(--red); }
.azbuka-table .cache-name { word-break: break-word; }
.muted { color: var(--muted); }

/* Геолото */
.cards-list { margin-top: 1rem; }
.loto-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.loto-card.completed { border-color: var(--game-green); background: #e8f5e9; }
.loto-card h3 { font-size: 1rem; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.loto-card .badge { font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; background: var(--game-green); color: #fff; }
.loto-card .numbers { font-size: 0.85rem; color: var(--muted); }
.detail { margin-top: 0.75rem; }
.detail summary { cursor: pointer; color: var(--game-blue); font-size: 0.9rem; }
.detail table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; }
.detail th, .detail td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.detail th { color: var(--muted); }
.detail .code { font-family: ui-monospace, monospace; }
.detail .cache-name { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.8rem; font-weight: normal; }
.detail .empty { color: var(--muted); }

@media (max-width: 640px) {
    .app { flex-direction: column; }
    .wrap { padding: 1.25rem 1rem; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 0.75rem 1rem; gap: 0; }
    .sidebar-title { width: 100%; padding: 0 0 0.5rem; margin-bottom: 0.5rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .sidebar nav a { padding: 0.4rem 0.75rem; }
    .sidebar nav a.active { border-left: none; border-bottom: 2px solid var(--game-blue); margin-left: 0; padding-left: 0.75rem; margin-bottom: -1px; }
}
