/* ============================================
   HOTDOG OR NOT HOTDOG - Standalone Styles
   ============================================ */

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #888;
    --accent: #00cc44;
    --accent-hover: #00ff55;
    --white: #ffffff;
    --black: #000000;
    --gray: #333;
    --orange: #FF851B;
    --red: #FF4444;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Borders */
    --border: 2px solid var(--gray);
    --border-light: 1px solid var(--gray);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
}

/* --- Layout --- */
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--accent);
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 500;
    flex: 1;
}

/* --- Game Area --- */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    flex: 1;
}

/* --- Result Area --- */
.result-area {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.result-area.show {
    visibility: visible;
    opacity: 1;
}

.result-area p {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.result-area .analyzing {
    color: var(--orange);
}

/* --- Canvas --- */
#drawingCanvas {
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 5/4;
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius-md);
    cursor: crosshair;
    touch-action: none;
}

/* --- Controls --- */
.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Tool & Width Selection */
.tool-selection,
.width-selection {
    display: flex;
    gap: var(--space-2);
    background: var(--bg-card);
    padding: var(--space-2);
    border: var(--border-light);
    border-radius: var(--radius-sm);
}

.tool-button,
.width-button {
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: var(--border-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
    transition: all var(--transition-fast);
}

.tool-button:hover,
.width-button:hover {
    background: var(--gray);
}

.tool-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tool-button.active-tool,
.width-button.active-tool {
    background: var(--accent);
    color: var(--black);
    border-color: var(--accent);
}

.width-preview {
    background: currentColor;
    border-radius: 50%;
}

/* Color Palette */
.color-palette {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
}

.color-box {
    width: 32px;
    height: 32px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.color-box:hover {
    transform: scale(1.1);
}

.color-box.active {
    transform: scale(1.2);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

/* White color box needs visible border */
.color-box[data-color="#FFFFFF"] {
    border-color: var(--text-muted);
}

/* Analyze Button */
.analyze-button {
    padding: var(--space-3) var(--space-5);
    background: var(--accent);
    color: var(--black);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.analyze-button:hover {
    background: var(--accent-hover);
}

.analyze-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: var(--space-5);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1rem;
    }

    .controls-row {
        justify-content: center;
    }

    /* Touch targets: minimum 44px for accessibility */
    .tool-button,
    .width-button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .color-box {
        width: 40px;
        height: 40px;
    }

    .analyze-button {
        width: 100%;
        min-height: 44px;
        margin-top: var(--space-2);
    }
}
