diff --git a/index.html b/index.html index d1f3505..26789b7 100644 --- a/index.html +++ b/index.html @@ -66,15 +66,17 @@
-
- Current Turn: -
- X +
+
+ Current Turn: +
+ X +
+
+
+
+ Player X starts the game
-
- -
- Player X starts the game
diff --git a/multiplayer.js b/multiplayer.js index 28c69b5..d8de4b7 100644 --- a/multiplayer.js +++ b/multiplayer.js @@ -357,7 +357,7 @@ class MultiplayerClient { document.getElementById('multiplayerPanel').style.display = 'none'; document.getElementById('gameControls').style.display = 'grid'; document.querySelector('.board-wrapper').style.display = 'flex'; - document.getElementById('statusMessage').style.display = 'block'; + // status container is part of gameControls now // Set board size document.querySelectorAll('.size-btn').forEach(btn => { @@ -387,13 +387,15 @@ class MultiplayerClient { } // Update status - const status = document.getElementById('statusMessage'); + const statusText = document.getElementById('statusMessage'); // This is the status-text element + const statusContainer = statusText.parentElement; // This is the status-container element + if (this.myTurn) { - status.textContent = `🎮 VS ${this.opponent} | YOUR TURN - You're playing as ${this.mySymbol}`; - status.className = 'status-message success'; + statusText.textContent = `🎮 VS ${this.opponent} | YOUR TURN - You're playing as ${this.mySymbol}`; + statusContainer.className = 'status-container success'; } else { - status.textContent = `🎮 VS ${this.opponent} | Waiting for ${this.opponent} to move - You're playing as ${this.mySymbol}`; - status.className = 'status-message info'; + statusText.textContent = `🎮 VS ${this.opponent} | Waiting for ${this.opponent} to move - You're playing as ${this.mySymbol}`; + statusContainer.className = 'status-container info'; } console.log(`✅ Game started! You are ${this.mySymbol}, ${this.myTurn ? 'your turn' : 'waiting'}`); @@ -504,7 +506,10 @@ class MultiplayerClient { const messageEl = document.getElementById('statusMessage'); if (messageEl) { messageEl.textContent = text; - messageEl.className = `status-message ${type}`; + // Apply class to the container, not the text element + if (messageEl.parentElement.classList.contains('status-container')) { + messageEl.parentElement.className = `status-container ${type}`; + } } } } diff --git a/styles.css b/styles.css index 063a7e6..09c426e 100644 --- a/styles.css +++ b/styles.css @@ -433,28 +433,50 @@ body { } /* Status Message */ -.status-message { - text-align: center; +/* Merged Status Container */ +.status-container { + display: flex; + align-items: center; + justify-content: center; + gap: 1.5rem; padding: 1rem; background: var(--bg-tertiary); border-radius: 12px; border: 1px solid var(--border-light); - color: var(--text-secondary); - font-weight: 600; - font-size: 1rem; width: 100%; } -.status-message.success { - border-color: var(--success); - color: var(--success); - background: rgba(16, 185, 129, 0.1); +.status-divider { + width: 1px; + height: 24px; + background: var(--border-light); } -.status-message.info { +.status-text { + color: var(--text-secondary); + font-weight: 600; + font-size: 1rem; + flex: 1; + text-align: left; +} + +/* Status variants applied to the container */ +.status-container.success { + border-color: var(--success); + background: rgba(16, 185, 129, 0.05); +} + +.status-container.success .status-text { + color: var(--success); +} + +.status-container.info { border-color: var(--accent-secondary); + background: rgba(56, 189, 248, 0.05); +} + +.status-container.info .status-text { color: var(--accent-secondary); - background: rgba(56, 189, 248, 0.1); } /* Victory Overlay */