:root {
    --bg-color: #e0e0ff;
    --card-bg: #ffffff;
    --text-color: #333;
    --input-bg: #f5f6fa;
    --accent-color: #6c5ce7;
    --border-color: #ddd;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #ffffff;
    --input-bg: #0f3460;
    --border-color: #2c3e50;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    transition: background 0.3s ease;
}

.card {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 800px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-top: 5px solid var(--accent-color);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-box {
    background-color: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

h1 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.theme-toggle {
    background: var(--input-bg);
    border: none;
    color: var(--text-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Input Area */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 120px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-color);
    resize: none;
    outline: none;
}

.dice-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Controls Section */
.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.select-wrapper {
    flex: 1;
    min-width: 140px;
}

select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

.generate-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    height: 45px;
}

.generate-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.generate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.results {
    margin-top: 30px;
    display: grid;
    gap: 20px;
}

.result-card {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    padding: 15px;
    color: var(--text-color);
}

.result-card img {
    width: 100%;
    border-radius: 14px;
    display: block;
    margin-bottom: 12px;
}

.result-card .result-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.95rem;
}

.no-result,
.loading {
    text-align: center;
    color: var(--text-color);
    padding: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    background-color: var(--card-bg);
}