@import url(https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap);

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: #fff0;
    touch-action: manipulation
}

body {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    overflow: hidden;
    background: #1a1a1a;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    touch-action: none;
    height: 100vh
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
    touch-action: none
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: rgb(30 30 30 / .95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgb(0 0 0 / .3);
    max-width: 280px;
    color: #fff;
    border: 1px solid rgb(255 255 255 / .1);
    transition: transform 0.3s ease
}

#ui.collapsed {
    transform: translateX(-186px)
}

#toggleUI {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    background: #2a2a2a;
    border: 1px solid rgb(255 255 255 / .1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 101
}

h1 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 20px
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 12px
}

button {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid rgb(255 255 255 / .1);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation
}

button:hover {
    background: #3a3a3a
}

select {
    padding: 8px;
    border: 1px solid rgb(255 255 255 / .1);
    border-radius: 6px;
    font-size: 14px;
    background: #2a2a2a;
    color: #fff;
    width: 100%;
    touch-action: manipulation
}

#message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(30 30 30 / .95);
    color: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    border: 1px solid rgb(255 255 255 / .1);
    pointer-events: none
}

#message.show {
    opacity: 1
}

#preview {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background: rgb(0 0 0 / .7);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / .1);
    z-index: 100
}

#preview img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

canvas {
    display: block;
    outline: none;
    touch-action: none
}

#hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgb(30 30 30 / .9);
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    max-width: 280px;
    border: 1px solid rgb(255 255 255 / .1)
}

@media (max-width:600px) {
    #hint {
        max-width: 90%
    }
}

.mode-selector {
    display: flex;
    gap: 8px;
    margin-top: 8px
}

.mode-btn {
    flex: 1;
    padding: 6px;
    font-size: 12px;
    background: #2a2a2a
}

.mode-btn.active {
    background: #4a9eff
}

.image-credit {
    font-size: 11px;
    color: #666;
    margin-top: 10px;
    text-align: center
}

.language-selector {
    margin-top: 10px;
    position: relative
}

.language-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px
}

.language-btn img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px
}

.language-dropdown {
    position: absolute;
    background: rgb(40 40 40 / .98);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / .15);
    border-radius: 8px;
    padding: 6px;
    min-width: 160px;
    top: 100%;
    left: 0;
    margin-top: 5px;
    z-index: 102;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 20px rgb(0 0 0 / .4)
}

.language-dropdown.show {
    display: flex;
    animation: fadeIn 0.2s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px
}

.language-option:hover {
    background: rgb(74 158 255 / .15)
}

.language-option.active {
    background: rgb(74 158 255 / .25);
    color: #4a9eff
}

.language-option span {
    font-size: 14px
}

.language-flag {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgb(0 0 0 / .3)
}

.language-chevron {
    margin-left: auto;
    font-size: 12px;
    opacity: .7
}

.copy {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #000;
    background: rgb(255 255 255 / .7);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px
}