body {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    font-family: 'Arial', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    box-sizing: border-box;
    transition: background 0.5s ease;
}
.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-sizing: border-box;
    margin-top: 60px; /* 上部余白を増やして下に移動 */
}
h1 {
    color: #2a5298;
    margin: 0 0 15px 0;
    font-size: clamp(20px, 6vw, 28px);
}
.mode-selector {
    margin-bottom: 15px;
}
.mode-selector label {
    margin: 0 10px;
    font-size: clamp(14px, 4vw, 16px);
    color: #333;
}
.input-container, .output-container, .password-container {
    position: relative;
    margin: 10px 0;
}
textarea, #password {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: clamp(14px, 4vw, 16px);
    transition: border-color 0.3s;
    box-sizing: border-box;
}
textarea {
    height: clamp(80px, 25vh, 100px);
    resize: none;
}
#password {
    height: clamp(40px, 10vh, 50px);
}
textarea:focus, #password:focus {
    border-color: #2a5298;
    outline: none;
}
#inputText {
    font-family: 'monospace';
    letter-spacing: 2px;
}
.note {
    display: block;
    font-size: clamp(10px, 3vw, 12px);
    color: #666;
    margin-top: 5px;
}
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}
#pasteBtn, #clearBtn, #copyBtn {
    padding: clamp(6px, 2vw, 8px) clamp(10px, 3vw, 15px);
    border: none;
    border-radius: 20px;
    background: #2a5298;
    color: white;
    cursor: pointer;
    font-size: clamp(12px, 3.5vw, 14px);
    transition: background 0.3s;
}
#copyBtn {
    position: absolute;
    right: 10px;
    bottom: 10px;
}
#processBtn {
    background: #2a5298;
    color: white;
    border: none;
    padding: clamp(10px, 3vw, 12px) clamp(20px, 5vw, 25px);
    border-radius: 25px;
    font-size: clamp(14px, 4vw, 16px);
    cursor: pointer;
    margin: 15px 0;
    transition: background 0.3s, transform 0.2s;
    width: 100%;
    box-sizing: border-box;
}
#processBtn:hover, #pasteBtn:hover, #clearBtn:hover, #copyBtn:hover {
    background: #1e3c72;
}
#processBtn:active {
    transform: translateY(2px);
}
.encrypt-mode {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}
.decrypt-mode {
    background: linear-gradient(135deg, #722c1e, #98522a);
}
.notification {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    font-size: clamp(12px, 3.5vw, 14px);
    z-index: 1000;
}
.notification.show {
    opacity: 1;
    visibility: visible;
}

@media (orientation: landscape) {
    body {
        align-items: center;
    }
    .container {
        max-height: 90vh;
        overflow-y: auto;
    }
}