/* ============================================
   TowerFill — Game Skyline UI
   ============================================ */

/* --- Unified Tools --- */
.skyline-global-tools {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
}

.ticket-status-sky {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 188, 212, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ticket-val {
    color: #00bcd4;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
}

.reward-btn.-sky {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4);
    transition: all 0.3s ease;
}

.reward-btn.-sky:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.6);
}

#sky-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    transition: background 2s;
}

.ground-base {
    width: 0px;
    height: 0px;
    background: #4caf50;
    border-radius: 50%;
    position: absolute;
    bottom: -15px;
    z-index: -1;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2), 0 10px 20px rgba(0, 0, 0, 0.3);
}

#skyline-visualizer {
    position: absolute;
    top: 260px;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 50px;
    z-index: 100;
    overflow-x: auto;
    overflow-y: auto;
    padding: 40px 20px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--green-neon) transparent;
}

.skyline-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 50px;
    min-height: 100%;
    width: 100%;
}

.building-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* --- Build Info Panel --- */
.building-info-group {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 155px;
    min-height: 120px;
    overflow: hidden;
    pointer-events: auto;
}

.building-info-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.info-core {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    gap: 5px;
}

.nav-arrow {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 0.9rem;
    color: var(--green-dark);
    cursor: pointer;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.diff-label {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 900;
}

.-easy .diff-label {
    color: #4caf50;
}

.-normal .diff-label {
    color: #ff9800;
}

.-hard .diff-label {
    color: #f44336;
}

.floor-count {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.repair-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    border-top: 1px solid #ddd;
    padding-top: 5px;
    width: 100%;
}

.collapse-rate {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: bold;
}

.repair-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    background: #eee;
    color: #999;
    cursor: not-allowed;
    transition: all 0.2s ease;
    font-weight: bold;
}

.repair-btn.active {
    background: var(--green-neon);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 172, 193, 0.3);
}

.repair-btn.active:hover {
    background: var(--green-dark);
    box-shadow: 0 4px 12px rgba(0, 172, 193, 0.4);
    transform: translateY(-1px);
}

/* --- 3D Isometric Blocks --- */
.building-stack {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    z-index: 1;
    position: relative;
    padding-bottom: 10px;
}

.floor-block {
    position: relative;
    width: 80px;
    height: 70px;
    margin-bottom: -40px;
    opacity: 0;
    animation: dropIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.3));
}

.floor-block .face {
    position: absolute;
}

.floor-block .face-top {
    width: 80px;
    height: 40px;
    background: hsl(var(--h), var(--s), 65%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    top: 0;
    left: 0;
    z-index: 3;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.floor-block .face-left {
    width: 40px;
    height: 50px;
    background: hsl(var(--h), var(--s), 50%);
    clip-path: polygon(0% 0%, 100% 20px, 100% 50px, 0% 30px);
    top: 20px;
    left: 0;
    z-index: 2;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.floor-block .face-right {
    width: 40px;
    height: 50px;
    background: hsl(var(--h), var(--s), 35%);
    clip-path: polygon(0% 20px, 100% 0%, 100% 30px, 0% 50px);
    top: 20px;
    left: 40px;
    z-index: 1;
}

.-easy .floor-block {
    --h: 140;
    --s: 60%;
}

.-normal .floor-block {
    --h: 30;
    --s: 90%;
}

.-hard .floor-block {
    --h: 0;
    --s: 70%;
}

.collapsed-anim .floor-block {
    animation: collapse-shake 1s ease-in-out, fall-down 1.5s ease-in 1s forwards !important;
}

/* --- Portal Overlay Enhancements --- */
.mode-menu-wrapper {
    width: 100%;
    max-width: 480px;
    /* Standardize the width of the portal interaction area */
    margin: 0 auto;
}

.mode-select-row {
    display: flex;
    flex-direction: row;
    gap: 0;
    /* Remove gap for a seamless tab look, or keep it if preferred - setting to 0 for precision */
    justify-content: stretch;
    width: 100%;
    margin-bottom: 0;
    /* Align directly with the drawer below */
}

.mode-btn-wrapper {
    flex: 1;
}

.difficulty-drawer {
    width: 100%;
    /* border 2px is already set in floating.css */
}

.difficulty-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    width: 100%;
}


.difficulty-buttons .diff-btn {
    flex: 1;
    min-width: 90px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 900;
    transition: all var(--transition-normal);
}

/* --- Mode-Specific Colors (Blue for Daily, Green for Permanent) --- */

/* Daily Mode - Blue Highlights */
.difficulty-drawer.daily-mode {
    border-color: rgba(3, 169, 244, 0.4);
}

.difficulty-drawer.daily-mode:hover {
    border-color: var(--color-daily);
    box-shadow: 0 0 20px rgba(3, 169, 244, 0.2);
}

.difficulty-drawer.daily-mode .diff-btn:hover {
    border-color: var(--color-daily);
    background: rgba(3, 169, 244, 0.05);
    box-shadow: 0 8px 32px rgba(3, 169, 244, 0.3);
    color: var(--color-daily);
}

/* Permanent Mode - Green Highlights */
.difficulty-drawer.permanent-mode {
    border-color: rgba(76, 175, 80, 0.4);
}

.difficulty-drawer.permanent-mode:hover {
    border-color: var(--color-permanent);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.difficulty-drawer.permanent-mode .diff-btn:hover {
    border-color: var(--color-permanent);
    background: rgba(76, 175, 80, 0.05);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    color: var(--color-permanent);
}