

@font-face {
    font-family: 'Hachi Maru Pop';
    src: url('./fonts/Hachi_Maru_Pop/HachiMaruPop-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    padding-top: max(40px, env(safe-area-inset-top));
    padding-bottom: max(40px, env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 300;
}

.download-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    display: block;
    margin: 30px auto 0;
    max-width: 100%;
    box-sizing: border-box;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.privacy-notice {
    text-align: center;
    font-size: 0.8em;
    color: #666;
    margin: 10px 0 0;
    line-height: 1.4;
}



.profile-form-section {
    margin-bottom: 30px;
    text-align: left;
}

.form-title {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    -webkit-tap-highlight-color: transparent;
}

.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    background: white;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    -webkit-tap-highlight-color: transparent;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    -webkit-tap-highlight-color: transparent;
}

.image-upload-container {
    position: relative;
    width: 100%;
}

.image-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.image-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-preview:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.image-preview.has-image {
    border-style: solid;
    border-color: #667eea;
}

.upload-text {
    color: #666;
    font-size: 0.9em;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.text-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.text-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-option label {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

.text-option input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.text-option select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

/* プレビューモーダル */
.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10001;
}

.preview-content {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    max-width: 90vw;
    max-height: 85vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-image {
    max-width: 80vw;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* クロップモーダル */
.crop-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    /* iOSでのスクロール防止 */
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    touch-action: none;
}

.crop-content {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 90vw;
}

.crop-canvas {
    width: 80vw;
    max-width: 420px;
    height: auto;
    aspect-ratio: 1 / 1;
    background: #f8f9fa;
    border-radius: 8px;
    /* iOSでのタッチ操作最適化 */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.crop-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.crop-zoom {
    width: 60%;
}

.crop-hint {
    font-size: 12px;
    color: #666;
}

.team-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.team-fieldset legend {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.team-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.team-checkboxes h4 {
    width: 100%;
    margin: 16px 0 8px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.team-checkboxes h4:first-child {
    margin-top: 0;
}

.team-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-size: 0.9em;
    color: #333;
}

.team-checkbox:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.team-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.team-checkbox input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

.team-checkbox input[type="checkbox"]:checked {
    accent-color: #667eea;
}

/* フォロー傾向オプション */
.follow-tendency-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.follow-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-size: 0.9em;
    color: #333;
}

.follow-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.follow-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.follow-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

.follow-option input[type="radio"]:checked {
    accent-color: #667eea;
}



/* フッター */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer p {
    margin: 0;
    padding: 0;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.legal-links {
    margin-top: 10px;
    font-size: 0.8em;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .download-section {
        flex-direction: column;
    }
}

/* ローディングオーバーレイ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 90%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-spinner p {
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
    margin: 0;
}

/* ローディング中の広告 */
.loading-ad {
    margin-top: 20px;
    text-align: center;
}

.loading-ad img {
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.loading-ad a {
    display: inline-block;
    text-decoration: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

 