@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'Outfit', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #0b0118;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.screen {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 15px; text-align: center;
}

.screen.active { display: flex; }

/* ROZCESTNÍK A LOGO */
.rules-corner-btn {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none;
  color: #fbbf24; font-size: 2rem;
  z-index: 100; cursor: pointer;
}

.quit-corner-btn {
  position: absolute; top: 12px; left: 12px;
  background: rgba(244, 63, 94, 0.2); border: 2px solid #f43f5e;
  color: #f43f5e; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.2rem; z-index: 100; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: 0.2s;
}
.quit-corner-btn:hover { background: #f43f5e; color: white; }
.quit-corner-btn.hidden { display: none; }

.logo-area { margin-top: -15px; margin-bottom: 10px; }

h1 {
  font-size: 2.8rem; font-weight: 900;
  background: linear-gradient(to right, #8b5cf6, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.icon-bounce { font-size: 2.8rem; color: #fbbf24; margin-bottom: 3px; animation: bounce 2s infinite ease-in-out; }

.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  width: 100%; max-width: 500px; margin-bottom: 10px;
}

.setting-item { background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
.setting-item label { display: block; margin-bottom: 4px; font-size: 0.7rem; color: #94a3b8; font-weight: 700; }

select { width: 100%; background: #1e1b4b; color: white; border: 2px solid #4338ca; padding: 5px; border-radius: 8px; font-size: 0.9rem; outline: none; }

.toggle-group { display: flex; gap: 4px; background: #0f172a; padding: 3px; border-radius: 8px; }
.toggle-btn { flex: 1; border: none; background: none; color: #64748b; padding: 5px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 0.7rem; }
.toggle-btn.active { background: #4338ca; color: white; }

.category-grid { width: 100%; max-width: 500px; margin-bottom: 15px; }
.cat-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.category-grid h3 { font-size: 0.85rem; color: #94a3b8; }

.btn-custom-add { background: none; border: 1px dashed #a855f7; color: #a855f7; padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.btn-custom-add:hover { background: rgba(168, 85, 247, 0.1); }

.cat-list { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 6px; 
  max-height: 150px; 
  overflow-y: auto; 
  padding-right: 4px; 
}

/* VLASTNÍ STYLOVÝ SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #4338ca;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

.cat-btn { background: #1e1b4b; border: 2px solid #4338ca; color: #fff; padding: 8px 6px; border-radius: 10px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 0.75rem; position: relative; }
.cat-btn.active { background: #4338ca; border-color: #6366f1; box-shadow: 0 0 12px rgba(99, 102, 241, 0.4); }

.cat-delete-btn { position: absolute; top: -5px; right: -5px; background: #f43f5e; color: white; border: none; width: 18px; height: 18px; border-radius: 50%; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.btn-main { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); border: none; padding: 12px 30px; font-size: 1.2rem; font-weight: 900; color: white; border-radius: 50px; box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3); cursor: pointer; transition: 0.2s; }
.btn-main:active { transform: scale(0.95); }

/* MODALS */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 15px; }
.modal.active { display: flex; }
.modal-content { background: #1e1b4b; padding: 20px; border-radius: 25px; max-width: 480px; width: 100%; text-align: center; border: 2px solid #4338ca; }
.modal-content h2 { color: #fbbf24; margin-bottom: 12px; font-size: 1.3rem; }

.custom-box input[type="text"] { width: 100%; background: #0f0221; border: 2px solid #4338ca; color: white; padding: 8px 12px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 10px; outline: none; }
.word-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.word-input-row input { margin-bottom: 0 !important; flex: 2; }
.word-input-row select { flex: 1; }
.btn-sub { background: #6366f1; border: none; color: white; padding: 0 15px; border-radius: 10px; font-weight: bold; cursor: pointer; }

.preview-list { background: #0f0221; border-radius: 10px; max-height: 110px; overflow-y: auto; padding: 8px; margin-bottom: 15px; text-align: left; border: 1px solid rgba(255,255,255,0.1); }
.preview-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.empty-preview { color: #64748b; font-size: 0.8rem; text-align: center; padding: 10px; }

.modal-buttons { display: flex; gap: 10px; justify-content: center; }
.btn-sec { background: #334155; border: none; padding: 10px 20px; font-size: 1rem; font-weight: 700; color: white; border-radius: 30px; cursor: pointer; }

.rules-text { text-align: left; margin-bottom: 15px; color: #cbd5e1; line-height: 1.4; font-size: 0.8rem; }
.rules-text p { margin-bottom: 6px; }

/* COUNTDOWN */
#screen-countdown { background: #0b0118; }
#countdown-number { font-size: 9rem; font-weight: 900; background: linear-gradient(135deg, #fbbf24 0%, #f43f5e 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; animation: pulseNum 0.6s infinite alternate ease-in-out; }
.countdown-sub { font-size: 1.4rem; font-weight: 700; color: #94a3b8; margin-top: 10px; }
@keyframes pulseNum { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }

/* GAME */
.word-container { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#word-multiplier { font-size: 1.6rem; font-weight: 900; color: #fbbf24; text-transform: uppercase; margin-bottom: 4px; min-height: 30px; text-shadow: 0 0 12px rgba(251, 191, 36, 0.6); }
#game-timer { font-size: 2rem; color: #fbbf24; font-weight: 900; position: absolute; top: 12px; }
#word-display { font-size: 4.5rem; font-weight: 900; text-transform: uppercase; transition: color 0.2s; max-width: 95%; line-height: 1.1; }

.correct-word { color: #10b981 !important; }
.pass-word { color: #f43f5e !important; }

.game-hints { position: absolute; bottom: 15px; display: flex; gap: 30px; color: #64748b; font-weight: 700; font-size: 1rem; }
.hidden { display: none; }

/* RESULTS - VERTIKÁLNÍ SCROLLOVATELNÝ SEZNAM */
.final-score-area { margin-bottom: 6px; }
.final-score-area p { font-size: 0.9rem; color: #94a3b8; }
#final-score { font-size: 3.2rem; font-weight: 900; color: #fbbf24; line-height: 1; margin-bottom: 10px; }

.results-container { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  width: 100%; 
  max-width: 380px; 
  max-height: 220px; 
  overflow-y: auto; 
  padding: 4px; 
  margin-bottom: 15px; 
}
.res-item { 
  background: #1e1b4b; 
  padding: 10px 14px; 
  border-radius: 10px; 
  font-weight: 700; 
  font-size: 0.9rem; 
  border: 2px solid transparent; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.res-item.ok { border-color: #10b981; color: #10b981; }
.res-item.pass { border-color: #f43f5e; color: #f43f5e; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }