body {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    background: url(pixel-sky.png);
    background-size: cover;
    color: #2b2b2b;
    margin: 0;
    padding: 20px;
    line-height: 1.8;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0;
}

header img {
    max-width: 1000px;
    display: block;
    width: 100%;
    margin: 0 auto;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}


.en {
    font-family: "Press Start 2P", cursive;
}

.layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.left-column {
    width: 32%;
    min-width: 320px;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    width: 68%;
    min-width: 700px;

    display: flex;
    flex-direction: column;
    gap: 24px;
}

#player-status {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}




#quest-list {
    width: 90%;
    max-width: 850px;
    margin: 40px auto;

    background: url("questpage.png");
    background-size: cover;
    background-position: center;

    padding: 24px 28px;
    border: 4px solid #3a2e1f;
    border-radius: 8px;
}




button {
    margin-top: 8px;
    background: #3a2e1f;
    color: #fff;
    border: 2px solid #000;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}
button.hidden {
    display: none;
}

button:hover {
    background: #5a4630;
}

h1 {
    color: #f5f5f5;
    text-align: center;
}

h2, h3 {
    color: #3a2e1f;
    text-shadow: none;
}

#player-status {
    background: #1f1f3a;
    color: #ffffff;
    padding: 16px 16px;
    border: 4px solid #ffffff;
    border-radius: 0;
    box-shadow: 0 0 0 4px #1f1f3a;
    margin: 0;
}

#player-status h2,
#player-status p,
#player-status li {
    color: #ffffff;
}

/* ----- PC: クエスト案内所 ----- */
#quest-form {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 32px auto 0;
}

.quest-form-desktop {
    position: relative;
    width: 100%;
}

.quest-form-bg {
    display: block;
    width: 100%;
    height: auto;
}

.quest-form-inner {
    position: absolute;
    top: 47%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#quest-form h2 {
    color: #5a2f12;
    font-size: 36px;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow:
        1px 1px 0 #fff3d6,
        2px 2px 0 #3a2e1f;
    margin: 0 0 10px;
    text-align: center;
    display: inline-block;
    padding: 6px 24px;
    background: rgba(255, 244, 214, 0.72);
    border: 2px solid rgba(90, 47, 18, 0.45);
    border-radius: 999px;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(-6px);
}

.quest-form-row {
    width: 92%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

#quest-input {
    width: 100%;
    max-width: 380px;
}

#quest-size,
#deadline-input {
    width: 160px;
    max-width: 160px;
    flex: 0 0 160px;
}

#category-input {
    width: 100%;
    max-width: 380px;
    flex: 0 0 380px;
}

.quest-submit {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* ----- PC: カテゴリ管理 ----- */
#category-manager {
    position: relative;
    width: 82%;
    max-width: 620px;
    margin: 20px auto;
    padding: 20px 16px;
    background: #f4ecd8;
    border: 4px solid #3a2e1f;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

#category-manager::before,
#category-manager::after {
    content: "";
    position: absolute;
    top: -20px;
    width: 80px;
    height: calc(100% + 40px);
    background:
        linear-gradient(to bottom, rgba(255,255,255,0.2), transparent),
        repeating-linear-gradient(
            to bottom,
            #8b3f2f,
            #8b3f2f 12px,
            #5a2e1b 12px,
            #5a2e1b 24px
        );
    border-radius: 8px;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.6),
        0 4px 10px rgba(0,0,0,0.3);
    z-index: 0;
}

#category-manager::before {
    left: -20px;
}

#category-manager::after {
    right: -20px;
}

#category-manager > * {
    position: relative;
    z-index: 1;
}

#category-manager h2 {
    text-align: center;
    margin: 0 auto 18px;
    display: block;
    width: fit-content;
    padding: 6px 20px;
    border-radius: 999px;
    transform: translateY(-10px);
    color: #5a2f12;
    background: linear-gradient(to bottom, #f5e2b8, #d8b36a);
    border: 2px solid #5a3818;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow:
        1px 1px 0 #fff3d6,
        2px 2px 0 #3a2e1f;
}



.quest-list-title-wrap {
    max-width: 520px;
    margin: 20px auto;

    background: url("questplacetitle.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;

    min-height: 120px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px 40px;
    box-sizing: border-box;
}

.quest-list-title-wrap h2 {
    margin: 0;
    color: #5a2f12;
    font-size: 50px;
    text-align: center;
    transform: none;
}

.quest-select-checkbox {
    width: 18px;
    height: 18px;
    margin: 4px 0 0;
    accent-color: #3d7edb;
    cursor: pointer;
}

input,
select {
    height: auto;
    box-sizing: border-box;
    background: #fff9e8;
    color: #2b2b2b;
    border: 2px solid #3a2e1f;
    padding: 0 12px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #d8b36a;
    box-shadow: 0 0 6px rgba(216, 179, 106, 0.6);
}

#player-name {
    position: relative;
    color: #2b2b2b;
    padding: 20px 20px 18px;
    border: 4px solid #8b5a2b;

    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.12),
            rgba(0,0,0,0.25)
        ),
        #e8dcc0;

    box-shadow:
        0 14px 30px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.25),
        inset 0 -6px 10px rgba(0,0,0,0.5);
    margin: 0 auto;
    box-sizing: border-box;
    width: fit-content;
    min-width: 300px;
    max-width: 420px;

    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    z-index: 1;
}
#player-name::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 6px;

    border: 2px solid #6a3f1f;

    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.25),
            rgba(0,0,0,0.15)
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(90,47,18,0.15),
            rgba(90,47,18,0.15) 2px,
            transparent 2px,
            transparent 6px
        );
    z-index: 0;

    box-shadow:
        inset 0 2px 6px rgba(255,255,255,0.2),   /* 上の光 */
        inset 0 -6px 12px rgba(0,0,0,0.5),       /* 下の影 */
        inset 0 0 12px rgba(90,47,18,0.4);       /* 木の深み */

    pointer-events: none;
}
#player-name::after {
    content: "";
    position: absolute;

    top: -14px;        /* ← 上に出す */
    left: -20px;       /* ← はみ出す */
    right: -20px;

    height: 26px;      /* ← 太くする */

    background:
        linear-gradient(
            to bottom,
            #b97845,
            #8a4f2b,
            #5a2e1b
        );

    border-radius: 20px;

    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.3),
        inset 0 -6px 12px rgba(0,0,0,0.6),
        0 6px 12px rgba(0,0,0,0.4);
}

.guild-title {
    margin: -6px auto 8px;
    padding: 6px 18px;
    width: fit-content;

    color: #5a2f12;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;

    background: linear-gradient(to bottom, #f5e2b8, #d8b36a);
    border: 2px solid #5a3818;
    border-radius: 999px;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.4);

    text-shadow:
        1px 1px 0 #fff3d6,
        2px 2px 0 #3a2e1f;
    z-index: 2;
}

#player-name label {
    font-size: 14px;
    font-weight: bold;
    color: #7a5c3a;
    letter-spacing: 1px;
}

#player-name-input {
    width: 100%;
    max-width: 280px;
    height: 44px;
    text-align: center;
    font-size: 20px;
    background: #fff9e8;
    border: 2px solid #3a2e1f;
    z-index: 2;
}

#logout-btn {
    background: linear-gradient(to bottom, #d97a7a, #8b2e2e);
}

#backup-btn {
    margin-top: 8px;
    background: linear-gradient(to bottom, #7aa7d9, #3d5a80);
}

#restore-btn {
    background: linear-gradient(to bottom, #6ccf7d, #2f7a3d);
}

#start-first-quest,
#login-btn,
#logout-btn,
#backup-btn,
#restore-btn {
    border-radius: 8px;
}

#login-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.login-status-group,
.login-action-group,
.data-manage-group {
    width: 100%;
    max-width: 280px;
    z-index: 2;
}

#login-status {
    font-weight: bold;
    font-size: 16px;
    color: #3a2e1f;
}

.data-manage-group {
    padding-top: 6px;
    border-top: 1px solid rgba(58, 46, 31, 0.2);
}

.section-label {
    margin: 4px 0 8px;
    font-size: 20px;
    font-weight: bold;
    color: #543e24;
    letter-spacing: 1px;
    text-align: center;
    opacity: 0.9;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;

    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.hidden {
    display: none;
}

.restore-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

#login-btn {
    background: linear-gradient(to bottom, #d9c27a, #a68a3a);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

#login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.22);
    filter: brightness(1.05);
}

#backup-btn,
#logout-btn,
#restore-btn {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease,
        background 0.18s ease;
}

#backup-btn:hover,
#logout-btn:hover,
#restore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    filter: brightness(1.06);
}

#backup-btn {
    margin-bottom: 15px;
}

#backup-btn,
#sync-btn {
    width: 180px;
    min-height: 44px;
    margin-bottom: 8px;
}

#restore-file {
    font-size: 12px;
    width: 100%;
}

#restore-file::file-selector-button {
    font-size: 12px;
    padding: 4px 8px;
    margin-right: 8px;
    border: 2px solid #3a2e1f;
    background: linear-gradient(to bottom, #fff9e8, #e8dcc0);
    color: #2b2b2b;
    cursor: pointer;
    border-radius: 4px;
}

#restore-file::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    filter: brightness(1.04);
    background: #f7efd8;
}

#restore-file::file-selector-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
}

#restore-btn {
    margin-top: 4px;
    margin-bottom: 15px;
    width: auto;
    min-width: 88px;
}

#save-name-btn {
    min-width: 140px;
    height: 46px;
    padding: 0 24px;

    position: relative;
    z-index: 2;

    color: #3a2e1f;
    font-weight: bold;
    font-size: 18px;

    text-shadow: 0 1px 0 rgba(255,255,255,0.35);

    background: radial-gradient(circle, #ffd700, #ff8c00);
    border: 2px solid #5a3818;
    border-radius: 999px;

    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(0,0,0,0.35),
        0 0 10px rgba(255,200,0,0.4);

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease;
}

#save-name-btn:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 20px rgba(0,0,0,0.38),
        0 0 18px rgba(255,210,0,0.65),
        0 0 30px rgba(255,170,0,0.35);
    filter: brightness(1.06);
}

#save-name-btn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.28),
        0 0 8px rgba(255,180,0,0.35);
    filter: brightness(0.98);
}


.level-text {
    display: inline-block;
    font-size: 35px;
    font-weight: bold;
    padding: 6px 12px;
    margin: 12px 0;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
}

input::placeholder {
    color: #7a6a55;
}

.exp-bar {
    width: 100%;
    height: 18px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 0;
    overflow: hidden;
    margin: 12px 0;
}

.exp-fill {
    height: 100%;
    width: 100%;
    background: #32cd32;
    border-radius: 0;
    transform-origin: left center;
    transform: scaleX(0);
}

#levelup-message {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    font-size: 70px;
    font-weight: bold;
    color: rgb(255, 13, 0);
    text-shadow: 3px 3px 0 rgb(255, 217, 0);
    padding: 20px 40px;
    border-radius: 10px;
    z-index: 9999;
    text-align: center;
    
}

.hidden {
    display: none;
}
#exp-popup {
    position: fixed;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 45px;
    font-weight: bold;
    color: red;
    padding: 10px 20px;
    text-shadow: 3px 3px 0 rgb(255, 217, 0);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: 
        opacity 0.3s ease,
        transform 0.3s ease;
}

#exp-popup.show {
    opacity: 1;
    transform: translate(-50%, -120%) scale(1);
}
#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: 40%;
    width: 12px;
    height: 12px;
    opacity: 0.9;
    animation: confetti-burst 1200ms ease-out forwards;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}

button:active {
    transform: scale(0.9);
}
li.complete-animate {
    animation: flash 0.4s ease;
}


.highlight {
    box-shadow: 0 0 15px gold;
    transition: 0.3s;
}

#today-title {
    margin-top: 16px;
    font-size: 32px;
    font-weight: bold;
    line-height: 1.3;
    color: rgb(255, 191, 0);
    letter-spacing: 1px;
    text-shadow: #3a2e1f 3px 3px 0;
    
}

.today-quest {
    background: rgba(255, 215, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.today-quest:hover {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.deadline-today {
    color: #ff9800;
    font-weight: bold;
}

/*クエスト一覧*/
#quest-items,
#completed-quest-items {
    padding: 0;
}

#quest-items li,
#completed-quest-items li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 30px;
    font-weight: bold;
    padding: 20px 10px;
    list-style: none;
}

.quest-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* タイトル */
.quest-title {
    font-weight: bold;
    font-size: 17px;
    color: #2b1a0f;
    text-shadow: 1px 1px 0 #fff3d6;
}

.quest-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quest-deadline {
    font-size: 14px;
    color: #7a5c3a;
    margin-top: 6px;
    display: block;
}

.quest-size {
    font-size: 13px;
    white-space: nowrap;
}

/* サイズ表示ちょい控えめに */
.size-small { color: #6c757d; }
.size-middle { color: #007bff; }
.size-large { color: #dc3545; font-weight: bold; }

/* 右（ボタン側） */
.quest-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* =========================
   ボタン共通
========================= */
.btn {
    border: 2px solid #000;
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.12s ease,
        filter 0.12s ease,
        box-shadow 0.12s ease;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn:active {
    transform: scale(0.96);
}

/* メインボタン */
.btn-primary {
    min-width: 110px;
    height: 48px;
    padding: 0 16px;
    background: linear-gradient(to bottom, #d8b36a, #8b5a2b);
    color: #fff8dc;
    border: 2px solid #5a3818;
    box-shadow: 0 3px 0 #4a2d12;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #4a2d12;
}

/* アイコンボタン */
.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* 編集 */
.btn-edit {
    background: linear-gradient(to bottom, #7aa7d9, #3d5a80);
    color: #fff;
}

/* 削除 */
.btn-delete {
    background: linear-gradient(to bottom, #d97a7a, #8b2e2e);
    color: #fff;
}

#save-name-btn {
    width: fit-content;
}



.status-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.status-left {
    width: 45%;
}

.status-left ul {
    margin-top: 8px;
}

.status-right {
    text-align: right;
    width: 55%;
}

#to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background-color: #6d2b05;
    color: rgb(255, 204, 0);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none; /* 非表示時はクリック不可 */
    
    transition: 
        opacity 0.4s ease,
        transform 0.4s ease,
        all 0.2s ease,
        box-shadow 0.6s ease;
    
    z-index: 1000;
}

#to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#to-top.flash {
    animation: flashGlow 0.6s ease;
    transform: translateY(0);
    box-shadow:
        0 0 25px rgba(255, 255, 0, 1),
        0 0 50px rgba(255, 200, 0, 0.9),
        0 0 80px rgba(255, 150, 0, 0.7);
}

@keyframes flashGlow {
    0% {
        box-shadow:
            0 0 0 rgba(255,255,0,0);
    }
    40% {
        box-shadow:
            0 0 60px rgba(255,255,0,1),
            0 0 100px rgba(255,200,0,0.9);
    }
    100% {
        box-shadow:
            0 0 20px rgba(255,200,0,0.6);
    }
}

#help-btn {
    position: fixed;
    top: 20px;
    right: 20px;

    width: 48px;
    height: 48px;

    border-radius: 50%;
    font-size: 20px;

    z-index: 9999;

    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#help-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

#help-btn.first-time {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.help-tip {
    color: #b3541e;
    font-weight: bold;
    font-size: 18px;
}

#help-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.help-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

#help-modal li {
    margin-bottom: 10px;
}

#help-modal li strong {
    letter-spacing: 0.5px;
}

.help-modal-box {
    position: relative;
    width: min(90%, 520px);
    max-height: 80vh;
    margin: 10vh auto 0;
    background: #f4ecd8;
    border: 4px solid #3a2e1f;
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
    z-index: 2001;
    overflow-y: auto;
}

.help-title {
    color: #ffcc00;

    text-shadow:
        /* 1px */
        1px 0 0 #000,
        -1px 0 0 #000,
        0 1px 0 #000,
        0 -1px 0 #000,
        1px 1px 0 #000,
        -1px 1px 0 #000,
        1px -1px 0 #000,
        -1px -1px 0 #000,

        /* 2px */
        2px 0 0 #000,
        -2px 0 0 #000,
        0 2px 0 #000,
        0 -2px 0 #000;
}

.help-modal-box::-webkit-scrollbar {
    width: 8px;
}

.help-modal-box::-webkit-scrollbar-thumb {
    background: rgba(58, 46, 31, 0.4);
    border-radius: 999px;
}

#help-modal h2 {
    color: #ffcc00; 
    text-align: center;
    font-size: 22px;
    
}

#help-modal h3 {
    color: #4da6ff; 
    border-bottom: 2px solid rgba(77, 166, 255, 0.4);
    padding-bottom: 4px;
}

#help-modal p {
    color: #5a2f12;        /* 少しだけ濃く */
    line-height: 1.8;
    opacity: 0.9;
}

#help-modal strong {
    color: #d35400; /* オレンジ系 */
    font-weight: bold;
}

.help-modal-box ol {
    padding-left: 24px;
}

.help-quest-size {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 249, 232, 0.9);
    border: 2px solid #3a2e1f;
    border-radius: 8px;
}

.help-quest-size h3 {
    margin: 0 0 12px;
    font-size: 18px;
    text-align: center;
}

.help-quest-size ul {
    margin: 0;
    padding-left: 20px;
}

.help-quest-size li {
    margin-bottom: 8px;
    line-height: 1.7;
}

#close-help-btn {
    margin-top: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

.help-category-guide {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 249, 232, 0.9);
    border: 2px solid #3a2e1f;
    border-radius: 8px;
}

.help-category-guide h3 {
    margin: 0 0 12px;
    font-size: 18px;
    text-align: center;
}

.help-category-guide ul {
    margin: 0;
    padding-left: 20px;
}

.help-category-guide li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.help-data-guide {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 249, 232, 0.9);
    border: 2px solid #3a2e1f;
    border-radius: 8px;
}

.help-data-guide h3 {
    margin: 0 0 12px;
    font-size: 18px;
    text-align: center;
}

.help-data-guide ul {
    margin: 0;
    padding-left: 20px;
}

.help-data-guide li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.help-action {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

#start-first-quest {
    display: inline-block;
    padding: 0 28px;
    width: auto;
    min-width: 0;
}

#category-manager {
    position: relative;
    width: 82%;
    max-width: 620px;
    margin: 20px auto;
    padding: 20px 16px;
    background: #f4ecd8;
    border: 4px solid #3a2e1f;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

#category-manager::before {
    content: "";
    position: absolute;
    top: -20px;
    left: -20px;
    width: 80px;
    height: calc(100% + 40px);

    background:
    linear-gradient(to bottom, rgba(255,255,255,0.2), transparent),
    repeating-linear-gradient(
        to bottom,
        #8b3f2f,
        #8b3f2f 12px,
        #5a2e1b 12px,
        #5a2e1b 24px
    );

    border-radius: 8px;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.6),
        0 4px 10px rgba(0,0,0,0.3);
    z-index: 0;
}

/* 右の柱 */
#category-manager::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: calc(100% + 40px);

    background:
    linear-gradient(to bottom, rgba(255,255,255,0.2), transparent),
    repeating-linear-gradient(
        to bottom,
        #8b3f2f,
        #8b3f2f 12px,
        #5a2e1b 12px,
        #5a2e1b 24px
    );

    border-radius: 8px;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.6),
        0 4px 10px rgba(0,0,0,0.3);
    z-index: 0;
}

.category-manager-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(58, 46, 31, 0.15);
}

.category-manager-row:first-child {
    gap: 12px; /* 少しだけ詰める */
}

.category-manager-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.category-manager-row.buttons {
    margin-top: 10px;
    gap: 12px;
}

#category-manager h2 {
    text-align: center;
    margin: 0 auto 18px;

    display: block;
    width: fit-content;

    padding: 6px 20px;
    background: rgba(255, 244, 214, 0.7);
    
    border-radius: 999px;

    transform: translateY(-10px);
    color: #5a2f12;

    background: linear-gradient(
        to bottom,
        #f5e2b8,
        #d8b36a
    );

    border: 2px solid #5a3818;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.4);

    text-shadow:
        1px 1px 0 #fff3d6,
        2px 2px 0 #3a2e1f;
}



#bulk-category-input,
#category-filter {
    width: 100%;
    max-width: 320px;
    transition: 
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

#bulk-category-input:hover,
#category-filter:hover {
    border-color: #b88a3b;
    box-shadow: 0 0 10px rgba(216, 179, 106, 0.25);
    transform: translateY(-1px);
}

#start-category-btn,
#apply-category-btn,
#cancel-category-btn {
    min-width: 220px;
}

.category-section-label {
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: bold;
    color: #7a5c3a;
    letter-spacing: 1px;
    opacity: 0.85;
    text-align: center;
}

.quest-category {
        font-size: 10px;
        color: #3d7edb;
        background: rgba(77, 166, 255, 0.12);
        padding: 1px 6px;
        border-radius: 999px;
        white-space: nowrap;
}


#apply-category-btn {
    width: auto;
}

.btn-energy {
    background: radial-gradient(circle, #ffd700, #ff8c00);
    color: #3a2e1f;
    font-weight: bold;

    border: 2px solid #5a3818;
    border-radius: 999px;

    padding: 8px 18px;
    height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 0 10px rgba(255,215,0,0.6),
        0 0 20px rgba(255,140,0,0.5);

    animation: energyFloat 2s ease-in-out infinite;
}

#sync-btn {
    background: linear-gradient(to bottom, #6b8ec6, #3e5f8a);
    color: white;
    border: 2px solid #2f4a6e;
    border-radius: 8px;
    box-shadow: 0 3px 0 #2a3e5a;
}
#sync-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

#sync-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

#sync-btn.is-loading {
    animation: syncPulse 1s ease-in-out infinite;
}

@keyframes syncPulse {
    0% {
        filter: brightness(1);
        transform: translateY(0);
    }
    50% {
        filter: brightness(1.12);
        transform: translateY(-1px);
    }
    100% {
        filter: brightness(1);
        transform: translateY(0);
    }
}

.sync-status-text {
    margin: 4px 0 10px;
    margin-top: 2px;
    font-size: 11px;
    color: #6b5538;
    opacity: 0.8;
    text-align: center;
    line-height: 1.5;
}

#quest-start-popup {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);

    font-size: 35px;
    font-weight: bold;
    color: #fff;

    padding: 20px 40px;

    background: radial-gradient(circle, rgba(255,215,0,0.9), rgba(139,69,19,0.95));
    border: 3px solid #5a3818;
    border-radius: 12px;

    text-shadow: 2px 2px 0 #000;

    box-shadow:
        0 0 20px rgba(255,215,0,0.7),
        0 0 40px rgba(255,140,0,0.5);

    z-index: 9999;

    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

#quest-start-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#deadline-input {
  cursor: pointer;
}

#recommended-quest {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 18px 18px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(22, 30, 48, 0.96), rgba(38, 48, 70, 0.94));
    border: 1px solid rgba(255, 200, 80, 0.28);
    box-shadow: 0 0 18px rgba(255, 180, 0, 0.12);
    color: #f5f1e8;
}

#recommended-quest h3 {
    margin-bottom: 10px;
    color: #ffb300;
}

.recommended-lead {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 10px;
    color: rgba(255, 245, 230, 0.82);
}

.recommended-item {
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 10px;
    cursor: pointer;
    line-height: 1.6;
    color: #fff4d6;
}

.recommended-reason {
    font-size: 20px;
    line-height: 1.7;
    margin-bottom: 14px;
    color: #ffd54f;
}
.recommended-jump-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: auto;
    min-height: 72px;
    margin-top: 18px;
    margin: 24px auto 0;
    padding: 0 28px;

    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.5px;

    color: #2f2108;
    background: linear-gradient(to bottom, #ffcc33, #ff9800);
    border: 2px solid #6a3f00;
    border-radius: 18px;

    box-shadow:
        0 0 14px rgba(255, 190, 0, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease,
        background 0.2s ease,
        color 0.2s ease;

    will-change: transform;
    backface-visibility: hidden;

    animation: pulseGlow 2.2s ease-in-out infinite;
}
@keyframes pulseGlow {
    0% {
        box-shadow:
            0 0 10px rgba(255, 180, 0, 0.3),
            0 4px 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow:
            0 0 22px rgba(255, 200, 0, 0.7),
            0 6px 16px rgba(0, 0, 0, 0.25);
    }
    100% {
        box-shadow:
            0 0 10px rgba(255, 180, 0, 0.3),
            0 4px 10px rgba(0, 0, 0, 0.2);
    }
}

.recommended-jump-btn:hover {
    background: #141414;   /* 黒寄り */
    color: #ffd54f;
    filter: brightness(1.04);
    box-shadow:
        0 0 22px rgba(255, 200, 0, 0.5),
        0 10px 20px rgba(0, 0, 0, 0.3);
}

.recommended-jump-btn:active {
    transform: scale(0.96);
    box-shadow:
        0 0 10px rgba(255, 190, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.25);
}
.recommended-click-effect {
    animation: clickFlash 0.4s ease;
}

@keyframes clickFlash {
    0% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
}

@keyframes recommendedFlash {
    0% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
        transform: scale(1);
    }
    30% {
        box-shadow: 0 0 24px rgba(255, 215, 0, 0.9);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
        transform: scale(1);
    }
}

.recommended-focus {
    animation: recommendedFlash 1.2s ease;
}

@keyframes recommendedFlash {
    0% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
        transform: scale(1);
    }
    40% {
        box-shadow: 0 0 28px rgba(255, 215, 0, 1);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #to-top {
        transition: none;
    }
}

@keyframes flash {
    0% {
        background: rgba(255, 255, 0, 0.6);
        transform: scale(1);
    }
    50% {
        background: rgba(255, 255, 0, 0.3);
        transform: scale(1.04);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

@keyframes confetti-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.7);
        opacity: 0;
    }
}

@keyframes energyFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@media (min-width: 1101px) {
    .left-column {
        position: sticky;
        top: 20px;
        align-self: flex-start;

        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    .left-column::-webkit-scrollbar {
        width: 6px;
    }

    .left-column::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.3);
        border-radius: 4px;
    }
}
@media (max-width: 1100px) {
    .layout {
        flex-direction: column;
        align-items: center;
    }

    .left-column,
    .right-column {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    #player-status {
        max-width: 320px;
        margin: 0 auto;
    }

    #quest-form {
        max-width: 100%;
        margin: 16px auto;
    }

    .quest-form-inner {
        width: 74%;
        top: 47%;
        gap: 10px;
    }

    #quest-form h2 {
        font-size: 24px;
        margin-bottom: 8px;
        padding: 4px 18px;
    }

    .quest-form-row {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    #quest-input {
        width: 100%;
        max-width: 260px;
    }

    #quest-size,
    #deadline-input {
        width: 140px;
        max-width: 140px;
        flex: 0 0 140px;
    }

    #category-input {
        width: 100%;
        max-width: 260px;
        flex: 0 0 260px;
    }

    .quest-submit {
        margin-top: 8px;
    }

    #add-btn {
        min-width: 120px;
        height: 46px;
        font-size: 18px;
        padding: 0 22px;
        margin-top: 0;
    }

    #category-manager {
        width: calc(100% - 24px);
        max-width: 360px;
        margin: 16px auto 0;
        padding: 18px 16px;
    }

    #category-manager::before,
    #category-manager::after {
        width: 18px;
        top: 12px;
        height: calc(100% - 24px);
    }

    #category-manager::before {
        left: -6px;
    }

    #category-manager::after {
        right: -6px;
    }

    #category-manager h2 {
        font-size: 18px;
        margin-bottom: 14px;
        padding: 4px 16px;
    }

    #bulk-category-input,
    #category-filter {
        width: 100%;
        max-width: 100%;
        height: 36px;
        font-size: 14px;
    }

    #start-category-btn,
    #apply-category-btn,
    #cancel-category-btn {
        min-width: 160px;
        height: 42px;
        font-size: 14px;
    }

    .quest-list-title-wrap {
        max-width: 100%;
        min-height: 88px;
        margin: 12px auto;
        padding: 12px 24px;
    }

    .quest-list-title-wrap h2 {
        font-size: 30px;
    }

    .status-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .status-left,
    .status-right {
        width: 100%;
    }

    .status-left {
        text-align: left;
        padding-left: 16px;
        padding-right: 16px;
    }

    .status-right {
        text-align: center;
    }
}

@media (max-width: 480px) {
    #quest-form {
        max-width: 390px;
        margin-top: 20px;
    }

    .quest-form-inner {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 88%;
    }
    #quest-form h2 {
        font-size: 18px;
        margin: 0 0 6px;
        padding: 4px 18px;
    }
    .quest-form-row {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    #quest-input {
        height: 34px;
        font-size: 13px;
    }

    #quest-size,
    #deadline-input {
        width: 44%;
        max-width: 44%;
        flex: 0 0 44%;
        height: 34px;
        font-size: 13px;
    }

    #category-input {
        flex: 0 0 92%;
         height: 34px;
        font-size: 13px;
    }
    

    #add-btn {
        min-width: 110px;
        height: 42px;
        font-size: 16px;
        padding: 0 18px;
    }

    #category-manager {
        max-width: 350px;
        padding: 16px 14px;
    }

    #category-manager::before,
    #category-manager::after {
        width: 14px;
    }

    #bulk-category-input,
    #category-filter {
        height: 34px;
        font-size: 13px;
    }

    #start-category-btn,
    #apply-category-btn,
    #cancel-category-btn {
        min-width: 140px;
        height: 40px;
        font-size: 13px;
    }

    .quest-title {
        font-size: 15px;
    }

    .quest-category {
        font-size: 9px;
        padding: 1px 5px;
    }
}

