/* ==========================================================================
   Pi Matrix Game Styles
   ========================================================================== */

body.pi-matrix-page {
    background-color: #0d0d0d;
    color: #e0e0e0;
    font-family: system-ui, -apple-system, sans-serif;
}

.matrix-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.matrix-header {
    text-align: center;
    margin-bottom: 40px;
}

.matrix-header h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 8px;
}

.matrix-header p {
    color: #a0a0a0;
}

/* Layout Grid */
.matrix-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 850px) {
    .matrix-layout {
        grid-template-columns: 1fr;
    }
}

/* Controls Panel */
.matrix-controls {
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #38bdf8;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #38bdf8;
    cursor: pointer;
}

.control-group input[type="number"] {
    background: #0d0d0d;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1rem;
}

/* Presets */
.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-preset {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-preset:hover {
    background: #334155;
    color: #fff;
}

/* Color Pickers Grid */
.color-pickers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
}

.color-item input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

.color-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-item input[type="color"]::-webkit-color-swatch {
    border: 2px solid #333;
    border-radius: 50%;
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.matrix-controls .btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.matrix-controls .btn-primary {
    background: #38bdf8;
    color: #0f172a;
}

.matrix-controls .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.matrix-controls .btn-secondary {
    background: #222;
    color: #fff;
    border: 1px solid #333;
}

/* Display & Canvas */
.matrix-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.canvas-wrapper {
    background: #000;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

#pi-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.matrix-stats {
    font-size: 0.9rem;
    color: #888;
}

.matrix-stats strong {
    color: #38bdf8;
}