# Quick Reference Guide

**Last Updated:** 2025-01-XX  
**Purpose:** Quick lookup for common tasks and critical information

---

## Critical Line Numbers

### Desktop Controls
- **Container:** `style.css` lines **983-1007**
- **Controls-row:** `style.css` lines **1036-1044**
- **Buttons:** `style.css` lines **1075-1096**
- **HDRI Buttons:** `style.css` lines **1098-1109**
- **Visibility Rules (NUCLEAR):** `style.css` lines **1016-1034**

### Mobile Landscape Fullscreen
- **Container:** `style.css` lines **3291-3314**
- **Controls-row:** `style.css` lines **3317-3331**
- **Buttons:** `style.css` lines **3334-3363**
- **Animation Select:** `style.css` lines **3366-3373**

### Shading Overlay
- **Base:** `style.css` lines **3091-3174**
- **Desktop Fullscreen:** `style.css` lines **3253-3263**
- **Mobile Portrait FS:** `style.css` lines **3268-3281**
- **Mobile Landscape FS:** `style.css` lines **3384-3403**

### Virtual Joystick
- **Portrait FS:** `style.css` lines **4900-4918**
- **Landscape FS:** `style.css` lines **4925-4964**

---

## Button Count

**Total: 17 buttons across 4 rows**
- Row 1: 4 buttons (1 select + 3 buttons)
- Row 2: 4 buttons
- Row 3: 4 buttons
- Row 4: 5 buttons

---

## Critical CSS Rules (DO NOT MODIFY)

### Desktop
```css
/* Line 1004-1006: Container height MUST be 60px */
height: 60px !important;
max-height: 60px !important;
overflow: hidden !important;

/* Line 1039: MUST be nowrap for single row */
flex-wrap: nowrap !important;

/* Line 1091: MUST be flex: 1 1 0 for equal distribution */
flex: 1 1 0 !important;
```

### Mobile Landscape Fullscreen
```css
/* Line 3298-3300: MUST be grid for 2-row layout */
display: grid !important;
grid-template-columns: 1fr 1fr !important;
grid-auto-flow: row !important;

/* Line 3343-3345: MUST have these for buttons to shrink */
flex: 1 1 0 !important;
min-width: 0 !important;
width: 0 !important;
```

---

## Media Query Breakpoints

```css
/* Desktop */
@media (min-width: 769px)

/* Mobile */
@media (max-width: 768px)

/* Mobile Portrait */
@media (max-width: 768px) and (orientation: portrait)

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape)

/* Small Mobile */
@media (max-width: 480px)

/* iPhone SE Landscape */
@media (max-width: 667px) and (orientation: landscape)
```

---

## Z-Index Hierarchy

- Controls: `z-index: 999` (desktop), `z-index: 10000` (mobile fullscreen)
- Virtual Joystick: `z-index: 10005`
- Shading Overlay: `z-index: 10060` (base), `z-index: 10090` (mobile fullscreen)
- SSR Master Control Panel: `z-index: 10050`

---

## Button IDs

### Row 1
- `#animation-select` (flex: 1.5)
- `#play-stop-toggle`
- `#auto-rotate`
- `#fit-camera`

### Row 2
- `#material-color-red`
- `#material-color-blue`
- `#material-color-green`
- `#material-reset`

### Row 3
- `#transform-toggle`
- `#transform-move`
- `#transform-rotate`
- `#transform-scale`

### Row 4
- `#hdri-toggle` (width: 70px on desktop)
- `#hdri-cycle` (width: 70px on desktop)
- `#lighting-cycle` (width: 70px on desktop)
- `#ground-plane-toggle`
- `#lighting-direction`

---

## Common Issues & Fixes

### Desktop buttons showing gaps
**Cause:** Changed `flex: 1 1 0` or `flex-wrap: nowrap`  
**Fix:** Restore `flex: 1 1 0` and `flex-wrap: nowrap` (lines 1091, 1039)

### Desktop buttons missing
**Cause:** Removed visibility rules (lines 1016-1034) or changed height (lines 1004-1006)  
**Fix:** Restore visibility rules and `height: 60px`

### Mobile landscape showing 4 rows instead of 2
**Cause:** Changed grid to flex or removed grid rules (lines 3298-3300)  
**Fix:** Restore `display: grid` with `grid-template-columns: 1fr 1fr`

### Shading overlay not visible
**Cause:** Missing `.model-view` class or visibility rules  
**Fix:** Check JavaScript sets `.model-view` class and visibility rules (lines 3112-3118)

### Virtual joystick showing in image/video galleries
**Cause:** Missing `:has()` selectors  
**Fix:** Add `:has(#image-gallery.active)` and `:has(#video-gallery.active)` selectors (lines 4853-4859)

---

## Before Making Changes Checklist

1. ✅ Read `MODEL_VIEWER_COMPLETE_REFERENCE.md`
2. ✅ Identify exact line numbers to modify
3. ✅ Check if change affects desktop OR mobile (or both)
4. ✅ Test desktop layout (all 17 buttons visible, no gaps)
5. ✅ Test mobile portrait fullscreen (2-row layout)
6. ✅ Test mobile landscape fullscreen (2-row grid layout)
7. ✅ Test iPhone SE (667x375 landscape) if changing mobile rules
8. ✅ Verify shading overlay positioning
9. ✅ Verify virtual joystick visibility

---

## Testing Checklist

- [ ] Desktop: 17 buttons visible, single row, NO GAPS
- [ ] Desktop: Animation select 50% wider
- [ ] Desktop: HDRI buttons 70px wide
- [ ] Desktop fullscreen: Same as desktop windowed
- [ ] Mobile portrait fullscreen: 2-row layout
- [ ] Mobile landscape fullscreen: 2-row grid layout (NOT 4 rows)
- [ ] Mobile landscape fullscreen: Buttons fill space with NO GAPS (iPhone SE test)
- [ ] Shading overlay: Visible in model view only
- [ ] Shading overlay: Positioned correctly above controls
- [ ] Virtual joystick: Visible only in model view
- [ ] Virtual joystick: Positioned correctly in fullscreen

---

**For complete details, see [MODEL_VIEWER_COMPLETE_REFERENCE.md](./MODEL_VIEWER_COMPLETE_REFERENCE.md)**
