:root {
--gold: #c6a355;
--gold-shadow: rgba(198, 163, 85, 0.5);
--dark-blue: #0a0e14;
--text-color: #e0d8c0;
}

body {
margin: 0;
padding: 0;
font-family: 'Noto Serif JP', serif;
background-color: var(--dark-blue);
background-image: url('bg-image.png'); 
background-size: cover;
background-attachment: fixed;
color: var(--text-color);
overflow-x: hidden;
}


.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 14, 20, 0.95); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    padding: 20px; box-sizing: border-box;
}
.modal-content {
    background: var(--dark-blue); border: 2px solid var(--gold);
    padding: 30px; max-width: 600px; width: 100%;
    text-align: center; box-shadow: 0 0 30px var(--gold-shadow);
}
.modal-content h2 { margin-top: 0; border-left: none; text-align: center; border-bottom: 1px solid var(--gold);}
.tos-summary { text-align: left; margin-bottom: 20px; background: rgba(255,255,255,0.05); padding: 15px; border-radius: 5px;}
.tos-summary ul { padding-left: 20px; }
.tos-summary li { margin-bottom: 10px; }
.tos-checkbox-label { display: block; margin: 20px 0; font-weight: bold; cursor: pointer;}
#tosStartBtn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none;}

.container {
max-width: 800px;
margin: 0 auto;
padding: 40px 20px;
background: rgba(10, 14, 20, 0.9);
box-shadow: 0 0 20px rgba(0,0,0,0.5);
box-sizing: border-box;
}

h1 {
font-family: 'Cormorant Garamond', serif;
text-align: center;
color: var(--gold);
font-size: 2.5rem;
border-bottom: 2px solid var(--gold);
padding-bottom: 10px;
line-height: 1.2;
}

h2 {
color: var(--gold);
font-size: 1.3rem;
margin-top: 40px;
border-left: 4px solid var(--gold);
padding-left: 10px;
text-align: left;
}

.step { margin-bottom: 50px; text-align: center; }
.hint { font-size: 0.9rem; color: #aaa; margin-bottom: 15px; }
.hint.highlight { color: var(--gold); font-weight: bold; }

#preview-wrapper {
position: relative;
width: 100%;
max-width: 400px;
margin: 20px auto;
border: 2px solid var(--gold);
background: #000;
aspect-ratio: 1393 / 2055;
overflow: hidden;
touch-action: none;
}

#preview-container { width: 100%; height: 100%; }

#frame-preview-overlay {
position: absolute;
top: 0; left: 0; width: 100%; height: 100%;
pointer-events: none;
z-index: 10;
display: none;
}

/* テキスト操作用UI */
#draggable-text-container {
position: absolute;
top: 75%; left: 50%;
transform: translate(-50%, -50%);
z-index: 20;
cursor: move;
user-select: none;
white-space: nowrap;
display: inline-block;
padding: 10px;
}

#draggable-text {
font-family: 'Cormorant Garamond', serif;
font-size: 24px;
font-weight: bold;
color: var(--gold);
text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
display: block;
}

/* 右下の調整ハンドル */
#text-handle {
position: absolute;
right: -5px;
bottom: -5px;
width: 20px;
height: 20px;
background: var(--gold);
border-radius: 50%;
cursor: nwse-resize;
border: 2px solid #fff;
}

input[type="file"], input[type="text"] {
padding: 10px;
background: rgba(255,255,255,0.1);
border: 1px solid var(--gold);
color: #fff;
border-radius: 5px;
width: 90%;
max-width: 300px;
text-align: center;
}

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.tab-btn {
background: transparent; border: 1px solid var(--gold); color: var(--gold);
padding: 10px 12px; cursor: pointer; flex: 1 1 30%; min-width: 80px; font-size: 0.9rem;
}
.tab-btn.active { background: var(--gold); color: var(--dark-blue); font-weight: bold; }

.main-btn, .save-btn {
background: var(--gold); border: none; color: var(--dark-blue);
padding: 15px 40px; font-weight: bold; cursor: pointer; border-radius: 30px;
box-shadow: 0 4px 15px var(--gold-shadow); width: 90%; max-width: 300px; margin-top: 10px;
}

#finalResultImage { width: 100%; height: auto; border: 2px solid var(--gold); }

.rules {
margin-top: 60px; padding: 20px; border: 1px solid rgba(198, 163, 85, 0.3);
font-size: 0.8rem; line-height: 1.8; text-align: left;
}
.rules h3 { color: var(--gold); text-align: center; }

@media (max-width: 600px) {
.container { padding: 20px 15px; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.1rem; text-align: center; border-left: none; border-bottom: 1px solid var(--gold); }
}