@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Noto Sans KR', system-ui, -apple-system, BlinkMacSystemFont;
    color: #0f172a;
    background: linear-gradient(to bottom, #e0f2fe, #bfdbfe, #93c5fd 80%, #60a5fa);
    overflow-x: hidden;
    position: relative;
}

/* 눈 효과 (앞 레이어) */
body::before {
    content: "";
    position: fixed;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
    background-repeat: repeat;
    background-image:
        radial-gradient(3px 3px at 10px 10px, rgba(255,255,255,0.9) 0%, transparent 60%),
        radial-gradient(3px 3px at 40px 90px, rgba(255,255,255,0.8) 0%, transparent 60%),
        radial-gradient(4px 4px at 140px 40px, rgba(255,255,255,0.9) 0%, transparent 60%);
    background-size: 200px 200px, 240px 240px, 300px 300px;
    animation: snowFast 12s linear infinite;
}

/* 눈 효과 (뒷 레이어) */
body::after {
    content: "";
    position: fixed;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
    background-repeat: repeat;
    background-image:
        radial-gradient(4px 4px at 50px 50px, rgba(255,255,255,0.7) 0%, transparent 60%),
        radial-gradient(3px 3px at 90px 150px, rgba(255,255,255,0.5) 0%, transparent 60%),
        radial-gradient(5px 5px at 160px 20px, rgba(255,255,255,0.6) 0%, transparent 60%);
    background-size: 250px 250px, 330px 330px, 350px 350px;
    animation: snowSlow 22s linear infinite;
}

@keyframes snowFast {
    0% { transform: translateY(-60px); }
    100% { transform: translateY(60px); }
}

@keyframes snowSlow {
    0% { transform: translateY(-80px); }
    100% { transform: translateY(80px); }
}

.memory-page {
    position: relative;
    z-index: 2;
}

/* ===========================
   LAYOUT
=========================== */

.layout {
    max-width: 1180px;
    margin: auto;
    padding: 0 22px;
}

/* ===========================
   HERO SECTION
=========================== */

.hero-section {
    padding: 80px 0 90px;
    background: linear-gradient(to bottom, #eff6ff, #dbeafe 60%, transparent);
}

.hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

.hero-left {
    max-width: 520px;
}

.hero-event-label {
    font-size: 14px;
    letter-spacing: 0.18em;
    color: #1e40af;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 46px;
    line-height: 1.08;
    font-weight: 900;
    color: #1e3a8a;
    text-shadow: 0 4px 10px rgba(30,64,175,0.15);
}

.hero-title span {
    display: inline-block;
    font-size: 40px;
}

.hero-desc {
    margin-top: 18px;
    font-size: 15px;
    color: #1e293b;
    line-height: 1.7;
}

.hero-meta {
    margin-top: 16px;
    font-size: 13px;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-main-btn {
    margin-top: 24px;
    padding: 10px 32px;
    font-size: 15px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    color: white;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(59,130,246,0.25);
    transition: 0.18s ease;
}

.hero-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(59,130,246,0.35);
}

/* RIGHT SIDE CHARACTER */

.hero-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.hero-character img {
    width: 260px;
}

.hero-speech {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.85);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 12px;
    color: #1e3a8a;
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* ===========================
   INFO PANELS
=========================== */

.info-section {
    margin-top: 40px;
    display: grid;
    gap: 24px;
    grid-template-columns: 2fr 1fr;
}

.panel {
    padding: 22px 26px;
    border-radius: 14px;
    background: rgba(255,255,255,0.75);
    border: 1px solid #bfdbfe;
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
}

.panel-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 14px;
    color: #1e3a8a;
}

.status-login-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.status-desc {
    margin-top: 8px;
    font-size: 12px;
    color: #475569;
}

/* ===========================
   GAME SECTION
=========================== */

.game-section {
    margin-top: 40px;
    padding: 50px 0 80px;
    background: linear-gradient(to bottom, #dbeafe, #bfdbfe, #93c5fd);
    border-top: 1px solid #bfdbfe;
}

.game-header {
    text-align: center;
    margin-bottom: 28px;
}

.game-header h2 {
    font-size: 26px;
    font-weight: 900;
    color: #1e3a8a;
}

.game-header p {
    margin-top: 5px;
    font-size: 14px;
    color: #475569;
}

/* STEP STRIP */

.step-strip {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.step-item {
    background: rgba(255,255,255,0.85);
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #bfdbfe;
}

.step-label {
    font-size: 11px;
    color: #2563eb;
    font-weight: 700;
}

.step-item p {
    margin-top: 4px;
    font-size: 11px;
    color: #475569;
}

/* WEEK TABS */

.week-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    gap: 8px;
}

.week-tab {
    padding: 8px 24px;
    font-size: 13px;
    border-radius: 999px 999px 0 0;
    border: 1px solid #93c5fd;
    background: white;
}

.week-tab.active {
    background: #dbeafe;
    color: #1e40af;
    border-color: #60a5fa;
}

/* BOARD PANEL */

.board-panel {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #93c5fd;
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}

.board-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.board-info-label {
    font-size: 12px;
    color: #475569;
}

.board-info-value {
    font-size: 16px;
    color: #2563eb;
    font-weight: 900;
}

.board-buttons {
    display: flex;
    gap: 8px;
}

.btn-main {
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    border: none;
    background: linear-gradient(135deg,#60a5fa,#3b82f6);
    color: white;
    cursor: pointer;
}

.btn-sub {
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    border: none;
    background: #e2e8f0;
    color: #1e293b;
}

/* CARD BOARD */

.card-board {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 12px;
}

.card {
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 110px;
    border-radius: 12px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
}

/* BACK */
.card-back {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border: 2px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-text {
    font-size: 14px;
    letter-spacing: 0.15em;
    font-weight: 900;
    color: white;
}

/* FRONT */
.card-front {
    transform: rotateY(180deg);
    background: white;
    border: 2px solid #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.card-front-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.card-front-text {
    font-size: 12px;
    color: #1e293b;
}

/* MATCHED ANIMATION */
.card.matched .card-inner {
    animation: matchPop 0.6s ease-out forwards;
}

@keyframes matchPop {
    0% { transform: rotateY(180deg) scale(1); opacity: 1; }
    35% { transform: rotateY(180deg) scale(1.14); opacity: 1; }
    60% { transform: rotateY(180deg) scale(1.1); opacity: 1; }
    100% { transform: rotateY(180deg) scale(0); opacity: 0; }
}

/* ===========================
   POPUP
=========================== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.overlay.hidden {
    display: none;
}

.overlay-dialog {
    width: 360px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

#clearText {
    font-size: 20px;
    color: #1e3a8a;
    font-weight: 900;
    margin-bottom: 10px;
}

.clear-sub {
    font-size: 14px;
    color: #475569;
    margin-bottom: 20px;
}

.btn-result-ok {
    padding: 10px 26px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg,#60a5fa,#3b82f6);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

/* ===========================
   REWARD SECTION (새 버전)
=========================== */

.reward-section {
    padding: 50px 0 80px;
    background: linear-gradient(
        to bottom,
        #bfdbfe 0%,
        #dbeafe 30%,
        #e0f2fe 100%
    );
    border-top: 1px solid #93c5fd;
}

.reward-section .layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

.reward-title {
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    color: #1e3a8a;
}

.reward-sub {
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    color: #475569;
}

.reward-list {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.reward-item {
    background: rgba(255,255,255,0.9);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    border: 1px solid #bfdbfe;
    box-shadow: 0 10px 24px rgba(15,23,42,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reward-icon {
    width: 46px;
    height: 46px;
    background: radial-gradient(circle at top, #fef9c3, #bfdbfe);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(148,163,184,0.6);
}

.reward-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.reward-desc {
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 768px) {
    .reward-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 1024px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .hero-right { justify-content: center; }
    .info-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .card-board {
        grid-template-columns: repeat(4,1fr);
    }
}