@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --primary-color: #6c5ce7;
    --secondary-color: #00cec9;
    --accent-color: #fd79a8;
    --success-color: #00b894;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --background-color: #0f1023;
    --card-bg-color: #1e213a;
    --text-color: #ffffff;
    --text-secondary: #b2becd;
    --memory-active-color: #00b894;
    --memory-show-color: #6c5ce7;
    --memory-error-color: #d63031;
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #2d3436 0%, var(--background-color) 70%);
}

.page-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 100;
}

#game-logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(108, 92, 231, 0.7),
                 0 0 20px rgba(108, 92, 231, 0.4);
    padding: 5px 0;
    letter-spacing: 1px;
    animation: glow 2s infinite alternate;
    text-align: center;
}

.back-to-portal {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.back-to-portal:hover {
    color: var(--primary-color);
    background-color: rgba(30, 33, 58, 0.8);
    transform: translateY(-2px);
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 650px;
    margin: 20px auto;
    background-color: var(--card-bg-color);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.6),
                inset 0 0 20px rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px;
}

.screen.active {
    display: flex;
}

/* 홈 화면 스타일 */
#home-screen h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 15px rgba(108, 92, 231, 0.7);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 22px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.game-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 650px;
}

.game-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    background: var(--card-bg-color);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.game-button .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.game-button .text {
    font-size: 18px;
    font-weight: 600;
}

.game-button.visual {
    background: linear-gradient(135deg, #6c5ce7 0%, #4834d4 100%);
    border-color: rgba(108, 92, 231, 0.3);
}

.game-button.memory {
    background: linear-gradient(135deg, #00b894 0%, #00896c 100%);
    border-color: rgba(0, 184, 148, 0.3);
}

.game-button.choice {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    border-color: rgba(253, 121, 168, 0.3);
}

.game-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.high-scores {
    background-color: rgba(15, 16, 35, 0.6);
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.high-scores h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--secondary-color);
    text-align: center;
}

.score-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 18px;
}

.score-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.score-value {
    font-weight: 700;
    color: var(--primary-color);
}

/* 게임 화면 공통 스타일 */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-header h2 {
    font-size: 32px;
    color: var(--text-color);
}

.score-display {
    font-size: 18px;
    color: var(--text-secondary);
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

.game-area {
    width: 100%;
    height: 400px;
    background-color: rgba(15, 16, 35, 0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* 시각 반응 게임 스타일 */
#visual-game-area.ready {
    background-color: #d63031;
}

#visual-game-area.go {
    background-color: #00b894;
}

/* 기억력 반응 게임 스타일 */
#memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

.memory-cell {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memory-cell:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.1);
}

.memory-cell.active {
    background-color: var(--memory-active-color);
    transform: scale(1.05);
}

.memory-cell.show {
    background-color: var(--memory-show-color);
    animation: pulse 0.5s forwards;
}

.memory-cell.error {
    background-color: var(--memory-error-color);
    animation: shake 0.5s;
}

.memory-status {
    margin-top: 15px;
    font-size: 18px;
    color: var(--text-secondary);
    height: 20px;
    text-align: center;
}

/* 선택 반응 게임 스타일 */
#shapes-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
    height: 100%;
    padding: 30px;
}

.shape {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.shape:hover {
    transform: scale(1.1);
}

.shape.circle {
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #4834d4);
}

.shape.square {
    border-radius: 10px;
    background: linear-gradient(135deg, #00cec9, #00a8a8);
}

.shape.triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 80px solid #fd79a8;
    background: none;
}

.shape.target {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.instruction {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-color);
    z-index: 5;
}

.highlight {
    color: #ff9f43;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 0 10px rgba(255, 159, 67, 0.5);
}

.sub-instruction {
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0.8;
    z-index: 5;
}

.result-display {
    width: 100%;
    text-align: center;
    margin: 20px 0;
}

.reaction-time {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.back-button {
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: rgba(108, 92, 231, 0.2);
    transform: translateY(-2px);
}

/* 게임 오버 화면 스타일 */
#game-over-screen {
    text-align: center;
}

#game-over-screen h2 {
    font-size: 36px;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.game-over-result {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 350px;
}

.result-title {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.result-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-color);
}

.result-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 5px;
    opacity: 0.7;
}

.score-analysis {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.analysis-item {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    width: 150px;
}

.analysis-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.analysis-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.share-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 10px;
    width: 120px;
    height: 100px;
    transition: all 0.3s ease;
    cursor: pointer;
    color: var(--text-color);
}

.share-button:hover {
    background-color: rgba(108, 92, 231, 0.2);
    transform: translateY(-3px);
}

.share-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    fill: var(--text-color);
}

.game-over-buttons {
    display: flex;
    gap: 15px;
}

.primary-button, .secondary-button {
    padding: 12px 25px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-color), #4834d4);
    color: white;
    border: none;
}

.secondary-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.primary-button:hover, .secondary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* 애니메이션 */
@keyframes glow {
    0% { text-shadow: 0 0 10px rgba(108, 92, 231, 0.7), 0 0 20px rgba(108, 92, 231, 0.4); }
    100% { text-shadow: 0 0 15px rgba(108, 92, 231, 0.9), 0 0 30px rgba(108, 92, 231, 0.6); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 모바일 반응형 */
@media (max-width: 800px) {
    #game-container {
        height: 600px;
        margin: 10px auto;
        width: 95%;
    }
    
    .page-header {
        padding: 10px 15px;
    }
    
    #game-logo {
        font-size: 20px;
    }
    
    .back-to-portal {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    #home-screen h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .game-buttons {
        gap: 15px;
    }
    
    .game-button {
        width: 150px;
        height: 150px;
    }
    
    .game-button .icon {
        font-size: 40px;
    }
    
    .game-header h2 {
        font-size: 28px;
    }
    
    .game-area {
        height: 350px;
    }
    
    #memory-grid {
        width: 250px;
        height: 250px;
    }
    
    .screen {
        padding: 20px 15px;
    }
}

@media (max-width: 500px) {
    #game-container {
        height: 550px;
        border-width: 2px;
    }
    
    #home-screen h1 {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .game-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-button {
        width: 100%;
        max-width: 280px;
        height: 100px;
        flex-direction: row;
    }
    
    .game-button .icon {
        font-size: 32px;
        margin: 0 15px 0 0;
    }
    
    .instruction {
        font-size: 20px;
    }
    
    .sub-instruction {
        font-size: 16px;
    }
    
    .result-value {
        font-size: 36px;
    }
    
    .score-analysis {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .analysis-item {
        width: 100%;
        max-width: 220px;
    }
    
    #memory-grid {
        width: 200px;
        height: 200px;
        gap: 5px;
    }
    
    .high-scores {
        padding: 15px;
    }
    
    .score-item {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .back-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .game-over-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .primary-button, .secondary-button {
        width: 100%;
        padding: 10px 15px;
        font-size: 16px;
    }
}

#memory-game-area {
    background-color: #4a789c;
    position: relative;
    border-radius: 10px;
    padding: 20px;
}

#memory-game-screen {
    background-color: #1a2a3a;
}

#target-time {
    font-size: 1.5em;
    color: #00e676;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
    padding: 0 5px;
} 