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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
}

.screen { width:100%; max-width:420px; margin:0 auto; padding:20px; }
.hidden { display:none !important; }

/* パスワード画面 */
.password-card {
    background:rgba(255,255,255,0.1);
    backdrop-filter:blur(20px);
    border-radius:24px;
    padding:50px 30px 40px;
    text-align:center;
    box-shadow:0 20px 40px rgba(0,0,0,0.4);
    border:1px solid rgba(255,255,255,0.2);
}
.password-card h1 {
    font-size:28px;
    margin-bottom:10px;
    background:linear-gradient(to right,#00f2ff,#ff00cc);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}
#passwordInput {
    width:100%;
    max-width:220px;
    height:65px;
    font-size:32px;
    text-align:center;
    background:rgba(255,255,255,0.15);
    border:2px solid rgba(255,255,255,0.3);
    border-radius:16px;
    color:#fff;
    margin-bottom:25px;
}
#passwordBtn {
    width:100%;
    max-width:220px;
    padding:18px;
    font-size:18px;
    background:linear-gradient(to right,#00f2ff,#ff00cc);
    border:none;
    border-radius:50px;
    color:#000;
    font-weight:bold;
    cursor:pointer;
}

/* メイン画面 */
#mainScreen h1 {
    text-align:center;
    font-size:26px;
    margin-bottom:8px;
    background:linear-gradient(to right,#00f2ff,#ff00cc);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}
#mainScreen p {
    text-align:center;
    opacity:0.85;
    margin-bottom:20px;
    font-size:15px;
}

input[type="file"] {
    display:block;
    margin:0 auto 30px;
    padding:14px 20px;
    background:rgba(255,255,255,0.12);
    border-radius:16px;
    color:#fff;
    width:100%;
    font-size:16px;
}

/* 結果エリア */
.results-container {
    display:flex;
    flex-direction:column;
    gap:40px;
}

.result-item {
    background:rgba(255,255,255,0.08);
    border-radius:20px;
    padding:15px;
    box-shadow:0 10px 25px rgba(0,0,0,0.3);
}

.result-item h3 {
    text-align:center;
    margin-bottom:12px;
    font-size:16px;
    opacity:0.9;
}

.result-item > div {
    display:flex;
    flex-direction:column;
    gap:20px;
}

canvas {
    width:100%;
    height:auto;
    border-radius:16px;
    box-shadow:0 10px 25px rgba(0,0,0,0.4);
    background:#111;
    display:block;
    touch-action: none;
    user-select: none;
}

/* 保存ボタン */
.save-single-btn {
    display:block;
    margin:20px auto 0;
    width:90%;
    padding:18px 30px;
    font-size:18px;
    font-weight:bold;
    background:linear-gradient(to right,#00f2ff,#ff00cc);
    border:none;
    border-radius:50px;
    color:#000;
    box-shadow:0 12px 30px rgba(0,242,255,0.5);
    transition:all 0.3s;
    cursor:pointer;
}

.save-single-btn:hover {
    transform:scale(1.05);
    box-shadow:0 18px 40px rgba(255,0,204,0.5);
}

/* 戻るボタン */
.undo-btn {
    display:block;
    margin:10px auto 0;
    width:90%;
    padding:12px 24px;
    font-size:15px;
    background:rgba(255,255,255,0.15);
    color:#fff;
    border:2px solid rgba(255,255,255,0.3);
    border-radius:50px;
    cursor:pointer;
}

/* 強度選択 */
.strength-container {
    display:flex;
    justify-content:center;
    gap:12px;
}
.strength-btn {
    flex:1;
    max-width:110px;
    padding:14px 20px;
    font-size:17px;
    font-weight:bold;
    background:rgba(255,255,255,0.15);
    border:2px solid rgba(255,255,255,0.3);
    border-radius:50px;
    color:#fff;
    cursor:pointer;
    transition:all 0.3s;
}
.strength-btn.active {
    background:linear-gradient(to right,#00f2ff,#ff00cc);
    color:#000;
    border:none;
    box-shadow:0 8px 20px rgba(0,242,255,0.4);
}