@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --ink: #3d2b26;
    --muted: #78645b;
    --paper: #f7efe3;
    --panel: #fffaf2;
    --line: #dfcdbd;
    --accent: #a64f35;
    --accent-dark: #7f3828;
    --warm: #e6ae3f;
    --shadow: 0 16px 40px rgba(93, 55, 38, .11);
}

* {
    box-sizing: border-box;
}

body {
    max-width: 1600px;
    margin: 0 auto;
    padding: 56px 24px 72px;
    color: var(--ink);
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--paper);
    background-image: linear-gradient(rgba(247, 239, 227, .75), rgba(247, 239, 227, .75)), url('2026_09_07_0vz_Kleki.png');
    background-repeat: repeat;
    background-size: auto, 640px 640px;
    font-size: 16px;
    line-height: 1.55;
}

h1 {
    max-width: 760px;
    margin: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    font-weight: 700;
    line-height: .98;
    letter-spacing: -.045em;
}

body > p {
    max-width: 620px;
    margin: 18px 0 34px;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
}

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

button,
input,
select,
textarea {
    font-size: 15px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid var(--warm);
    outline-offset: 3px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 34px;
    padding: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--shadow);
    width: 100%;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-group label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.filter-group input,
.filter-group select,
.clear-button {
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--panel);
    color: var(--ink);
    padding: 10px 11px;
    width: 100%;
    min-height: 44px;
}

.filter-group input::placeholder {
    color: #aa9487;
}
.clear-button2 {
    border: 1px solid var(--accent);
    border-radius: 2px;
    background: transparent;
    color: var(--accent-dark);
    padding: 8px 10px;
    font-weight: 700;
    width: auto;
    min-width: 84px;
    min-height: 44px;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    justify-self: start;
    white-space: nowrap;
}

.clear-button2:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

button {
    cursor: pointer;
    font: inherit;
}

.page-actions button,
.card-actions button,
.dialog-actions button {
    border: 1px solid var(--accent);
    border-radius: 2px;
    background: var(--accent);
    color: white;
    padding: 9px 13px;
    font-weight: 700;
    transition: background .18s ease, transform .18s ease;
}

.page-actions button:hover,
.card-actions button:hover,
.dialog-actions button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.page-actions .secondary-action,
.dialog-actions .secondary-action {
    background: transparent;
    color: var(--accent-dark);
}

#saveStatus {
    color: var(--accent);
    font-size: 14px;
}

.search-group input {
    min-width: 0;
}

.clear-button {
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    align-self: stretch;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .search-group {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .filters {
        grid-template-columns: 1fr;
    }
}

#opportunities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 0;
}

.opportunity-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(93, 55, 38, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}

.opportunity-card:hover {
    box-shadow: 0 16px 30px rgba(93, 55, 38, .16);
    transform: translateY(-3px);
}

.opportunity-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--ink);
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.opportunity-card p {
    margin: 8px 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.opportunity-card strong {
    color: var(--ink);
    font-size: .78rem;
    letter-spacing: .02em;
}

.opportunity-card a {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent);
    font-weight: 700;
    text-underline-offset: 3px;
}

.empty-state {
    padding: 20px;
    border: 1px dashed var(--accent);
    background: rgba(255, 255, 255, .6);
    color: var(--muted);
    font-weight: 500;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.card-actions button {
    font-size: 14px;
}

.card-actions .remove-button {
    background: transparent;
    color: #a54b2d;
    border-color: #c97d60;
}

dialog {
    width: min(680px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

#editForm {
    padding: 24px;
}

.dialog-heading,
.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dialog-heading {
    margin-bottom: 20px;
}

.dialog-heading h2 {
    margin: 0;
    overflow-wrap: anywhere;
}

.icon-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.edit-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.edit-fields label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.edit-fields label:nth-child(3) {
    grid-column: 1 / -1;
}

.edit-fields input,
.edit-fields textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 10px;
    color: var(--ink);
    background: #fffefa;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
}

.edit-fields textarea {
    min-height: 100px;
    resize: vertical;
}

.dialog-actions {
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 560px) {
    body {
        padding: 32px 16px 48px;
    }

    .filters {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .search-group {
        grid-column: auto;
    }

    .clear-button2 {
        width: 100%;
    }

    #opportunities {
        grid-template-columns: 1fr;
    }

    .edit-fields {
        grid-template-columns: 1fr;
    }

    .edit-fields label:nth-child(3) {
        grid-column: auto;
    }
}
.page-actions {
    margin: 20px 0;
}

.top-opportunities-button {
    display: inline-block;
    padding: 10px 16px;
    background: #6b4f3a;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}
.starred-opportunities-button {
    display: inline-block;
    padding: 10px 16px;
    background: #6b4f3a;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}
.top-opportunities-button:hover {
    background: #513a2b;
}

.top-header {
    margin-bottom: 30px;
}

.top-header a {
    color: #6b4f3a;
    text-decoration: none;
    font-weight: 600;
}

.top-opportunity-card {
    background: #fffaf2;
    border: 1px solid #d8c7b5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    position: relative;
}

.opportunity-rank {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.top-opportunity-card h2 {
    margin-top: 0;
}

.top-opportunity-card a {
    color: #6b4f3a;
    font-weight: 600;
}
.opportunity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.opportunity-grid .opportunity-card {
    margin-bottom: 0;
}

.opportunity-rank {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.podium-section {
    position: relative;
    overflow: hidden;
    text-align: center;
    margin: 30px 0 50px;
    padding: 30px 20px 0;
}

.podium-section h2,
.all-opportunities-section h2 {
    position: relative;
    z-index: 2;
    margin-bottom: 25px;
}

.podium {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    max-width: 850px;
    margin: 0 auto;
}

.podium-card {
    width: 190px;
    min-height: 150px;
    padding: 16px 12px;
    border-radius: 14px 14px 0 0;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.podium-card.first {
    min-height: 185px;
}

.podium-card.second {
    min-height: 160px;
}

.podium-card.third {
    min-height: 145px;
}

.podium-medal {
    font-size: 30px;
    line-height: 1;
    margin-bottom: 6px;
}

.podium-place {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.podium-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    max-height: 38px;
    overflow: hidden;
}

.podium-clicks {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.75;
}

.podium-card a {
    margin-top: 8px;
    font-size: 12px;
}

.fireworks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.fireworks span {
    position: absolute;
    font-size: 28px;
    animation: firework 2.5s ease-in-out infinite;
    opacity: 0;
}

.fireworks span:nth-child(1) {
    left: 12%;
    top: 20%;
    animation-delay: 0s;
}

.fireworks span:nth-child(2) {
    left: 25%;
    top: 8%;
    animation-delay: 0.6s;
}

.fireworks span:nth-child(3) {
    left: 40%;
    top: 18%;
    animation-delay: 1.1s;
}

.fireworks span:nth-child(4) {
    left: 58%;
    top: 10%;
    animation-delay: 0.3s;
}

.fireworks span:nth-child(5) {
    left: 73%;
    top: 22%;
    animation-delay: 1.4s;
}

.fireworks span:nth-child(6) {
    left: 87%;
    top: 12%;
    animation-delay: 0.8s;
}

.fireworks span:nth-child(7) {
    left: 18%;
    top: 42%;
    animation-delay: 1.8s;
}

.fireworks span:nth-child(8) {
    left: 82%;
    top: 40%;
    animation-delay: 1.2s;
}

@keyframes firework {
    0% {
        transform: scale(0.2) rotate(0deg);
        opacity: 0;
    }

    30% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }

    60% {
        transform: scale(0.8) rotate(90deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
}

.all-opportunities-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 50px;
}

@media (max-width: 700px) {
    .podium {
        gap: 6px;
    }

    .podium-card {
        width: 30%;
        min-height: 125px;
        padding: 12px 6px;
    }

    .podium-card.first {
        min-height: 150px;
    }

    .podium-card.second {
        min-height: 135px;
    }

    .podium-card.third {
        min-height: 120px;
    }

    .podium-name {
        font-size: 12px;
    }

    .podium-clicks {
        font-size: 11px;
    }

    .podium-medal {
        font-size: 24px;
    }
}
.podium-medal {
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
}

.podium-medal svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.podium-medal.gold svg {
    fill: #f5c542;
    stroke: #c99a16;
}

.podium-medal.gold svg path:last-child {
    fill: #fff3a6;
}

.podium-medal.silver svg {
    fill: #c7c7c7;
    stroke: #8e8e8e;
}

.podium-medal.silver svg path:last-child {
    fill: #eeeeee;
}

.podium-medal.bronze svg {
    fill: #cd7f32;
    stroke: #99551f;
}

.podium-medal.bronze svg path:last-child {
    fill: #e7a15d;
}
.star-button {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    padding: 0;
}

.star-button.starred {
    color: #f5c542;
}

.star-button:hover {
    color: #f5c542;
}

.opportunity-card {
    position: relative;
}
#starredOpportunities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

/* Free learning resources page */

.learning-resources {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.learning-resource {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.resource-logo {
    flex: 0 0 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.resource-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.resource-info {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(93, 55, 38, .08);
}

.resource-info h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    line-height: 1.2;
}

.resource-info p {
    margin: 0 0 12px;
    color: var(--muted);
}

.resource-info a {
    color: var(--accent);
    font-weight: 700;
    text-underline-offset: 3px;
}

.learning-resources-button {
    display: inline-block;
    padding: 10px 16px;
    background: #6b4f3a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

.learning-resources-button:hover {
    background: #513a2b;
}

@media (max-width: 560px) {
    .learning-resource {
        gap: 10px;
    }

    .resource-logo {
        flex-basis: 76px;
        padding: 8px;
    }

    .resource-logo img {
        width: 48px;
        height: 48px;
    }

    .resource-info {
        padding: 14px;
    }

    .resource-info h2 {
        font-size: 1.05rem;
    }
}
