/* --- Wrapper (Matches Stopwatch/Diff Theme) --- */
#cg-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
    gap: 20px;
}

/* --- Display Area --- */
.cg-display-container {
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Glass reflection effect */
.cg-display-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.cg-expression {
    font-size: 2rem;
    color: #10b981; /* Emerald Green */
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    letter-spacing: 2px;
    word-spacing: 10px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-weight: bold;
}

.cg-readable {
    font-size: 0.8rem;
    color: #9ca3af;
    font-family: 'Press Start 2P', monospace, sans-serif;
    text-transform: uppercase;
}

/* --- Input Grid --- */
.cg-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
}

.cg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.cg-field label {
    font-size: 0.5rem;
    color: #fbbf24; /* Amber */
    text-transform: uppercase;
    text-align: center;
}

.cg-input {
    background-color: #1f2937;
    border: 2px solid #4b5563;
    color: white;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 1.2rem;
    padding: 10px 5px;
    border-radius: 4px;
    width: 100%;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

.cg-input:focus {
    border-color: #3b82f6; /* Blue */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.cg-hint {
    font-size: 0.4rem;
    color: #6b7280;
    font-family: 'Press Start 2P', monospace, sans-serif;
}

/* --- Presets --- */
.cg-presets {
    width: 100%;
    margin-top: 10px;
}

.cg-label {
    font-size: 0.6rem;
    color: #9ca3af;
    border-bottom: 2px solid #374151;
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cg-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cg-btn {
    background-color: #374151;
    color: #d1d5db;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.1s;
}

.cg-btn:hover {
    background-color: #4b5563;
    color: white;
}

/* --- Action Buttons --- */
.cg-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.cg-action-btn {
    flex: 1;
    padding: 15px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.cg-action-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.cg-action-btn.copy {
    background-color: #3b82f6; /* Blue */
    color: #1e3a8a;
    border-bottom: 4px solid #2563eb;
}

.cg-action-btn.copy.active {
    background-color: #10b981; /* Green feedback */
    border-color: #059669;
    color: #064e3b;
}

.cg-action-btn.clear {
    background-color: #ef4444; /* Red */
    color: #7f1d1d;
    border-bottom: 4px solid #b91c1c;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cg-grid {
        grid-template-columns: 1fr 1fr; /* 2 cols */
    }
    .cg-field:last-child {
        grid-column: 1 / -1; /* Center last item */
    }
    
    .cg-expression {
        font-size: 1.5rem;
    }
}