/* Basic reset was likely imported, adding specific styles */

.hidden {
    display: none !important;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.controls-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

/* Logo */
.logo-link {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: auto;
    z-index: 100;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.1);
}

.site-logo {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* Header & Icons */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.controls-panel h1 {
    margin: 0;
    border: none;
    padding: 0;
}

.icon-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: #cca352;
    color: #cca352;
    background: rgba(204, 163, 82, 0.1);
}

/* Control Groups */
.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #cccccc;
}

.control-group select,
.control-group input[type="number"],
.control-group input[type="text"] {
    width: 100%;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow */
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    border-color: #cca352;
}

.control-group input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.control-group input[type="color"] {
    background: none;
    border: none;
    width: 100%;
    height: 40px;
    cursor: pointer;
    padding: 0;
}

.color-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    text-align: center;
}

.polymorphism-hint {
    margin-top: 4px;
    text-align: left;
}

.polymorphism-hint:empty {
    display: none;
}

.icon-btn:hover {
    border-color: #cca352;
    color: #cca352;
    background: rgba(204, 163, 82, 0.1);
}

/* Caste color button */
.caste-color-btn {
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.caste-color-btn:hover {
    border-color: #cca352;
    color: #cca352;
    background: rgba(204, 163, 82, 0.1);
}

.caste-color-btn.active {
    border-color: #66dd66;
    color: #66dd66;
    background: rgba(102, 221, 102, 0.1);
}

/* Caste legend */
.caste-legend {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.82rem;
}

.legend-minor { color: #66dd66; }
.legend-media { color: #6699ff; }
.legend-major { color: #ff4444; }

/* Legal Footer */
.legal-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    color: #888;
}

.legal-links a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: #cca352;
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    color: #eee;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.modal-content h2 {
    color: #cca352;
    margin-top: 0;
}

.modal-content h3 {
    margin-bottom: 5px;
    color: #eee;
}

.modal-content ul {
    margin-top: 5px;
    padding-left: 20px;
    color: #ccc;
    font-size: 0.95rem;
}

.modal-content li {
    margin-bottom: 5px;
}

.modal-footer {
    margin-top: 25px;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #cca352;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn:hover {
    background: #e6c268;
}

/* App subtitle */
.app-subtitle {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

/* Custom outworld size inputs */
.custom-size-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.custom-size-row input[type="number"] {
    width: 80px;
    flex-shrink: 0;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.custom-size-row input[type="number"]:focus {
    border-color: #cca352;
}

.custom-size-row span {
    color: #888;
    font-size: 0.9rem;
}

/* API offline warning */
.api-offline-hint {
    color: #e8a020 !important;
    font-style: normal !important;
    text-align: left !important;
    margin-top: 4px;
}