:root {
    --bg: #e5b953;
    --panel: #f5e4ba;
    --panel-light: #fff0cd;
    --card: #fff9e9;
    --border: #ba8d37;
    --text: #382b17;
    --muted: #79643e;
    --gold: #a87021;
    --gold-light: #f3d783;
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color:var(--text);
    font-family: "DM Sans", sans-serif;
    line-height: 1.5;
    background: linear-gradient(145deg, #f4d77e 0%, #e5b953 55%, #c9983c 100%);
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
}


.app-shell {
    width: min(100% - 48px, 1440px);
    margin: 0 auto;
}


.topbar {
    min-height: 84px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(100, 68, 20, 0.3);
}


.brand,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}


.brand {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}


.back-link,
.board-toolbar {
    color: #d4c39e;
}


.back-link {
    color: var(--muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}


.back-link:hover {
    color: var(--gold-light);
}


.board-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
    padding: 64px 0 42px;
    position: relative;
}


.compass-art {
    display: inline-block;
    width: 72px;
    height: 72px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 16px;
    opacity: 0.55;
    pointer-events: none;
}


.chest-art {
    display: block;
    width: clamp(100px, 25vw, 200px);
    height: auto;
    margin: -35px 0 30px auto;
    position: relative;
    pointer-events: none;
    opacity: 0.55;
    z-index: 0;
}


.board-heading h1 {
    margin: 0;
    position: relative;
    padding-left: 46px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.75rem);
    font-weight: 700;
    letter-spacing: -0.07em;
    line-height: 1.07;
    color: var(--text);
}


.board-description {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}


.add-button,
.save-button {
    border: 1px solid #130f08;
    background: linear-gradient(180deg, #e9c779, #bf8738);
    color: #342713;
    font-weight: 700;
    transition: background 0.2s ease;
}


.add-button {
    flex-shrink: 0;
    padding: 12px 18px;
}


.add-button span {
    margin-right: 4px;
    font-size: 1.25rem;
    line-height: 0;
    vertical-align: -1px;
}


.add-button:hover,
.save-button:hover {
    transform: translateY(-2px);
}


.board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.87rem;
}


.board-toolbar p {
    margin: 0;
}


.board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    padding-bottom: 80px;
}


.column{
    min-width: 0;
    min-height: 420px;
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease;
}


.column.drag-over {
    border-color: #80541e;
    transform: translateY(-3px);
}


.column-heading,
.column-title {
    display: flex;
    align-items: center;
}


.column-heading {
    justify-content: space-between;
    gap: 10px;
    margin: 2px 2px 17px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(128, 84, 30, 0.3);
}


.column-title {
    gap: 10px;
}


.column-title h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}


.task-count {
    display: grid;
    place-items: center;
    min-width: 27px;
    height: 27px;
    padding: 0 6px;
    background: var(--panel-light);
    color: var(--muted);
    font-size: 0.87rem;
}


.task-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    max-width: 340px;
}


.task-card {
    padding: 17px;
    border: 1px solid #cbb78e;
    border-left: 4px solid var(--gold);
    background: var(--card);
    box-shadow: 0 4px 10px rgba(75, 51, 27, 0.1);
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 18px rgba(75, 51, 27, 0.16)
}


.task-card.dragging {
    opacity: 0.45;
    cursor: grabbing;
}


.task-card h3 {
    overflow-wrap: anywhere;
    margin: 0 0 7px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 600;
}


.task-card p {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}


.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}


.card-actions button {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    transition: color 0.2s ease;
}


.card-actions button:hover {
    color: var(--gold-light);
}


.card-actions .delete-btn:hover {
    color: #a43f33;
}


.card-actions button + button {
    margin-left: auto;
}


.empty-state {
    padding: 28px 12px;
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}


.task-dialog {
    width: min(100% - 32px, 500px);
    max-height: min(90vh, 700px);
    padding: 28px;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow), inset 0 0 0 5px rgba(193, 139, 59, 0.16);
}


.task-dialog::backdrop {
    background: rgba(4, 10, 11, 0.75);
    backdrop-filter: blur(5px);
}


.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 25px;
}


.dialog-heading h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.65rem;
}


.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
}


.task-dialog label {
    display: block;
    margin: 16px 0 7px;
    font-size: 0.85rem;
    font-weight: 700;
}


.task-dialog label span {
    color: var(--muted);
    font-weight: 400;
}


.task-dialog input,
.task-dialog textarea,
.task-dialog select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    outline: none;
    background: #fffdf5;
    color: var(--text);
}


.task-dialog textarea {
    resize: vertical;
}


.task-dialog input:focus,
.task-dialog textarea:focus,
.task-dialog select:focus {
    border-color: var(--gold);
}


.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}


.cancel-button,
.save-button {
    padding: 10px 16px;
}


.cancel-button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}


.cancel-button:hover {
    background: var(--panel-light);
}


button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}


@media (max-width: 900px) {
    .board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 650px) {
    .app-shell {
        width: min(100% - 28px, 500px);
    }


    .topbar {
        min-height: 72px;
    }


    .brand {
        font-size: 0.95rem;
    }


    .back-link {
        font-size: 0.8rem;
    }


    .board-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        padding: 44px 0 30px;
    }


    .board-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }


    .board {
        grid-template-columns: 1fr;
    }


    .column {
        min-height: 210px;
    }


    .task-list {
        min-height: 140px;
    }


    .task-dialog {
        padding: 20px;
    }


    .compass-art {
        width: 48px;
        height: 48px;
        margin-left: 8px;
    }


    .chest-art {
        margin-top: 0;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}