:root {
    --scale-factor: 1;
    --pixel-ratio: 1;
    --logical-height: 550px;
    --primary-color: #0056b3;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #343a40;
    --color-text-secondary: #343a40;
    --color-text-secondary: #ffffff;
    --surface: #13131a;
    --color-background-secondary: #2a2a3a;
    --color-background-primary: #fefefe;
    --color-text-bright: #ffffff;
    --accent: #e8ff47;
    --accent2: #ff4778;
    --color-border-secondary: #4e4e8d;
    --color-text-secondary: #7d7d81;
    --color-border-tertiary: #434345;
    --color-text-primary: #ffffff;
    --text-dim: #6a6a8a;
    --correct: #47ffaa;
    --tile-border: #2a2a3a;
    --tile-correct: #47ffaa44;
    --border-radius-lg: 4px;
    --gap: 0px;
    --greenborder: #2d5227;
    --border-radius-md: 5px;
    --font-sans: sans-serif;
}

.eraser {
    display: flex;
    justify-content: center;
    /* Poziom */
    align-items: center;
    /* Pion */
    border: 0.5px solid #000000;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.erase-active {
    border: 0.5px solid #ff0000;
}

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

#app {
    display: flex;
    flex-direction: column;
    min-height: 580px;
}

.clearfixLine {
    display: block;
    clear: both;
    width: 100%;
}


#shape-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 auto;
    /* Centruje cały pasek względem rodzica (#app) */
    /*max-width: 1000px;*/
    /* Przykładowa szerokość - dostosuj do potrzeb */
    width: fit-content;
}

.thumb {
    width: 100px;
    height: 100px;
    border: 0.5px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background-primary);
    flex-shrink: 0;
    padding: 5px;
    transition: border-color 0.15s;
    box-sizing: border-box;
    position: relative;
}

.thumb:hover {
    border-color: var(--color-border-secondary);
}

.thumb.active {
    border: 2px solid #378ADD;
}

.thumb svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

#toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.tool-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--color-text-primary);
}

#width-val {
    font-size: 12px;
    font-weight: 500;
    min-width: 18px;
    color: var(--color-text-primary);
}

.nomouse {
    pointer-events: none;
}

.tbtn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--border-radius-md);
    border: 0.5px solid var(--color-border-secondary);
    background: transparent;
    color: var(--color-text-secondary) !important;
    cursor: pointer;
    white-space: nowrap;
}

.tbtn:hover {
    background: var(--color-background-secondary);
    color: var(--color-text-bright) !important;
}

.prevNextBtn {
    font-size: 15px;
    padding: 5px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid green;
    background: transparent;
    color: green !important;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
}

.prevNextBtn:hover {
    background: #28a745;
    color: white !important;
}


#canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: var(--logical-height);
    max-height: 750px;
    /*background: var(--color-background-primary);*/
    margin-left: auto;
    margin-right: auto;
    border: 0.5px solid var(--color-border-secondary);
    background-image: url(https://projektika.org/gamesImg/psaci_pismena/paperBG.webp);
    background-color: var(--color-background-primary);
    background-repeat: no-repeat;
    background-size: cover;
}

#canvas-bg,
#canvas-cursor,
#canvas-draw,
#linie,
#letterName {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

}

#reload {
    position: absolute;
    top: 0;
    right: 0;
    width: 4%;
    height: 4%;
    font-size: 35px;
    cursor: pointer;
}

#reload svg {
    padding: 0px;
    float: inline-end;
    width: 2.5rem;
    height: auto;
    color: #343a4080;
}

#letterNameContent {
    font-family: Georgia, "Times New Roman", serif;
    font-optical-sizing: auto;
    padding-top: 0px;
    padding-left: 1.2%;
    font-weight: 600;
    font-size: 2rem;
}

#canvas-cursor {
    pointer-events: none;
}

.indicator-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
}

#canvas-bg {
    pointer-events: none;
}

#canvas-draw {
    cursor: crosshair;
    touch-action: none;
}

#hint {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    pointer-events: none;
    opacity: 0.7;
}

.header-title {
    font-size: 2.2rem;
    color: rgb(18, 55, 21);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {

    .header-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem !important;
    }

    #hint {
        font-size: 12px;
    }

    .smallHide, .prevNextBtn {
        display: none;
    }

}


/******************/
.hero-game-section {
    background: linear-gradient(135deg, #43b8e3 0%, #2c549e 100%);
    color: white;
    padding: 20px 0;
    border-radius: 20px;
    margin-bottom: 40px;
}

.feature-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.icon-box {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #764ba2;
}

.highlight-text {
    color: #764ba2;
    font-weight: 600;
}

.category-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 8px;
}
.category-wrapper{
    background: #fdfdfd;
    padding: 6px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

#dynamicCategories{
    flex: 1; 
    text-align: center; 
    margin: 0 5px;
}

.cat-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cat-btn:hover {
    background:#2563eb; /* #e9ecef;*/
    color:white;
}

.cat-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Opcjonalnie: płynniejsze ukrywanie */
.clearfixLine hr {
    margin: 12px 0;
    border: 0;
    border-top: 1px dashed #828282;
}
