/* public/css/qrnonogram.css */

.qrn-app {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 20px;
    align-items: flex-start;
}

.editor-side {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 💡 変更：問題・答えの2枚を縦に並べるようにしたため、上寄せの1列にしています */
.preview-side {
    flex: 1.5;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-label {
    font-size: 1rem;
    color: #2a5298;
    border-left: 4px solid #2a5298;
    padding-left: 10px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #444;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    box-sizing: border-box;
}

.form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

.check-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.input-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.6;
}

/* プレビューカード */
.qrn-preview-card {
    background: #fff;
    width: 100%;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.preview-title {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 💡 変更：以前はCSS Gridでマス目をDOMに1つずつ作っていました。
       QRコードは短い内容でも21マス角になり、盤面が画面の外へはみ出すと
       中央寄せの都合で左側・上側がスクロールしても見えなくなる不具合がありました。
       いまは Canvas で描いた1枚の画像として表示するだけにしたため、
       max-width:100% で必ず箱の中に収まります（保険で横スクロールも付けています）。 */
.puzzle-preview-frame {
    width: 100%;
    overflow-x: auto;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.puzzle-preview-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 保存形式・保存する・共有する（x-nono-preview-actions） --- */
.preview-actions .action-buttons-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-action {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-download {
    background-color: #2a5298;
    color: #fff;
}
.btn-download:hover {
    background-color: #1e3c72;
}

.btn-sub {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.btn-sub:hover {
    background-color: #e2e8f0;
}

.preview-status {
    margin: 10px 0 0;
    padding: 8px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #1d4ed8;
    line-height: 1.6;
}
.preview-status[hidden] { display: none; }

@media (max-width: 768px) {
    .qrn-app {
        gap: 20px;
    }
    .editor-side, .preview-side {
        flex: 1 1 100%;
        min-width: 0;
    }
}
