#gacha-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 12px;
}
#month-label {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent3);
}
#gacha-header .nav-btn {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
#gacha-header .nav-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

#gacha-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 70vh;
}

#cal-grid-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
#weekdays div {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 6px 0;
}

#cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

.cal-day {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    transition: border-color .15s, background .15s;
    min-height: 90px;
}
.cal-day:hover { background: var(--card2); border-color: var(--accent); }
.cal-day.today { border-color: var(--accent); border-width: 2px; background: var(--card2); }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; pointer-events: none; }
.cal-day.selected { border-color: var(--accent2); border-width: 2px; }

.day-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 2px 3px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3px;
    flex-shrink: 0;
}
.day-num { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-day.today .day-num { color: var(--accent2); }
.day-legend-name {
    font-size: 9px;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.day-sprite {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}
.day-sprite img {
    max-width: 100%;
    max-height: 80px;
    image-rendering: pixelated;
    object-fit: contain;
}

#sidebar {
    width: 100%;
    flex-shrink: 0;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#sidebar.hidden { display: none; }
#sidebar-date { font-size: 13px; font-weight: 700; color: var(--accent3); text-align: center; }
#sidebar-sub { font-size: 10px; color: var(--dim); text-align: center; }
#sidebar-sprite-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}
#sidebar-sprite { max-width: 100%; image-rendering: pixelated; }
#sidebar-legend-name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; }
#sidebar-divider { height: 1px; background: var(--border); }
#sidebar-rus-label { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
#sidebar-rus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 4px; }
.rus-cell {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.rus-cell img { width: 100%; image-rendering: pixelated; min-height: 40px; background: var(--card2); }
.rus-cell img:not([src]), .rus-cell img[src=""] { visibility: hidden; }
.rus-name { font-size: 8px; color: var(--dim); text-align: center; line-height: 1.2; }
