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

:root {
  --color-background: #0a0118;
  --color-foreground: #f5f0e8;
  --color-primary: #ff6b35;
  --color-primary-dark: #e85a2a;
  --color-accent: #ffa500;
  --color-destructive: #dc2626;
  --color-card: #1a0f2e;
  --color-muted: #9ca3af;
  --color-border: #4a3f5c;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

body {
      background-image: url(https://f005.backblazeb2.com/file/Materials-for-websites/bg_dark.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* background-attachment: fixed; */
  font-family: var(--font-sans);
  color: var(--color-foreground);
  /* background: var(--color-background); */
  overflow-x: hidden;
}

.game-container {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 1, 24, 0.6), rgba(10, 1, 24, 0.4), rgba(10, 1, 24, 0.6));
}

.game-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.phase {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Start Screen */
.start-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 1, 24, 0.7);
    backdrop-filter: blur(12px);
}

.start-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 107, 53, 0.1),
        rgba(255, 165, 0, 0.1)
    );
    z-index: -1;
}

.start-content {
    text-align: center;
    z-index: 10;
    animation: fadeInUp 0.8s ease-out;
}

.start-title {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(255, 107, 53, 0.5);
}

.start-subtitle {
    font-size: 1.5rem;
    color: var(--color-foreground);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.start-button {
    font-size: 1.25rem;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive for start screen */
@media (max-width: 768px) {
    .start-title {
        font-size: 2.5rem;
    }
    
    .start-subtitle {
        font-size: 1.25rem;
    }
}

/* Intro Phase */
#intro-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  width: 100%;
  padding: 5rem 1rem 2rem;
}

.intro-header {
  text-align: center;
}

.game-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.game-subtitle {
  font-size: 1.25rem;
  color: var(--color-muted);
}

.dialogue-box {
  width: 100%;
  max-width: 56rem;
  background: rgba(26, 15, 46, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dialogue-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.speaker-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.2);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.speaker-avatar span {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-primary);
}

.speaker-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-primary);
}

.dialogue-text {
  font-size: 1.125rem;
  line-height: 1.6;
  min-height: 4rem;
  margin-bottom: 1.5rem;
}

.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialogue-counter {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.dialogue-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Game Phase */
#game-phase {
  width: 100%;
  max-width: 64rem;
}

.game-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(26, 15, 46, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
}

.stat-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary);
}

.stat-value {
  font-family: "Courier New", monospace;
  font-size: 1.25rem;
  font-weight: bold;
}

.game-area {
  position: relative;
  width: 100%;
  height: 500px;
  /* background: rgba(26, 15, 46, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem; */
  overflow: hidden;
}

.clickable-items {
  position: relative;
  width: 100%;
  height: 100%;
}

.clickable-item {
  position: absolute;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 53, 0.5);
  background: rgba(255, 107, 53, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.clickable-item:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.4);
}

.clickable-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.clickable-item.phase2 {
  border-color: rgba(255, 165, 0, 0.5);
  background: rgba(255, 165, 0, 0.2);
}

.clickable-item.phase2:hover {
  border-color: var(--color-accent);
  background: rgba(255, 165, 0, 0.4);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(255, 107, 53, 0);
  }
}

/* End Screens */
.end-screen {
  background: rgba(26, 15, 46, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  gap: 1.5rem;
}

.end-icon {
  width: 6rem;
  height: 6rem;
  color: var(--color-primary);
}

.end-icon-error {
  color: var(--color-destructive);
}

.end-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-primary);
}

.end-title-error {
  color: var(--color-destructive);
}

.end-text {
  max-width: 28rem;
  font-size: 1.125rem;
  line-height: 1.6;
}

.end-image {
  width: 200px;
  height: 200px;
  border-radius: 0.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.instructions {
  margin-top: 1.5rem;
  max-width: 42rem;
  text-align: center;
  font-size: 0.875rem;
  color: #eff5ff;
}

/* Buttons */
.btn {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-destructive {
  background: var(--color-destructive);
  color: white;
}

.btn-destructive:hover {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-large {
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
}

/* Popups */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 1, 24, 0.8);
  backdrop-filter: blur(8px);
}

.popup-card {
  max-width: 28rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.popup-card-large {
  max-width: 32rem;
  padding: 2rem;
}

.popup-text {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.found-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.found-image {
  width: 200px;
  height: 200px;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  .game-area {
    height: 400px;
  }

  .clickable-item {
    width: 3rem;
    height: 3rem;
  }
}

/* Стили для завершающего экрана */
.final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeInFinal 1.5s ease-in-out forwards;
}

.final-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #080c16 50%, #000000 100%);
    opacity: 0.95;
}

.final-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 600px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.final-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: #ffa500;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: #e0e0e0;
    font-weight: 300;
}

.final-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.final-button {
    font-size: 1.2rem;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: rgba(255, 107, 107, 0.2);
    backdrop-filter: blur(10px);
}

.final-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.3);
}

.final-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.final-footer p {
    color: #b0b0b0;
    font-size: 1rem;
    font-style: italic;
}

/* Анимация появления завершающего экрана */
@keyframes fadeInFinal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .final-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .final-title {
        font-size: 2.2rem;
    }
    
    .final-subtitle {
        font-size: 1.2rem;
    }
    
    .final-button {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
}
