@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Special+Elite&display=swap');

:root {
  --primary-color: #a855f7; /* Lighter purple/violet */
  --secondary-color: #fdd835;
  --text-color: #cbd5e1;
  --background-color: #0b0f19;
  --table-border: rgba(255, 255, 255, 0.08);
  --success-color: #10b981;
  --error-color: #ef4444;
}

html, body.game-body, body {
    background: var(--background-color);
    color: var(--text-color);
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.8);
}

/* Ambient Background Orbs */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.glow-orb {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    opacity: 0.12;
    transform: translateZ(0);
}
.orb-purple {
    background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 70%);
    top: -10%;
    right: 5%;
}
.orb-blue {
    background: radial-gradient(circle, #0ea5e9 0%, rgba(14, 165, 233, 0) 70%);
    bottom: -15%;
    left: 10%;
}

/* Base Glass Components */
.glass {
    background: rgba(15, 23, 42, 0.85); /* Ztmaveno jako kompenzace za odstraněný blur pro MAX výkon */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Menší statický stín */
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s ease;
}
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.left-panel .glass-panel {
    margin-bottom: 0 !important;
}
.glass-panel:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Typography & Links */
h1, h2, h3 {
    color: #ffffff;
    font-weight: 700;
}
a { color: var(--secondary-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #fff59d; }

/* Containers */
.container {
  max-width: 950px;
  margin: 3rem auto;
  padding: 2.5rem;
  border-radius: 20px;
}
.container.full-width { max-width: 1800px; width: 96%; flex-grow: 1; margin: 2rem auto; }
.container.container-wide { max-width: 1300px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; color: #f1f5f9; }
th, td { border: 1px solid var(--table-border); padding: 12px 16px; text-align: left; }
th { background-color: rgba(255, 255, 255, 0.04); font-weight: 600; color: #94a3b8; }
tr:hover td { background-color: rgba(255, 255, 255, 0.01); }

/* Inputs and Forms */
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 12px;
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}
textarea { height: 100px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--primary-color); background-color: rgba(0,0,0,0.5); box-shadow: 0 0 10px rgba(168, 85, 247, 0.25); }

/* Buttons */
button, .btn-primary, .btn-create, .btn-secondary, .btn-danger, .next-level-btn {
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  line-height: 1.6;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}
button, .btn-primary { 
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}
button:hover, .btn-primary:hover { 
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4);
}
button:active, .btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary { 
  background: rgba(255, 255, 255, 0.05); 
  border: 1px solid rgba(255, 255, 255, 0.1); 
}
.btn-secondary:hover { 
  background: rgba(255, 255, 255, 0.1); 
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: scale(0.97);
}

.btn-danger { 
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); 
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { 
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); 
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}
.btn-danger:active {
  transform: scale(0.97);
}

.btn-close {
  background: transparent !important;
  box-shadow: none !important;
  width: 1.2em;
  height: 1.2em;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.2em;
  border: none;
  transition: all 0.2s ease;
  line-height: 1;
}
.btn-close:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.1) !important;
  box-shadow: none !important;
}

.btn-create, .next-level-btn { 
  background: linear-gradient(135deg, #10b981 0%, #047857 100%); 
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-create:hover, .next-level-btn:hover { 
  background: linear-gradient(135deg, #34d399 0%, #059669 100%); 
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}
.btn-create:active, .next-level-btn:active {
  transform: scale(0.97);
}

.btn-completed {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25) !important;
}
.btn-completed:hover {
  background: linear-gradient(135deg, #f472b6 0%, #e11d48 100%) !important;
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4) !important;
}

/* Specific Elements */
.schema-section pre { background: rgba(0, 0, 0, 0.3); padding: 10px; border-radius: 4px; overflow-x: auto; color: #aaa; }
.cheatsheet { background: rgba(253, 216, 53, 0.1); padding: 15px; border-radius: 4px; margin-bottom: 20px; border: 1px solid rgba(253, 216, 53, 0.3); }
.cheatsheet p { margin: 5px 0; font-family: monospace; }
.cheatsheet code { background: rgba(0, 0, 0, 0.4); padding: 2px 5px; border-radius: 3px; color: #ffb74d; font-weight: bold; }

/* Messages */
.message { padding: 1rem; border-radius: 4px; margin-top: 1rem; font-weight: bold; }
.message.success { background-color: rgba(46, 125, 50, 0.2); border: 1px solid var(--success-color); color: #a5d6a7;}
.message.error { background-color: rgba(198, 40, 40, 0.2); border: 1px solid var(--error-color); color: #ef9a9a;}
.status-msg { margin-top: 10px; font-style: italic; color: #aaa; }

/* Navbar */
.navbar.glass { padding: 1rem 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.nav-content { display: flex; justify-content: space-between; align-items: center; max-width: 1800px; width: 96%; margin: 0 auto; flex-wrap: wrap; }
.nav-brand { text-decoration: none; color: inherit; display: flex; align-items: center; }
.nav-brand h1 { margin: 0; color: white; font-size: 1.5rem; }

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
}
.hamburger span {
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        gap: 15px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Layout & Utils */
.layout-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; }
@media (max-width: 768px) { .layout-grid { grid-template-columns: 1fr; } }
.hidden { display: none !important; }

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content.glass { padding: 2rem; border-radius: 8px; text-align: center; max-width: 400px; }
.modal-actions { margin-top: 1.5rem; display: flex; justify-content: space-around; }

/* Dashboard Cards (Admin) */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }

/* THEME: NOIR (Overrides) */
body.theme-noir { background: #1a1a1a; }
.theme-noir .glass-panel, .theme-noir .navbar { filter: grayscale(0.7) contrast(1.1); font-family: 'Special Elite', 'Courier New', monospace; }
.theme-noir h1, .theme-noir h2, .theme-noir h3 { font-family: 'Special Elite', cursive; }
.theme-noir .input-section textarea { color: #0f0; background: rgba(0,20,0,0.6); }

/* TYPEWRITER EFFECT */
.typewriter-active { display: inline-block; overflow: hidden; border-right: .15em solid orange; white-space: pre-wrap; margin: 0 auto; }
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: orange; } }

/* CODE MIRROR INTEGRATION */
.glass-input-container {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.cm-editor {
    height: 150px;
    background: transparent !important;
}

.cm-editor.cm-focused {
    outline: none !important;
    border-color: var(--primary-color) !important;
}

.cm-scroller {
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
}

.cm-gutters {
    background: rgba(0, 0, 0, 0.2) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.cm-activeLine, .cm-activeLineGutter {
    background: rgba(255, 255, 255, 0.05) !important;
}

.cm-content {
    caret-color: white !important;
    color: #e0e0e0 !important;
    padding: 10px 0 !important;
}

/* Syntax Highlighting Overrides for better contrast */
.cm-keyword { color: #c678dd !important; font-weight: bold; } /* Purple keywords */
.cm-string { color: #98c379 !important; } /* Green strings */
.cm-number { color: #d19a66 !important; } /* Orange numbers */
.cm-comment { color: #5c6370 !important; font-style: italic; } /* Gray comments */
.cm-type { color: #e5c07b !important; } /* Yellow types */
.cm-property, .cm-variableName { color: #61afef !important; } /* Blue variables/columns */
.cm-builtin, .cm-atom, .cm-callee, .cm-function { color: #e5c07b !important; } /* Yellow standard functions/builtins */

/* Tooltip / Autocomplete styling */
.cm-tooltip-autocomplete {
    background: #1e1e1e !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
    color: white !important;
}

.cm-tooltip-autocomplete ul li[aria-selected] {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Badges for Columns and Types */
.badge-text {
    background: rgba(144, 202, 249, 0.15) !important;
    color: #90caf9 !important;
    border: 1px solid rgba(144, 202, 249, 0.3) !important;
}
.badge-num {
    background: rgba(255, 171, 145, 0.15) !important;
    color: #ffab91 !important;
    border: 1px solid rgba(255, 171, 145, 0.3) !important;
}
.col-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
    text-transform: uppercase;
    line-height: 1;
}

/* Legend Box */
.db-explanation {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.9em;
}
.db-explanation h4 {
    margin: 0 0 8px 0;
    color: var(--secondary-color);
}
.db-explanation ul {
    margin: 0;
    padding-left: 15px;
}
.db-explanation li {
    margin-bottom: 6px;
}
.db-explanation code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    color: #ffb74d;
}

/* Cheatsheet Accordion Styling */
.cheatsheet-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cheatsheet-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.cheatsheet-item[open] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.cheatsheet-item summary {
    padding: 12px 15px;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    user-select: none;
    outline: none;
    list-style: none; /* Hide default arrow */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}
.cheatsheet-item summary::-webkit-details-marker {
    display: none; /* Hide Safari arrow */
}
.cheatsheet-item summary::after {
    content: "▼";
    font-size: 0.8em;
    opacity: 0.7;
    transition: transform 0.3s ease;
}
.cheatsheet-item[open] summary::after {
    transform: rotate(180deg);
    color: var(--secondary-color);
}
.cheatsheet-item summary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-color);
}
.cheatsheet-content {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95em;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cheatsheet-content p {
    margin: 0 0 5px 0;
}
.code-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 5px;
}
.code-wrapper code {
    font-family: 'Courier New', Courier, monospace;
    color: #ffb74d;
    font-weight: bold;
    font-size: 0.95em;
    word-break: break-all;
}
.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    flex-shrink: 0;
}
.copy-btn:hover {
    background: var(--secondary-color);
    color: #000;
    border-color: var(--secondary-color);
}
.cheatsheet-content .desc {
    font-size: 0.85em;
    color: #94a3b8;
    margin-bottom: 12px;
    line-height: 1.4;
}
.cheatsheet-content .desc:last-child {
    margin-bottom: 0;
}

/* Story Grid Homepage */
.story-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
    margin-top: 25px;
}
.story-list .story-section.glass-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    margin-bottom: 0 !important; /* Override layout stack margin */
}

/* GLightbox Simplification: Hide navigation arrows and descriptions */
.glightbox-desc,
.gslide-description,
.gnext, 
.gprev {
    display: none !important;
}

/* Theme Card Specific Styles on index.php */
.story-section.theme-detective { border-color: rgba(139, 69, 19, 0.4); }
.story-section.theme-detective h2 { color: #d2b48c; }
.story-section.theme-detective .next-level-btn { background: linear-gradient(135deg, #8b4513 0%, #5c3a21 100%); box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25); }

.story-section.theme-horror { border-color: rgba(153, 0, 0, 0.4); }
.story-section.theme-horror h2 { color: #ff4d4d; }
.story-section.theme-horror .next-level-btn { background: linear-gradient(135deg, #990000 0%, #4d0000 100%); box-shadow: 0 4px 12px rgba(153, 0, 0, 0.25); }

.story-section.theme-mystery { border-color: rgba(75, 0, 130, 0.4); }
.story-section.theme-mystery h2 { color: #b366ff; }
.story-section.theme-mystery .next-level-btn { background: linear-gradient(135deg, #4b0082 0%, #2b005e 100%); box-shadow: 0 4px 12px rgba(75, 0, 130, 0.25); }

.story-section.theme-ocean { border-color: rgba(0, 105, 148, 0.4); }
.story-section.theme-ocean h2 { color: #66ccff; }
.story-section.theme-ocean .next-level-btn { background: linear-gradient(135deg, #006994 0%, #003b5c 100%); box-shadow: 0 4px 12px rgba(0, 105, 148, 0.25); }

.story-section.theme-nature { border-color: rgba(34, 139, 34, 0.4); }
.story-section.theme-nature h2 { color: #90ee90; }
.story-section.theme-nature .next-level-btn { background: linear-gradient(135deg, #228b22 0%, #006400 100%); box-shadow: 0 4px 12px rgba(34, 139, 34, 0.25); }

.story-section.theme-scifi { border-color: rgba(0, 255, 255, 0.4); }
.story-section.theme-scifi h2 { color: #00ffff; }
.story-section.theme-scifi .next-level-btn { background: linear-gradient(135deg, #00ced1 0%, #008b8b 100%); box-shadow: 0 4px 12px rgba(0, 255, 255, 0.25); }

.story-section.theme-noir { border-color: rgba(169, 169, 169, 0.4); font-family: 'Special Elite', 'Courier New', monospace; }
.story-section.theme-noir h2 { color: #d3d3d3; font-family: 'Special Elite', cursive; }
.story-section.theme-noir .next-level-btn { background: linear-gradient(135deg, #555555 0%, #222222 100%); box-shadow: 0 4px 12px rgba(169, 169, 169, 0.25); }

.story-section.theme-neon { border-color: rgba(255, 20, 147, 0.4); }
.story-section.theme-neon h2 { color: #ff1493; text-shadow: 0 0 10px rgba(255, 20, 147, 0.5); }
.story-section.theme-neon .next-level-btn { background: linear-gradient(135deg, #ff1493 0%, #9400d3 100%); box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3); }

.story-section.type-coop { border-color: rgba(245, 158, 11, 0.4) !important; }
.story-section.type-coop h2 { color: #fbd38d !important; }
.story-section.type-coop .next-level-btn { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important; color: white !important; }

/* ==== FULL GAME UI THEME OVERRIDES ==== */

/* DETECTIVE THEME */
body.theme-detective { background: #1a1412; }
body.theme-detective .orb-purple { background: radial-gradient(circle, #8b4513 0%, rgba(139, 69, 19, 0) 70%); }
body.theme-detective .orb-blue { background: radial-gradient(circle, #d2b48c 0%, rgba(210, 180, 140, 0) 70%); }
body.theme-detective button, body.theme-detective .btn-primary { background: linear-gradient(135deg, #8b4513 0%, #5c3a21 100%); box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25); }
body.theme-detective button:hover, body.theme-detective .btn-primary:hover { background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%); }
body.theme-detective .cm-focused { border-color: #8b4513 !important; }

/* HORROR THEME */
body.theme-horror { background: #110000; }
body.theme-horror .orb-purple { background: radial-gradient(circle, #990000 0%, rgba(153, 0, 0, 0) 70%); }
body.theme-horror .orb-blue { background: radial-gradient(circle, #550000 0%, rgba(85, 0, 0, 0) 70%); }
body.theme-horror button, body.theme-horror .btn-primary { background: linear-gradient(135deg, #990000 0%, #4d0000 100%); box-shadow: 0 4px 12px rgba(153, 0, 0, 0.25); }
body.theme-horror button:hover, body.theme-horror .btn-primary:hover { background: linear-gradient(135deg, #cc0000 0%, #990000 100%); }
body.theme-horror .cm-focused { border-color: #990000 !important; }
body.theme-horror h1, body.theme-horror h2 { color: #ff4d4d; }

/* MYSTERY THEME */
body.theme-mystery { background: #0b0512; }
body.theme-mystery .orb-purple { background: radial-gradient(circle, #4b0082 0%, rgba(75, 0, 130, 0) 70%); }
body.theme-mystery .orb-blue { background: radial-gradient(circle, #8a2be2 0%, rgba(138, 43, 226, 0) 70%); }
body.theme-mystery button, body.theme-mystery .btn-primary { background: linear-gradient(135deg, #4b0082 0%, #2b005e 100%); box-shadow: 0 4px 12px rgba(75, 0, 130, 0.25); }
body.theme-mystery button:hover, body.theme-mystery .btn-primary:hover { background: linear-gradient(135deg, #8a2be2 0%, #4b0082 100%); }
body.theme-mystery .cm-focused { border-color: #8a2be2 !important; }

/* OCEAN THEME */
body.theme-ocean { background: #00121a; }
body.theme-ocean .orb-purple { background: radial-gradient(circle, #006994 0%, rgba(0, 105, 148, 0) 70%); }
body.theme-ocean .orb-blue { background: radial-gradient(circle, #00ced1 0%, rgba(0, 206, 209, 0) 70%); }
body.theme-ocean button, body.theme-ocean .btn-primary { background: linear-gradient(135deg, #006994 0%, #003b5c 100%); box-shadow: 0 4px 12px rgba(0, 105, 148, 0.25); }
body.theme-ocean button:hover, body.theme-ocean .btn-primary:hover { background: linear-gradient(135deg, #00ced1 0%, #006994 100%); }
body.theme-ocean .cm-focused { border-color: #00ced1 !important; }

/* NATURE THEME */
body.theme-nature { background: #051405; }
body.theme-nature .orb-purple { background: radial-gradient(circle, #228b22 0%, rgba(34, 139, 34, 0) 70%); }
body.theme-nature .orb-blue { background: radial-gradient(circle, #90ee90 0%, rgba(144, 238, 144, 0) 70%); }
body.theme-nature button, body.theme-nature .btn-primary { background: linear-gradient(135deg, #228b22 0%, #006400 100%); box-shadow: 0 4px 12px rgba(34, 139, 34, 0.25); }
body.theme-nature button:hover, body.theme-nature .btn-primary:hover { background: linear-gradient(135deg, #32cd32 0%, #228b22 100%); }
body.theme-nature .cm-focused { border-color: #228b22 !important; }

/* SCIFI THEME */
body.theme-scifi { background: #000b14; font-family: 'Courier New', monospace; }
body.theme-scifi h1, body.theme-scifi h2, body.theme-scifi h3, body.theme-scifi button { font-family: 'Courier New', monospace; text-transform: uppercase; }
body.theme-scifi .orb-purple { background: radial-gradient(circle, #00ffff 0%, rgba(0, 255, 255, 0) 70%); }
body.theme-scifi .orb-blue { background: radial-gradient(circle, #008b8b 0%, rgba(0, 139, 139, 0) 70%); }
body.theme-scifi button, body.theme-scifi .btn-primary { background: linear-gradient(135deg, #00ced1 0%, #008b8b 100%); box-shadow: 0 4px 12px rgba(0, 255, 255, 0.25); }
body.theme-scifi button:hover, body.theme-scifi .btn-primary:hover { background: linear-gradient(135deg, #00ffff 0%, #00ced1 100%); }
body.theme-scifi .glass-panel { border-color: rgba(0, 255, 255, 0.2); }
body.theme-scifi .cm-focused { border-color: #00ffff !important; }

/* NEON THEME */
body.theme-neon { background: #0a001a; }
body.theme-neon h1, body.theme-neon h2 { color: #ff1493; text-shadow: 0 0 10px rgba(255, 20, 147, 0.5); }
body.theme-neon .orb-purple { background: radial-gradient(circle, #ff1493 0%, rgba(255, 20, 147, 0) 70%); }
body.theme-neon .orb-blue { background: radial-gradient(circle, #00ffff 0%, rgba(0, 255, 255, 0) 70%); }
body.theme-neon button, body.theme-neon .btn-primary { background: linear-gradient(135deg, #ff1493 0%, #9400d3 100%); box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3); }
body.theme-neon button:hover, body.theme-neon .btn-primary:hover { background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%); }
body.theme-neon .cm-focused { border-color: #ff1493 !important; }

/* Filter Toggles */
.filter-toggle {
    opacity: 0.5;
    transition: all 0.3s ease;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}
.filter-toggle:hover {
    opacity: 0.8;
}
.filter-toggle.active {
    opacity: 1;
}
.filter-toggle.active[data-theme="detective"] { border-color: #8b4513; box-shadow: 0 0 12px rgba(139, 69, 19, 0.7); color: #d2b48c; }
.filter-toggle.active[data-theme="horror"] { border-color: #990000; box-shadow: 0 0 12px rgba(153, 0, 0, 0.7); color: #ff4d4d; }
.filter-toggle.active[data-theme="mystery"] { border-color: #4b0082; box-shadow: 0 0 12px rgba(75, 0, 130, 0.7); color: #b366ff; }
.filter-toggle.active[data-theme="ocean"] { border-color: #006994; box-shadow: 0 0 12px rgba(0, 105, 148, 0.7); color: #66ccff; }
.filter-toggle.active[data-theme="nature"] { border-color: #228b22; box-shadow: 0 0 12px rgba(34, 139, 34, 0.7); color: #90ee90; }
.filter-toggle.active[data-theme="scifi"] { border-color: #00ffff; box-shadow: 0 0 12px rgba(0, 255, 255, 0.7); color: #00ffff; }
.filter-toggle.active[data-theme="noir"] { border-color: #a9a9a9; box-shadow: 0 0 12px rgba(169, 169, 169, 0.7); color: #d3d3d3; }
.filter-toggle.active[data-theme="neon"] { border-color: #ff1493; box-shadow: 0 0 12px rgba(255, 20, 147, 0.7); color: #ff1493; }
.filter-toggle.active[data-theme="default"] { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.7); color: #ffffff; }
.filter-toggle.active[data-theme="all"] { border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, 0.7); color: #c084fc; }
.filter-toggle.active[data-theme="coop"] { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.7); color: #fcd34d; }

/* Error Effects */
@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes flash-error {
  0% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
  50% { box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.6); }
  100% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
}

.shake-effect {
  animation: shake-error 0.4s ease-in-out;
}

.flash-effect::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  animation: flash-error 0.5s ease-in-out;
}

/* Achievements Toast Notification */
#achievement-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

.achievement-toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--secondary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  min-width: 280px;
  max-width: 350px;
  animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.achievement-toast.hiding {
  animation: slideOutRight 0.5s forwards;
}

.achievement-toast .ach-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.achievement-toast .ach-content {
  flex: 1;
}

.achievement-toast .ach-title {
  font-weight: bold;
  color: var(--secondary-color);
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.achievement-toast .ach-desc {
  font-size: 0.8rem;
  color: var(--text-color);
  line-height: 1.3;
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* Achievements Grid in Profile */
#profile-modal .modal-content {
  max-width: 800px;
  width: 95%;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

@media (min-width: 1024px) {
  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ach-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  text-align: left;
}

.ach-item.unlocked {
  background: rgba(253, 216, 53, 0.1);
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(253, 216, 53, 0.2);
}

.ach-item.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.ach-item .ach-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.ach-item .ach-title {
  font-weight: bold;
  font-size: 0.95rem;
  color: white;
  margin-bottom: 4px;
}

.ach-item.unlocked .ach-title {
  color: var(--secondary-color);
}

.ach-item .ach-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.3;
}

/* Konami Retro Mode */
body.retro-mode {
    font-family: 'Courier New', Courier, monospace !important;
    image-rendering: pixelated;
    filter: sepia(0.6) hue-rotate(180deg) saturate(2);
}
body.retro-mode * {
    font-family: 'Courier New', Courier, monospace !important;
}

/* Screen Shake Animation */
@keyframes screenShake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

body.shake {
    animation: screenShake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Copy to Clipboard Popup */
.copy-popup {
    position: absolute;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.2s, transform 0.2s;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.copy-popup.show {
    opacity: 1;
    transform: translateY(-15px);
}
.copyable {
    transition: opacity 0.1s;
}
.copyable:hover {
    opacity: 0.7;
}
.copyable:active {
    opacity: 0.4;
}
