:root {
    --bg: #0f1724;
    --card: #111827;
    --accent: #10b981;
    --muted: #9ca3af;
    --cooldown-opacity: 0.6;
    --ready-opacity: 1;
}

* {
    box-sizing: border-box;
    font-family: Inter, system-ui, Arial;
}

body {
    margin: 16px;
    background: linear-gradient(180deg, #071029 0%, #071a2b 100%);
    color: #e6eef6;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
}

.btn.primary {
    background: var(--accent);
    color: #022a1f;
    border: none;
    font-weight: 600;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

@media (max-width:1024px) {
    .setup-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:768px) {
    .setup-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:480px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.hero-setup-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all .2s;
}

/* .hero-setup-card:hover {
            transform: translateY(-6px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
        } */

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    overflow: hidden;
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-name {
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    min-height: 24px;
}

.select-group {
    width: 100%;
    margin-bottom: 10px;
}

select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1f2e;
    color: white;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width:1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:480px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spells {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.spell {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spell.ready {
    opacity: var(--ready-opacity);
    filter: brightness(1.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.spell.cooldown {
    opacity: var(--cooldown-opacity);
    filter: grayscale(0.7) brightness(0.7);
}

.progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #34d399);
    transition: width .5s;
}

.remaining {
    position: absolute;
    right: 8px;
    top: 8px;
    font-weight: 700;
    font-size: 12px;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.ready {
    color: #10b981 !important;
}

.cooling {
    color: #f59e0b !important;
}

.active-time {
    font-size: 11px;
    margin-top: 5px;
    color: #d1d5db;
    font-weight: 500;
}

.sp-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
    width: 100%;
}

.mini {
    padding: 6px 8px;
    font-size: 12px;
}

.small-note {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.dropdown-selected:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-selected img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.dropdown-selected span {
    flex: 1;
}

.dropdown-arrow {
    transition: transform 0.3s;
    font-size: 12px;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.dropdown-options.open {
    display: block;
}

.dropdown-option {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-option img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.dropdown-option span {
    flex: 1;
}

.dropdown-option small {
    color: var(--muted);
    margin-left: 5px;
}

/* Custom Hero Dropdown - IMPROVED */
.custom-hero-dropdown {
    position: relative;
    width: 100%;
}

.hero-dropdown-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 12px;
    width: auto;
    min-width: 100%;
}

@media (min-width: 768px) {
    .hero-dropdown-options {
        grid-template-columns: repeat(3, 1fr);
        min-width: 350px;
        /* Lebar lebih besar di desktop */
        left: 0;
        right: auto;
    }
}

@media (min-width: 1024px) {
    .hero-dropdown-options {
        grid-template-columns: repeat(4, 1fr);
        min-width: 450px;
        /* Lebar lebih besar di desktop besar */
    }
}

.hero-dropdown-options.open {
    display: grid;
}

.hero-dropdown-option {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    text-align: center;
}

.hero-dropdown-option:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.hero-dropdown-option img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.hero-dropdown-option span {
    font-size: 12px;
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Game Clock Improvements */
.game-clock-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.time-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-inputs input {
    width: 50px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-align: center;
}

/* Hide original select but keep it for form data */
.hidden-select {
    display: none;
}

/* New styles for PYT Emblem checkbox */
.pyt-emblem-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--muted);
}

.pyt-emblem-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.pyt-emblem-group .info-icon {
    cursor: pointer;
    font-weight: bold;
    color: var(--accent);
}

/* Styles for the new game clock card */
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.game-clock-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    min-width: 250px;
}

.game-clock-display {
    font-weight: 700;
    font-size: 3em;
    min-width: 150px;
    text-align: center;
    margin-bottom: 10px;
}

.game-clock-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.game-clock-controls .time-inputs {
    justify-content: center;
}

.game-clock-controls .btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

/* NEW STYLES FOR SEARCH FUNCTIONALITY */
.dropdown-search-container {
    padding: 8px;
    position: sticky;
    top: 0;
    background: #1a1f2e;
    z-index: 1001;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    grid-column: 1 / -1;
    /* Search mengambil seluruh kolom */
}

.dropdown-search {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
}

.dropdown-search::placeholder {
    color: var(--muted);
}

/* NEW STYLES FOR CLOCK STATUS INDICATION */
.clock-running {
    background: var(--accent) !important;
    color: #022a1f !important;
}

.clock-stopped {
    background: #ef4444 !important;
    color: white !important;
}

/* Improved dropdown for desktop */
@media (min-width: 768px) {
    .hero-dropdown-options {
        width: 350px;
        right: auto;
        left: 0;
    }

    .dropdown-search-container {
        padding: 12px;
    }

    .dropdown-search {
        padding: 12px;
        font-size: 16px;
    }
}

@media (min-width: 1024px) {
    .hero-dropdown-options {
        width: 450px;
    }
}