.memo {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}
.memo-board {
    display: grid;
    gap: 15px;
    perspective: 1000px;
    margin-bottom: 20px;
    justify-content: center;
    max-width: 800px;
}
.memo-card {
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.memo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.memo-card.matched .memo-card-inner {
    width: 100%;
    height: 100%;
}
.memo-card.flipped .memo-card-inner {
    transform: rotateY(180deg);
    cursor: default;
}
.memo-card.matched {
    cursor: default;
}
.memo-card.matched .memo-card-inner {
    transform: rotateY(180deg);
}
.memo-card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    backface-visibility: hidden;
    transition: opacity 0.3s;
}
.memo-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transform: rotateY(180deg);
    overflow: hidden;
    backface-visibility: hidden;
    transition: opacity 0.3s;
    opacity: 0;
}
.memo-card.flipped .memo-card-back {
    opacity: 1;
}
.memo-card.matched .memo-card-back {
    opacity: 1;
    z-index: 2;
}
.memo-card.matched .memo-card-front {
    opacity: 0;
    z-index: 1;
}
.memo-card.matched .memo-card-back img {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}
.memo-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.memo-card-front img {
    border-radius: 8px;
}
.memo-reset {
    padding: 12px 24px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.memo-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}
.memo-reset:active {
    transform: translateY(0);
}
.memo-reset.text {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: transform 0.2s;
}
.memo-reset.text:hover {
    transform: translateY(-2px);
    box-shadow: none;
}
.memo-reset.text img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.memo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.memo-modal.show {
    opacity: 1;
    visibility: visible;
}
.memo-modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    animation: memo-pop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.memo-modal h2 {
    margin: 0 0 20px 0;
    color: #667eea;
    font-size: 32px;
}
.memo-modal p {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 18px;
}
.memo-modal .memo-reset {
    margin-top: 20px;
}
@keyframes memo-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@media (max-width: 500px) {
    .memo-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .memo-card {
        width: 80px;
        height: 80px;
    }
}
@media (max-width: 350px) {
    .memo-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .memo-card {
        width: 70px;
        height: 70px;
    }
}
