/* ゲームアプリ - スタイルシート */

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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: #1a1a2e;
    color: #e4e4e4;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 画面切り替え */
.screen {
    display: none;
    height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ボタン共通 */
.btn {
    padding: 12px 24px;
    border: 2px solid;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.btn-primary {
    border-color: #4a90e2;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.btn-secondary {
    border-color: #888;
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

.btn-large {
    padding: 16px 40px;
    font-size: 20px;
}

/* タイトル画面 */
#titleScreen {
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.title-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.title {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8); }
    50% { text-shadow: 3px 3px 20px rgba(74, 144, 226, 0.8); }
}

.subtitle {
    font-size: 18px;
    margin-bottom: 10px;
    color: #aaa;
}

.version-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 30px;
}

.difficulty-select {
    margin-bottom: 40px;
}

.difficulty-select h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

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

.difficulty-buttons .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 20px;
    border: 3px solid transparent;
}

.difficulty-buttons .btn.selected {
    border-color: #50c878;
    background: linear-gradient(135deg, rgba(80, 200, 120, 0.3) 0%, rgba(62, 166, 95, 0.3) 100%);
}

.btn-easy {
    border-color: #50c878;
    background: linear-gradient(135deg, rgba(80, 200, 120, 0.2) 0%, rgba(62, 166, 95, 0.2) 100%);
}

.btn-normal {
    border-color: #4a90e2;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2) 0%, rgba(53, 122, 189, 0.2) 100%);
}

.btn-hard {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.2) 100%);
}

.difficulty-name {
    font-size: 20px;
}

.difficulty-desc {
    font-size: 14px;
    color: #aaa;
}

/* ゲーム画面 */
#gameScreen {
    padding: 10px;
    gap: 10px;
    height: 100vh;
    overflow: hidden;
}

.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #4a4a4a;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 11px;
    color: #aaa;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #4a90e2;
}

#comboDisplay .stat-value {
    color: #ff6b6b;
}

.combo-animation {
    animation: comboShake 0.5s;
}

@keyframes comboShake {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
}

/* 画像コンテナ */
.image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #4a4a4a;
    border-radius: 8px;
    padding: 10px;
    overflow: auto;
    min-height: 0;
}

#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
    border-radius: 5px;
}

/* RPG風メッセージボックス */
.message-box {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #4a4a4a;
    border-radius: 8px;
    min-height: 120px;
}

.face-container {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border: 3px solid #4a4a4a;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
}

.face-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

#messageText {
    font-size: 16px;
    line-height: 1.5;
    flex: 1;
    display: flex;
    align-items: center;
}

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

.action-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-action {
    flex: 1;
    min-width: 120px;
}

.btn-zoom {
    border-color: #9b59b6;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.8) 0%, rgba(142, 68, 173, 0.8) 100%);
}

.btn-zoom-out {
    border-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.8) 0%, rgba(34, 153, 84, 0.8) 100%);
}

/* リザルト画面 */
#resultScreen {
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.result-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #4a4a4a;
    border-radius: 8px;
    padding: 20px;
}

.result-title {
    font-size: 28px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.result-rank {
    margin-bottom: 15px;
}

.rank-badge {
    display: inline-block;
    font-size: 50px;
    font-weight: bold;
    padding: 10px 25px;
    border: 3px solid #4a90e2;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3) 0%, rgba(53, 122, 189, 0.3) 100%);
    animation: rankPulse 2s ease-in-out infinite;
}

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

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.result-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #4a4a4a;
    border-radius: 5px;
}

.result-stat-label {
    font-size: 14px;
    color: #aaa;
}

.result-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #4a90e2;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

    .game-header {
        gap: 10px;
        padding: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    .message-box {
        flex-direction: column;
        align-items: center;
    }

    .face-container {
        width: 120px;
        height: 120px;
    }

    #messageText {
        font-size: 16px;
        text-align: center;
    }

    .result-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .rank-badge {
        font-size: 40px;
        padding: 10px 20px;
    }

    .result-stats {
        gap: 8px;
        margin-bottom: 15px;
    }

    .result-stat-item {
        padding: 8px 12px;
        flex-direction: row;
        gap: 5px;
    }

    .result-stat-label {
        font-size: 13px;
    }

    .result-stat-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .difficulty-name {
        font-size: 16px;
    }

    .btn-large {
        padding: 12px 24px;
        font-size: 16px;
    }

    .face-container {
        width: 100px;
        height: 100px;
    }

    #messageText {
        font-size: 14px;
    }

    .result-stat-value {
        font-size: 20px;
    }

    #resultScreen {
        padding: 10px;
    }

    .result-container {
        padding: 15px;
    }

    .result-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .rank-badge {
        font-size: 35px;
        padding: 8px 16px;
    }

    .result-stat-value {
        font-size: 14px;
    }

    .result-stat-label {
        font-size: 12px;
    }

    .btn-share {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 言語切替ボタンをモバイルで調整 */
    .language-selector {
        top: 10px;
        right: 10px;
    }

    .lang-button {
        padding: 12px 20px;
        font-size: 16px;
        min-width: 60px;
        min-height: 44px;
    }
}

/* 言語切替ボタン */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-button {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #4a90e2;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-button:hover {
    background: rgba(74, 144, 226, 0.3);
    transform: scale(1.05);
}

/* 注意表示 */
.nsfw-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffa726;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    animation: warningPulse 3s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        border-color: #ffa726;
        box-shadow: 0 0 10px rgba(255, 167, 38, 0.2);
    }
    50% {
        border-color: #ffb74d;
        box-shadow: 0 0 15px rgba(255, 167, 38, 0.4);
    }
}

.warning-text {
    font-size: 16px;
    font-weight: bold;
    color: #ff9800;
    margin-bottom: 10px;
}

.age-confirm {
    font-size: 14px;
    color: #ffb74d;
}

/* SNS共有ボタン */
.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.btn-share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.share-icon {
    font-size: 20px;
}

.btn-x {
    border-color: #000;
    background: linear-gradient(135deg, #000 0%, #333 100%);
}

.btn-x:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-bluesky {
    border-color: #00a8e8;
    background: linear-gradient(135deg, #00a8e8 0%, #0084b4 100%);
}

.btn-bluesky:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.5);
}

.btn-copy {
    border-color: #666;
    background: linear-gradient(135deg, #666 0%, #444 100%);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 102, 102, 0.5);
}

.copy-feedback {
    text-align: center;
    color: #4a90e2;
    font-size: 14px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-share {
        width: 100%;
        justify-content: center;
    }
}
