.memory-page { min-height: 100vh; padding: 1.5rem 1rem; background: radial-gradient(circle at top left, #f0f4ff, #fff0f8, #ffffff); }
.memory-title { text-align: center; font-size: 1.75rem; font-weight: 700; color: #7c3aed; margin-bottom: 0.25rem; }
.memory-subtitle { text-align: center; color: #6b7280; margin-bottom: 1.5rem; }
.memory-toolbar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.memory-stat { background: #fff; border-radius: 0.75rem; padding: 0.5rem 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-weight: 600; color: #4b5563; }
.memory-stat span { color: #7c3aed; }
.memory-btn { padding: 0.65rem 1.25rem; border-radius: 0.75rem; border: none; background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; font-weight: 600; cursor: pointer; transition: transform 0.15s; box-shadow: 0 4px 12px rgba(124,58,237,0.25); }
.memory-btn:hover { transform: translateY(-2px); }
.memory-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.5rem; max-width: 1200px; margin: 0 auto; }
.memory-card { aspect-ratio: 3/4; border-radius: 0.75rem; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform 0.5s; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.memory-card.flipped { transform: rotateY(180deg); }
.memory-card.matched { animation: pulse 0.5s ease; pointer-events: none; }
.memory-card-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 0.75rem; overflow: hidden; }
.memory-card-front { background: linear-gradient(135deg, #7c3aed, #ec4899); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; }
.memory-card-back { transform: rotateY(180deg); background: #fff; }
.memory-card-back img { width: 100%; height: 100%; object-fit: cover; }
.memory-finish { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); z-index: 100; }
.memory-finish.active { display: flex; }
.memory-finish-box { background: #fff; padding: 2rem; border-radius: 1rem; text-align: center; max-width: 320px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.memory-finish-box h2 { color: #7c3aed; margin-bottom: 0.5rem; }
@keyframes pulse { 0% { transform: scale(1) rotateY(180deg); } 50% { transform: scale(1.08) rotateY(180deg); } 100% { transform: scale(1) rotateY(180deg); } }
@media (max-width: 500px) { .memory-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; } }
@media (max-width: 600px) {
    .memory-page { padding: 1rem 0.75rem; }
    .memory-title { font-size: 1.35rem; }
    .memory-subtitle { margin-bottom: 1rem; font-size: 0.85rem; }
    .memory-toolbar { flex-direction: column; gap: 0.6rem; width: 100%; }
    .memory-stat, .memory-btn { width: 100%; text-align: center; box-sizing: border-box; }
    .memory-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; max-width: 100%; }
    .memory-card-front { font-size: 1.1rem; }
}
@media (max-width: 400px) {
    .memory-grid { grid-template-columns: repeat(2, 1fr); }
}
