/* ========================================
   PAINTER ACTIVITY STYLES
   ======================================== */

/* Page header with paint splashes */
.painter-page-header {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    padding: 40px 0 30px;
    text-align: center;
    color: #1e293b;
    margin-bottom: 2rem;
    border-bottom: 3px solid #e2e8f0;
}

.painter-page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.painter-page-header p {
    color: #475569;
    font-size: 1rem;
}

.painter-page-header .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.painter-page-header .back-link {
    display: inline-block;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.painter-page-header .back-link:hover {
    color: #1e293b;
}

.painter-page-header .set-for-class-btn {
    background: rgba(30, 41, 59, 0.08);
    color: #475569;
    border-color: #cbd5e1;
}

.painter-page-header .set-for-class-btn:hover {
    background: rgba(30, 41, 59, 0.15);
    border-color: #94a3b8;
}

/* Paint splash blobs */
.painter-header-splashes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.painter-header-splashes .splash {
    position: absolute;
}

/* Big yellow splat — top-left, dripping down */
.painter-header-splashes .s1 {
    width: 140px; height: 110px;
    background: radial-gradient(ellipse at 35% 40%, #fbbf24 0%, #f59e0b 70%, #d97706 100%);
    top: -25px; left: 5%;
    border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
    transform: rotate(-12deg);
    opacity: 0.85;
    box-shadow: 12px 30px 0 -8px #f59e0b, 4px 52px 0 -12px #fbbf24;
}

/* Bright red splat — bottom-left, organic shape */
.painter-header-splashes .s2 {
    width: 100px; height: 85px;
    background: radial-gradient(ellipse at 45% 40%, #f87171 0%, #ef4444 60%, #dc2626 100%);
    bottom: -18px; left: 22%;
    border-radius: 55% 45% 62% 38% / 48% 58% 42% 52%;
    transform: rotate(8deg);
    opacity: 0.8;
    box-shadow: -8px 18px 0 -6px #ef4444;
}

/* Green splat — top-right, tall drip */
.painter-header-splashes .s3 {
    width: 110px; height: 120px;
    background: radial-gradient(ellipse at 50% 35%, #34d399 0%, #10b981 65%, #059669 100%);
    top: -30px; right: 8%;
    border-radius: 44% 56% 38% 62% / 55% 42% 58% 45%;
    transform: rotate(15deg);
    opacity: 0.85;
    box-shadow: -6px 35px 0 -10px #10b981, 8px 55px 0 -14px #34d399;
}

/* Blue splat — bottom-right */
.painter-header-splashes .s4 {
    width: 120px; height: 95px;
    background: radial-gradient(ellipse at 55% 45%, #60a5fa 0%, #3b82f6 65%, #2563eb 100%);
    bottom: -22px; right: 18%;
    border-radius: 58% 42% 52% 48% / 45% 55% 45% 55%;
    transform: rotate(-6deg);
    opacity: 0.8;
    box-shadow: 10px 20px 0 -8px #3b82f6;
}

/* Purple splat — top-center, smaller */
.painter-header-splashes .s5 {
    width: 75px; height: 65px;
    background: radial-gradient(ellipse at 45% 40%, #c084fc 0%, #a855f7 65%, #7c3aed 100%);
    top: 2px; left: 40%;
    border-radius: 52% 48% 58% 42% / 46% 54% 46% 54%;
    transform: rotate(-22deg);
    opacity: 0.75;
    box-shadow: 5px 20px 0 -8px #a855f7;
}

/* Orange splat — middle-left, small drip */
.painter-header-splashes .s6 {
    width: 65px; height: 55px;
    background: radial-gradient(ellipse at 50% 40%, #fb923c 0%, #f97316 65%, #ea580c 100%);
    top: 40%; left: 2%;
    border-radius: 48% 52% 44% 56% / 56% 44% 56% 44%;
    transform: rotate(18deg);
    opacity: 0.8;
    box-shadow: 4px 16px 0 -6px #f97316;
}

/* Pink splat — center-right */
.painter-header-splashes .s7 {
    width: 80px; height: 70px;
    background: radial-gradient(ellipse at 45% 45%, #f472b6 0%, #ec4899 65%, #db2777 100%);
    top: 35%; right: 3%;
    border-radius: 56% 44% 50% 50% / 42% 58% 42% 58%;
    transform: rotate(-10deg);
    opacity: 0.75;
    box-shadow: -5px 18px 0 -7px #ec4899;
}

/* Teal splat — bottom-center, small accent */
.painter-header-splashes .s8 {
    width: 55px; height: 50px;
    background: radial-gradient(ellipse at 50% 50%, #2dd4bf 0%, #14b8a6 65%, #0d9488 100%);
    bottom: -8px; left: 52%;
    border-radius: 50% 50% 42% 58% / 58% 42% 58% 42%;
    transform: rotate(25deg);
    opacity: 0.8;
    box-shadow: 3px 14px 0 -6px #14b8a6;
}

@media (max-width: 768px) {
    .painter-header-splashes .splash {
        transform: scale(0.6) !important;
    }
    .painter-page-header h1 {
        font-size: 1.8rem;
    }
}

/* Fade transitions */
.painter-fade-out { opacity: 0; transition: opacity 0.2s ease; }
.painter-fade-in { animation: painterFadeIn 0.3s ease forwards; }
@keyframes painterFadeIn { from { opacity: 0; } to { opacity: 1; } }

.painter-activity {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

/* ---- Intro Scene ---- */
.painter-intro-scene {
    padding: 0 !important;
}
.painter-intro-house-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}
.painter-intro-house {
    width: 100%;
    display: block;
}
.painter-intro-speech {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    z-index: 2;
    pointer-events: none;
}
.painter-speech-bubble {
    background: white;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    font-size: 1.25rem;
    line-height: 1.5;
    animation: painter-bubble-in 0.3s ease;
    border: 3px solid #2d2d2d;
}
.painter-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 16px solid #2d2d2d;
}
.painter-speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid white;
    z-index: 1;
}
@keyframes painter-bubble-in {
    0%   { opacity: 0; transform: scale(0.85) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.painter-typewriter-cursor {
    display: inline;
    font-weight: 400;
    color: #999;
    animation: painter-cursor-blink 0.7s step-end infinite;
}
@keyframes painter-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.painter-intro-advance {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
    animation: painter-pulse-hint 2s ease-in-out infinite;
}
@keyframes painter-pulse-hint {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ---- Room Select with House Background ---- */
.painter-room-select-scene {
    padding: 0 !important;
    border-radius: 16px;
    overflow: hidden;
}
.painter-room-bg {
    width: 100%;
    display: block;
    filter: brightness(0.2);
}
.painter-room-select-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.painter-select-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.painter-select-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
    color: white;
}
.painter-select-header p {
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.painter-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
}

.painter-room-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
}
.painter-room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}
.painter-room-card.locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
    pointer-events: auto;
}
.painter-room-card.locked:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-color: transparent;
}
.painter-room-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    filter: grayscale(1) brightness(0.4);
}
.painter-room-card.complete {
    cursor: pointer;
    border-color: #10b981;
}
.painter-room-card.complete:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.painter-room-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.painter-room-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.painter-room-check {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.painter-room-info {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.painter-room-info h3 {
    margin: 0;
    font-size: 1.05rem;
}
.painter-room-colour {
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.painter-all-done-prompt {
    text-align: center;
    margin-top: 2rem;
}
.painter-finish-btn {
    padding: 0.75rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.painter-finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* ---- Wall View ---- */
.painter-wall-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.painter-back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0;
    white-space: nowrap;
}
.painter-back-btn:hover { text-decoration: underline; }
.painter-wall-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.painter-wall-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.painter-wall-nav {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #334155;
}
.painter-wall-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.painter-wall-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.painter-wall-scene {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    background: #1a1a2e;
}
.painter-wall-image {
    display: block;
    width: 100%;
    height: auto;
}
.painter-measurement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---- Measurement: Hidden hint lines ---- */
.painter-measure.hidden {
    cursor: pointer;
    pointer-events: all;
}
.painter-measure-hint {
    stroke: rgba(255, 255, 255, 0.15);
    stroke-dasharray: 12 6;
    fill: none;
    transition: stroke 0.2s, opacity 0.2s;
}
.painter-measure-hint-hover {
    stroke: rgba(255, 200, 50, 0);
    fill: none;
    stroke-linecap: round;
    transition: stroke 0.25s, filter 0.25s;
    pointer-events: none;
}
.painter-measure-hitbox {
    fill: transparent;
    cursor: pointer;
    pointer-events: all;
}

/* Hover: bright yellow pulsing line with glow */
.painter-measure.hidden:hover .painter-measure-hint {
    stroke: rgba(255, 220, 80, 0.9);
    stroke-dasharray: none;
    animation: painterHintPulse 0.8s ease-in-out infinite;
}
.painter-measure.hidden:hover .painter-measure-hint-hover {
    stroke: rgba(255, 200, 50, 0.35);
    filter: blur(6px);
}
@keyframes painterHintPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ---- Measurement: Animated reveal (new measurement only) ---- */
.painter-measure-line {
    stroke: #1a1a1a;
    stroke-linecap: round;
    fill: none;
    animation: painterMeasureGrow 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.painter-measure-glow {
    stroke: rgba(0, 0, 0, 0.35);
    stroke-linecap: round;
    fill: none;
    filter: blur(6px);
    animation: painterMeasureGrow 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes painterMeasureGrow {
    to { stroke-dashoffset: 0; }
}
.painter-measure-arrows polygon {
    fill: #1a1a1a;
    stroke: none;
    opacity: 0;
    animation: painterArrowPop 0.3s ease 0.6s forwards;
}
@keyframes painterArrowPop {
    0% { opacity: 0; transform: scale(0.3); }
    70% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
.painter-measure-label-bg {
    fill: rgba(20, 20, 30, 0.88);
    stroke: #1a1a1a;
    stroke-width: 2;
    opacity: 0;
    animation: painterLabelFade 0.4s ease 0.5s forwards;
}
.painter-measure-label {
    fill: white;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    opacity: 0;
    animation: painterLabelFade 0.4s ease 0.55s forwards;
}
@keyframes painterLabelFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ---- Measurement: Static (already revealed, no re-animation) ---- */
.painter-measure-line-static {
    stroke: #1a1a1a;
    stroke-linecap: round;
    fill: none;
}
.painter-measure-glow-static {
    stroke: rgba(0, 0, 0, 0.25);
    stroke-linecap: round;
    fill: none;
    filter: blur(6px);
}
.painter-measure-arrows-static polygon {
    fill: #1a1a1a;
    stroke: none;
}
.painter-measure-label-bg-static {
    fill: rgba(20, 20, 30, 0.88);
    stroke: #1a1a1a;
    stroke-width: 2;
}
.painter-measure-label-static {
    fill: white;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

/* ---- Measurement: Close (x) button ---- */
.painter-measure.revealed {
    pointer-events: all;
}
.painter-measure-close {
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.2s;
}
.painter-measure.revealed:hover .painter-measure-close,
.painter-measure-close:hover {
    opacity: 1;
}
.painter-measure-close circle {
    fill: rgba(40, 40, 50, 0.85);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1.5;
    transition: fill 0.15s, stroke 0.15s;
}
.painter-measure-close:hover circle {
    fill: #e63946;
    stroke: white;
}
.painter-measure-close text {
    fill: rgba(255, 255, 255, 0.8);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    pointer-events: none;
}
.painter-measure-close:hover text {
    fill: white;
}
/* Animated reveal: show close button after label appears */
.painter-measure.animate .painter-measure-close {
    animation: painterLabelFade 0.3s ease 0.8s forwards;
}

/* ---- Boundary Glow (paintable area highlight) ---- */
.painter-boundary-glow {
    pointer-events: none;
    animation: painterBoundaryPulse 3s ease-in-out infinite;
}
.painter-boundary-glow-blur {
    pointer-events: none;
    animation: painterBoundaryPulse 3s ease-in-out infinite;
}
@keyframes painterBoundaryPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.painter-wall-area-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #10b981;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---- Wall Footer (Floor Plan + Input) ---- */
/* Area input overlay — positioned on the wall image */
.painter-area-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 6;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    pointer-events: auto;
}
.painter-area-overlay label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}
.painter-area-field {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.painter-area-field input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
    appearance: textfield;
}
.painter-area-field input::-webkit-outer-spin-button,
.painter-area-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.painter-area-field input:focus {
    border-color: var(--primary-color);
}
.painter-area-unit {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}
.painter-submit-btn {
    padding: 0.35rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.painter-submit-btn:hover {
    background: #5a67d8;
}

.painter-feedback {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}
.painter-feedback.success {
    background: #d1fae5;
    color: #065f46;
}
.painter-feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Done state — green tick */
.painter-area-overlay.done {
    background: rgba(16, 185, 129, 0.9);
    gap: 0.4rem;
}
.painter-area-done-tick {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}
.painter-area-done-val {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ---- Paint Calculation Overlay ---- */
.painter-calc-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.painter-calc-overlay.visible {
    opacity: 1;
}
.painter-calc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}
.painter-calc-card {
    position: relative;
    max-width: 420px;
    width: 90%;
    margin: 0 auto;
    padding: 0;
    transform: translateY(12px);
    transition: transform 0.35s ease;
}
.painter-calc-overlay.visible .painter-calc-card {
    transform: translateY(0);
}
.painter-card-inner {
    background: #fffdf7;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    padding: 2rem 1.75rem;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 4px #f5f0e3,
        0 0 0 5px #d4c9a8;
    position: relative;
}
.painter-card-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 6px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 27px,
        #e8e0cc 27px,
        #e8e0cc 28px
    );
    opacity: 0.3;
    pointer-events: none;
}
.painter-card-header {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #d4c9a8;
}
.painter-card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.painter-card-colour-dot {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.painter-card-section {
    position: relative;
    margin-bottom: 1.25rem;
}
.painter-card-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.painter-card-walls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.painter-card-wall-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}
.painter-card-wall-name {
    color: #475569;
    font-size: 0.95rem;
}
.painter-card-wall-area {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}
.painter-card-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-top: 2px dashed #cbd5e1;
    margin-top: 0.25rem;
}
.painter-card-total-input {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.painter-card-total-input input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    background: white;
    transition: border-color 0.2s;
}
.painter-card-total-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.painter-card-total-input input:disabled {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.painter-card-unit {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}
/* Inline check button */
.painter-card-check-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.painter-card-check-btn:hover {
    background: #2563eb;
}
/* Subtle tick for correct answers */
.painter-card-tick {
    color: #16a34a;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}
/* Remove number input spinners */
.painter-card-total-input input[type="number"]::-webkit-inner-spin-button,
.painter-card-total-input input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.painter-card-total-input input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.painter-card-section .painter-submit-btn {
    margin-top: 0.5rem;
}
.painter-card-section .painter-feedback {
    margin-top: 0.5rem;
}

/* Paint section (revealed after total area) */
.painter-card-paint-section {
    padding-top: 1.25rem;
    border-top: 2px solid #d4c9a8;
}
.painter-card-coverage-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1rem;
    color: #1e40af;
}
.painter-card-coverage-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.painter-card-paint-input-row {
    margin-bottom: 0.75rem;
}
.painter-card-paint-input-row label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: #334155;
}
.painter-card-paint-input-row .painter-card-total-input {
    margin-top: 0.3rem;
}

@media (max-width: 500px) {
    .painter-card-inner {
        padding: 1.25rem 1rem;
    }
}

/* ---- End Screen ---- */
.painter-end-screen {
    text-align: center;
    padding: 2rem 1rem;
}
.painter-end-screen h2 {
    margin: 0 0 1.5rem;
}
.painter-end-rooms {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.painter-end-room {
    text-align: center;
}
.painter-end-thumb {
    width: 140px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
}
.painter-end-room-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

/* ---- Paint Wipe Animation ---- */
.painter-painted-reveal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(0 100% 0 0);
    z-index: 5;
}
.painter-painted-reveal.painting {
    animation: paintWipe 2s ease-in-out forwards;
}
@keyframes paintWipe {
    0%   { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

/* ---- Painted Room Gallery ---- */
.painter-painted-gallery {
    position: relative;
    max-width: 700px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    background: #f0f0f0;
}
.painter-painted-wall {
    display: none;
}
.painter-painted-wall.active {
    display: block;
}
.painter-painted-wall img {
    width: 100%;
    display: block;
}
.painter-painted-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
}
.painter-painted-tabs {
    display: flex;
    gap: 0.5rem;
}
.painter-painted-tab {
    padding: 0.4rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.painter-painted-tab:hover {
    border-color: #10b981;
    background: #f0fdf4;
}
.painter-painted-tab.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}
.painter-painted-summary {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #555;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}
.painter-painted-summary strong {
    color: #333;
}

/* ---- Pete's Wall Dialogue ---- */
.painter-pete-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: painter-bubble-in 0.4s ease;
    pointer-events: none;
}
.painter-pete-bar.narrow {
    right: auto;
    max-width: 55%;
}
.painter-pete-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid #2d2d2d;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
}
.painter-pete-speech {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.45;
    min-height: 50px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.painter-pete-speech::after,
.painter-pete-speech::before {
    /* Move tail to left side pointing at Pete's avatar */
    bottom: auto;
    top: 14px;
    left: -16px;
    right: auto;
    transform: none;
    border-left: none;
    border-right: 16px solid #2d2d2d;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}
.painter-pete-speech::before {
    left: -12px;
    border-right-color: white;
    border-top-width: 8px;
    border-bottom-width: 8px;
    top: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .painter-room-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
    }
    .painter-area-overlay {
        bottom: 8px;
        right: 8px;
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
    }
    .painter-area-overlay label {
        font-size: 0.8rem;
    }
    .painter-area-field input {
        width: 64px;
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
    }
    .painter-wall-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .painter-painted-summary {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
    .painter-speech-bubble {
        font-size: 0.85rem;
        padding: 0.7rem 0.9rem;
        border-width: 2px;
    }
    .painter-intro-advance {
        font-size: 0.75rem;
        padding: 0.3rem 0.9rem;
    }
    .painter-room-select-content {
        padding: 1.25rem 1rem;
    }
    .painter-select-header h2 {
        font-size: 1.2rem;
    }
    .painter-pete-avatar {
        width: 80px;
        height: 80px;
    }
    .painter-pete-speech {
        font-size: 0.88rem;
        min-height: 36px;
        padding: 0.45rem 0.65rem;
    }
    .painter-pete-speech::after {
        top: 16px;
    }
    .painter-pete-speech::before {
        top: 18px;
    }
}

