/* --- スタイルは維持 --- */
body {
    background-image: url('images/akipassport.png');
    background-color: #ffffff;
    background-repeat: repeat;
    background-size: 150px;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 0.5s ease;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

#site-nav {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 5px;
    z-index: 100;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: bold;
}

.nav-link.active {
    background-color: #4385f4;
    color: white !important;
}

.container {
    background-color: rgba(255, 255, 255, 0.85);
    width: 90%;
    max-width: 380px;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

#display {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 2rem;
    text-align: right;
    background: #fdfdfd;
    color: #333;
    outline: none;
    display: block;
    margin: 0 auto 15px auto;
    text-align: right;
    width: 90%;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 5px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 3px 0 #bbb;
}

.btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.btn-num {
    background: white;
    color: #333;
}
.btn-op {
    background: #f39c12;
    color: white;
}
.btn-clear {
    background: #e74c3c;
    color: white;
}
.btn-equal {
    background: #4385f4;
    color: white;
    grid-row: span 2;
}
.btn-pattern-active {
    background-color: #28a745 !important;
}

.settings-area {
    border-top: 1px solid #ccc;
    padding-top: 15px;
}

label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.file-input {
    margin-bottom: 10px;
    font-size: 0.8rem;
    width: 100%;
}
.pattern-toggle-btn {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
