* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #faf7f2;
    --surface: #ffffff;
    --border: #e8e4dc;
    --text: #1f2937;
    --text-muted: #6b7280;
    --accent: #d97757;
    --accent-hover: #c25f3f;
    --accent-soft: #fdf2ec;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 560px;
    width: 100%;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.dog-frame {
    position: relative;
    width: 100%;
    min-height: 260px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

#dog-image {
    max-width: 100%;
    max-height: 45vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: block;
}

#dog-image.loaded {
    opacity: 1;
}

.loader {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.loader.active {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, transform 0.05s ease;
}

button:hover:not(:disabled) {
    background: var(--accent-hover);
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

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

.dog-count {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

#dog-count {
    color: var(--text);
    font-weight: 600;
}

@media (max-width: 480px) {
    .container { padding: 24px; }
}

footer {
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

footer a {
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}

footer a:hover {
    color: var(--text);
    text-decoration-color: var(--text-muted);
}
