/* Build your degree game (Pages/DegreeBuilder.cshtml). Same type and colors as the cost calculator. */

#degree-builder {
    --db-navy: #1f3566;
    --db-ink: #1d1d1d;
    --db-orange: #f47920;
    --db-red: #c00000;
    --db-gray: #6f7c8a;
    --db-rule: #d4d4d4;
    --db-soft: #f5f6f8;
    /* Tile colors by subject */
    --db-cs: #1f3566;
    --db-se: #f47920;
    --db-math: #2e8540;
    --db-sci: #0f7c8c;
    --db-ge: #7a6a9a;
}

.db-eyebrow-bar {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: var(--db-ink);
    padding-bottom: 0.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--db-orange);
}

.db-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 0.95;
    color: var(--db-ink);
    margin-bottom: 1.5rem;
}

.db-headline-accent {
    color: var(--db-navy);
}

.db-intro {
    font-size: 1.2rem;
    color: #555;
    max-width: 44rem;
}

.db-section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    color: var(--db-ink);
    margin: 0;
}

/* ---- mode and status */

.db-modes-title {
    margin-top: 1.5rem;
}

/* Big cards, like the starting-point question */
.db-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 1.25rem;
}

.db-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--db-rule);
    border-left: 6px solid var(--db-orange);
    border-radius: 0;
    background: white;
    color: var(--db-ink);
    text-align: left;
    white-space: normal;
}

.db-toggle b {
    font-size: 1.1rem;
}

.db-toggle span {
    font-size: 0.9rem;
    color: #555;
}

.db-toggle:hover {
    border-color: var(--db-navy);
    border-left-color: var(--db-orange);
}

.db-toggle.active {
    border-color: var(--db-navy);
    background: var(--db-navy);
    color: white;
}

.db-toggle.active span {
    color: #d6dbe6;
}

.db-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    margin-bottom: 1.25rem;
}

.db-progress {
    flex: 1 1 100%;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--db-soft);
    border: 1px solid var(--db-rule);
}

.db-progress-bar {
    height: 100%;
    width: 0;
    background: repeating-linear-gradient(-45deg, var(--db-orange) 0 10px, #f8994f 10px 20px);
    background-size: 28px 28px;
    animation: db-stripes 1s linear infinite;
    transition: width 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes db-stripes {
    to { background-position: 28px 0; }
}

.db-status-text {
    font-weight: 500;
}

.db-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--db-navy);
    border-radius: 2rem;
    background: white;
    color: var(--db-navy);
    font-weight: 500;
}

.db-reset:hover {
    background: var(--db-navy);
    color: white;
}

.db-reset:hover svg {
    transform: rotate(-200deg);
}

.db-reset svg {
    transition: transform 0.4s;
}

/* ---- layout: the class list beside the plan on a wide screen */

.db-play {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 1.5rem;
}

@media (min-width: 992px) {
    .db-play {
        grid-template-columns: 19rem minmax(0, 1fr);
    }

    /* Stays on screen while the plan scrolls; the class list scrolls by itself when it's long */
    .db-pool {
        position: sticky;
        top: 0.5rem;
        align-self: start;
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 1rem);
    }

    .db-pool .db-tray-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        margin-bottom: 0;
    }
}

/* ---- tray */

.db-tray-wrap {
    border: 1px solid var(--db-rule);
    background: var(--db-soft);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
}

.db-tray {
    min-height: 4rem;
    margin-top: 0.25rem;
}

.db-pool-group + .db-pool-group {
    margin-top: 0.6rem;
}

.db-pool-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.3rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--db-ink);
}

.db-pool-name {
    flex: 1;
}

.db-pool-name::before {
    content: "";
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.35rem;
    vertical-align: -0.05rem;
    background: var(--db-kind);
}

.db-pool-head b {
    font-variant-numeric: tabular-nums;
}

.db-pool-bad {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--db-red);
}

.db-pool-done .db-pool-head b {
    color: var(--db-math);
}

/* The progress bars are game mode's */
.db-pool-bar {
    display: none;
}

/* A full row per class, so there's room for part of its name */
.db-pool-tiles {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.db-tray-empty {
    margin: 0.75rem 0 0;
    color: var(--db-gray);
}

/* ---- tiles */

.db-k-cs { --db-kind: var(--db-cs); }
.db-k-se { --db-kind: var(--db-se); }
.db-k-math { --db-kind: var(--db-math); }
.db-k-sci { --db-kind: var(--db-sci); }
.db-k-ge { --db-kind: var(--db-ge); }

/* A card: a button with a row per class (a unit of corequisites has several) and any problems underneath,
   a toggle, and the details the toggle shows. */
.db-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    border: 1px solid var(--db-rule);
    border-left: 6px solid var(--db-kind);
    border-radius: 8px;
    background: white;
    color: var(--db-ink);
    line-height: 1.25;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s, box-shadow 0.15s;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
}

.db-tile:hover {
    border-color: var(--db-kind);
    transform: translateY(-2px) rotate(-0.6deg);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
}

/* Hold still while someone reads the details */
.db-tile:has(.db-details:not([hidden])):hover {
    transform: none;
}

.db-tile-main {
    display: block;
    min-width: 0;
    padding: 0.3rem 0.3rem 0.3rem 0.55rem;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: grab;
}

.db-tile-main:focus-visible {
    outline: 3px solid var(--db-navy);
    outline-offset: 2px;
    border-radius: 4px;
}

/* One line per class: number, name (cut short if it has to be) and credits */
.db-tile-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 0.5rem;
}

.db-unit .db-tile-row + .db-tile-row {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px dashed var(--db-rule);
}

.db-tile-row > b {
    font-weight: 700;
    white-space: nowrap;
}

.db-cr {
    font-size: 0.8rem;
    color: var(--db-gray);
    white-space: nowrap;
}

.db-tile-name {
    font-size: 0.85rem;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-more {
    width: 2rem;
    border: none;
    border-left: 1px solid var(--db-soft);
    background: none;
    color: var(--db-gray);
    cursor: pointer;
}

.db-more::before {
    content: "";
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
    transition: transform 0.2s;
}

.db-more[aria-expanded="true"]::before {
    transform: translateY(25%) rotate(-135deg);
}

.db-more:hover {
    color: var(--db-ink);
}

.db-more:focus-visible {
    outline: 3px solid var(--db-navy);
    outline-offset: -3px;
}

.db-details {
    grid-column: 1 / -1;
    padding: 0.45rem 0.6rem 0.5rem;
    border-top: 1px solid var(--db-soft);
    font-size: 0.85rem;
    cursor: auto;
    user-select: text;
}

.db-details[hidden] {
    display: none;
}

.db-about + .db-about {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--db-rule);
}

.db-about p {
    margin: 0 0 0.25rem;
}

.db-about-title {
    font-weight: 700;
}

.db-about {
    display: flow-root;
}

.db-about-facts {
    color: var(--db-gray);
}

/* Floats to the right end of the last line, or onto its own line if there's no room */
.db-about-link {
    float: right;
    margin-left: 0.75rem;
    font-weight: 500;
}

.db-tile.db-picked {
    border-color: var(--db-navy);
    box-shadow: 0 0 0 3px var(--db-navy);
}

.db-tile.db-bad {
    border-color: var(--db-red);
    border-left-color: var(--db-kind);
    background: #fff5f5;
}

.db-issues {
    margin: 0.2rem 0 0;
    padding-left: 1rem;
    font-size: 0.8rem;
    color: var(--db-red);
}

/* ---- selected bar (tap to place) */

/* Pinned to the bottom of the screen while a tile is picked, so it's in view wherever the semester is. */
.db-selected {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(1140px, 100%);
    z-index: 1030;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem;
    background: var(--db-navy);
    color: white;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

/* Room so the pinned bar never covers the last semester */
#degree-builder.db-has-pick {
    padding-bottom: 9rem !important;
}

.db-selected[hidden] {
    display: none;
}

.db-selected-text {
    flex: 1 1 20rem;
}

.db-selected-actions .btn-link {
    color: white;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
}

/* ---- board */

.db-year {
    margin-bottom: 1.25rem;
}

.db-year-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--db-navy);
    margin: 0 0 0.4rem;
    border-bottom: 2px solid var(--db-orange);
}

.db-year-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.db-semester {
    border: 1px solid var(--db-rule);
    padding: 0.6rem;
    min-height: 6rem;
    background: white;
    transition: background 0.1s;
}

.db-placing .db-semester {
    border-style: dashed;
    border-color: var(--db-navy);
    cursor: pointer;
}

.db-sem-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.db-sem-name {
    border: none;
    background: none;
    padding: 0;
    font-weight: 700;
    color: var(--db-ink);
}

.db-sem-cr {
    font-size: 0.85rem;
    color: var(--db-gray);
}

.db-sem-cr.db-over {
    color: var(--db-red);
    font-weight: 700;
}

.db-sem-warn {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--db-red);
}

/* Lots of CS, SE, math and science in one semester: a nudge, not a problem */
.db-semester.db-loaded {
    border-color: #e0a630;
    background: #fffaf0;
}

.db-sem-note {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #7a4a00;
}

.db-year-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.db-drop-year {
    padding: 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--db-gray);
}

.db-add-year {
    display: block;
    width: 100%;
    margin-bottom: 1.25rem;
    padding: 0.6rem;
    border: 2px dashed var(--db-rule);
    border-radius: 10px;
    background: none;
    color: var(--db-gray);
    font-weight: 500;
}

.db-add-year:hover {
    border-color: var(--db-navy);
    color: var(--db-navy);
}

/* Where the upper-division Software Engineering classes start */
.db-program-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
    color: var(--db-orange);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.db-program-line::before,
.db-program-line::after {
    content: "";
    flex: 1;
    border-top: 3px double var(--db-orange);
}

.db-sem-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.db-sem-empty {
    margin: 0;
    padding: 0.75rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--db-gray);
}

@media (max-width: 575.98px) {
    .db-year-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- win */

.db-win {
    border: 2px solid var(--db-orange);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.db-win:focus {
    outline: none;
}

.db-win-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    color: var(--db-navy);
}

.db-win-text {
    font-size: 1.1rem;
    max-width: 44rem;
}

.db-name-label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.3rem;
}

.db-name {
    max-width: 22rem;
    border-radius: 0;
    margin-bottom: 1rem;
}

.db-win-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.db-btn-primary,
.db-btn-secondary {
    border-radius: 0;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
}

.db-btn-primary {
    background: var(--db-orange);
    border-color: var(--db-orange);
    color: white;
}

.db-btn-primary:hover {
    background: #d9661a;
    color: white;
}

.db-btn-secondary {
    border: 1px solid var(--db-navy);
    color: var(--db-navy);
}

.db-fineprint {
    font-size: 0.85rem;
    color: var(--db-gray);
    max-width: 50rem;
    margin-top: 2rem;
}

/* ---- printout */

.db-printout {
    display: none;
}

@media print {
    #navigation,
    footer,
    .db-no-print {
        display: none !important;
    }

    .db-printout {
        display: block;
        font-size: 10pt;
        color: black;
    }

    .db-print-eyebrow {
        margin: 0;
        font-family: 'Bebas Neue', sans-serif;
        font-size: 13pt;
        border-bottom: 2px solid var(--db-orange);
    }

    .db-print-title {
        font-family: 'Bebas Neue', sans-serif;
        font-size: 28pt;
        margin: 6pt 0 0;
    }

    .db-print-sub {
        margin: 0 0 8pt;
    }

    .db-print-year {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 8pt;
        page-break-inside: avoid;
    }

    .db-print-year caption {
        caption-side: top;
        padding: 0 0 2pt;
        color: black;
        font-weight: 700;
    }

    .db-print-year th,
    .db-print-year td {
        border: 1px solid #999;
        padding: 2pt 4pt;
        width: 42%;
    }

    .db-print-year th {
        background: #eee;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .db-print-year .db-print-cr {
        width: 8%;
        text-align: center;
    }

    .db-print-total td {
        font-weight: 700;
    }

    .db-print-note {
        margin: 4pt 0 0;
        font-size: 9pt;
    }
}

/* ---- starting point question */

.db-start {
    margin: 1.5rem 0 0.5rem;
}

.db-start-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.db-start-btn {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--db-rule);
    border-left: 6px solid var(--db-cs);
    border-radius: 0;
    background: white;
    color: var(--db-ink);
    text-align: left;
}

.db-start-btn b {
    font-size: 1.1rem;
}

.db-start-btn span {
    font-size: 0.9rem;
    color: #555;
}

.db-start-btn:hover {
    border-color: var(--db-navy);
}

.db-start-btn[aria-pressed="true"] {
    border-color: var(--db-navy);
    background: var(--db-navy);
    color: white;
}

.db-start-btn[aria-pressed="true"] span {
    color: #d6dbe6;
}

.db-game[hidden] {
    display: none;
}

/* ---- sound */

/* A switch: speaker with waves and a green "On", or crossed out with a gray "Off" */
.db-sound {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.3rem 0.4rem 0.3rem 0.75rem;
    border: 1px solid var(--db-rule);
    border-radius: 2rem;
    background: white;
    color: var(--db-ink);
    font-weight: 500;
}

.db-sound:hover {
    border-color: var(--db-navy);
}

.db-sound-state {
    min-width: 2.6rem;
    padding: 0.05rem 0.5rem;
    border-radius: 1rem;
    background: var(--db-math);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-sound[aria-checked="false"] {
    color: var(--db-gray);
}

.db-sound[aria-checked="false"] .db-sound-state {
    background: var(--db-rule);
    color: #555;
}

.db-sound[aria-checked="true"] .db-sound-x,
.db-sound[aria-checked="false"] .db-sound-waves {
    display: none;
}

/* ---- coach and score */

.db-side[hidden] {
    display: none;
}

.db-coach {
    border: 2px solid var(--db-orange);
    border-radius: 10px;
    background: white;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
}

.db-side-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    color: var(--db-orange);
    margin: 0 0 0.25rem;
}

.db-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin: 0 0 0.6rem;
}

.db-stat {
    border: 2px solid var(--db-navy);
    border-radius: 8px;
    background: white;
    padding: 0.2rem 0.4rem;
    text-align: center;
}

.db-stat dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--db-gray);
}

.db-stat dd {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--db-ink);
    font-variant-numeric: tabular-nums;
}

.db-stat dd.db-stat-bad {
    color: var(--db-red);
}

.db-pool-bar {
    display: block;
    height: 5px;
    margin: 0 0 0.35rem;
    border-radius: 3px;
    background: white;
    overflow: hidden;
}

.db-pool-bar div {
    height: 100%;
    background: var(--db-kind);
    transition: width 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.db-coach-text {
    font-size: 0.85rem;
    margin: 0 0 0.4rem;
}

.db-coach-show {
    padding: 0.15rem 0.8rem;
    border-radius: 2rem;
}

.db-coach-show[hidden] {
    display: none;
}

/* Board and tiles get rounder, lift on hover and spring when they land */

.db-tray-wrap,
.db-semester {
    border-radius: 10px;
}

.db-semester {
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.db-semester.db-over-drop,
.db-tray.db-over-drop {
    outline: none;
    background: #fff4ea;
    box-shadow: 0 0 0 3px var(--db-orange), 0 6px 18px rgba(244, 121, 32, 0.25);
}

.db-semester.db-over-drop {
    transform: scale(1.015);
}

.db-semester.db-hint-at {
    animation: db-glow 1.2s ease-in-out infinite;
}

@keyframes db-glow {
    50% { box-shadow: 0 0 0 4px var(--db-orange), 0 0 22px rgba(244, 121, 32, 0.5); }
}

.db-tile.db-dragging {
    opacity: 0.25;
    transform: none;
    box-shadow: none;
}

.db-tile.db-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    margin: 0;
    pointer-events: none;
    cursor: grabbing;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
    will-change: transform;
}

.db-is-dragging,
.db-is-dragging * {
    cursor: grabbing !important;
}

.db-tile.db-landing {
    position: relative;
    z-index: 5;
}

.db-tile.db-lock {
    animation: db-lock 0.45s ease-out;
}

@keyframes db-lock {
    0% { box-shadow: 0 0 0 0 var(--db-kind); }
    30% { transform: scale(1.04); }
    100% { box-shadow: 0 0 0 10px transparent; }
}

.db-shake {
    animation: db-shake 0.45s ease-in-out;
}

@keyframes db-shake {
    20%, 60% { transform: translateX(-6px) rotate(-1deg); }
    40%, 80% { transform: translateX(6px) rotate(1deg); }
}

/* A new game deals the tiles in one by one */
.db-deal .db-tile {
    animation: db-deal 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both;
    animation-delay: calc(var(--db-i, 0) * 20ms);
}

@keyframes db-deal {
    from { opacity: 0; transform: translateY(14px) scale(0.85) rotate(-4deg); }
}

.db-floater {
    position: fixed;
    z-index: 1045;
    transform: translate(-50%, -100%);
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    color: white;
    pointer-events: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    animation: db-float 1.3s ease-out forwards;
}

.db-floater-good { background: var(--db-math); }
.db-floater-warn { background: #9a5b00; }
.db-floater-bad { background: var(--db-red); }

@keyframes db-float {
    0% { opacity: 0; transform: translate(-50%, -60%) scale(0.6); }
    15% { opacity: 1; transform: translate(-50%, -110%) scale(1.1); }
    25% { transform: translate(-50%, -110%) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -260%); }
}

.db-toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    z-index: 1045;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    background: var(--db-navy);
    color: white;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    animation: db-toast 2.4s ease-in-out forwards;
}

@keyframes db-toast {
    0% { opacity: 0; transform: translate(-50%, -150%); }
    12% { opacity: 1; transform: translate(-50%, 10%); }
    18%, 85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -150%); }
}

.db-win {
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7ef, white 60%);
    animation: db-win 0.6s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.db-win-title::before {
    content: "\1F3C6  ";
}

@keyframes db-win {
    from { opacity: 0; transform: scale(0.85); }
}

.db-confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .db-progress-bar,
    .db-semester.db-hint-at,
    .db-tile.db-lock,
    .db-shake,
    .db-win {
        animation: none;
    }

    .db-tile:hover,
    .db-semester.db-over-drop {
        transform: none;
    }

    .db-floater,
    .db-toast {
        animation-name: db-fade;
    }

    .db-semester.db-hint-at {
        box-shadow: 0 0 0 4px var(--db-orange);
    }
}

@keyframes db-fade {
    0%, 100% { opacity: 0; }
    10%, 80% { opacity: 1; }
}

@media print {
    .db-confetti,
    .db-floater,
    .db-toast {
        display: none !important;
    }
}

/* ---- phones: back to the class list */

.db-to-pool {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1020;
    border-radius: 2rem;
    background: var(--db-navy);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.db-to-pool:hover {
    color: white;
}

.db-to-pool[hidden],
.db-has-pick .db-to-pool {
    display: none;
}

@media (min-width: 992px) {
    .db-to-pool {
        display: none !important;
    }
}

/* Engineering classes */
.db-tile-row.db-long {
    grid-template-columns: minmax(0, 1fr) auto;
}

.db-tile-row.db-long > b {
    white-space: normal;
}

.db-tile-row.db-long .db-tile-name {
    grid-column: 1 / -1;
    grid-row: 2;
}

.db-k-engr { --db-kind: var(--db-se); }

/* Which degree: a quiet picker under the intro */
.db-degree-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 1rem 0 1.5rem;
}

.db-degree-pick label {
    margin: 0;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--db-ink);
}

.db-degree-select {
    width: auto;
    max-width: 100%;
    min-height: 44px;
    border-radius: 0;
    border-color: var(--db-rule);
}

/* Every other degree, at the bottom */
.db-other {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 4px solid var(--db-navy);
}

.db-other-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--db-ink);
}

.db-other-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.5rem 1.5rem;
    padding: 0;
    margin: 0.5rem 0 1rem;
    list-style: none;
}

.db-other-list a {
    font-weight: 700;
}

.db-other-list span {
    display: block;
    font-size: 0.85rem;
    color: var(--db-gray);
}
