/* ピクセルアート × 夏の浜辺テーマ */
:root {
    /* 夏の浜辺カラー */
    --sand: #F4E4BC;
    --sand-dark: #E8D5B7;
    --sea: #5B9BD5;
    --sea-light: #7EB8DA;
    --sky: #87CEEB;
    --foam: #FFFFFF;
    --sea-deep: #2E5C8A;
    --coral: #E07A5F;
    --text: #2E5C8A;
    --text-light: #5B9BD5;
    /* ピクセル風シャドウ */
    --shadow-pixel: 4px 4px 0 var(--sea-deep);
    --shadow-pixel-sm: 2px 2px 0 var(--sea-deep);
}

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

html {
    /* 画面遷移時にスクロールバー出没で幅が変わらないようにする */
    scrollbar-gutter: stable;
}

body {
    font-family: 'DotGothic16', sans-serif;
    background: var(--sea-light);
    min-height: 100vh;
    color: var(--text);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 共通背景（常に1要素のため遷移時にサイズが変わらない） */
.app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: var(--sea-light);
    background-image: url('images/bg-main.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    isolation: isolate;
}

.p5-bg-ready .app-bg {
    background-image: none;
}

.app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 30%, rgba(13, 47, 79, 0.14) 100%);
    pointer-events: none;
    z-index: 1;
}

.p5-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* 認証画面（背景は .app-bg に任せる） */
#auth-screen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: transparent;
}

/* 読み込み後：タイトル→サブタイトル→ログインの順でスタッガードフェードイン */
.auth-screen-content .auth-fade-in-1,
.auth-screen-content .auth-fade-in-2,
.auth-screen-content .auth-fade-in-3 {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.auth-screen-content.is-visible .auth-fade-in-1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.auth-screen-content.is-visible .auth-fade-in-2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.35s;
}

.auth-screen-content.is-visible .auth-fade-in-3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

/* 読み込み→ログイン時：ラッパーは即時表示し、子だけスタッガードでフェード */
.auth-screen-content.screen-content.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: none;
}

.screen {
    display: none;
}

.screen:not(.hidden) {
    display: block;
}

/* 画面内の「中身」だけフェード（背景は動かさない） */
.screen-content {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.screen-content.screen--in {
    opacity: 1;
    transform: translateY(0);
}

.screen-content.screen--out {
    opacity: 0;
    transform: translateY(-12px);
}

/* 読み込み画面（背景は .app-bg、中央のボトル＋テキストだけフェード） */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.loading-content {
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.loading-content.loading-content--out {
    opacity: 0;
    transform: translateY(-12px);
}

/* 読み込み中：バウンスする3点（わかりやすいローディング） */
.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 20px;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: var(--sea-deep);
    border-radius: 50%;
    animation: loading-bounce 0.6s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.1s; }
.loading-dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes loading-bounce {
    0%, 80%, 100% { transform: scale(0.85); opacity: 0.7; }
    40% { transform: scale(1.2); opacity: 1; }
}

.loading-text {
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
    font-size: 0.95em;
    letter-spacing: 0.1em;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 認証画面ヘッダー */
.wave-header {
    text-align: center;
    color: var(--foam);
    padding: 40px 20px;
}

.wave-header h1 {
    font-family: 'Press Start 2P', 'DotGothic16', cursive;
    font-size: 2em;
    margin-bottom: 12px;
    text-shadow: var(--shadow-pixel-sm);
    color: var(--foam);
    letter-spacing: 0.02em;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    color: var(--sand);
}

.wave-header a {
    color: var(--sand);
}

/* 認証画面 */
.auth-forms {
    background: var(--sand);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    padding: 24px;
    box-shadow: var(--shadow-pixel);
    margin-top: 24px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-button {
    flex: 1;
    padding: 12px;
    border: 3px solid var(--sea-deep);
    background: var(--sand-dark);
    cursor: pointer;
    border-radius: 0;
    font-size: 1em;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
}

.tab-button:hover {
    background: var(--sea-light);
    color: var(--foam);
}

.tab-button.active {
    background: var(--sea);
    color: var(--foam);
    box-shadow: var(--shadow-pixel-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-field {
    padding: 12px 16px;
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1em;
    font-family: 'DotGothic16', sans-serif;
    background: var(--foam);
    color: var(--text);
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: var(--sea);
    box-shadow: 0 0 0 2px var(--sea-light);
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%232E5C8A' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.primary-button {
    padding: 14px 24px;
    background: var(--sea);
    color: var(--foam);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1.05em;
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
    box-shadow: var(--shadow-pixel-sm);
}

.primary-button:hover {
    background: var(--sea-deep);
}

.primary-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.secondary-button {
    padding: 14px 24px;
    background: var(--sand);
    color: var(--sea-deep);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1.05em;
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
    box-shadow: var(--shadow-pixel-sm);
}

.secondary-button:hover {
    background: var(--sand-dark);
}

.secondary-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.danger-button {
    padding: 14px 24px;
    background: var(--coral);
    color: var(--foam);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1.05em;
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
    box-shadow: var(--shadow-pixel-sm);
}

.danger-button:hover {
    background: var(--sea-deep);
}

.danger-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.account-delete-warning {
    font-size: 0.95em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.6;
}

.link-button {
    background: none;
    border: none;
    color: var(--sea-deep);
    text-decoration: underline;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
    padding: 4px 0;
}

.password-change-button {
    margin-top: 16px;
}

/* メイン画面（ログイン後）背景は .app-bg、4ボタンのみ */
.main-screen-with-bg {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: transparent;
}

.main-screen-inner {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.main-header {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

.main-header .icon-button {
    background: var(--sand);
    color: var(--sea-deep);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-family: 'DotGothic16', sans-serif;
    box-shadow: var(--shadow-pixel-sm);
}

.main-header .icon-button:hover {
    background: var(--sea-light);
    color: var(--foam);
}

.main-header .icon-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ヘッダーボタン：画像（マイボトル・ログアウト）枠線なし・拡大なし・レスポンシブ（約半分サイズ） */
.main-header .header-btn {
    width: clamp(53px, 16.8vw, 114px);   /* PCでは約1.2倍に拡大 */
    height: clamp(43px, 13.8vw, 95px);
    min-width: 53px;
    max-width: 114px;
    min-height: 43px;
    max-height: 95px;
    padding: 0;
    text-indent: -9999px;
    overflow: hidden;
    background-color: transparent;
    border: none;
    box-shadow: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.main-header .header-btn-my {
    background-image: url('images/header-my-bottle.png');
}

.main-header .header-btn-logout {
    background-image: url('images/header-logout.png');
}

.main-header .header-btn-account {
    background-image: url('images/header-account.png');
}

.main-header .header-btn:hover {
    background-color: transparent;
    filter: none;
    opacity: 0.85;
}

.main-header .header-btn-my:hover {
    background-image: url('images/header-my-bottle.png');
}

.main-header .header-btn-logout:hover {
    background-image: url('images/header-logout.png');
}
.main-header .header-btn-account:hover {
    background-image: url('images/header-account.png');
}

.main-header .header-btn:active {
    filter: none;
    opacity: 0.75;
}

/* スマホ表示時：ヘッダーアイコンを約1.4倍に拡大 */
@media (max-width: 768px) {
    .main-header .header-btn {
        width: clamp(62px, 20vw, 133px);   /* 元: 44px, 14vw, 95px */
        height: clamp(50px, 16vw, 111px);  /* 元: 36px, 11.5vw, 79px */
    }
}

.main-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* 登場時：海に流す→ボトルを探すの順でスタッガード表示 */
.main-screen-inner .main-action-button {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.main-screen-inner.screen--in .main-action-send {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.main-screen-inner.screen--in .main-action-pick {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.35s;
}

/* 軽い浮きアニメーション（海に漂うイメージ） */
.main-screen-inner.screen--in .main-action-send {
    animation: main-btn-float 2.5s ease-in-out infinite;
    animation-delay: 0.8s;
}

.main-screen-inner.screen--in .main-action-pick {
    animation: main-btn-float 2.5s ease-in-out infinite;
    animation-delay: 1.1s;
}

@keyframes main-btn-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.main-action-button {
    padding: 16px 40px;
    border-radius: 0;
    border: 3px solid var(--sea-deep);
    font-size: 1.1em;
    font-family: 'DotGothic16', sans-serif;
    font-weight: bold;
    cursor: pointer;
    min-width: 200px;
    box-shadow: var(--shadow-pixel);
}

.main-action-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
    animation: none;
}

.main-action-send {
    background: var(--sea);
    color: var(--foam);
}

.main-action-send:hover {
    background: var(--sea-deep);
}

.main-action-pick {
    background: var(--sand);
    color: var(--sea-deep);
}

.main-action-pick:hover {
    background: var(--sand-dark);
}

.main-picks-hint {
    margin-top: 20px;
    color: var(--foam);
    font-family: 'DotGothic16', sans-serif;
    text-shadow: 2px 2px 0 var(--sea-deep);
    font-size: 0.95em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.main-screen-inner.screen--in .main-picks-hint {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* 海を漂っているボトル数表示（ログイン画面・メイン画面）読みやすく・タイプライター用 */
.bottle-count-hint {
    margin-top: 16px;
    padding: 12px 20px;
    background: rgba(46, 92, 138, 0.75);
    border: 2px solid var(--sea-deep);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    text-align: center;
    color: var(--foam);
    text-shadow: 1px 1px 0 var(--sea-deep);
    box-shadow: var(--shadow-pixel-sm);
    min-height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#auth-screen .bottle-count-hint {
    background: rgba(46, 92, 138, 0.8);
    color: var(--sand);
    border-color: var(--sea-deep);
}

.bottle-count-typed {
    display: inline;
}

/* タイプライターのカーソル点滅 */
.bottle-count-cursor {
    display: inline-block;
    margin-left: 2px;
    color: var(--foam);
    animation: bottle-count-blink 0.8s step-end infinite;
}

#auth-screen .bottle-count-cursor {
    color: var(--sand);
}

/* ログイン後画面ではタイプライターを使わないのでカーソル非表示 */
#main-screen .bottle-count-cursor {
    display: none;
}

@keyframes bottle-count-blink {
    50% { opacity: 0; }
}

/* 確認：ボトルを探すモーダル */
.pick-confirm-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(46, 92, 138, 0.75);
    border: 2px solid var(--sea-deep);
    color: var(--foam);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    text-align: center;
    text-shadow: 1px 1px 0 var(--sea-deep);
}

.pick-confirm-question {
    margin-bottom: 20px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.05em;
    color: var(--sea-deep);
    text-align: center;
}

.pick-confirm-actions {
    justify-content: center;
    gap: 16px;
}

/* 3本から1本選ぶモーダル */
.pick-choose-content h3 {
    margin-bottom: 8px;
}
.pick-choose-message {
    margin-bottom: 20px;
    font-size: 0.95em;
    color: var(--text);
}
.pick-choose-bottles {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.pick-choose-bottle {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.pick-choose-bottle:hover {
    border-color: var(--sea);
    transform: translateY(-4px);
    box-shadow: var(--shadow-pixel-sm);
}
.pick-choose-bottle .pick-choose-bottle-img-wrap {
    display: block;
    line-height: 0;
}
.pick-choose-bottle img {
    width: 128px;
    height: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}
.pick-choose-bottle-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8em;
    color: var(--text);
    width: 128px;
}
.pick-choose-bottle-preview {
    width: 100%;
    font-size: 0.95em;
    font-weight: bold;
    color: var(--sea-deep);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pick-choose-bottle-stat {
    white-space: nowrap;
}
.pick-choose-cancel-wrap {
    margin-top: 20px;
    text-align: center;
}
.pick-choose-cancel-wrap .secondary-button {
    padding: 10px 20px;
}

/* 初回案内モーダル */
.intro-message {
    font-family: 'DotGothic16', sans-serif;
    font-size: 1em;
    color: var(--sea-deep);
    line-height: 1.6;
    margin-bottom: 20px;
}

.intro-dismiss-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.9em;
    color: var(--text-light);
    cursor: pointer;
    margin-bottom: 20px;
}

.intro-dismiss-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#intro-modal .modal-actions {
    justify-content: center;
}

.account-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.account-modal-actions .account-modal-btn {
    width: 100%;
}

.account-modal-links {
    margin-bottom: 12px;
    font-size: 0.82em;
    text-align: center;
    color: var(--text-light);
}

.account-modal-links a {
    color: var(--sea-deep);
    text-decoration: underline;
}

/* 初回チュートリアル（複数ステップ） */
.tutorial-modal-content .tutorial-title {
    margin-bottom: 12px;
    color: var(--sea-deep);
}

.tutorial-body {
    font-family: 'DotGothic16', sans-serif;
    font-size: 1em;
    color: var(--sea-deep);
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.tutorial-progress {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 20px;
}

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

.tutorial-skip-btn {
    padding: 6px 12px;
    font-size: 0.85em;
}

.tutorial-nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* チュートリアルモーダル：常にコンパクト（文字・枠を小さく） */
#tutorial-modal .modal-content {
    padding: 18px 22px;
    border-width: 3px;
    max-height: 70vh;
}
#tutorial-modal .tutorial-modal-content .tutorial-title {
    font-size: 0.95em;
    margin-bottom: 8px;
}
#tutorial-modal .tutorial-body {
    font-size: 0.88em;
    line-height: 1.55;
    margin-bottom: 10px;
}
#tutorial-modal .tutorial-progress {
    font-size: 0.82em;
    margin-bottom: 12px;
}
#tutorial-modal .tutorial-actions .secondary-button,
#tutorial-modal .tutorial-actions .primary-button {
    padding: 8px 14px;
    font-size: 0.9em;
}
#tutorial-modal .tutorial-skip-btn {
    padding: 5px 10px;
    font-size: 0.82em;
}

#tutorial-encourage-modal .modal-content {
    padding: 18px 22px;
    border-width: 3px;
}
#tutorial-encourage-modal .tutorial-encourage-content {
    max-height: 36vh;
}
#tutorial-encourage-modal .tutorial-title {
    font-size: 0.95em;
}
#tutorial-encourage-modal .tutorial-body {
    font-size: 0.88em;
    line-height: 1.55;
}

/* チュートリアル用スポットライト（メイン画面のボタン強調・海に流すモーダル内の要素強調） */
.tutorial-spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050; /* 送信モーダル(1000)より上・チュートリアルモーダル(1100)より下 */
    pointer-events: none;
}

.tutorial-spotlight-overlay.hidden {
    display: none;
}

/* 案内表示中は「海に流す」以外を押せないようにする（ブロッカーで穴以外をブロック） */
.tutorial-spotlight-overlay.tutorial-spotlight-overlay--blocking {
    pointer-events: none; /* 穴部分のクリックは背面へ透過 */
}
.tutorial-spotlight-overlay.tutorial-spotlight-overlay--blocking .tutorial-spotlight-blocker {
    pointer-events: auto; /* 穴以外の範囲だけクリックを受け付ける */
}
.tutorial-spotlight-blocker {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1;
}
.tutorial-spotlight-overlay--blocking .tutorial-spotlight-blocker {
    display: block;
}

.tutorial-spotlight-hole {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    pointer-events: none;
    transition: top 0.2s ease-out, left 0.2s ease-out, width 0.2s ease-out, height 0.2s ease-out;
}

/* マイボトル画面（メイン画面と同様に前面に表示） */
#my-bottles-screen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: transparent;
}

/* ヘッダー（マイボトル画面など） */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sand);
    padding: 16px 20px;
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow-pixel);
}

.header h2 {
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    padding: 10px 14px;
    background: var(--sand-dark);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1em;
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
    box-shadow: var(--shadow-pixel-sm);
}

.icon-button:hover {
    background: var(--sea-light);
    color: var(--foam);
}

.icon-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 送信セクション（モーダル内など） */
.send-bottle-section,
.pick-bottle-section {
    background: var(--sand);
    padding: 24px;
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    box-shadow: var(--shadow-pixel);
}

.send-bottle-section h3,
.pick-bottle-section h3 {
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
    margin-bottom: 12px;
}

/* 海に流すポップアップ：通常のテキストエリアに戻す */
#bottle-content {
    width: 100%;
    min-height: 120px;
    max-height: 240px;
    padding: 12px 16px;
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    font-size: 1em;
    font-family: 'DotGothic16', sans-serif;
    background: var(--foam);
    color: var(--text);
    resize: vertical;
    overflow-y: auto;
}

#bottle-content:focus {
    outline: none;
    border-color: var(--sea);
}

.send-bottle-hint {
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.85em;
    color: var(--text-light);
    margin: 8px 0 4px 0;
    line-height: 1.4;
}

.send-bottle-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.send-bottle-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: var(--sea-deep);
    font-family: 'DotGothic16', sans-serif;
    cursor: pointer;
}

/* ピクセルアート風チェックボックス（角ばった枠・シャドウ・チェックマーク） */
.send-bottle-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    margin: 0;
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    background: var(--sand);
    box-shadow: var(--shadow-pixel-sm);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.send-bottle-option input[type="checkbox"]:hover {
    background: var(--sand-dark);
}
.send-bottle-option input[type="checkbox"]:checked {
    background: var(--sea-deep);
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.2), var(--shadow-pixel-sm);
}
.send-bottle-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--foam);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    box-sizing: border-box;
}
.send-bottle-option input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--sea);
    outline-offset: 2px;
}

.send-bottle-option-note {
    margin: 0;
    font-size: 0.8em;
    color: var(--text-light);
}

.char-count {
    text-align: right;
    color: var(--sea-deep);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.9em;
    margin: 6px 0 12px 0;
}

/* 拾うセクション */
.pick-info {
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
    margin-bottom: 12px;
}

.picked-bottle {
    margin-top: 16px;
}

.bottle-card {
    background: var(--sand);
    padding: 20px;
    border-radius: 0;
    border: 3px solid var(--sea-deep);
    box-shadow: var(--shadow-pixel-sm);
}

.bottle-header {
    margin-bottom: 12px;
}

.bottle-status {
    display: inline-block;
    padding: 6px 12px;
    background: var(--sea-light);
    border: 2px solid var(--sea-deep);
    border-radius: 0;
    font-size: 0.9em;
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
    transition: all 0.3s ease;
}

.my-bottle-card.stopped .bottle-status {
    background: linear-gradient(135deg, #8b7355 0%, #6b5344 100%);
    color: var(--foam);
    border: 2px solid #4a3b2f;
    font-weight: bold;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bottle-content {
    background: var(--foam);
    padding: 16px;
    border: 2px solid var(--sea-deep);
    border-radius: 0;
    margin-bottom: 12px;
    line-height: 1.6;
    min-height: 80px;
    white-space: pre-wrap;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
}

.bottle-meta {
    margin-bottom: 6px;
    font-size: 0.85em;
    color: var(--text-light);
    font-family: 'DotGothic16', sans-serif;
}

/* マイボトル「コメントを見る」用モーダル：
   長文投稿は本文のみスクロールさせ、閉じるボタンは常にモーダル下部に表示 */
#picked-bottle-detail-modal .picked-bottle-modal-content {
    max-height: 80vh;
}

#picked-bottle-detail-modal .bottle-content {
    max-height: 40vh;
    overflow-y: auto;
}

.bottle-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-family: 'DotGothic16', sans-serif;
    color: var(--sea-deep);
    font-size: 0.95em;
}

.bottle-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 拾ったモーダル・詳細モーダル：コメント欄 */
.picked-comments-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px dashed var(--sea-deep);
}

.picked-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    color: var(--sea-deep);
}

.picked-comment-form {
    margin-bottom: 12px;
}

.picked-comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 2px solid var(--sea-deep);
    border-radius: 0;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    background: var(--foam);
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}

.picked-comment-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.9em;
    color: var(--sea-deep);
}

.picked-comments-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.picked-comment-item {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--foam);
    border: 2px solid var(--sea-deep);
    border-radius: 0;
    font-family: 'DotGothic16', sans-serif;
}

.picked-comment-body {
    margin-bottom: 8px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 8em;
    overflow-y: auto;
}

.picked-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-light);
}

.picked-comment-date {
    flex-shrink: 0;
}

/* 自分のコメントのハイライト */
.picked-comment-item.my-comment {
    background: #fff4d6;
    border-color: #f2a65a;
}

.picked-comment-badge {
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 12px;
    background: #f2a65a;
    color: #ffffff;
    font-size: 0.8em;
}

/* コメント右端の「・・・」メニュー（通報など） */
.comment-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.comment-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 0;
    font-size: 1em;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.comment-menu-btn:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.06);
}

.comment-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 120px;
    padding: 4px 0;
    background: var(--foam);
    border: 1px solid var(--sea-deep);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 10;
}

.comment-menu.is-open {
    display: block;
}

.comment-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.9em;
    font-family: inherit;
    text-align: left;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
}

.comment-menu-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.comment-menu-item.comment-menu-report {
    color: var(--danger, #c62828);
}

.picked-comment-empty {
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.9em;
    color: var(--text-light);
    padding: 12px 0;
}

.my-bottle-actions-row {
    margin-top: 10px;
}

.my-bottle-actions-row .view-comments-btn {
    width: 100%;
}

.my-bottle-comments-disabled-note {
    margin-top: 10px;
}
.my-bottle-comments-disabled-text {
    font-size: 0.85em;
    color: var(--text-light);
    font-family: 'DotGothic16', sans-serif;
}

.action-button {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    background: var(--sand);
    border: 3px solid var(--sea-deep);
    color: var(--sea-deep);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.95em;
    font-family: 'DotGothic16', sans-serif;
    box-shadow: var(--shadow-pixel-sm);
}

.action-button:hover {
    background: var(--sea);
    color: var(--foam);
}

.action-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.action-button.danger {
    border-color: var(--coral);
    color: var(--coral);
}

.action-button.danger:hover {
    background: var(--coral);
    color: var(--foam);
}

/* 応援ボタンなど：非活性時の見た目 */
.action-button-disabled,
.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: #d3c8aa;
    color: #777777;
}

/* マイボトル画面（ピクセルアート） */
.my-bottles-container {
    position: relative;
}

/* 読み込み中：操作ブロック用（透明オーバーレイ・一覧は別で「読み込み中」表示） */
.my-bottles-loading-block {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: auto;
}

.my-bottles-loading-block.hidden {
    display: none;
    pointer-events: none;
}

/* 一覧エリア内の読み込み表示 */
.my-bottles-list-loading {
    text-align: center;
    padding: 32px 20px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    color: var(--sea-deep);
}

.bottles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.my-bottles-empty {
    text-align: center;
    padding: 40px 20px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    color: var(--text);
    line-height: 1.6;
    max-width: 600px;
    margin: 40px auto;
    background: rgba(244, 228, 188, 0.95);
    border: 3px solid var(--sea-deep);
    box-shadow: var(--shadow-pixel-sm);
}

.my-bottle-card {
    background: var(--sand);
    padding: 20px;
    border-radius: 0;
    border: 3px solid var(--sea-deep);
    box-shadow: var(--shadow-pixel);
    font-family: 'DotGothic16', sans-serif;
}

.my-bottle-card.stopped {
    background: linear-gradient(135deg, var(--sand-dark) 0%, #c4b5a0 100%);
    border-style: dashed;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1), var(--shadow-pixel);
    position: relative;
    overflow: hidden;
}

.my-bottle-card.stopped::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(80, 120, 140, 0.05) 10px,
            rgba(80, 120, 140, 0.05) 20px
        );
    pointer-events: none;
    z-index: 0;
}

.my-bottle-card.stopped > * {
    position: relative;
    z-index: 1;
}

.my-bottle-card.stopped .my-bottle-content {
    background: var(--foam);
}

.my-bottle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.my-bottle-content {
    background: var(--foam);
    padding: 15px;
    border-radius: 0;
    border: 2px solid var(--sea-deep);
    margin-bottom: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
}

.my-bottle-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: var(--sea-deep);
    font-size: 0.9em;
    margin-bottom: 10px;
    font-family: 'DotGothic16', sans-serif;
}

.delete-button {
    padding: 10px 14px;
    background: var(--coral);
    color: var(--foam);
    border: 3px solid var(--sea-deep);
    border-radius: 0;
    cursor: pointer;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.95em;
    box-shadow: var(--shadow-pixel-sm);
}

.delete-button:hover {
    background: var(--sea-deep);
}

.delete-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* マイボトルタブ（ピクセルアート） */
.my-bottles-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--sea-deep);
}

.my-bottle-tab {
    padding: 12px 20px;
    background: var(--sand-dark);
    border: 3px solid var(--sea-deep);
    border-bottom: none;
    cursor: pointer;
    font-size: 1em;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
    border-radius: 0;
    box-shadow: var(--shadow-pixel-sm);
}

.my-bottle-tab:hover {
    background: var(--sea-light);
    color: var(--foam);
}

.my-bottle-tab.active {
    background: var(--sea);
    color: var(--foam);
}

.my-bottles-section {
    display: none;
}

.my-bottles-section:not(.hidden) {
    display: block;
}

.my-bottles-toolbar {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.my-bottles-toolbar label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.my-bottles-toolbar-label-text {
    white-space: nowrap;
    writing-mode: horizontal-tb;
    font-family: 'DotGothic16', sans-serif;
    color: var(--foam);
    text-shadow: 2px 2px 0 var(--sea-deep);
}
.my-bottles-search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: auto;
}
.my-bottles-search-input {
    max-width: 220px;
    font-size: 0.9em;
    padding: 8px 10px;
}
.my-bottles-search-button {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.9em;
}
.my-bottles-sort,
.my-bottles-order {
    padding: 6px 10px;
    font-size: 0.9em;
    min-width: 0;
}
.my-bottles-pagination {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.my-bottles-pagination-info-row {
    font-size: 0.9em;
    font-family: 'DotGothic16', sans-serif;
    color: var(--foam);
    text-shadow: 2px 2px 0 var(--sea-deep);
}
.my-bottles-pagination-buttons-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.my-bottles-page-arrow,
.my-bottles-page-num-btn {
    padding: 6px 12px;
    min-width: 2.5em;
}
.my-bottles-page-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.my-bottles-page-nums {
    display: flex;
    align-items: center;
    gap: 4px;
}
@media (max-width: 767px) {
    .my-bottles-page-nums {
        display: none;
    }
}
.my-bottles-pagination-info {
    font-size: 0.9em;
    color: var(--text);
}
.my-bottles-page-num {
    font-size: 0.9em;
}
.my-bottles-page-num-btn.current {
    background: var(--sea);
    color: var(--foam);
    border-color: var(--sea-deep);
}
.my-bottles-pagination-ellipsis {
    padding: 0 4px;
    font-size: 0.9em;
}

/* 管理画面のページングもマイボトルと同じ見た目に寄せる */
.admin-pagination {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-family: 'DotGothic16', sans-serif;
}

.admin-pagination-info-row {
    font-size: 0.9em;
    color: var(--text);
}

.admin-pagination-buttons-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-page-nums {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-page-btn {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 2px solid var(--sea-deep);
    background: var(--sand);
    cursor: pointer;
    font-family: 'DotGothic16', sans-serif;
}

.admin-page-btn.current {
    background: var(--sea);
    color: var(--foam);
    border-color: var(--sea-deep);
}

.admin-page-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.admin-pagination-ellipsis {
    padding: 0 4px;
    font-size: 0.9em;
}

/* モーダル（ピクセルアート・登場アニメーション） */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 92, 138, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* チュートリアル用：他モーダル（海に流す等）の前面に表示 */
#tutorial-modal,
#tutorial-encourage-modal {
    z-index: 1100;
}

/* チュートリアル完了後の案内：画面上部に表示してボタンを隠さない */
#tutorial-encourage-modal {
    align-items: flex-start;
    padding-top: 8vh;
    pointer-events: none; /* クリックを背面のスポットライト層へ通し「海に流す」のみ押下可能にする */
}
#tutorial-encourage-modal .tutorial-encourage-content {
    max-height: 40vh;
}

/* チュートリアル用：ステップに応じて表示位置を変える */
/* メインボタン（海に流す／ボトルを探す）の下あたりに表示する */
#tutorial-modal.tutorial-modal--below-main {
    align-items: flex-end;
    padding-bottom: 10vh;
}

#tutorial-modal.tutorial-modal--below-main .modal-content {
    max-height: 60vh;
}

/* 「海に流す」送信チュートリアル用：ステップで位置を切り替え */
/* ステップ1・2（テキストボックス・チェックボックス）：チュートリアルを下に配置し対象を隠さない */
#tutorial-modal.tutorial-modal--send-bottom {
    align-items: flex-end;
    padding-bottom: 2vh;
}

#tutorial-modal.tutorial-modal--send-bottom .modal-content {
    max-height: 42vh;
}

/* ステップ3（流すボタン）：チュートリアルを上に配置しボタンを隠さない */
#tutorial-modal.tutorial-modal--send-top {
    align-items: flex-start;
    padding-top: 14vh;
}

#tutorial-modal.tutorial-modal--send-top .modal-content {
    max-height: 50vh;
}

/* 縦幅が十分ないとき：チュートリアルを小さくして画面下寄せにし、ボタンに被らないようにする */
@media (max-height: 640px) {
    #tutorial-modal {
        align-items: flex-end;
        padding-bottom: 6px;
        padding-top: 0;
    }
    #tutorial-modal .modal-content,
    #tutorial-modal.tutorial-modal--below-main .modal-content {
        max-height: 42vh;
        padding: 14px 18px;
        border-width: 3px;
    }
    #tutorial-modal.tutorial-modal--send-bottom .modal-content {
        max-height: 34vh;
        padding: 14px 18px;
        border-width: 3px;
    }
    #tutorial-modal.tutorial-modal--send-top .modal-content {
        max-height: 38vh;
        padding: 14px 18px;
        border-width: 3px;
    }
    #tutorial-modal .tutorial-title {
        font-size: 0.95em;
        margin-bottom: 6px;
    }
    #tutorial-modal .tutorial-body {
        font-size: 0.82em;
        line-height: 1.5;
        margin-bottom: 8px;
    }
    #tutorial-modal .tutorial-progress {
        font-size: 0.8em;
        margin-bottom: 10px;
    }
    #tutorial-modal .tutorial-actions .secondary-button,
    #tutorial-modal .tutorial-actions .primary-button {
        padding: 8px 14px;
        font-size: 0.88em;
    }
    #tutorial-modal .tutorial-skip-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    #tutorial-encourage-modal {
        padding-top: 4vh;
    }
    #tutorial-encourage-modal .modal-content {
        padding: 14px 18px;
        border-width: 3px;
    }
    #tutorial-encourage-modal .tutorial-encourage-content {
        max-height: 32vh;
    }
    #tutorial-encourage-modal .tutorial-title {
        font-size: 0.95em;
    }
    #tutorial-encourage-modal .tutorial-body {
        font-size: 0.82em;
        line-height: 1.5;
    }
}

.modal .modal-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.modal.modal--open .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal-content {
    background: var(--sand);
    padding: 28px 32px;
    border-radius: 0;
    border: 4px solid var(--sea-deep);
    max-width: 700px;
    max-height: 90vh;
    width: 95%;
    box-shadow: var(--shadow-pixel);
    font-family: 'DotGothic16', sans-serif;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--sea-deep);
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.15em;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

/* トースト（目立つ・画面下部メッセージ） */
.toast {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--sea-deep);
    color: var(--foam);
    padding: 18px 36px;
    border-radius: 0;
    border: 4px solid var(--text);
    box-shadow: 0 6px 0 rgba(0,0,0,0.25), 0 8px 24px rgba(46, 92, 138, 0.5);
    z-index: 2000;
    opacity: 0;
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.05em;
    font-weight: bold;
    text-align: center;
    min-width: 280px;
    max-width: 90vw;
    transition: opacity 0.25s ease-out, transform 0.3s ease-out;
}

.toast:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--sea);
    border-color: var(--sea-deep);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2), 0 8px 24px rgba(46, 92, 138, 0.45);
}

.toast.error {
    background: var(--coral);
    border-color: var(--sea-deep);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2), 0 8px 24px rgba(224, 122, 95, 0.4);
}

/* トースト表示時のみアニメーション用 */
.toast.hidden {
    pointer-events: none;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .wave-header h1 {
        font-size: 2em;
    }

    .auth-forms {
        padding: 20px;
    }

    .send-bottle-section,
    .pick-bottle-section {
        padding: 20px;
    }

    .bottle-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }

    /* マイボトルのツールバー: 1段目=並び替え、2段目=検索 */
    .my-bottles-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .my-bottles-toolbar label {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .my-bottles-toolbar-label-text {
        flex: 0 0 100%;
    }

    .my-bottles-sort,
    .my-bottles-order {
        flex: 1 1 calc(50% - 4px);
        width: calc(50% - 4px);
    }

    .my-bottles-search {
        margin-left: 0;
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .my-bottles-search-input {
        max-width: none;
        width: 100%;
        min-width: 0;
    }

    /* ボトル選択モーダル: スマホで情報テキストを読みやすく */
    .pick-choose-bottles {
        gap: 10px;
        align-items: flex-start;
    }

    .pick-choose-bottle {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
        max-width: 46vw;
        padding: 10px 8px;
    }

    .pick-choose-bottle img {
        width: min(30vw, 112px);
    }

    .pick-choose-bottle-info {
        width: 100%;
        min-width: 0;
        font-size: 0.94em;
        line-height: 1.35;
        gap: 3px;
    }

    .pick-choose-bottle-preview {
        white-space: normal;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
    }

    .pick-choose-bottle-stat {
        white-space: normal;
        line-height: 1.35;
    }

    /* モーダル：スマホで横幅を最大限活用 */
    .modal-content {
        width: 98%;
        padding: 16px 14px;
        max-height: 92vh;
    }

    .modal-content h3 {
        font-size: 1em;
        margin-bottom: 12px;
    }

    /* ボトルカード本文：パディングを最小化して読める幅を確保 */
    .bottle-card {
        padding: 12px 10px;
    }

    .bottle-content {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .bottle-meta {
        font-size: 0.8em;
    }

    /* 統計行：縦並びに切り替えて折り返し防止 */
    .bottle-stats {
        flex-direction: column;
        gap: 4px;
        font-size: 0.85em;
    }

    /* コメント欄 */
    .picked-comments-section {
        margin-top: 12px;
        padding-top: 10px;
    }

    .picked-comment-form textarea {
        font-size: 0.9em;
        min-height: 64px;
    }

    .modal-actions {
        margin-top: 14px;
        gap: 8px;
    }

    /* スマホ表示時のチュートリアル位置調整（ボタンの下に出しつつ、ボタンに被りにくくする） */
    #tutorial-modal.tutorial-modal--below-main {
        align-items: flex-end;
        padding-bottom: 4vh;
    }
    #tutorial-modal.tutorial-modal--below-main .modal-content {
        max-height: 40vh;
    }
}

/* 利用規約・プライバシー同意 */
.consent-lead {
    font-size: 0.95em;
    color: var(--text);
    margin-bottom: 12px;
}

.consent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.consent-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
}

.consent-item input {
    margin-top: 4px;
}

.consent-links {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.consent-links a {
    color: var(--sea-deep);
    text-decoration: underline;
}

.consent-note {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 12px;
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 利用規約・プライバシーのページ */
.legal-page {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 20px 60px;
    font-family: 'DotGothic16', sans-serif;
    color: var(--text);
    line-height: 1.7;
}

.legal-page h1 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--sea-deep);
}

.legal-page h2 {
    font-size: 1.2em;
    margin: 22px 0 8px;
    color: var(--sea-deep);
}

.legal-page ul {
    padding-left: 20px;
}

.legal-updated {
    margin-top: 24px;
    font-size: 0.9em;
    color: var(--text-light);
}
