* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

.game-container {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    background-color: #1a1a1a;
    border: 8px solid #333;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8),
                inset 0 0 10px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    position: absolute;
    top: 0;
    left: 0;
}

.screen-active {
    display: flex !important;
}

/* タイトル画面 */
#titleScreen {
    justify-content: space-around;
    align-items: center;
}

.screen-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.title-logo {
    text-align: center;
    margin-bottom: 20px;
}

.phone-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.title-logo h1 {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
}

.title-description {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid #555;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    color: #ddd;
    width: 100%;
}

.title-description p {
    line-height: 1.8;
    margin: 5px 0;
}

.difficulty-selector {
    text-align: center;
    font-size: 13px;
    color: #aaa;
}

.difficulty-btn {
    background-color: #444;
    color: #fff;
    border: 2px solid #666;
    padding: 8px 16px;
    margin: 8px 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.difficulty-btn:hover {
    background-color: #555;
    border-color: #888;
}

.difficulty-btn.selected {
    background-color: #666;
    border-color: #999;
}

.start-button {
    background-color: #333;
    color: #fff;
    border: 3px solid #666;
    padding: 16px 32px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.start-button:active {
    background-color: #555;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ゲーム画面 */
#gameScreen {
    justify-content: space-between;
    padding: 15px;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid #555;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.score-display,
.timer-display {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.screen-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.call-display {
    background-color: rgba(255, 255, 255, 0.02);
    border: 3px solid #555;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.call-line {
    font-size: 18px;
    line-height: 1.6;
    color: #fff;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.line1 {
    font-weight: bold;
    color: #bbb;
    opacity: 1;
    animation: fadeIn 0.3s ease-in;
}

.line2 {
    color: #fff;
    text-align: left;
    justify-content: flex-start;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-footer {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.action-button {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.accept-button {
    background-color: #2a5a2a;
    border-color: #4a8a4a;
    color: #fff;
}

.accept-button:active {
    background-color: #3a7a3a;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cut-button {
    background-color: #5a2a2a;
    border-color: #8a4a4a;
    color: #fff;
}

.cut-button:active {
    background-color: #7a3a3a;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.result-message {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    min-height: 30px;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

/* 結果画面 */
#resultScreen {
    justify-content: center;
    align-items: center;
}

.final-score {
    text-align: center;
    margin: 20px 0;
}

.score-label {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 10px;
}

.score-value {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.rank-display {
    text-align: center;
    margin: 15px 0;
}

.rank-label {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 8px;
}

.rank-value {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

.result-stats {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid #555;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #ddd;
}

.result-stats p {
    margin: 8px 0;
}

.result-message-box {
    background-color: rgba(50, 50, 100, 0.3);
    border: 2px solid #555;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 13px;
    color: #ddd;
    line-height: 1.8;
}

.restart-button {
    background-color: #333;
    color: #fff;
    border: 3px solid #666;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.restart-button:active {
    background-color: #555;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* レスポンシブ対応 */
@media (max-height: 600px) {
    .game-container {
        aspect-ratio: auto;
        max-height: 100vh;
    }
    
    .call-line {
        font-size: 16px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .game-container {
        border-width: 6px;
        border-radius: 15px;
    }
    
    .screen {
        padding: 15px;
    }
    
    .title-logo h1 {
        font-size: 28px;
    }
    
    .action-button {
        padding: 14px;
        font-size: 14px;
    }
}

/* 無効状態 */
.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
