:root {
    --bg: #0f172a;
    --card: #1e293b;
    --accent: #38bdf8;
    --text: #f8fafc;
}

body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; }
header { padding: 40px 20px; text-align: center; }
header h1 { margin: 0; font-size: 2rem; letter-spacing: 2px; }

/* 그리드 설정 */
.retro-grid {
    display: grid;
    gap: 16px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 화면 크기에 따른 가로 개수 정의 */
@media (max-width: 599px) { .retro-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 600px) and (max-width: 899px) { .retro-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) and (max-width: 1199px) { .retro-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1200px) { .retro-grid { grid-template-columns: repeat(7, 1fr); } }

/* 카드 및 광고 공통 비율 설정 (어긋남 방지 핵심) */
.retro-card, .ad-slot {
    background: var(--card);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    aspect-ratio: 3 / 4; /* 모든 박스의 높이 비율을 통일 */
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

.retro-card:hover { transform: translateY(-5px); border-color: var(--accent); }

.thumb-container { flex: 1; background: #000; position: relative; }
.temp-thumb { 
    position: absolute; top:0; left:0; width:100%; height:100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    font-weight: bold; text-align: center; font-size: 14px;
}

.info { padding: 12px; text-align: center; font-weight: 600; font-size: 14px; }

/* 광고 전용 스타일 */
.ad-slot { background: rgba(0,0,0,0.2); border: 1px dashed #475569; }
.ad-label { font-size: 10px; color: #64748b; text-align: center; padding-top: 8px; }
.ad-content { flex: 1; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 12px; }

.disabled { opacity: 0.5; cursor: not-allowed; }