 html, body {
        height: 100%;
        margin: 0;
        padding: 0;
       }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: #ffffff;
        }
        .toolbar {
            background-color: #dcdcdc;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
            border-radius: 16px;
            padding: 15px 10px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            width: 155px;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
            scrollbar-width: none;
        }
        #toolbar,
#eraser-size-container,
#shapes-container,
.canvas-container,
canvas {
  -webkit-touch-callout: none;   
  -webkit-user-select: none;      
  -moz-user-select: none;         
  -ms-user-select: none;         
  user-select: none;            
}

        .toolbar::-webkit-scrollbar {
            display: none;
        }
        .tool-section {
            display: flex;
            flex-direction: column;
            gap: 10px;
            position: relative;
        }
        .tool-section-title {
            font-size: 12px;
            font-weight: 600;
            color: #555;
            text-align: center;
            margin-bottom: 4px;
            cursor: pointer;
            transition: color 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        .tool-section-title:hover {
            color: #4361ee;
        }
        .tool-button {
            width: 65px;
            height: 65px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            background-color: #ffffff;
            border: 1px solid #cccccc;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        }
        .tool-button:hover {
            background-color: #d1d5db;
            transform: translateY(-2px);
        }
        .tool-button.active {
            border-color: #4361ee;
            background-color: #ebf0ff;
            box-shadow: 0 3px 8px rgba(67, 97, 238, 0.15);
        }
        .color-picker {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: flex-start;
        }
        .color-option {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid #f1f3f9;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .color-option:hover {
            transform: scale(1.1);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
        .color-option.active {
            border-color: #333;
            transform: scale(1.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
        .canvas-container {
            position: relative;
            flex-grow: 1;
            height: 100vh;
            overflow: hidden;
        }
        canvas {
            position: absolute;
            top: 0;
            left: 0;
            cursor: crosshair;
        }
        .size-slider {
            width: 100%;
            margin: 5px 0;
            -webkit-appearance: none;
            appearance: none;
            height: 4px;
            background: #cccccc;
            border-radius: 2px;
            outline: none;
        }
        .size-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #4361ee;
            cursor: pointer;
            transition: all 0.2s;
        }
        .size-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }
        .timer-container {
            position: absolute;
            top: 20px;
            right: 20px;
            background-color: #ffffff;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            z-index: 100;
            display: none;
            min-width: 240px;
        }
        .timer-container.active {
            display: flex;
        }
        .timer-display {
            font-size: 42px;
            font-weight: bold;
            color: #333;
            font-family: 'Roboto Mono', monospace;
            background: linear-gradient(135deg, #4361ee, #3a56d4);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-shadow: 0px 2px 4px rgba(67, 97, 238, 0.2);
            margin-bottom: 5px;
        }
        .timer-buttons {
            display: flex;
            gap: 8px;
            justify-content: center;
            width: 100%;
        }
        .timer-button {
            padding: 6px 12px;
            border-radius: 8px;
            border: none;
            background-color: #4361ee;
            color: white;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .timer-button:hover {
            background-color: #3a56d4;
            transform: translateY(-2px);
        }
        .timer-button.reset {
            background-color: #ff5e5e;
        }
        .timer-button.reset:hover {
            background-color: #e55252;
        }
        .eraser-size-container {
            position: absolute;
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
            padding: 15px;
            width: 150px;
            display: none;
            z-index: 100;
        }
        .eraser-size-container.active {
            display: block;
        }
        .eraser-preview {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #d1d5db;
            margin: 10px auto;
            border: 1px dashed #888888;
        }
        .link-button {
            width: 130px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding-left: 8px;
            gap: 5px;
            cursor: pointer;
            transition: all 0.2s;
            background-color: #ffffff;
            border: 1px solid #cccccc;
            font-size: 12px;
            font-weight: bold;
            color: #333;
            text-decoration: none;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
        }
        .link-button:hover {
            background-color: #d1d5db;
            transform: translateY(-2px);
        }
        .link-button svg {
            flex-shrink: 0;
        }
        .math-buttons {
            display: none;
            margin-top: 8px;
        }
        .math-buttons.active {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .fullscreen-button {
            position: absolute;
            bottom: 20px;
            right: 20px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #4361ee;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
            z-index: 100;
            transition: all 0.2s;
        }
        .fullscreen-button:hover {
            transform: scale(1.1);
            background-color: #3a56d4;
        }
        .timer-settings {
            display: none;
            margin-top: 15px;
            width: 100%;
            background-color: #dcdcdc;
            border-radius: 8px;
            padding: 10px;
        }
        .timer-settings.active {
            display: block;
        }
        .history-button { /* Stil .history-buttons sınıfından buraya taşındı veya burada tanımlı kalabilir */
            padding: 6px;
            border-radius: 6px;
            background-color: #ffffff;
            border: 1px solid #cccccc;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
        }
        .history-button:hover {
            background-color: #d1d5db;
            transform: translateY(-2px);
        }
        .history-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }
        .timer-input {
            width: 100%;
            padding: 8px;
            border-radius: 6px;
            border: 1px solid #cccccc;
            margin-bottom: 8px;
            text-align: center;
            background-color: white;
        }
        .section-divider {
            height: 1px;
            background-color: #cccccc;
            margin: 5px 0;
        }
        .size-value-display {
            background-color: #4361ee;
            color: white;
            border-radius: 50%;
            width: 15px;
            height: 15px;
            font-size: 9px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: -10px; /* Bu satır kalsa da olur, flex gap ile de ayarlanabilir */
            opacity: 0;
            transition: opacity 0.3s;
            flex-shrink: 0;
        }
        .size-value-display.visible {
            opacity: 1;
        }
        .timer-header {
            display: flex;
            justify-content: space-between;
            width: 100%;
            align-items: center;
        }
        .timer-controls {
            display: flex;
            gap: 8px;
        }
        .timer-icon-button {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background-color: #d1d5db;
            transition: all 0.2s;
        }
        .timer-icon-button:hover {
            background-color: #c4c4c4;
        }
        .timer-notification {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 30px 50px;
            border-radius: 16px;
            font-size: 24px;
            font-weight: bold;
            z-index: 1000;
            display: none;
            animation: pulse 1s infinite alternate;
            box-shadow: 0 0 30px rgba(255, 94, 94, 0.5);
        }
        @keyframes pulse {
            from {
                box-shadow: 0 0 30px rgba(255, 94, 94, 0.5);
            }
            to {
                box-shadow: 0 0 50px rgba(255, 94, 94, 0.8);
            }
        }
        /* Şekiller için stil */
         .shapes-container {
            position: absolute;
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
            padding: 15px;
            width: 300px;
            /* display: none; Bu satırı kaldırın veya yorum satırı yapın */
            z-index: 100;
            max-height: 80vh; /* Panelin maksimum yüksekliği */
            overflow-y: auto; /* Panel içeriği taşarsa kaydırma çubuğu */

            /* Yumuşak açılış için eklenecek stiller */
            opacity: 0;
            transform: translateY(15px) scale(0.98); /* Başlangıçta biraz aşağıda ve küçük */
            pointer-events: none; /* Başlangıçta tıklanamaz */
            transition: opacity 0.25s ease-out, transform 0.25s ease-out;
        }

        .shapes-container.active {
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto; 
        }
        .shapes-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-top: 10px;
        }
        .shape-button {
            width: 80px;
            height: 80px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            background-color: #ffffff;
            border: 1px solid #cccccc;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
            flex-direction: column;
            gap: 5px;
        }
        .shape-button:hover {
            background-color: #d1d5db;
            transform: translateY(-2px);
        }
        .shape-button.active {
            border-color: #4361ee;
            background-color: #ebf0ff;
            box-shadow: 0 3px 8px rgba(67, 97, 238, 0.15);
        }
        .shape-preview {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .shape-preview svg {
            max-width: 100%;
            max-height: 100%;
        }
        .shape-name {
            font-size: 10px;
            text-align: center;
            color: #555;
            margin-top: 5px;
        }
        .shape-helper {
            position: absolute;
            border: 2px dashed #4361ee;
            pointer-events: none;
            display: none; 
            z-index: 99;
        }
        .shape-category {
            margin-top: 15px;
            margin-bottom: 5px;
            font-weight: 600;
            color: #4361ee;
            border-bottom: 1px solid #e9ecef;
            padding-bottom: 5px;
        }
        canvas {
          touch-action: none;
        } 

       .eraser-size-container,
.timer-container
 {
  display: flex !important;    
  flex-direction: column;     
  visibility: hidden;          
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition:
    visibility 0s linear 0.25s,  
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}

.eraser-size-container.active,
.timer-container.active
 {
  visibility: visible;        
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s;          
}

.canvas-container { position: relative; overflow: hidden; }
  .canvas-container > #media-img,
  .canvas-container > #media-pdf {
    position: absolute; inset: 0;
    width:100%; height:100%;
    object-fit: contain;
    z-index: 0;
    pointer-events: none;
  }
  #drawing-canvas {
    position: relative; z-index:1;
    cursor: crosshair;
    pointer-events: auto;
  }
  #load-media-btn { margin-top:8px; }

 #load-media-btn {
  margin-top: 0 !important;
}

#media-controls {
  position: absolute;
  bottom: 20px;
  right: 90px;
  display: flex;
  gap: 8px;
  z-index: 200;
}

/* Ortak buton stili */
.media-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform .1s;
}
.media-btn:hover {
  transform: scale(1.1);
}

/* Zoom butonları (yeşil) */
.media-btn.zoom {
  background: #16a34a; /* Tailwind emerald-600 */
}

/* Pan butonu (sarı) */
.media-btn.pan {
  background: #d97706; /* Tailwind amber-600 */
}
.media-btn.pan.active {
  background: #ca8a04; /* biraz koyu sarı */
}

.measure-invisible {
    visibility: hidden !important;
    display: block !important;
    position: absolute !important;
}
#wheel-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    justify-content: center;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
}
#wheel-modal {
    background-color: #f0f0f0;
    padding: clamp(15px, 2vw, 30px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    max-width: 95vw;
    max-height: 95vh;   
    animation: zoomInFadeIn 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
#wheel-modal h2 {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    color: #333;
    margin: 0;
}
#wheel-settings, #wheel-controls, #winner-display {
    position: relative;
    z-index: 10;
}
#wheel-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
#wheel-settings label { font-size: clamp(14px, 2vw, 16px); }
#wheel-settings .timer-input { width: 80px; margin: 0; }
#wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 50%;
    z-index: 1;
    flex-shrink: 0; /* Çarkın büzüşmesini engeller */
}
#wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #ff5e5e;
    z-index: 20;
    filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.3));
}
#wheel-canvas {
    transition: transform 7s cubic-bezier(0.25, 1, 0.5, 1);
}
#wheel-controls { display: flex; gap: 15px; }
#spin-button { padding: 12px 30px; font-size: clamp(16px, 2.2vw, 18px); }
#close-wheel { padding: 12px 25px; font-size: clamp(14px, 2vw, 16px); }
#winner-display {
    display: none;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: bold;
    color: #16a34a;
    background-color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    min-height: 50px;
    margin-top: 0px;
    border: 2px dashed #16a34a;
    align-items: center;
    justify-content: center;
}

#wheel-tab-container {
    width: 100%;
    padding-bottom: 8px;
    margin-bottom: 20px;
}
.wheel-tab {
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 600;
    color: #888; /* Sönük (aktif olmayan) renk */
    cursor: pointer;
    padding: 5px 10px;
    border-bottom: 3px solid transparent; /* Alt çizgi için boşluk */
    transition: all 0.2s ease-in-out;
    user-select: none;
}
.wheel-tab:hover {
    color: #555; /* Üzerine gelince biraz daha belirgin */
}
.wheel-tab.active {
    color: #4361ee; /* Aktif renk (mavi) */
    border-bottom-color: #4361ee; /* Aktif alt çizgi */
}

#web-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Arka plana daha modern bir yarı saydam ve bulanık efekti */
    background-color: rgba(10, 20, 30, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#web-modal-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

#web-modal {
    /* Hafif bir arkaplan geçişi ve daha yumuşak gölgeler */
    background: linear-gradient(145deg, #ffffff, #f7f9fc);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    gap: 18px; /* Elementler arası boşluk */
    text-align: center;
    max-width: 480px; /* Geniş ekranlarda daha iyi görünüm */
    width: 90%;
    padding: 30px; /* Daha ferah bir iç boşluk */
    box-sizing: border-box;
    /* Daha akıcı bir giriş animasyonu */
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#web-modal-container.active #web-modal {
    transform: scale(1) translateY(0);
}

#web-modal h2 {
    font-size: 24px;
    font-weight: 700;
    /* Daha modern bir metin rengi */
    color: #2c3e50;
    margin: 0;
}

#web-modal p {
    font-size: 15px;
    color: #576574; /* Daha yumuşak bir gri tonu */
    margin: -10px 0 5px 0; /* Başlık ile arasındaki boşluğu ayarla */
    line-height: 1.5;
}

#web-modal .timer-input {
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

/* Tıklandığında (focus) daha belirgin bir çerçeve */
#web-modal .timer-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

#web-modal-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px; /* Butonlarla üst taraf arasına boşluk */
}

/* Butonlara genel iyileştirmeler */
#web-modal .timer-button {
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* Butonların üzerine gelince daha belirgin bir efekt */
#web-modal .timer-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Butonların SVG ikonları için stil */
#web-modal .timer-button svg {
    margin-right: 8px;
}

@keyframes zoomInFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9); /* Animasyonun ne kadar küçük başlayacağı (0.7 = %70 boyut) */
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#wheel-center-display {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 38%; height: 38%;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,0,0,0.2), inset 0 0 8px rgba(0,0,0,0.1);
    border: 4px solid #f0f0f0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#wheel-center-display.visible { display: flex; opacity: 1; transform: translate(-50%, -50%) scale(1); }
#wheel-center-display .winner-number { font-size: clamp(24px, 10vw, 48px); font-weight: 700; color: #4361ee; line-height: 1.1; }
#wheel-center-display .winner-text { font-size: clamp(12px, 4vw, 16px); font-weight: 500; color: #555; }

#close-reward-wheel {    
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#close-reward-wheel:hover {    
    background-color: #e55252;   
    transform: scale(1.1);
}


.shapes-accordion-header {
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
.shapes-tab {
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none; /* Metin seçilmesini engelle */
}
.shapes-tab:hover {
    color: #555;
}
.shapes-tab.active {
    color: #4361ee;
    border-bottom-color: #4361ee;
}