* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: 
        radial-gradient(ellipse at center, #9d7a4f 0%, #eb9011 50%, #e0bb8d 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 111, 71, 0.15) 2px, rgba(139, 111, 71, 0.15) 4px);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #3a2a1a;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M0,0 L200,200 M200,0 L0,200" stroke="%23d4af37" stroke-width="0.5" opacity="0.03"/></svg>');
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 50%, #dcc8a0 100%),
        repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(139, 105, 20, 0.02) 30px, rgba(139, 105, 20, 0.02) 60px);
    border: 5px solid #8b6914; /* бордюр главного поля */
    border-radius: 120px;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(212, 175, 55, 0.3);
    padding: 40px;
    position: relative;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.15) 0%, transparent 40%),
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(139, 105, 20, 0.04) 15px, rgba(139, 105, 20, 0.04) 30px);
    pointer-events: none;
    border-radius: 16px;
    opacity: 0.8;
}

.container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(139, 105, 20, 0.1) 50%, rgba(212, 175, 55, 0.3) 100%);
    border-radius: 20px;
    z-index: -1;
    filter: blur(3px);
}

/* Декоративные углы */
.container {
    position: relative;
}

.container .corner-decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 2;
    pointer-events: none;
}

.container .corner-decoration.top-left {
    top: 10px;
    left: 10px;
    border-top: 4px solid #d4af37;
    border-left: 4px solid #d4af37;
    border-top-left-radius: 15px;
}

.container .corner-decoration.top-right {
    top: 10px;
    right: 10px;
    border-top: 4px solid #d4af37;
    border-right: 4px solid #d4af37;
    border-top-right-radius: 15px;
}

.container .corner-decoration.bottom-left {
    bottom: 10px;
    left: 10px;
    border-bottom: 4px solid #d4af37;
    border-left: 4px solid #d4af37;
    border-bottom-left-radius: 15px;
}

.container .corner-decoration.bottom-right {
    bottom: 10px;
    right: 10px;
    border-bottom: 4px solid #d4af37;
    border-right: 4px solid #d4af37;
    border-bottom-right-radius: 15px;
}

.container .corner-decoration::before {
    content: '⚜';
    position: absolute;
    font-size: 1.5em;
    color: #d4af37;
    opacity: 0.5;
}

.container .corner-decoration.top-left::before {
    top: -8px;
    left: -8px;
}

.container .corner-decoration.top-right::before {
    top: -8px;
    right: -8px;
}

.container .corner-decoration.bottom-left::before {
    bottom: -8px;
    left: -8px;
}

.container .corner-decoration.bottom-right::before {
    bottom: -8px;
    right: -8px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
    padding: 25px 0;
    border-bottom: 4px solid #d4af37;
    border-image: linear-gradient(90deg, transparent, #d4af37 20%, #d4af37 80%, transparent) 1;
    position: relative;
    z-index: 1;
}

.header::before,
.header::after {
    content: '⚜';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    color: #d4af37;
    opacity: 0.6;
}

.header::before {
    left: 10%;
}

.header::after {
    right: 10%;
}

.logo svg {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.header h1 {
    font-size: 3em;
    color: #d4af37;
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.7),
        0 0 15px rgba(212, 175, 55, 0.6),
        0 0 30px rgba(212, 175, 55, 0.3);
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #d4af37 0%, #f5d76e 50%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.welcome-message {
    text-align: center;
    font-size: 1.2em;
    color: #6b5537;
    margin-bottom: 15px;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.admin-link {
    display: inline-block;
    color: #8b6914;
    text-decoration: none;
    font-size: 0.9em;
    padding: 5px 10px;
    border: 1px solid #d4af37;
    border-radius: 5px;
    background: rgba(212, 175, 55, 0.1);
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.admin-link:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.block {
    margin-bottom: 30px;
    padding: 25px;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(248, 240, 220, 0.5) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(139, 105, 20, 0.03) 20px, rgba(139, 105, 20, 0.03) 40px);
    border: 3px double #d4af37;
    border-radius: 15px;
    box-shadow: 
        inset 0 2px 8px rgba(255, 255, 255, 0.4),
        inset 0 -2px 8px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(2px);
}

.block::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, transparent 50%, rgba(212, 175, 55, 0.2) 100%);
    border-radius: 15px;
    z-index: -1;
    opacity: 0.5;
}

/* Декоративные элементы для блоков */
.block::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    pointer-events: none;
    z-index: 0;
}

.block .block-decoration {
    position: absolute;
    width: 25px;
    height: 25px;
    z-index: 3;
    pointer-events: none;
}

.block .block-decoration.top-left {
    top: 8px;
    left: 8px;
    border-top: 2px solid #d4af37;
    border-left: 2px solid #d4af37;
    border-top-left-radius: 6px;
}

.block .block-decoration.top-right {
    top: 8px;
    right: 8px;
    border-top: 2px solid #d4af37;
    border-right: 2px solid #d4af37;
    border-top-right-radius: 6px;
}

.block .block-decoration.bottom-left {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid #d4af37;
    border-left: 2px solid #d4af37;
    border-bottom-left-radius: 6px;
}

.block .block-decoration.bottom-right {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid #d4af37;
    border-right: 2px solid #d4af37;
    border-bottom-right-radius: 6px;
}

.block-2, .block-3, .block-4, .block-5 {
    display: none;
}

.block.active {
    display: block;
}

.block-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.left-column, .right-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 768px) {
    .block-content {
        flex-direction: row;
        gap: 30px;
    }
    
    .left-column, .right-column {
        flex: 1;
        min-width: 300px;
        width: auto;
    }
}

.block h2 {
    color: #8b6914;
    margin: 0 0 25px 0;
    font-size: 1.8em;
    text-align: center;
    width: 100%;
    position: relative;
    padding: 15px 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2) 20%, rgba(212, 175, 55, 0.2) 80%, transparent);
    border-top: 2px solid #d4af37;
    border-bottom: 2px solid #d4af37;
    z-index: 2;
    box-sizing: border-box;
}

.block h2::before,
.block h2::after {
    content: '⚔';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: #d4af37;
    opacity: 0.6;
    z-index: 3;
}

.block h2::before {
    left: 15px;
}

.block h2::after {
    right: 15px;
}

.input-group, .output-group {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.input-group label, .output-group label {
    display: block;
    margin-bottom: 8px;
    color: #6b5537;
    font-weight: bold;
    font-size: 1.1em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.input-field {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #8b6914;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff 0%, #faf8f0 100%);
    font-size: 1em;
    font-family: inherit;
    color: #3a2a1a;
    transition: all 0.3s;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.input-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37 50%, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 
        0 0 15px rgba(212, 175, 55, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #fff 0%, #fffef8 100%);
}

.input-field:focus::before {
    opacity: 1;
}

.input-field:disabled {
    background: #e8e0d0;
    cursor: not-allowed;
    opacity: 0.6;
}

.output-field {
    padding: 12px 18px;
    border: 2px solid #8b6914;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff 0%, #faf8f0 100%);
    min-height: 40px;
    font-size: 1em;
    color: #3a2a1a;
    word-wrap: break-word;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.output-field::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37 50%, transparent);
    opacity: 0.3;
}

.btn {
    padding: 14px 28px;
    border: 3px solid #8b6914;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #c9a42f 50%, #b8941f 100%);
    color: #2a1f0f;
    font-size: 1.1em;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 
        0 5px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e5c158 0%, #c9a42f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
    background: #a0a0a0;
    border-color: #808080;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2em;
}

.btn-clue {
    min-width: 140px;
    max-width: 100%;
    margin: 0;
    padding: 10px 15px;
    font-size: 0.95em;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
    line-height: 1.3;
    height: auto;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clue.clue-revealed {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 50%, #2e7d32 100%);
    border-color: #2e7d32;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 5px 12px rgba(76, 175, 80, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.btn-clue.clue-revealed:hover {
    background: linear-gradient(135deg, #5cbf60 0%, #4caf50 50%, #45a049 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 15px rgba(76, 175, 80, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.clues-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 30px 0 25px 0;
    padding: 35px 15px 20px 15px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px dashed #d4af37;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.clues-container::before {
    content: '🔑';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    background: linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 100%);
    padding: 5px 15px;
    border: 2px solid #d4af37;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    line-height: 1;
}

.riddle-container {
    background: 
        linear-gradient(135deg, #fffef8 0%, #faf8f0 100%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000"><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23d4af37" stroke-width="0.3" opacity="0.1"/></svg>');
    border: 4px double #d4af37;
    border-radius: 15px;
    padding: 50px 30px 50px 30px;
    margin: 40px 0 25px 0;
    box-shadow: 
        inset 0 3px 10px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 0 30px rgba(212, 175, 55, 0.1);
    min-height: 120px;
    position: relative;
    overflow: visible;
}

.riddle-container::before {
    content: '📜';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 2em;
    background: linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 100%);
    padding: 8px 12px;
    border: 3px solid #d4af37;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
    line-height: 1;
}

.riddle-container::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.2);
    z-index: 1;
}

/* Декоративные элементы для контейнера загадки */
.riddle-container .scroll-decoration {
    position: absolute;
    width: calc(100% - 8px);
    height: 15px;
    top: 4px;
    left: 4px;
    background: repeating-linear-gradient(90deg, 
        transparent 0px, 
        transparent 10px, 
        rgba(212, 175, 55, 0.15) 10px, 
        rgba(212, 175, 55, 0.15) 12px);
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    z-index: 1;
    pointer-events: none;
}

.riddle-container .scroll-decoration.bottom {
    top: auto;
    bottom: 4px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
}

.riddle-text {
    font-size: 1.3em;
    line-height: 1.8;
    color: #3a2a1a;
    text-align: center;
    font-style: italic;
    position: relative;
    z-index: 2;
    padding: 10px 0;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.timer-section {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.timer-display, .countdown-timer {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 20px;
    background: 
        linear-gradient(135deg, #fff 0%, #faf8f0 100%),
        radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border: 3px double #d4af37;
    border-radius: 15px;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.1),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
    overflow: hidden;
}

.timer-display::before,
.countdown-timer::before {
    content: '⏱';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    opacity: 0.25;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.timer-display::after,
.countdown-timer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37 20%, #d4af37 80%, transparent);
}

/* Декоративные элементы для таймеров */
.timer-display .timer-ornament,
.countdown-timer .timer-ornament {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #d4af37;
    border-radius: 50%;
    opacity: 0.3;
}

.timer-display .timer-ornament.top-left,
.countdown-timer .timer-ornament.top-left {
    top: 5px;
    left: 5px;
}

.timer-display .timer-ornament.top-right,
.countdown-timer .timer-ornament.top-right {
    top: 5px;
    right: 5px;
}

.timer-display .timer-ornament.bottom-left,
.countdown-timer .timer-ornament.bottom-left {
    bottom: 5px;
    left: 5px;
}

.timer-display .timer-ornament.bottom-right,
.countdown-timer .timer-ornament.bottom-right {
    bottom: 5px;
    right: 5px;
}

.timer-label, .countdown-label {
    font-size: 0.9em;
    color: #6b5537;
    margin-bottom: 10px;
    font-weight: bold;
}

.timer-value, .countdown-value {
    font-size: 2em;
    font-weight: bold;
    color: #8b6914;
    font-family: 'Courier New', monospace;
}

.countdown-value.warning {
    color: #d32f2f;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.answer-section, .treasure-section {
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.result-message {
    margin-top: 15px;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    min-height: 60px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    pointer-events: none;
}

.result-message.success {
    background: #4caf50;
    color: #fff;
    border: 2px solid #2e7d32;
}

.result-message.error {
    background: #f44336;
    color: #fff;
    border: 2px solid #c62828;
}

.result-message.timeout {
    background: #ff9800;
    color: #fff;
    border: 2px solid #f57c00;
}

.summary-section {
    margin-bottom: 40px;
    margin-top: 20px;
    padding: 35px 25px 25px 25px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px dashed #d4af37;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.summary-section::before {
    content: '🏆';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8em;
    background: linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 100%);
    padding: 6px 14px;
    border: 2px solid #d4af37;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    line-height: 1;
}

.contacts-section {
    margin-top: 50px;
    padding: 35px 25px 25px 25px;
    border-top: 3px double #d4af37;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.contacts-section::before {
    content: '📮';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8em;
    background: linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 100%);
    padding: 6px 14px;
    border: 2px solid #d4af37;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    line-height: 1;
}

.contacts-section h3 {
    color: #8b6914;
    margin: 0 0 15px 0;
    padding-top: 5px;
    text-align: center;
    font-size: 1.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.contacts-section p {
    color: #6b5537;
    text-align: center;
    font-size: 1.1em;
    margin: 0;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: 
        linear-gradient(135deg, #f4e8d0 0%, #e8d4b8 100%),
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(139, 105, 20, 0.02) 20px, rgba(139, 105, 20, 0.02) 40px);
    border: 4px double #d4af37;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        inset 0 2px 10px rgba(255, 255, 255, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    pointer-events: none;
}

.modal-content::after {
    content: '⚔';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8em;
    opacity: 0.25;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.modal-content h3 {
    color: #8b6914;
    margin: 0 0 30px 0;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.modal-buttons .btn {
    min-width: 120px;
    padding: 14px 28px;
    font-size: 1.1em;
}

.btn-secondary {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    border-color: #616161;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #b0b0b0 0%, #858585 100%);
}

/* Кнопка "Завершить игру" - красный/бордовый в старинном стиле */
.btn-end-game {
    background: linear-gradient(135deg, #8b0000 0%, #6b0000 50%, #4b0000 100%);
    border: 3px solid #5a0000;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 5px 15px rgba(139, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(139, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-end-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-end-game:hover:not(:disabled)::before {
    left: 100%;
}

.btn-end-game:hover:not(:disabled) {
    background: linear-gradient(135deg, #a00000 0%, #8b0000 50%, #6b0000 100%);
    border-color: #6b0000;
    transform: translateY(-2px);
    box-shadow: 
        0 7px 20px rgba(139, 0, 0, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.15),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(139, 0, 0, 0.4);
}

.btn-end-game:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 
        0 3px 10px rgba(139, 0, 0, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-end-game:disabled {
    background: #5a5a5a;
    border-color: #404040;
    color: #999;
    text-shadow: none;
    box-shadow: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .block-content {
        flex-direction: column;
    }

    .left-column, .right-column {
        min-width: 100%;
    }

    .clues-container {
        grid-template-columns: 1fr;
    }

    .timer-section {
        flex-direction: column;
    }
}

