body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(45deg, #8B7355, #A0522D);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.choose-text {
    font-family: 'Arial', sans-serif;
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 
        2px 2px 0 #4a3c28,
        4px 4px 0 #3a2e1f,
        6px 6px 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.shapes-container {
    display: flex;
    gap: 2rem;
    margin-bottom: auto;
    padding-top: 40vh;
    perspective: 1000px;
}

.shape-wrapper {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
}

.shape-wrapper.selected {
    position: fixed;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%) scale(4.5);
    z-index: 10;
}

.shape-wrapper.fade-out {
    opacity: 0;
    pointer-events: none;
}

.shape-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.shape-wrapper.flipped .shape-inner {
    transform: rotateY(180deg);
}

.shape {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.front {
    background: linear-gradient(145deg, #919191, #7a7a7a);
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.3),
        inset 2px 2px 5px rgba(255, 255, 255, 0.5),
        inset -2px -2px 5px rgba(0, 0, 0, 0.3);
}

.back {
    background: #f4d03f;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.3),
        inset 2px 2px 5px rgba(255, 255, 255, 0.5),
        inset -2px -2px 5px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.shape-svg {
    width: 70%;
    height: 70%;
}

.shape-wrapper:hover .front {
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.4),
        inset 2px 2px 5px rgba(255, 255, 255, 0.5),
        inset -2px -2px 5px rgba(0, 0, 0, 0.3);
}

.choose-text.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.shape-wrapper.selected .shape-svg use {
    stroke-width: 2px;
}

.shape-svg use {
    stroke-width: 8px;
    transition: stroke-width 0.5s ease;
}

.timer {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    text-align: center;
    z-index: 5;
    pointer-events: none;
}

.timer-text {
    color: #ffffff;
    font-size: 2rem;
    font-family: 'Arial', sans-serif;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: #444;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.timer-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #ff3333;
    animation: countdown 30s linear forwards;
}

@keyframes countdown {
    from { width: 100%; }
    to { width: 0%; }
}

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

.crack {
    position: absolute;
    width: 2px;
    height: 10px;
    background: #000;
    pointer-events: none;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    transform-origin: center;
    z-index: 5;
}

.shattered {
    /* animation: shatter 0.5s forwards; */
    /* transform: scale(4.5); */
}

@keyframes shatter {
    0% {
        transform: scale(4.5);
        opacity: 1;
    }
    20% {
        transform: scale(4.7);
        opacity: 1;
    }
    50% {
        transform: scale(4.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(5.1);
        opacity: 0;
    }
}

.achievements-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
}

.achievements-panel.open {
    display: block;
}

.achievements-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    color: #4a3c28;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-text {
    font-size: 16px;
    font-family: 'Georgia', serif;
}

.achievements-content {
    padding: 30px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.achievements-content h2 {
    color: #4a3c28;
    font-family: 'Georgia', serif;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.achievements-list li {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(74, 60, 40, 0.1);
    border-radius: 5px;
    color: #4a3c28;
    font-family: 'Georgia', serif;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.achievements-list li.achievement-special {
    cursor: pointer;
}

.achievements-list li.achievement-special:hover {
    background: rgba(74, 60, 40, 0.2);
    transform: scale(1.02);
}

.achievements-list li.achieved {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transform: scale(1.02);
}

.achievements-list li.achieved .achievement-description {
    color: #4a3c28;
}

.achievement-description {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
    font-family: 'Arial', sans-serif;
}

.difficulty-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Difficulty colors for indicators */
.difficulty-easy .difficulty-indicator {
    background-color: #3498db;  /* Blue */
}

.difficulty-normal .difficulty-indicator {
    background-color: #2ecc71;  /* Green */
}

.difficulty-difficult .difficulty-indicator {
    background-color: #e67e22;  /* Orange */
}

.difficulty-challenging .difficulty-indicator {
    background-color: #e74c3c;  /* Red */
}

.difficulty-extreme .difficulty-indicator {
    background-color: #9b59b6;  /* Purple */
}

/* Add a slight glow effect to the indicators */
.difficulty-indicator {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Adjust the achievement text to make room for the indicator */
.achievement-name, .achievement-description {
    margin-right: 25px;
}

.achievements-content::-webkit-scrollbar {
    width: 8px;
}

.achievements-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.achievements-content::-webkit-scrollbar-thumb {
    background: rgba(74, 60, 40, 0.5);
    border-radius: 4px;
}

.achievements-content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 60, 40, 0.7);
}

.difficulty-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.difficulty-item {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.difficulty-item.easy {
    background-color: #3498db;  /* Blue */
}

.difficulty-item.normal {
    background-color: #2ecc71;  /* Green */
}

.difficulty-item.difficult {
    background-color: #e67e22;  /* Orange */
}

.difficulty-item.challenging {
    background-color: #e74c3c;  /* Red */
}

.difficulty-item.extreme {
    background-color: #9b59b6;  /* Purple */
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes achievement-unlock {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
