@font-face {
    font-family: 'MPLUS1-Black';
    src: url('../../fonts/MPLUS1-Black.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'MPLUS1-Bold';
    src: url('../../fonts/MPLUS1-Bold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'MPLUS1-ExtraLight';
    src: url('../../fonts/MPLUS1-ExtraLight.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'MPLUS1-Light';
    src: url('../../fonts/MPLUS1-Light.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'MPLUS1-Medium';
    src: url('../../fonts/MPLUS1-Medium.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'MPLUS1-SemiBold';
    src: url('../../fonts/MPLUS1-SemiBold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'NotoSerifJP-Bold';
    src: url('../../fonts/NotoSerifJP-Bold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'NotoSerifJP-Medium';
    src: url('../../fonts/NotoSerifJP-Medium.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'keifont';
    src: url('../../fonts/keifont.ttf') format('truetype');
    font-display: swap;
}

/* ここから通常のCSS */

/* ロゴのサイズと余白の調整 */
.logo {
  width: 210px;
  margin-top: 14px;
}

/* ナビゲーションメニューの装飾 */
.main-nav {
  /* 横に並べる */
  display: flex;
  font-size: 1.25rem;
  text-transform: uppercase;
  margin-top: 34px;
  /* リストの黒丸を消す */
  list-style: none;
}
.main-nav li {
  margin-left: 36px;
}
.main-nav a {
  color: #432;
}
/* ホバー時の色を変える */
.main-nav a:hover {
  color: #0bd;
}

.page-header {
  /* 横に並べる */
  display: flex;
  /* 両端に設置する */
  justify-content: space-between;
}

.wrapper {
  /* 横幅最大1100pxを設定して、中央に配置する */
  max-width: 1100px;
  margin: 0 auto;
  /* スマートフォンで横の空白ができて見やすくする */
  padding: 0 4%;
}


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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 1rem;
    color: #333;
}

/* 最上部 白ヘッダー */
.topbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.topbar-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-version {
    font-weight: 700;
    color: #0d6efd;
    background: #e7f1ff;
    border: 1px solid #cfe2ff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.topbar-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.topbar-link:hover {
    background: #e7f1ff;
    border-color: #cfe2ff;
}

/* レスポンシブ（アイコン縮小） */
@media (max-width: 768px) {
    .topbar-inner {
        padding: 0.75rem 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .topbar-logo {
        height: 40px;
    }
    
    .topbar-info {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .topbar-version,
    .topbar-link {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.header p {
    opacity: 0.9;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* ヘッダー下広告（728x90） */
.header-ad {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.header-ad .adsbygoogle {
    width: 728px !important;
    height: 90px !important;
    display: inline-block !important;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    padding: 2rem;
}

.controls {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    height: fit-content;
}

/* タブ設定 */
.tab-container {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    gap: 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #4facfe;
    border-bottom-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
}

.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker {
    width: 45px;
    height: 35px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker:hover {
    border-color: #4facfe;
    transform: scale(1.05);
}

.hex-input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.hex-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

textarea,
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.4;
}

#blogNameInput {
    min-height: 60px;
}

textarea:focus,
input[type="text"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.checkbox-wrapper,
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.checkbox,
.radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label,
.radio-label {
    font-weight: normal;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 55px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #495057;
    font-weight: 600;
}

.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

canvas {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
}

.download-btn,
.bg-clear-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
    margin: 0.3rem;
}

.bg-clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.download-btn:hover,
.bg-clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.bg-clear-btn:hover {
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

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

/* 下部の広告エリア（レスポンシブ） */
.ad-container {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 800px;
    min-height: 100px;
}

.adsbygoogle {
    display: block !important;
}

.text-bg-control {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 8px;
}

.text-bg-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls {
        order: 2;
    }

    .canvas-area {
        order: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
        gap: 1rem;
    }

    .controls {
        padding: 1.5rem;
    }

    .tab-button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .header-ad {
        display: none;
    }

    .control-group {
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 800px) {
    .header-ad {
        display: none;
    }
}