* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

body.dark-mode {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.toggle-container {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.toggle-icon {
    font-size: 1rem;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease-out;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.creator-section {
    display: grid;
    gap: 30px;
}

.input-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.dark-mode .input-panel {
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
}

.prompt-container {
    margin-bottom: 20px;
}

.prompt-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 1.1rem;
}

.prompt-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

.dark-mode .prompt-input {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(102, 126, 234, 0.4);
    color: #e2e8f0;
}

.dark-mode .prompt-input::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

.prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.strength-control {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.date-control {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.date-controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.date-presets {
    display: flex;
    gap: 10px;
}

.preset-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.detailed-date-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.date-row, .time-row, .environment-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 80px;
}

.date-input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
}

.date-number-input {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    width: 80px;
}

.date-select-input {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    width: 120px;
}

.date-number-input:focus, .date-select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.date-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.current-date-display {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
}

.era-display {
    font-weight: 600;
    color: #764ba2;
    font-size: 1.1rem;
}

.environment-display {
    font-weight: 500;
    color: #667eea;
    font-size: 0.95rem;
    background: rgba(102, 126, 234, 0.05);
    padding: 8px 16px;
    border-radius: 8px;
    margin-top: 5px;
}

.dark-mode .date-input-group label {
    color: #e2e8f0;
}

.dark-mode .date-number-input,
.dark-mode .date-select-input {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(102, 126, 234, 0.4);
    color: #e2e8f0;
}

.dark-mode .current-date-display {
    background: rgba(102, 126, 234, 0.2);
    color: #e2e8f0;
}

.dark-mode .era-display {
    color: #a78bfa;
}

.dark-mode .environment-display {
    background: rgba(102, 126, 234, 0.15);
    color: #a78bfa;
}

.strength-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 1rem;
}

.date-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 1rem;
}

.strength-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.date-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.strength-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #f56565 0%, #ffd700 50%, #48bb78 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.date-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #8b4513 0%, #4a5568 25%, #667eea 50%, #764ba2 75%, #ff6b6b 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.strength-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.date-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #764ba2;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.strength-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.date-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.strength-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.date-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #764ba2;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.strength-indicator {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.date-indicator {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.strength-indicator.weak {
    color: #f56565;
}

.strength-indicator.powerful {
    color: #48bb78;
}

.date-indicator.ancient {
    color: #8b4513;
}

.date-indicator.future {
    color: #ff6b6b;
}

.strength-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.date-value {
    font-weight: 600;
    color: #764ba2;
    font-size: 1.1rem;
}

.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.generate-btn, .random-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.random-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(245, 87, 108, 0.3);
}

.generate-btn:hover, .random-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
    animation: spin 1s linear infinite;
}

.generate-btn.loading .btn-loader {
    display: inline;
}

.result-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideInUp 0.8s ease-out;
}

.dark-mode .result-panel {
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
}

.flag-section {
    text-align: center;
    margin-bottom: 30px;
}

.flag-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #4a5568;
}

.flag-container {
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.flag-container:hover {
    transform: scale(1.05);
}

.flag-image {
    width: 300px;
    height: 200px;
    object-fit: cover;
    display: block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .info-card {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.info-content {
    color: #4a5568;
    line-height: 1.6;
}

.info-item {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.info-item strong {
    color: #2d3748;
    min-width: 120px;
}

.info-content ul {
    list-style-type: none;
    padding-left: 0;
}

.info-content li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.info-content li:before {
    content: "•";
    color: #667eea;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: 5px;
}

.rules-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e2e8f0;
}

.rules-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
}

.rules-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
}

.rules-container {
    margin-bottom: 15px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rule-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.rule-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.rule-counter {
    font-size: 0.75rem;
    color: #718096;
    min-width: 35px;
    text-align: center;
}

.rule-counter.warning {
    color: #f56565;
}

.remove-rule-btn {
    background: #fed7d7;
    color: #c53030;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-rule-btn:hover {
    background: #feb2b2;
}

.add-rule-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-rule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.add-rule-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-screen.hidden {
    display: none;
}

.splash-image {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    animation: splashPulse 2s ease-in-out infinite alternate;
}

.tabs-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.tab-button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.thanks-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.thanks-image-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.thanks-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.thanks-image:hover {
    transform: scale(1.05);
}

.thanks-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.thanks-text p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.flag-prompt-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.flag-prompt-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
}

.flag-prompt-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 12px;
}

.flag-prompt-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

.dark-mode .flag-prompt-input {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(102, 126, 234, 0.4);
    color: #e2e8f0;
}

.dark-mode .flag-prompt-input::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

.flag-prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dark-mode .flag-prompt-title {
    color: #e2e8f0;
}

.dark-mode .flag-prompt-description {
    color: #a0aec0;
}

.dark-mode .flag-prompt-section {
    border-top-color: rgba(102, 126, 234, 0.3);
}

.history-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.history-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #4a5568;
}

.history-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.history-search {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.clear-history-btn {
    background: #f56565;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.history-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.history-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.history-item h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.history-item p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.history-item-type {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.alliance-panel, .civil-war-panel, .change-ideology-panel, .character-takeover-panel, .formable-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out;
}

.alliance-panel h2, .civil-war-panel h2, .change-ideology-panel h2, .character-takeover-panel h2, .formable-panel h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.alliance-controls, .civil-war-controls, .change-ideology-controls, .character-takeover-controls, .formable-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

.alliance-input, .civil-war-input, .ideology-input, .takeover-input, .formable-input {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.alliance-select, .civil-war-select, .ideology-select, .takeover-select, .formable-select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.alliance-input:focus, .civil-war-input:focus, .ideology-input:focus, .takeover-input:focus, .formable-input:focus,
.alliance-select:focus, .civil-war-select:focus, .ideology-select:focus, .takeover-select:focus, .formable-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.create-alliance-btn, .start-civil-war-btn, .change-ideology-btn, .character-takeover-btn, .form-nation-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.create-alliance-btn:hover, .start-civil-war-btn:hover, .change-ideology-btn:hover, .character-takeover-btn:hover, .form-nation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.alliance-result, .civil-war-result, .ideology-result, .character-takeover-result, .formable-result {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.political-parties-section {
    margin-top: 20px;
}

.political-parties-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.political-parties-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.political-party {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.party-name {
    font-weight: 600;
    color: #2d3748;
}

.party-ideology {
    color: #667eea;
    font-size: 0.9rem;
}

.government-section {
    margin-top: 20px;
}

.government-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.government-departments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.department {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.department-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.department-official {
    color: #667eea;
    font-size: 0.9rem;
}

.dark-mode .history-section,
.dark-mode .alliance-panel,
.dark-mode .civil-war-panel,
.dark-mode .change-ideology-panel,
.dark-mode .character-takeover-panel,
.dark-mode .formable-panel {
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.dark-mode .history-item {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(102, 126, 234, 0.3);
}

.dark-mode .history-item h4,
.dark-mode .alliance-panel h2,
.dark-mode .civil-war-panel h2,
.dark-mode .change-ideology-panel h2,
.dark-mode .character-takeover-panel h2,
.dark-mode .formable-panel h2 {
    color: #e2e8f0;
}

.dark-mode .alliance-input,
.dark-mode .formable-input,
.dark-mode .alliance-select,
.dark-mode .formable-select,
.dark-mode .history-search {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(102, 126, 234, 0.4);
    color: #e2e8f0;
}

.dark-mode .alliance-result,
.dark-mode .formable-result {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .generate-btn, .random-btn {
        width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .flag-image {
        width: 250px;
        height: 167px;
    }
    
    .info-item {
        flex-direction: column;
    }
    
    .info-item strong {
        min-width: auto;
    }
}

.dark-mode .info-card h3,
.dark-mode .prompt-label,
.dark-mode .strength-label,
.dark-mode .date-label,
.dark-mode .rules-title {
    color: #e2e8f0;
}

.dark-mode .info-content,
.dark-mode .info-item,
.dark-mode .rules-description {
    color: #a0aec0;
}

.dark-mode .info-item strong {
    color: #e2e8f0;
}

.dark-mode .tabs {
    background: rgba(15, 15, 35, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.dark-mode .tab-button {
    color: #a0aec0;
}

.dark-mode .tab-button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.2);
    color: #e2e8f0;
}

.dark-mode .rule-item {
    background: rgba(26, 26, 46, 0.6);
    border-color: rgba(102, 126, 234, 0.3);
}

.dark-mode .thanks-text h2 {
    color: #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-mode .thanks-text p {
    color: #a0aec0;
}