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

body {
    background-color: #000000;
    color: #ff0000;
    font-family: Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100vh;
    padding-top: 20px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin-top: -100px;
    pointer-events: none;
}

.game-area > * {
    pointer-events: auto;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(255, 0, 0, 0.5);
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.title .green-letter {
    color: #00ff00;
    text-shadow: 2px 2px 4px rgba(0, 255, 0, 0.5);
}

.title.every-clickable .letter-e1,
.title.every-clickable .letter-v,
.title.every-clickable .letter-e2,
.title.every-clickable .letter-r,
.title.every-clickable .letter-y {
    cursor: pointer;
    transition: all 0.2s ease;
}

.title.every-clickable .letter-e1:hover,
.title.every-clickable .letter-v:hover,
.title.every-clickable .letter-e2:hover,
.title.every-clickable .letter-r:hover,
.title.every-clickable .letter-y:hover {
    transform: scale(1.1);
    text-shadow: 2px 2px 8px rgba(0, 255, 0, 0.8);
}

.epilepsy-warning {
    font-size: 0.8rem;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin-top: 5px;
    opacity: 0.7;
}

.instruction {
    font-size: 1.5rem;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 0, 0, 0.5);
}

.click-button {
    background-color: #ff0000;
    color: #000000;
    border: none;
    width: 150px;
    height: 150px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.click-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.click-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

.bottom-area {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.endings-button {
    background-color: #ff0000;
    color: #000000;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.endings-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.endings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #000000;
    border: 2px solid #ff0000;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ff0000;
}

.modal-header h2 {
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: #ff0000;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #cc0000;
}

.modal-body {
    padding: 20px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
}

.ending-item {
    background-color: #333333;
    border: 2px solid #555555;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ending-item.achieved {
    background-color: #555555;
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

.ending-title {
    color: #cccccc;
    font-weight: bold;
    font-size: 1.2rem;
}

.ending-item.achieved .ending-title {
    color: #ffffff;
}

.clickable-ending {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-ending:hover {
    background-color: #444444;
    border-color: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
}

@keyframes glow {
    from {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.8);
    }
}

.draggable {
    cursor: grab;
    user-select: none;
    position: relative;
    z-index: 10;
}

.draggable:active {
    cursor: grabbing;
}

.hidden-button {
    background-color: #ff0000;
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    position: relative;
    z-index: 5;
}

.hidden-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
}

.hidden-button.show {
    display: block;
}

.click-button.broken {
    background-color: #8b0000;
    border: 3px solid #ff0000;
    box-shadow: 
        0 0 15px rgba(255, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: shake 0.5s ease-in-out infinite;
}

.click-button.broken::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff0000, transparent);
    animation: crack 2s ease-in-out infinite;
}

.click-button.broken::after {
    content: '';
    position: absolute;
    top: 60%;
    left: 30%;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff0000, transparent);
    animation: crack 2s ease-in-out infinite 1s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes crack {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.counter-display {
    margin-top: 30px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 0, 0, 0.5);
}

#clickCount {
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
}

.ending-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.ending-overlay.show {
    opacity: 1;
}

.ending-text {
    text-align: center;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.ending-text h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 0, 0, 0.5);
}

.ending-text p {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(255, 0, 0, 0.5);
}

.fade-out {
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.info-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #ff0000;
    color: #000000;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.info-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.settings-button {
    position: fixed;
    top: 20px;
    right: 70px;
    width: 40px;
    height: 40px;
    background-color: #ff0000;
    color: #000000;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.settings-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.copycat-input {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
}

.copycat-input input {
    background-color: #000000;
    color: #ff0000;
    border: 2px solid #ff0000;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    width: 200px;
    outline: none;
}

.copycat-input input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.copycat-input input::placeholder {
    color: #666666;
}

.invisible-text {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: transparent;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    user-select: text;
    z-index: 5;
    cursor: text;
}

.darkness-detector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 1px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.info-content {
    background-color: #000000;
    border: 2px solid #ff0000;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ff0000;
}

.info-header h2 {
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin: 0;
}

.info-body {
    padding: 20px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
}

.clickable-word {
    color: #ff0000;
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable-word:hover {
    color: #cc0000;
}

.editable-text {
    color: #ff0000;
    cursor: text;
    outline: none;
}

.editable-text:hover {
    color: #cc0000;
}

.editable-text:focus {
    color: #ffffff;
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.settings-content {
    background-color: #000000;
    border: 2px solid #ff0000;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ff0000;
}

.settings-header h2 {
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin: 0;
}

.settings-body {
    padding: 20px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.setting-item label {
    font-weight: bold;
    font-size: 1.2rem;
}

.brightness-slider {
    width: 100%;
    height: 8px;
    background: #333333;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
}

.brightness-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.brightness-value {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.code-slider {
    width: 100%;
    height: 8px;
    background: #333333;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.code-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
}

.code-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.code-value {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.hidden-book-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.book-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.book-content {
    background-color: #000000;
    border: 2px solid #ff0000;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ff0000;
}

.book-header h2 {
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin: 0;
}

.book-body {
    padding: 20px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.book-page h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.book-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.nav-button {
    background-color: #ff0000;
    color: #000000;
    border: none;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background-color: #cc0000;
}

.square-diagram {
    text-align: center;
    margin: 30px 0;
}

.square-top, .square-bottom {
    font-weight: bold;
    margin: 10px 0;
}

.square-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.square-left, .square-center, .square-right {
    font-weight: bold;
}

.code-letters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.click-button.disco {
    animation: disco-colors 0.2s linear infinite;
    border: 3px solid #fff700;
    position: relative;
    z-index: 20;
}

@keyframes disco-colors {
    0% { background: #ff0000; color: #fff; }
    20% { background: #ff7f00; color: #000; }
    40% { background: #ffff00; color: #000; }
    60% { background: #00ff00; color: #000; }
    80% { background: #0000ff; color: #fff; }
    100% { background: #8b00ff; color: #fff; }
}

body.destroyed {
    animation: screen-destroyed 0.1s linear infinite;
}

@keyframes screen-destroyed {
    0% { background: #ff0000; }
    16.67% { background: #ff7f00; }
    33.33% { background: #ffff00; }
    50% { background: #00ff00; }
    66.67% { background: #0000ff; }
    83.33% { background: #8b00ff; }
    100% { background: #ff0000; }
}

.deserving-hint {
    position: fixed;
    top: 60px;
    left: 20px;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 50;
}

.deserving-hint.show {
    opacity: 1;
}

.editable-brightness {
    cursor: text;
    transition: color 0.2s ease;
}

.editable-brightness:hover {
    color: #ffffff;
}

.editable-brightness:focus {
    color: #ffffff;
    outline: 2px solid #ff0000;
}

.white-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.white-flash.show {
    opacity: 1;
}

.mostly-free-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 100;
    pointer-events: none;
}

.mostly-free-prompt.show {
    opacity: 1;
}

.gift-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 200;
    pointer-events: none;
    text-shadow: 2px 2px 8px rgba(0, 255, 0, 0.8);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border: 2px solid #00ff00;
    border-radius: 10px;
}

.gift-notification.show {
    opacity: 1;
}
