

/* ========== GLOBAL RESET ========== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: 100vw;
}

/* ========== VISUALLY HIDDEN (but still tappable via JS) ========== */
/* iOS Safari often won't open a color/file picker for an input that's
   display:none - it needs to still be "rendered" even if invisible. */
.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: normal;
    max-width: 86%;
    text-align: center;
    border: 0;
}

/* ========== IPHONE-SIZED FRAME ========== */
/* Keeps every page's content constrained to a phone-width column
   (matches .container below), instead of stretching edge-to-edge
   on wider screens. On an actual iPhone this is a no-op since the
   viewport is already this width. */
.phone-frame {
    position: relative;
    width: 100%;
    max-width: 428px;
    min-height: 100vh;
    margin: 0 auto;
    overflow-x: hidden;
}


/* ========== PAGE: HOME (index.html) ========== */

body.page-home {
    /* Locked in place - no scrolling or rubber-band bounce on the home
       screen. Everything (logo, snake, buttons, nav) fits one screen. */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #3FDCD3; /* flat teal - the snake is drawn live on top */
    z-index: -10;
    overflow: hidden;
}

.bg-snake {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.logo-animation-overlay {
    position: absolute !important;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    height: 250px;
    pointer-events: none;
    animation: floatLogo 4s ease-in-out infinite;
}

/* Slow, happy wiggle: gentle rocking side to side while it floats */
@keyframes floatLogo {
    0%, 100% {
        transform: translateX(-50%) translateY(0px) rotate(-2.5deg);
    }
    25% {
        transform: translateX(-50%) translateY(-6px) rotate(0deg);
    }
    50% {
        transform: translateX(-50%) translateY(-10px) rotate(2.5deg);
    }
    75% {
        transform: translateX(-50%) translateY(-5px) rotate(0deg);
    }
}

.logo-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.center-button-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.main-button {
    display: none;
    padding: 18px 50px;
    font-size: 24px;
    font-weight: bold;
    color: #00CED1;
    background: linear-gradient(145deg, #FFD700, #FFC700);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 8px 15px rgba(255, 215, 0, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.main-button:active {
    transform: translateY(2px);
    box-shadow:
        0 4px 8px rgba(255, 215, 0, 0.3),
        0 2px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.main-button.visible {
    display: block;
}

.build-tag {
    position: fixed;
    bottom: 64px;
    right: 10px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    z-index: 50;
    pointer-events: none;
}

.social-icons {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 9999;
}

.social-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.social-icon:active {
    transform: scale(0.95);
}

.social-icon img,
.social-icon svg {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


/* ========== PAGE: SIGN UP (signup.html) ========== */

body.page-signup {
    overflow-x: hidden;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

body.page-signup .background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/backgroundswiggle.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.signup-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.signup-title {
    color: white;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.form-group input {
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #FFD700;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.form-group input::placeholder {
    color: #999;
}

.play-button {
    margin-top: 10px;
    padding: 18px 50px;
    font-size: 24px;
    font-weight: bold;
    color: #00CED1;
    background: linear-gradient(145deg, #FFD700, #FFC700);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 8px 15px rgba(255, 215, 0, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.play-button:active {
    transform: translateY(2px);
    box-shadow:
        0 4px 8px rgba(255, 215, 0, 0.3),
        0 2px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.page-signup .social-icons {
    position: fixed;
    bottom: 40px;
}

@media (max-height: 700px) {
    .signup-container {
        padding: 20px;
    }

    .signup-title {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .form-group {
        gap: 6px;
    }

    .signup-form {
        gap: 15px;
    }
}


/* ========== PAGE: MAKE A SWIGGLE (make-swiggle.html) ========== */

.swiggle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/backgroundswiggle.png');
    background-size: cover;
    background-position: center;
    z-index: -10;
}

.make-logo-container {
    text-align: center;
    padding-top: 20px;
}
.make-logo {
    width: 200px;
    height: auto;
}

.swiggle-tagline {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 2px 0 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.canvas-wrapper {
    width: 90%;
    margin: 5px auto 0 auto;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.18);
}

#drawCanvas {
    width: 100%;
    height: 320px;
    display: block;
    touch-action: none; /* the page must never scroll mid-swiggle */
}

.toolbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    width: 92%;
    margin: 8px auto 0;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    flex-wrap: nowrap;
}

.left-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.clear-btn {
    font-weight: 700;
    font-size: 13px;
    padding: 7px 13px;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(180deg, #ff6bbd 0%, #ff4fae 100%);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(255, 79, 174, 0.35);
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}

.clear-btn:active {
    transform: scale(0.94);
}

.divider {
    width: 2px;
    height: 40px;
    background: rgba(0,0,0,0.15);
    border-radius: 50px;
}

.tool-icon {
    width: 46px;
    height: 46px;
    object-fit: contain;
    cursor: pointer;
    border-radius: 12px;
    padding: 3px;
    transition: transform 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.tool-icon:active {
    transform: scale(0.92);
}

#colorPicker,
#colorPickerArt {
    width: 42px !important;
    height: 42px !important;
    padding: 0;
}

/* The real color input sits invisibly on top of the wheel so a tap
   opens iOS's native color picker (programmatic .click() is unreliable) */
.color-picker-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.color-picker-wrap input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: none;
    padding: 0;
    cursor: pointer;
}

.draw-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.size-popup {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 18px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.size-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.size-popup input[type="range"] {
    width: 250px;
}

/* ---- Slick gold slider (both pages) ---- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #00CED1, #4DD0E1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FFE66E 0%, #FFC700 100%);
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.tool-icon.active-tool {
    background: rgba(0, 206, 209, 0.15);
    filter: drop-shadow(0 0 6px rgba(0, 206, 209, 0.8));
    transform: translateY(-3px);
}

.send-btn {
    position: relative;
    width: 70%;
    margin: 8px auto 10px;
    padding: 14px 0;
    display: block;
    text-align: center;

    transform: scale(0.88);
    transform-origin: center;

    background: linear-gradient(
        to bottom,
        #FFE66E 0%,
        #FFD43B 60%,
        #F4B000 100%
    );

    border: none;
    border-radius: 45px;

    font-size: 26px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 3px rgba(0,0,0,0.15);

    box-shadow:
        0 8px 0px #D19A00,
        0 14px 22px rgba(0,0,0,0.18);

    cursor: pointer;
    transition: transform 0.1s ease;
}

.send-btn::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 12px;
    width: 45%;
    height: 38%;
    background: rgba(255,255,255,0.35);
    border-radius: 80px;
    filter: blur(10px);
    pointer-events: none;
}

.send-btn:active {
    transform: translateY(3px);
    box-shadow:
        0 5px 0px #B58400,
        0 10px 18px rgba(0,0,0,0.2);
}


/* ========== PAGE: LIBRARY (library.html) ========== */

body.page-library {
    background-image: url("assets/backgroundswiggle.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 428px;
  margin: 0 auto;
  padding-bottom: 40px;
  background: transparent;
}

.logo-static-overlay {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 80%;
  z-index: 10;
  pointer-events: none;
}

.logo-static-overlay .logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.main-content {
  padding: 180px 20px 20px;
}

.library-section {
    margin-bottom: 35px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    padding-left: 5px;
}

.card-container {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.turn-into-art-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #FFD700;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pulse-glow 2s ease-in-out infinite;
    flex: 0 0 auto;
    width: 200px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 20px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

.turn-into-art-card:active {
    transform: scale(0.98);
}

.turn-into-art-card::before {
    content: 'NEW';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FFD700;
    color: #333;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.card-image-container {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 15px;
    background: #fff;
}

.card-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.your-swiggle-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0.85;
    position: relative;
    flex: 0 0 auto;
    width: 200px;
}

.your-swiggle-card .card-image-container {
    filter: grayscale(20%);
    opacity: 0.9;
}

.your-swiggle-card .card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.status-icon {
    width: 16px;
    height: 16px;
}

.completed-pair-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
    width: 200px;
}

.pair-stack {
    display: flex;
    flex-direction: column;
}

.pair-image-container {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pair-image-container.swiggle {
    border-bottom: none;
}

.pair-image-container.art {
    border-top: none;
}

.pair-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pair-divider {
    height: 2px;
    background: linear-gradient(90deg, #00BCD4 0%, #4DD0E1 50%, #00BCD4 100%);
    position: relative;
}

.pair-divider::after {
    content: '⬇';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #00BCD4;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pair-info {
    padding: 12px 15px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pair-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.finished-badge {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.timestamp {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 16px;
    font-weight: 500;
}

html {
    scroll-behavior: smooth;
}

@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}


/* ========== PAGE: TURN INTO ART (turn-into-art.html) ========== */

body.page-turn-art {
    background-image: url("assets/backgroundswiggle.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;

    /* Explicit height (not just min-height) - Safari computes flex:1
       children as 0px tall against min-height alone, which made the
       whole canvas invisible and untouchable. */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.load-swiggle-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    background: linear-gradient(180deg, #00CED1 0%, #00c0c3 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.load-swiggle-btn {
    background: white;
    color: #00CED1;
    border: none;
    border-radius: 20px;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease;
}

.load-swiggle-btn.secondary {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.load-swiggle-btn.move-active {
    background: linear-gradient(180deg, #FFE66E 0%, #FFC700 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.load-swiggle-btn:active {
    transform: scale(0.97);
}

#drawCanvasArt.moving {
    cursor: grab;
}

.swiggle-toast {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #fff;
    color: #00b3b6;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: auto; /* tappable & flickable to dismiss */
    cursor: pointer;
    touch-action: none; /* the pill owns its touches - flicks don't scroll the page */
    white-space: normal;
    max-width: 86%;
    text-align: center;
}

.swiggle-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.canvas-wrapper.turn-art-canvas {
    flex: 1;
    min-height: 200px; /* never collapse, no matter the browser */
    width: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#swiggleCanvas,
#drawCanvasArt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#swiggleCanvas {
    z-index: 1;
}

#drawCanvasArt {
    z-index: 2;
}

.bottom-bar {
    width: 100%;
    background: #00CED1;
    padding: 5px 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.art-toolbox {
    background: white;
    width: 90%;
    padding: 8px 16px;
    border-radius: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Slightly smaller icons here so everything (plus Clear) fits one row */
.art-toolbox .tool-icon {
    width: 50px;
    height: 50px;
}

.art-toolbox #colorPickerArt {
    width: 44px !important;
    height: 44px !important;
}

.art-toolbox .clear-btn {
    font-size: 13px;
    padding: 7px 13px;
}

.clear-art-btn {
    background: #FF5757;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ========== PRO ART PACK ========== */

.pro-toggle-btn {
    background: linear-gradient(135deg, #FFD54F, #FF8A65);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 7px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    margin-bottom: -8px; /* sit snug above the tray/toolbox */
}

.pro-toggle-btn:active {
    transform: scale(0.95);
}

.pro-toolbox {
    display: none;
    padding: 8px 10px; /* slimmer than the main toolbox so all 8 fit */
}

.pro-toolbox.visible {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.pro-toolbox .emoji-tool {
    width: 34px;
    height: 34px;
    font-size: 21px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
}

.pro-toolbox .emoji-tool.active-tool {
    background: #E0F7F5;
    box-shadow: 0 0 0 2px #3FDCD3 inset;
}

.pro-toolbox .emoji-tool svg {
    vertical-align: middle;
}

/* Stamp emoji chooser - floats above the brush-size slider */
.stamp-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 250px;
    bottom: 215px;
}

.stamp-choice {
    font-size: 23px;
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.stamp-choice.selected {
    background: #E0F7F5;
    box-shadow: 0 0 0 2px #3FDCD3 inset;
}

.brush-size-popup {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9999;
}

.brush-size-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.button-container {
    text-align: center;
    padding: 2px 10px 8px 10px;
    background: linear-gradient(180deg, #00CED1 0%, #20B2AA 100%);
}

.send-back-btn {
    margin-top: -8px;
    display: block;
    background: linear-gradient(180deg, #FFD700 0%, #FFC700 100%);
    color: white;
    text-decoration: none;
    padding: 12px 55px;
    border-radius: 50px;
    font-size: 28px;
    font-weight: bold;
    border: none;

    transform: scale(0.85);
    transform-origin: center;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.send-back-btn:active {
    transform: scale(0.98);
}


/* ========== SHARED: BOTTOM NAVIGATION ========== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  /* Deep teal that belongs to the same family as the background -
     the bar now feels like part of the game, not a browser leftover */
  background: linear-gradient(180deg, #17b3aa, #0e9c94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  z-index: 9999;
}

.nav-item {
  font-size: 16px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.nav-item.active {
  color: #FFE066; /* Swiggle yellow for the page you're on */
}

.badge {
  background: #ff4fae;
  color: white;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 12px;
  margin-left: 4px;
  display: inline-block;
}

.badge.hidden {
  display: none;
}

/* ========== SIGN IN / SIGN UP SWITCH LINKS ========== */

.auth-switch {
    text-align: center;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-switch a,
.auth-switch span {
    color: #FFD700;
    font-weight: 700;
    text-decoration: underline;
}

.home-signin {
    display: block;
    text-decoration: none;
}

/* ========== UNDO BUTTON (teal cousin of Clear) ========== */

.undo-btn {
    background: linear-gradient(180deg, #2fd4d7 0%, #00b3b6 100%);
    box-shadow: 0 3px 8px rgba(0, 179, 182, 0.35);
}

/* Slightly tighter art toolbox so Undo + Clear both fit on one row */
.art-toolbox .tool-icon {
    width: 42px;
    height: 42px;
    padding: 2px;
}

.art-toolbox #colorPickerArt {
    width: 38px !important;
    height: 38px !important;
}

.art-toolbox .clear-btn {
    font-size: 12px;
    padding: 6px 10px;
}

/* ========== LIBRARY: DELETE + IMPORT ========== */

.turn-into-art-card,
.your-swiggle-card,
.completed-pair-card {
    position: relative;
}

.card-delete-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-delete-btn:active {
    transform: scale(0.9);
}

.import-art-btn {
    display: block;
    margin: 14px auto 0;
    padding: 10px 22px;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.import-art-btn:active {
    transform: scale(0.97);
}

/* ========== PINCH-ZOOM VIEW (turn-into-art) ========== */

.canvas-wrapper.turn-art-canvas {
    overflow: hidden; /* zoomed canvas stays inside its window */
}

.zoom-layer {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
}

.zoom-reset-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    display: none;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.zoom-reset-btn.visible {
    display: block;
}

.zoom-reset-btn:active {
    transform: scale(0.94);
}
