/* --- style sheet version 0.1.0 --- */

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #f59e0b;
    --text-main: #111827;
    --text-body: #292e36;
    --text-light: #9ca3af;
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --bg-subtle: #f9fafb;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --success: #10b981;
    --error: #ef4444;
}

h1 {
    font-weight: 700;
    font-size: 2em;
}

h2 {
    font-weight: 700;
    font-size: 1.4em;
}

h3 {
    font-weight: 600;
    font-size: 1.3em;
}

h4 {
    font-weight: 400;
    font-size: 1.2em;
    margin: 8px 5px;
}

p {
    font-weight: 400;
    font-size: 1.1em;
}

span {
    font-weight: 600;
    font-size: 1.125em;
}

label {
    font-weight: 500;
    font-size: 1.125em;
}

.gamypx-page * {
    box-sizing: border-box;
}

/* --- Layout System --- */
.gamypx-page {
    font-family: var(--font-main);
    color: var(--text-main);
    padding: 0;
    line-height: 1.3;
    width: 100%;
}

@media (min-width: 900px) {
    .gamypx-page {
        padding: 10px 16px;
    }
}

.gamypx-page main {
    max-width: 1120px;
    margin: 0 auto;
}

.gamypx-hero {
    text-align: center;
    margin: 40px 0;
    margin-top: 0px;
}

.gamypx-hero h1 {
    font-size: 2em;
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: 700;
}

.gamypx-hero p {
    max-width: 640px;
    margin: 0 auto;
    color: var(--text-body);
    font-size: 1.1em;
}

.gamypx-section{
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .gamypx-section {
        padding: 10px;
    }
}

.gamypx-section-dark {
    background-color: #111827;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.gamypx-section h2,
.gamypx-section-dark h2 {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 24px;
    margin-top: 0px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.gamypx-section-dark h2 {
    color: var(--accent);
    border-bottom-color: #374151;
}

/* --- Grids --- */
.gamypx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gamypx-grid-2 {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr);
}

.gamypx-grid-3 {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .gamypx-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .gamypx-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Stack layout (vertical, full-width children) */
.gamypx-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Components: Buttons & Toggles --- */
.gamypx-btn,
.gamypx-card-link {
    display: inline-block;
    background-color: var(--primary);
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.gamypx-btn:hover,
.gamypx-card-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.gamypx-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.gamypx-toggle-btn {
    background: var(--bg-subtle);
    color: var(--text-body);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.gamypx-toggle-btn:hover,
.gamypx-toggle-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.gamypx-toggle-btn.active--accent {
    background: var(--accent);
    border-color: var(--accent);
}

/* --- Filter Buttons --- */
.gamypx-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    margin-top: 24px;
}

.gamypx-filter-buttons button {
    background-color: rgb(221, 225, 231);
    border: 1px solid var(--border);
    color: rgb(40, 40, 40);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.2s ease;
}

.gamypx-filter-buttons button:hover {
    background-color: rgb(196, 200, 206);
    transform: translateY(-1px);
}

.gamypx-filter-buttons button.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* --- Components: Cards --- */
.gamypx-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.gamypx-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.gamypx-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.gamypx-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.gamypx-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gamypx-card-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
    cursor: pointer;
}

.gamypx-card-title:hover {
    color: var(--primary);
}

.gamypx-card-description {
    font-size: 1em;
    color: var(--text-body);
    line-height: 1.3;
    margin-bottom: 16px;
    flex-grow: 1;
}

.gamypx-card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 16px;
}

.gamypx-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Components: Info Panels (Modes, Warnings, Tips) --- */
.gamypx-panel {
    background-color: var(--bg-subtle);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-left-width: 4px;
}

.gamypx-panel--warning {
    background-color: #fffbeb;
    border-left-color: var(--accent);
}

.gamypx-panel--info {
    background-color: #eff6ff;
    border-left-color: var(--primary);
    color: #1e40af;
}

.gamypx-panel--mixed {
    background-color: #f5f3ff;
    border-left-color: #8b5cf6;
}

.gamypx-panel h3,
.gamypx-panel h4 {
    margin: 0 0 8px 0;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .gamypx-panel {
        padding: 10px;
    }
}

/* --- Components: Content Subsections/Cards --- */
.gamypx-subsection,
.gamypx-mode-card {
    background-color: var(--bg-subtle);
    border-radius: 8px;
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    padding: 15px;
    border-left-width: 6px;
    margin-bottom: 16px;
}

.gamypx-subsection h3,
.gamypx-mode-card h3 {
    font-size: 1.1em;
    color: var(--text-main);
    margin: 5px 0 12px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.gamypx-subsection p,
.gamypx-mode-card p {
    font-size: 1em;
    /* from user custom p style reference or standard */
    color: var(--text-body);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.gamypx-subsection .gamypx-icon,
.gamypx-mode-card .gamypx-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Variants */
.gamypx-mode-card--baked,
.gamypx-subsection--accent {
    background-color: #fffbeb;
    border-left-color: var(--accent);
}

.gamypx-mode-card--mixed,
.gamypx-subsection--purple {
    background-color: #f5f3ff;
    border-left-color: #8b5cf6;
}

/* --- Components: Lists & Steps --- */
.gamypx-list-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gamypx-list-item {
    width: 100%;
    text-align: left;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-family: inherit;
}

.gamypx-list-item:hover {
    background-color: var(--bg-subtle);
}

.gamypx-list-item.active {
    background-color: #fffbeb;
    border-left: 4px solid var(--accent);
    border-color: #fcd34d;
}

/* --- Components: Forms & Inputs --- */
.gamypx-form-group {
    margin-bottom: 16px;
}

.gamypx-form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-body);
}

.gamypx-select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: inherit;
    background-color: var(--bg-card);
}

/* Range Slider Styling */
input[type=range] {
    width: 100%;
    height: 8px;
    background: #d1d5db;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    background: #d97706;
}

/* --- Components: Tables --- */
.gamypx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.gamypx-table th {
    background: var(--bg-subtle);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.gamypx-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-page);
    color: var(--text-body);
}

/* --- Future Components --- */
/* Badge/Tag */
.gamypx-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background-color: var(--bg-subtle);
    color: var(--text-body);
    border: 1px solid var(--border);
}

.gamypx-badge--primary {
    background-color: #eff6ff;
    color: var(--primary);
    border-color: #dbeafe;
}

.gamypx-badge--accent {
    background-color: #fffbeb;
    color: var(--accent);
    border-color: #fcd34d;
}

/* Progress Bar */
.gamypx-progress {
    width: 100%;
    height: 8px;
    background-color: var(--bg-subtle);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.gamypx-progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Spinner */
.gamypx-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-subtle);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accordion */
.gamypx-accordion {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.gamypx-accordion-item {
    border-bottom: 1px solid var(--border);
}

.gamypx-accordion-item:last-child {
    border-bottom: none;
}

.gamypx-accordion-header {
    padding: 16px;
    background-color: var(--bg-card);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gamypx-accordion-header:hover {
    background-color: var(--bg-subtle);
}

.gamypx-accordion-content {
    padding: 16px;
    display: none;
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border);
}

.gamypx-accordion-item.active .gamypx-accordion-content {
    display: block;
}

/* --- Utilities --- */
.gamypx-hidden {
    display: none;
}

.gamypx-visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gamypx-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.gamypx-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.gamypx-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.gamypx-empty-text {
    font-size: 1.1em;
    color: var(--text-body);
}


.gamypx-highlight {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Helper Icons */
.gamypx-icon-circle {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    margin-right: 8px;
}

.gamypx-tip {
    background-color: #eff6ff;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    color: #1d4ed8;
    margin-top: 12px;
}

/* --- Components: Table of Contents (TOC) --- */
.gamypx-toc {
    background: var(--bg-subtle);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin: 20px 0;
}

.gamypx-toc h4 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: 600;
}

.gamypx-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.gamypx-toc li {
    margin: 8px 0;
}

.gamypx-toc a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.gamypx-toc a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* --- Components: Modal --- */
.gamypx-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gamypx-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.gamypx-modal {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.gamypx-modal-backdrop.active .gamypx-modal {
    transform: scale(1);
}

.gamypx-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gamypx-modal-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.gamypx-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5em;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.gamypx-modal-close:hover {
    color: var(--error);
}

.gamypx-modal-body {
    padding: 24px;
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.3;
    overflow-y: auto;
    white-space: pre-wrap;
    /* Preserve newlines from alert strings */
}

.gamypx-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* --- Components: Example Box --- */
.gamypx-example-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 15px;
    margin-top: 15px;
    border-radius: 6px;
}

.gamypx-example-box h4 {
    color: #b45309;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 5px;
}

.gamypx-example-box p {

    color: var(--text-body);
    font-size: 1rem;
    margin: 6px 0;
    padding-left: 12px;
}

@media (max-width: 768px) {
    .gamypx-subsection,
    .gamypx-mode-card,
    .gamypx-example-box {
        padding: 7px;
    }

    .gamypx-table th,
    .gamypx-table td {
        padding: 7px;
    }
}
