@import url('https://cdn.jsdelivr.net/npm/galmuri@latest/dist/galmuri.css');

:root {
    --poke-blue: #2c5aa8;
    --poke-yellow: #ffcb05;
    --poke-border: #3c3c3c;
    --poke-bg: #f5f5f5;
    --text-color: #333;
    --button-shadow: #c79a00;
}

body {
    background-color: var(--poke-blue);
    background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
                      linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
    background-size: 10px 10px;
    font-family: 'Galmuri11', 'Galmuri9', 'Galmuri7', sans-serif;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    padding-bottom: 60px; /* 늘어난 높이와 하단바 고려 */
}

/* --- 레이아웃 컨테이너 --- */
.main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in 0.5s;
    margin-top: 5vh;
}

.card, .info-card {
    background-color: var(--poke-bg);
    border: 6px solid var(--poke-border);
    border-radius: 7px;
    box-shadow:
        inset 0 0 0 3px var(--poke-bg),
        inset 0 0 0 6px var(--poke-border);
    width: 280px;
    max-width: 90%;
}

.card {
    padding: 25px 14px;
}

/* --- 미션 카드 --- */
.info-card {
    padding: 20px;
    width: 210px; /* Reverted to original width */
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.info-card h2 {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 12px;
    color: var(--poke-blue);
}
.step {
    margin-top: 15px;
}
.step h3 {
    font-size: 1.1em;
    color: var(--poke-blue);
    margin-bottom: 8px;
}
.step p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.4;
}
.step .button-container {
    display: flex;
    flex-direction: column; /* Changed to column for narrower card */
    gap: 10px;
}
.step .action-button {
    width: 100%;
    margin: 0;
}

/* --- 이벤트 카드 --- */
.card h1 { font-size: 1.6em; margin-bottom: 15px; color: var(--poke-blue); text-shadow: 2px 2px 0 #fff; }
#pokemon-image { width: 90px; height: 90px; margin: 0 auto 12px; image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; background-color: #e0e0e0; border: 3px solid var(--poke-border); border-radius: 4px; }
#pokemon-key { font-size: 1.3em; color: #d9534f; margin-bottom: 8px; min-height: 30px; word-break: keep-all; }
#catch-phrase { font-size: 0.9em; color: #555; margin-bottom: 20px; min-height: 16px; }

#saveImageButton {
    margin-top: 10px;
}

.action-button {
    position: relative;
    display: block;
    background-color: var(--poke-yellow);
    color: var(--poke-blue);
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1em;
    margin: 10px auto 0;
    border: 2px solid var(--poke-border);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Galmuri11', 'Galmuri9', 'Galmuri7', sans-serif;
    font-weight: bold;
    text-shadow: 1px 1px 0 #fff;
    box-shadow: 4px 4px 0px var(--button-shadow);
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center; /* Centered text inside button */
}
.action-button.disabled {
    background-color: #a0a0a0;
    color: #666;
    box-shadow: 4px 4px 0px #6e6e6e;
    pointer-events: none;
    cursor: default;
}

.action-button.button-pressed {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--button-shadow);
}

.action-button:active:not(.disabled) {
    filter: brightness(0.95);
}

/* --- 오프닝 트랜지션 --- */
#transition-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; display: flex; flex-direction: column; pointer-events: none; }
.overlay-stripe { flex-grow: 1; width: 100%; background: #000; animation: stripe-wipe 1.2s forwards; }
.overlay-stripe:nth-child(odd) { animation-direction: reverse; }
.overlay-stripe:nth-child(1) { animation-delay: 0s; }
.overlay-stripe:nth-child(2) { animation-delay: 0.05s; }
.overlay-stripe:nth-child(3) { animation-delay: 0.1s; }
.overlay-stripe:nth-child(4) { animation-delay: 0.15s; }
.overlay-stripe:nth-child(5) { animation-delay: 0.2s; }
@keyframes stripe-wipe { 0% { transform: translateX(-101%); } 50% { transform: translateX(0%); } 100% { transform: translateX(101%); } }

/* --- 반응형 --- */
@media (max-width: 800px) {
    body { overflow-y: auto; height: auto; padding: 30px 15px; padding-bottom: 60px; }
    .main-container { flex-direction: column; align-items: center; }
    .card, .info-card { width: 280px; } /* Reverted to original mobile width */
}

/* --- 하단 텍스트 스크롤 --- */
.ticker-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    color: white;
    padding: 5px 0;
    overflow: hidden;
    white-space: nowrap;
    z-index: 100;
}

.ticker-wrap .ticker-text {
    display: inline-block;
    animation: ticker 25s linear infinite;
}

.ticker-wrap .ticker-text span {
    padding: 0 2rem;
    font-size: 1em;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}