/* ゆるかわタイピングアプリ スタイルシート */

/* 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rounded Mplus 1c', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN',
        'メイリオ', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #FFF8DC 0%, #FFE4E1 50%, #E6E6FA 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* パーティクルキャンバス */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* コンテナ */
.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(255, 182, 193, 0.4);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    position: relative;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 2.5rem;
    color: #FF69B4;
    text-shadow: 2px 2px 0 #FFB6C1, 4px 4px 10px rgba(255, 105, 180, 0.3);
    margin-bottom: 15px;
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.character-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.1rem;
    color: #666;
}

.character-name {
    background: linear-gradient(135deg, #FFB6C1, #DDA0DD);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
}

.character-level {
    background: linear-gradient(135deg, #98D8C8, #87CEEB);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
}

/* メインエリア */
.main {
    min-height: 400px;
    position: relative;
}

/* 画面切り替え */
.screen {
    text-align: center;
}

.screen.hidden {
    display: none;
}

/* 汎用的な非表示クラス */
.hidden {
    display: none !important;
}

/* キャラクター */
.character-container {
    margin: 30px 0;
}

.character {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(152, 216, 200, 0.3));
}

.character.bounce {
    animation: characterBounce 3s ease-in-out infinite;
}

@keyframes characterBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-15px) rotate(-5deg);
    }

    50% {
        transform: translateY(0) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.character.celebrate {
    animation: celebrate 1s ease-in-out infinite;
}

@keyframes celebrate {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-10deg);
    }

    50% {
        transform: scale(1.15) rotate(0deg);
    }

    75% {
        transform: scale(1.1) rotate(10deg);
    }
}

.character-container-small {
    position: relative;
    margin-bottom: 20px;
}

.character-small {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    animation: feedbackPop 0.5s ease-out;
    pointer-events: none;
}

@keyframes feedbackPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.feedback.correct {
    color: #FF69B4;
}

.feedback.wrong {
    color: #FFB6C1;
}

/* ステージ情報 */
.stage-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.stage-nav-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFB6C1, #DDA0DD);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.stage-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.4);
}

.stage-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.current-stage-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FF69B4;
    min-width: 80px;
    text-align: center;
}

.stage-info {
    margin: 30px 0;
}

.stage-info h2 {
    font-size: 1.8rem;
    color: #FF69B4;
    margin-bottom: 15px;
}

.stage-info p {
    font-size: 1.2rem;
    color: #666;
    margin: 10px 0;
}

.hint {
    background: #FFF8DC;
    padding: 15px;
    border-radius: 15px;
    border-left: 5px solid #FFB6C1;
    margin-top: 20px;
    font-size: 1rem;
}

/* 進捗情報 */
.progress-info {
    margin: 25px 0;
}

.stars {
    font-size: 1.3rem;
    color: #666;
}

.stars strong {
    color: #FF69B4;
    font-size: 1.5rem;
}

/* タイピングエリア */
.typing-area {
    margin: 30px 0;
}

.word-display {
    background: linear-gradient(135deg, #FFFAF0, #FFF8DC);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.05);
}

.word-to-type {
    font-size: 3rem;
    font-weight: bold;
    color: #FF69B4;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
    margin-bottom: 10px;
}

.romaji-hint {
    font-size: 1.5rem;
    color: #98D8C8;
    font-weight: bold;
    margin-top: 10px;
    background: #F0FFF0;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
}

.typing-input {
    width: 100%;
    font-size: 2rem;
    padding: 20px;
    border: 3px solid #FFB6C1;
    border-radius: 15px;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.typing-input:focus {
    border-color: #FF69B4;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
    transform: scale(1.02);
}

/* 統計情報 */
.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    gap: 15px;
}

.stat-item {
    background: linear-gradient(135deg, #FFB6C1, #DDA0DD);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
}

/* ボタン */
.btn {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin: 10px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #FF69B4, #FFB6C1);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
}

.btn-secondary {
    background: linear-gradient(135deg, #98D8C8, #B0E0E6);
    color: white;
    box-shadow: 0 5px 15px rgba(152, 216, 200, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7CC8B8, #98D8C8);
}

/* クリア画面 */
.celebration {
    position: relative;
}

.fireworks {
    font-size: 5rem;
    animation: fireworksPop 1s ease-out infinite;
}

@keyframes fireworksPop {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.8;
    }
}

#clearTitle {
    font-size: 2.5rem;
    color: #FF69B4;
    margin: 20px 0;
}

.clear-message {
    font-size: 1.5rem;
    color: #666;
    margin: 20px 0;
}

.clear-stats {
    background: #FFF8DC;
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
}

.clear-stats p {
    font-size: 1.3rem;
    color: #666;
    margin: 10px 0;
}

.clear-stats strong {
    color: #FF69B4;
    font-size: 1.5rem;
}

.clear-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* フッター */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #FFB6C1;
}

.footer p {
    font-size: 1.2rem;
    color: #FF69B4;
    font-weight: bold;
}

/* 隠しパスワード入力 */
.secret-input {
    width: 200px;
    margin: 10px auto;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9rem;
    font-family: inherit;
    background: transparent;
    color: #DDA0DD;
    outline: none;
    transition: all 0.3s ease;
}

.secret-input:focus {
    border-color: #FFB6C1;
    background: #FFF;
}

/* デバッグメニュー */
.debug-menu {
    margin-top: 20px;
}

.debug-toggle-btn {
    padding: 8px 16px;
    background: #DDA0DD;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.debug-toggle-btn:hover {
    background: #BA55D3;
}

.debug-panel {
    margin-top: 15px;
    padding: 15px;
    background: #F0F0F0;
    border-radius: 10px;
    border: 2px dashed #DDA0DD;
}

.debug-panel h3 {
    margin-bottom: 10px;
    color: #BA55D3;
    font-size: 1rem;
}

.debug-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}

.debug-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFB6C1, #DDA0DD);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.debug-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(221, 160, 221, 0.4);
}

.debug-reset {
    width: 100%;
    margin-top: 5px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
}

.debug-reset:hover {
    background: linear-gradient(135deg, #FF4444, #FF6B6B);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .title {
        font-size: 2rem;
    }

    .word-to-type {
        font-size: 2rem;
    }

    .typing-input {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 1.2rem;
        padding: 12px 30px;
    }

    .character {
        width: 150px;
        height: 150px;
    }

    .stats {
        flex-direction: column;
    }
}

/* キラキラエフェクト */
@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.sparkle {
    position: absolute;
    font-size: 2rem;
    animation: sparkle 1s ease-out;
    pointer-events: none;
}