/* RPG Tools Styles */

/* Hero Section */
.rpg-tools-hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("/rpg_tools/assets/images/loop5_a_serene_rpg_landscape_medieval_fantasy_--ar_169_--styl_a0fc41a4-b8f9-4ea1-9023-e9b121c505d6_0.png");
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.rpg-tools-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 105, 189, 0.3), rgba(114, 101, 179, 0.3));
    backdrop-filter: blur(3px);
    z-index: 1;
}

.rpg-tools-hero .container {
    position: relative;
    z-index: 2;
}

.rpg-tools-hero h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.rpg-tools-hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* RPG Tools Grid */
.rpg-tools-grid {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--background-light), var(--section-gradient-end));
}

.rpg-tools-grid .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/rpg_tools/assets/images/loop5_parchment_texture_repeating_--style_raw_3b24d24c-bb90-4b68-aa92-c6a0c24ff990_3.png') repeat;
    opacity: 0.1;
    z-index: -1;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(74, 105, 189, 0.2);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-icon-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(var(--primary-color-rgb), 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.tool-card:hover .tool-icon-img {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(var(--primary-color-rgb), 0.45));
}

.tool-card h2 {
    font-family: 'MedievalSharp', cursive;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tool-card p {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.tool-card .btn {
    background: var(--button-primary);
    color: var(--text-light);
}

.tool-card .btn:hover {
    background: var(--button-secondary);
    color: var(--text-dark);
    text-shadow: none;
}

.tool-card .btn:disabled {
    background: var(--button-primary);
    opacity: 0.5;
}

.dark .tool-card .btn:hover {
    color: var(--background-dark);
}

.coming-soon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--tertiary-color);
    color: var(--text-light);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* RPG Demo Section */
.rpg-demo {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--background-light), var(--section-gradient-end));
}

.demo-parchment {
    background: var(--background-dark);
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 20px rgba(74, 105, 189, 0.3);
    border: 2px solid var(--primary-color);
    text-align: left;
    color: var(--text-light);
}

.demo-parchment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/rpg_tools/assets/images/loop5_parchment_texture_repeating_--style_raw_3b24d24c-bb90-4b68-aa92-c6a0c24ff990_3.png') repeat;
    opacity: 0.1;
    z-index: 1;
    border-radius: 8px;
}

.rpg-demo h2 {
text-align: center;
}

.demo-parchment h3 {
    font-family: 'MedievalSharp', cursive;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--primary-color);
}

.demo-parchment ul {
    list-style-type: none;
    padding: 0;
    position: relative;
    z-index: 2;
}

.demo-parchment li {
    margin-bottom: 0.5rem;
    font-family: 'MedievalSharp', cursive;
    font-size: 1.2rem;
    color: var(--text-light);
}

.seal {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    font-family: 'MedievalSharp', cursive;
    font-size: 1.5rem;
    z-index: 2;
}

.seal::before {
    content: 'CC';
}

/* Responsive styles */
@media (max-width: 768px) {
    .rpg-tools-grid {
        grid-template-columns: 1fr;
    }

    .rpg-tools-hero h1 {
        font-size: 2.5rem;
    }
}

/* Dark mode styles */
.dark .rpg-tools-grid {
    background: linear-gradient(135deg, var(--background-dark), var(--section-dark-end));
}

.dark .rpg-demo {
    background: linear-gradient(135deg, var(--background-dark), var(--section-dark-end));
}

/* Parchment texture for all RPG pages — both modes */
.rpg-tools-body {
    background: url('/rpg_tools/assets/images/loop5_parchment_texture_repeating_--style_raw_3b24d24c-bb90-4b68-aa92-c6a0c24ff990_3.png') repeat;
    background-color: var(--background-light, #f5f0e8);
    color: var(--text-dark);
}

.dark .rpg-tools-body {
    background: url('/rpg_tools/assets/images/loop5_parchment_texture_repeating_--style_raw_3b24d24c-bb90-4b68-aa92-c6a0c24ff990_3.png') repeat;
    background-color: var(--background-dark, #1a202c);
    color: var(--text-light);
}

.dark .tool-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.dark .tool-card h2 {
    color: var(--primary-color-light);
}

.dark .tool-card p {
    color: var(--text-light);
}

.dark .demo-parchment {
    background: var(--background-light);
    border-color: var(--primary-color);
}

.dark .demo-parchment h3 {
    color: var(--primary-color-light);
}

.dark .demo-parchment li {
    color: var(--text-light);
}

.dark .seal {
    background: var(--secondary-color);
    color: var(--text-light);
}

/* Campaign Forge (Coming Soon page) */
.coming-soon-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--background-light), var(--section-gradient-end));
    position: relative;
    overflow: hidden;
    padding-top: 6rem;
}
.coming-soon-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('/rpg_tools/assets/images/loop5_parchment_texture_repeating_--style_raw_3b24d24c-bb90-4b68-aa92-c6a0c24ff990_3.png') repeat;
    opacity: 0.05;
    z-index: 0;
}
.coming-soon-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    padding: 2rem;
}
.coming-soon-content .tool-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.coming-soon-content h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.coming-soon-content .badge-coming-soon {
    font-size: 0.9rem;
    padding: 0.35rem 1rem;
    margin-left: 0;
    display: inline-block;
    margin-bottom: 1.5rem;
}
.coming-soon-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}
.feature-preview {
    text-align: left;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(74,105,189,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}
.feature-preview h3 {
    font-family: 'MedievalSharp', cursive;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}
.feature-preview ul {
    list-style: none;
    padding: 0;
}
.feature-preview li {
    padding: 0.4rem 0;
    color: var(--text-dark);
}
.feature-preview li i {
    color: var(--primary-color);
    margin-right: 0.5rem;
    width: 1.2rem;
    text-align: center;
}
.dark .coming-soon-hero {
    background: linear-gradient(135deg, var(--background-dark), var(--section-dark-end));
}
.dark .coming-soon-content h1 {
    color: var(--primary-color);
}
.dark .coming-soon-content p {
    color: var(--text-light);
}
.dark .feature-preview {
    background: rgba(255,255,255,0.06);
    border-color: rgba(74,105,189,0.3);
}
.dark .feature-preview h3 {
    color: var(--primary-color);
}
.dark .feature-preview li {
    color: var(--text-light);
}

/* ===========================
   RPG Tools Settings — Gear Button & Modal
   =========================== */

/* Gear button — positioned in hero section */
.rpg-settings-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.3s, color 0.2s;
    backdrop-filter: blur(4px);
}
.rpg-settings-btn:hover {
    background: rgba(74, 105, 189, 0.7);
    color: #fff;
    transform: rotate(90deg);
}
.rpg-settings-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Settings overlay */
.rpg-settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}
.rpg-settings-overlay.active {
    display: flex;
}

/* Settings panel */
.rpg-settings-panel {
    background: var(--background-light, #f5f5f5);
    color: var(--text-dark, #333);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: settingsSlideIn 0.25s ease-out;
}
@keyframes settingsSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rpg-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.rpg-settings-header h2 {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rpg-settings-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-dark);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s;
}
.rpg-settings-close:hover {
    background: rgba(0, 0, 0, 0.08);
}
.rpg-settings-close:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.rpg-settings-body {
    padding: 1rem 1.25rem 1.5rem;
}

/* Settings sections (fieldsets) */
.rpg-settings-section {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem 1rem 0.5rem;
    margin-bottom: 1rem;
}
.rpg-settings-section legend {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.05rem;
    color: var(--primary-color);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Setting row — label + input on same line */
.rpg-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.rpg-setting-row:last-child {
    border-bottom: none;
}
.rpg-setting-row label {
    font-size: 0.9rem;
    color: var(--text-dark);
    flex: 1;
}
.rpg-setting-row select {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--background-light, #fff);
    color: var(--text-dark);
    min-width: 130px;
    cursor: pointer;
}
.rpg-setting-row select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Reset button */
.rpg-settings-footer {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 0.25rem;
}
.rpg-settings-reset-btn {
    background: none;
    border: 1px solid var(--danger-color, #e74c3c);
    color: var(--danger-color, #e74c3c);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.rpg-settings-reset-btn:hover {
    background: var(--danger-color, #e74c3c);
    color: #fff;
}
.rpg-settings-reset-btn:focus-visible {
    outline: 2px solid var(--danger-color, #e74c3c);
    outline-offset: 2px;
}

/* Dark mode overrides */
.dark .rpg-settings-panel {
    background: var(--background-dark, #1a202c);
    color: var(--text-light, #ecf0f1);
    border-color: var(--primary-color);
}
.dark .rpg-settings-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
.dark .rpg-settings-close {
    color: var(--text-light);
}
.dark .rpg-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
}
.dark .rpg-settings-section {
    border-color: rgba(255, 255, 255, 0.1);
}
.dark .rpg-setting-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}
.dark .rpg-setting-row label {
    color: var(--text-light);
}
.dark .rpg-setting-row select {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.15);
}
.dark .rpg-settings-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}