@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

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

:root {
  --mc-green: #5D8C3E;
  --mc-stone: #7F7F7F;
  --mc-text: #FCFCFC;
  --mc-shadow: #3F3F3F;
  --mc-gold: #FFAA00;
  --mc-red: #FF5555;
  --mc-lime: #55FF55;
  --mc-cyan: #55FFFF;
}

body {
  font-family: 'VT323', monospace;
  background: var(--mc-stone);
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  transition: background 2s ease;
}

.app.daytime {
  background: linear-gradient(180deg, #87CEEB 0%, #90C695 80%, #5D8C3E 100%);
}

.app.nighttime {
  background: linear-gradient(180deg, #0d1b2a 0%, #1b263b 50%, #1a1a2e 100%);
}

/* Header */
.mc-header {
  background: linear-gradient(180deg, #8B6914 0%, #6B5110 100%);
  padding: 1rem 2rem;
  border-bottom: 4px solid #3F3F00;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.header-icon {
  font-size: 2rem;
}

.server-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1rem, 4vw, 1.8rem);
  color: #FCFC00;
  text-shadow: 3px 3px 0 #3F3F00;
}

.info-btn {
  position: absolute;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mc-cyan);
  border: 3px solid #228888;
  color: #000;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  cursor: pointer;
  animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 15px var(--mc-cyan); }
}

/* Main Layout */
.main-content {
  display: grid;
  grid-template-columns: 280px 1fr 250px;
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 1fr;
  }
  .right-column { grid-column: span 2; }
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .right-column { grid-column: span 1; }
}

/* Panels */
.mc-panel {
  background: linear-gradient(135deg, #C6C6C6 0%, #8B8B8B 100%);
  border: 4px solid;
  border-color: #FCFCFC #373737 #373737 #FCFCFC;
  margin-bottom: 1rem;
}

.panel-header {
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
  color: var(--mc-text);
  padding: 0.75rem 1rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  text-transform: uppercase;
  border-bottom: 2px solid #1A1A1A;
}

/* Buttons */
.mc-button {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, #8B8B8B 0%, #5B5B5B 100%);
  border: 3px solid;
  border-color: #FCFCFC #373737 #373737 #FCFCFC;
  color: var(--mc-text);
  cursor: pointer;
  text-shadow: 2px 2px 0 #3F3F3F;
}

.mc-button:hover {
  background: linear-gradient(180deg, #9B9B9B 0%, #6B6B6B 100%);
}

.mc-button:active {
  border-color: #373737 #FCFCFC #FCFCFC #373737;
}

.mc-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-button.small {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
}

/* Status Panel */
.status-content {
  padding: 1rem;
}

.demo-badge {
  background: linear-gradient(90deg, var(--mc-cyan) 0%, #00AAAA 100%);
  color: #000;
  padding: 0.5rem;
  text-align: center;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  margin-bottom: 1rem;
  animation: glow-badge 2s infinite;
}

@keyframes glow-badge {
  0%, 100% { box-shadow: 0 0 5px var(--mc-cyan); }
  50% { box-shadow: 0 0 20px var(--mc-cyan); }
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.redstone-lamp {
  width: 20px;
  height: 20px;
  border: 2px solid #3F3F3F;
}

.redstone-lamp.online {
  background: radial-gradient(circle, #55FF55 30%, #2A8A2A 100%);
  box-shadow: 0 0 10px #55FF55;
}

.status-online {
  color: var(--mc-lime);
  font-weight: bold;
}

.player-count {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.server-ip-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.server-ip {
  background: #1a1a1a;
  color: var(--mc-lime);
  padding: 0.4rem 0.6rem;
  font-family: 'VT323', monospace;
  border: 2px solid #3F3F3F;
  flex: 1;
  min-width: 120px;
  font-size: 0.9rem;
}

.hint-text {
  font-size: 0.85rem;
  color: #555;
  font-style: italic;
}

/* Username Panel */
.username-content {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skin-preview {
  width: 48px;
  height: 48px;
  background: linear-gradient(180deg, #8B6C50 0%, #5B3C20 100%);
  border: 2px solid #3F3F3F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.username-edit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.username-input {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  padding: 0.5rem;
  background: #1a1a1a;
  border: 2px solid #3F3F3F;
  color: var(--mc-text);
  outline: none;
}

.username-input:focus {
  border-color: var(--mc-cyan);
}

.username-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.current-username {
  font-size: 1.2rem;
  color: var(--mc-gold);
  font-weight: bold;
}

/* Vote Panel */
.vote-content {
  padding: 1rem;
  text-align: center;
}

.vote-count {
  margin-bottom: 1rem;
}

.vote-number {
  display: block;
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: var(--mc-gold);
  text-shadow: 2px 2px 0 #3F3F00;
}

.vote-label {
  font-size: 0.85rem;
  color: var(--mc-shadow);
}

.vote-btn {
  background: linear-gradient(180deg, #55AA55 0%, #226622 100%);
  border-color: #88FF88 #225522 #225522 #88FF88;
  font-size: 1rem;
  width: 100%;
}

/* Mini-games Panel */
.minigames-panel .panel-header {
  background: linear-gradient(180deg, #AA5500 0%, #662200 100%);
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 3px solid #4A4A4A;
  cursor: pointer;
  transition: all 0.2s;
}

.game-card.playable {
  border-color: var(--mc-lime);
  background: rgba(85, 255, 85, 0.1);
}

.game-card.playable:hover {
  background: rgba(85, 255, 85, 0.3);
  transform: translateX(5px);
  box-shadow: 0 0 15px rgba(85, 255, 85, 0.5);
}

.game-icon {
  font-size: 1.8rem;
}

.game-name {
  font-size: 1rem;
  color: var(--mc-text);
  font-weight: bold;
}

.game-desc {
  font-size: 0.8rem;
  color: #AAA;
  flex: 1;
}

.high-score {
  font-size: 0.75rem;
  background: var(--mc-gold);
  color: #000;
  padding: 0.2rem 0.4rem;
  font-family: 'Press Start 2P', cursive;
}

/* Chat Panel */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.chat-messages {
  flex: 1;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  font-size: 0.95rem;
  max-height: 200px;
}

.chat-message {
  padding: 0.2rem 0;
  word-wrap: break-word;
}

.chat-message.player-msg {
  background: rgba(85, 255, 255, 0.1);
  padding: 0.2rem 0.4rem;
  margin: 0.1rem 0;
}

.system-msg { color: #FFFF55; }
.join-msg { color: #55FF55; }
.leave-msg { color: #FF5555; }

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #4A4A4A;
}

.chat-input {
  flex: 1;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  padding: 0.5rem;
  background: #1a1a1a;
  border: 2px solid #3F3F3F;
  color: var(--mc-text);
  outline: none;
}

.chat-input:focus { border-color: var(--mc-cyan); }
.chat-input:disabled { opacity: 0.5; }

/* Player List */
.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
}

.player-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #4A4A4A;
}

.player-head {
  width: 20px;
  height: 20px;
  background: #6B4C30;
  border: 1px solid #3F3F3F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.player-info {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 0.85rem;
  color: var(--mc-text);
}

.player-rank {
  font-size: 0.7rem;
}

/* Info Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: linear-gradient(135deg, #C6C6C6 0%, #8B8B8B 100%);
  border: 4px solid;
  border-color: #FCFCFC #373737 #373737 #FCFCFC;
  padding: 1.5rem;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  color: var(--mc-gold);
  margin-bottom: 1rem;
}

.modal-content h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
  color: #333;
}

.modal-content p {
  font-size: 1.1rem;
  line-height: 1.4;
  color: #333;
}

.modal-content ul {
  list-style: none;
  padding-left: 0;
}

.modal-content li {
  font-size: 1rem;
  padding: 0.3rem 0;
  color: #333;
}

.modal-content .mc-button {
  margin-top: 1rem;
  width: 100%;
}

/* Game Modals */
.game-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 4px solid;
  border-color: #5a5a5a #1a1a1a #1a1a1a #5a5a5a;
  z-index: 1001;
  width: 90%;
  max-width: 400px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #1A1A1A;
}

.game-header h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--mc-text);
}

.close-btn {
  background: var(--mc-red);
  border: 2px solid #AA3333;
  color: white;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
}

.game-stats {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #333;
  color: var(--mc-gold);
  font-size: 0.9rem;
}

.game-area {
  position: relative;
  height: 300px;
  background: #1a1a1a;
  overflow: hidden;
}

/* Click Game */
.click-game {
  cursor: crosshair;
}

.click-target {
  position: absolute;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  cursor: pointer;
  animation: target-pop 0.2s ease-out;
}

@keyframes target-pop {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}

/* Diamond Game */
.mine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 1rem;
  height: 100%;
}

.mine-block {
  background: #8B6914;
  border: 2px solid #5C4A10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mine-block:hover:not(.revealed) {
  background: #9B7920;
  transform: scale(1.05);
}

.mine-block.revealed {
  background: #4a4a4a;
  cursor: default;
}

.mine-block.revealed.diamond {
  background: #3399CC;
}

.mine-block.revealed.creeper {
  background: #55AA55;
}

/* Creeper Game */
.creeper-game {
  background: linear-gradient(180deg, #1a1a2e 0%, #2d1a1a 100%);
}

.falling-creeper {
  position: absolute;
  font-size: 2rem;
  transform: translateX(-50%);
  animation: creeper-wiggle 0.3s infinite;
}

@keyframes creeper-wiggle {
  0%, 100% { transform: translateX(-50%) rotate(-5deg); }
  50% { transform: translateX(-50%) rotate(5deg); }
}

.player-steve {
  position: absolute;
  bottom: 10px;
  font-size: 2.5rem;
  transform: translateX(-50%);
}

/* Game Over Overlay */
.game-over, .game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--mc-text);
  z-index: 10;
}

.game-over h2, .game-over-overlay h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: var(--mc-gold);
  margin-bottom: 1rem;
}

.game-over p, .game-over-overlay p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Footer */
.mc-footer {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
}

.remix-link {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: var(--mc-gold);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 2px solid var(--mc-gold);
}

.remix-link:hover {
  background: var(--mc-gold);
  color: #000;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #4A4A4A; }
::-webkit-scrollbar-thumb { background: #8B8B8B; border: 2px solid #4A4A4A; }

/* Columns */
.left-column, .center-column, .right-column {
  display: flex;
  flex-direction: column;
}