/* —— Dereceler sayfası —— */

body.dereceler-page {
    overflow: hidden;
    min-height: 100%;
    height: 100%;
}

body.dereceler-page .settings-trigger {
    top: auto;
    left: auto;
    bottom: 1.25rem;
    right: 1.25rem;
}

.dereceler-header {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    padding: clamp(0.65rem, 1.5vh, 1rem) clamp(1.25rem, 3vw, 2.5rem) clamp(0.4rem, 1vh, 0.65rem);
    flex-shrink: 0;
}

.dereceler-logo {
    width: var(--derece-logo, clamp(56px, 7vw, 88px));
    height: var(--derece-logo, clamp(56px, 7vw, 88px));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.dereceler-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dereceler-header-text {
    text-align: center;
    min-width: 0;
}

.dereceler-header .faculty-label {
    font-family: var(--font-ui);
    font-size: var(--derece-fakulte, clamp(0.62rem, 1vw, 0.78rem));
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-fakulte, var(--gold));
    line-height: 1.35;
}

.dereceler-header .faculty-line {
    display: block;
}

/* —— Derece kartları —— */
.podium-section {
    position: relative;
    z-index: 8;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: calc(var(--derece-foto-lift-px, 2.75rem) + 0.15rem) clamp(1rem, 2.5vw, 2rem) clamp(0.2rem, 0.8vh, 0.5rem);
    min-height: 0;
    overflow: visible;
}

.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: clamp(0.5rem, 1.2vw, 1rem);
    width: min(100%, var(--derece-kart-max, 820px));
    margin: 0 auto;
    overflow: visible;
    transform: translateY(var(--derece-podium-shift, 0vh));
    transition: transform 0.35s ease;
}

.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    position: relative;
    overflow: visible;
    padding: 0 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.06) 0%,
        var(--glass) 50%,
        rgba(0, 0, 0, 0.15) 100%
    );
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: podium-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    min-width: 0;
}

.podium-card[data-rank="1"] { animation-delay: 0s; }
.podium-card[data-rank="2"] { animation-delay: 0.08s; }
.podium-card[data-rank="3"] { animation-delay: 0.16s; }

@keyframes podium-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.podium-photo-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 5;
    width: var(--derece-foto, clamp(96px, 12vw, 150px));
    height: var(--derece-foto, clamp(96px, 12vw, 150px));
    transform: translate(-50%, -50%);
    flex-shrink: 0;
}

.podium-photo,
.podium-photo-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.podium-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-muted);
}

.podium-photo-fallback svg {
    width: 38%;
    height: 38%;
    opacity: 0.55;
}

.podium-photo-wrap.has-photo .podium-photo-fallback {
    display: none;
}

.podium-photo-wrap:not(.has-photo) .podium-photo {
    display: none;
}

.podium-card[data-rank="1"] .podium-photo,
.podium-card[data-rank="1"] .podium-photo-fallback {
    border: 2px solid #e8c547;
    box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.18), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.podium-card[data-rank="2"] .podium-photo,
.podium-card[data-rank="2"] .podium-photo-fallback {
    border: 2px solid #c8d0dc;
    box-shadow: 0 0 0 3px rgba(200, 208, 220, 0.15), 0 8px 24px rgba(0, 0, 0, 0.32);
}

.podium-card[data-rank="3"] .podium-photo,
.podium-card[data-rank="3"] .podium-photo-fallback {
    border: 2px solid #c47a2d;
    box-shadow: 0 0 0 3px rgba(196, 122, 45, 0.15), 0 8px 24px rgba(0, 0, 0, 0.32);
}

.podium-rank-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 7;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    color: #1a1208;
    background: linear-gradient(145deg, #f5e6a8, #c9a227);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transform: translate(50%, -50%);
}

.podium-card[data-rank="2"] .podium-rank-badge {
    background: linear-gradient(145deg, #eef2f7, #9aa8bc);
    color: #1e2836;
}

.podium-card[data-rank="3"] .podium-rank-badge {
    background: linear-gradient(145deg, #e8b07a, #a85f1f);
    color: #2a1406;
}

.podium-info {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    width: 100%;
    margin-top: calc(var(--derece-foto-half-px, 0px) + var(--derece-foto-unvan-gap, 0px));
    padding: 0 0.15rem;
    position: relative;
    z-index: 6;
}

.podium-unvan {
    font-family: var(--font-ui);
    font-size: var(--derece-unvan, clamp(0.58rem, 0.95vw, 0.68rem));
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-unvan, var(--gold));
    line-height: 1.2;
}

.podium-name {
    font-family: var(--font-display);
    font-size: var(--derece-isim, clamp(1.1rem, 1.85vw, 1.45rem));
    font-weight: 600;
    color: var(--color-isim, var(--text));
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.podium-il {
    font-family: var(--font-ui);
    font-size: var(--derece-il, clamp(0.92rem, 1.45vw, 1.1rem));
    font-weight: 500;
    color: var(--color-il, var(--gold-bright));
    letter-spacing: 0.03em;
}

.podium-empty {
    font-family: var(--font-ui);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* —— Harita —— */
.dereceler-map-stage {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.35rem, 1vh, 0.65rem) clamp(1.25rem, 3vw, 2.5rem) clamp(0.85rem, 1.8vh, 1.35rem);
}

.dereceler-map-frame {
    --map-max-height: var(--derece-harita-vh, 36vh);
    width: min(
        calc(88vw * var(--map-scale, 1)),
        calc(1180px * var(--map-scale, 1)),
        calc(var(--map-max-height, 36vh) * var(--map-aspect, 2.37) * var(--map-scale, 1))
    );
}

body.dereceler-page.has-active-province .map-glow {
    opacity: 1;
}

.rank-badge-layer {
    pointer-events: none;
}

.rank-map-badge circle {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.rank-map-badge text {
    font-family: "Outfit", system-ui, sans-serif;
    font-weight: 700;
    pointer-events: none;
}

.rank-map-badge--1 circle {
    fill: #e8c547;
    stroke: rgba(255, 255, 255, 0.7);
}

.rank-map-badge--2 circle {
    fill: #b8c4d4;
    stroke: rgba(255, 255, 255, 0.65);
}

.rank-map-badge--3 circle {
    fill: #c47a2d;
    stroke: rgba(255, 255, 255, 0.6);
}

.rank-map-badge--1 text { fill: #1a1208; }
.rank-map-badge--2 text { fill: #1e2836; }
.rank-map-badge--3 text { fill: #2a1406; }

/* —— Kart → harita ışınları —— */
.rank-beam-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9;
    overflow: visible;
}

.rank-beam {
    stroke-linecap: round;
    stroke-width: 2.2;
    opacity: 0.88;
    stroke-dasharray: 10 8;
    animation: rank-beam-flow 1.45s linear infinite;
}

.rank-beam--1 {
    stroke: var(--gold-bright, #e8c547);
    filter: drop-shadow(0 0 10px var(--province-glow, rgba(232, 197, 71, 0.65)));
}

.rank-beam--2 {
    stroke: #c8d0dc;
    filter: drop-shadow(0 0 8px rgba(200, 208, 220, 0.55));
}

.rank-beam--3 {
    stroke: #c47a2d;
    filter: drop-shadow(0 0 8px rgba(196, 122, 45, 0.5));
}

@keyframes rank-beam-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -36; }
}

@media (max-width: 560px) {
    .dereceler-header .faculty-label {
        letter-spacing: 0.08em;
    }

    .podium-grid {
        gap: 0.35rem;
        max-width: 100%;
    }

    .podium-card {
        padding-bottom: 0.6rem;
    }
}

@media (max-height: 700px) {
    .dereceler-map-frame:not([style*="--derece-harita-vh"]) {
        --map-max-height: 32vh;
    }
}
