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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #fff;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(255, 100, 0, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(255, 100, 0, 0.5); }
  to { text-shadow: 0 0 30px rgba(255, 150, 0, 0.8), 0 0 40px rgba(255, 100, 0, 0.4); }
}

.main-layout {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Панель предметов */
.items-panel {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  width: 300px;
  backdrop-filter: blur(10px);
}

.items-panel h2 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: #ffd700;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.cat-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s;
}

.cat-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.cat-btn.active {
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.items-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.item-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.item-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.item-card.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.2);
}

.item-emoji {
  font-size: 2em;
  display: block;
  margin-bottom: 5px;
}

.item-name {
  font-size: 0.85em;
  color: #eee;
}

/* Микроволновка */
.microwave-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.microwave {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 50%, #2a2a2a 100%);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  width: 420px;
}

.microwave-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.brand {
  font-size: 1.1em;
  color: #ccc;
  font-weight: bold;
}

.timer-display {
  background: #000;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 1.8em;
  padding: 5px 15px;
  border-radius: 5px;
  border: 2px solid #333;
  text-shadow: 0 0 10px #00ff00;
}

.microwave-body {
  display: flex;
  gap: 15px;
}

.door {
  flex: 1;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.door-window {
  position: relative;
  background: #0a0a0a;
  margin: 10px;
  border-radius: 8px;
  overflow: hidden;
}

#microwaveCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.door-glass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.magnetron-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(100, 150, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.magnetron-glow.active {
  opacity: 1;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.controls {
  width: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctrl-btn {
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: #555;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  background: #666;
  transform: scale(1.05);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.action-btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.start-btn {
  background: linear-gradient(135deg, #00aa00, #00cc00);
  color: #fff;
}

.start-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00cc00, #00ee00);
  box-shadow: 0 0 15px rgba(0, 204, 0, 0.5);
}

.start-btn:disabled {
  background: #444;
  cursor: not-allowed;
}

.stop-btn {
  background: linear-gradient(135deg, #aa0000, #cc0000);
  color: #fff;
}

.stop-btn:hover {
  background: linear-gradient(135deg, #cc0000, #ee0000);
  box-shadow: 0 0 15px rgba(204, 0, 0, 0.5);
}

.open-btn {
  background: linear-gradient(135deg, #0066aa, #0088cc);
  color: #fff;
}

.open-btn:hover {
  background: linear-gradient(135deg, #0088cc, #00aaee);
  box-shadow: 0 0 15px rgba(0, 136, 204, 0.5);
}

.current-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 1.1em;
}

.result-panel {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  border-left: 4px solid #ff6b00;
}

.result-panel h3 {
  color: #ffd700;
  margin-bottom: 10px;
}

.result-panel p {
  line-height: 1.6;
  color: #eee;
}

/* Анимации для Canvas */
@keyframes explode {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(0); }
}

/* Скроллбар */
.items-list::-webkit-scrollbar {
  width: 8px;
}

.items-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.items-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.items-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}