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

body {
    font-family: 'Arial', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow-x: hidden;
}

.game-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* スクリーン管理 */
.screen {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* タイトル画面 */
.title-wrapper {
    text-align: center;
}

.game-title {
    margin-bottom: 20px;
}

.star-icon {
    font-size: 3em;
    display: block;
    animation: starRotate 3s linear infinite;
}

@keyframes starRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.title-main {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
}

.title-sub {
    display: block;
    font-size: 1em;
    color: #ddd;
    letter-spacing: 3px;
}

.game-description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #f0f0f0;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    border: 3px solid #ffd700;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.menu-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.btn-icon {
    font-size: 1.5em;
}

.btn-text {
    font-weight: bold;
}

.collection-rate {
    font-size: 0.8em;
    color: #ffd700;
    margin-left: auto;
}

/* シナリオ選択画面 */
.screen-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 10px;
    color: #ffd700;
}

.screen-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #ddd;
    margin-bottom: 30px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.scenario-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scenario-card:not(.locked):hover {
    border-color: #ffd700;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.scenario-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.scenario-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.scenario-title {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.scenario-desc {
    font-size: 0.9em;
    color: #ddd;
    margin-bottom: 10px;
}

.scenario-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.scenario-status.unlocked {
    background: linear-gradient(135deg, #51cf66, #37b24d);
}

.scenario-status.locked {
    background: rgba(255, 255, 255, 0.2);
}

/* ストーリー画面 */
.story-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

.story-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5em;
}

.story-text-box {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    min-height: 100px;
}

.story-text {
    font-size: 1.2em;
    line-height: 1.8;
}

.story-next-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 1.5em;
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-next-btn:hover {
    background: rgba(255, 215, 0, 1);
    transform: scale(1.1);
}

/* 選択肢画面 */
.choice-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
}

.choice-question {
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.choice-btn {
    padding: 20px;
    font-size: 1.2em;
    border: 3px solid #4dabf7;
    border-radius: 10px;
    background: rgba(77, 171, 247, 0.2);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    background: rgba(77, 171, 247, 0.4);
    transform: scale(1.05);
}

.timer-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #ffd43b, #ff6b6b);
    width: 100%;
    transition: width 10s linear;
}

/* QTE画面 */
.qte-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
}

.qte-title {
    font-size: 3em;
    margin-bottom: 20px;
    animation: pulse 0.5s ease-in-out infinite;
}

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

.qte-gauge-container {
    width: 100%;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 3px solid #ffd700;
}

.qte-gauge {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #ffd43b, #ff6b6b);
    width: 0%;
    transition: width 0.1s ease;
}

.qte-instruction {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #ffd700;
}

.qte-button {
    padding: 30px 60px;
    font-size: 2em;
    font-weight: bold;
    border: 4px solid #ffd700;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}

.qte-button:active {
    transform: scale(0.95);
}

.qte-result {
    font-size: 2em;
    font-weight: bold;
    margin-top: 20px;
    min-height: 50px;
}

/* エンディング画面 */
.ending-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.ending-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ffd700;
}

.ending-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #fed6e3, #a8edea);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5em;
}

.ending-text {
    font-size: 1.3em;
    line-height: 1.8;
    margin-bottom: 30px;
}

.card-reveal-btn {
    padding: 20px 40px;
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

.card-reveal-btn:hover {
    transform: scale(1.1);
}

/* カード獲得画面 */
.card-get-panel {
    text-align: center;
}

.card-get-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #ffd700;
}

.card-display {
    width: 300px;
    height: 420px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 3px solid #ffd700;
    padding: 15px;
    animation: cardFlip 0.6s ease-in-out;
}

@keyframes cardFlip {
    0% {
        transform: rotateY(90deg) scale(0.5);
    }
    100% {
        transform: rotateY(0deg) scale(1);
    }
}

.card-rarity {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-rarity.N {
    color: #aaa;
}

.card-rarity.R {
    color: #4dabf7;
}

.card-rarity.SR {
    color: #ffd43b;
}

.card-rarity.UR {
    color: #ff6b6b;
}

.card-image-area {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5em;
}

.card-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-description {
    font-size: 0.9em;
    color: #ddd;
}

.new-badge {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    border-radius: 25px;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.card-get-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* カード図鑑画面 */
.collection-stats {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 20px;
}

.stat-value {
    color: #ffd700;
    font-weight: bold;
}

.rarity-filter {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #ffd700;
    color: #333;
    border-color: #ffd700;
}

.filter-btn:hover {
    border-color: #ffd700;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.collection-card {
    aspect-ratio: 5/7;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.collection-card.unlocked {
    border-color: #ffd700;
}

.collection-card.unlocked:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.collection-card.locked {
    opacity: 0.3;
}

.collection-card-icon {
    font-size: 3em;
    margin-bottom: 5px;
}

.collection-card-number {
    font-size: 0.9em;
    color: #aaa;
}

/* 共通ボタン */
.back-btn,
.continue-btn {
    padding: 15px 40px;
    font-size: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover,
.continue-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.collection-back-btn {
    display: block;
    margin: 0 auto;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .title-main {
        font-size: 2em;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .qte-button {
        padding: 20px 40px;
        font-size: 1.5em;
    }

    .card-display {
        width: 250px;
        height: 350px;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
