Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 325 additions & 0 deletions CSS/2048-index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@

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

body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: #333;
overflow-x: hidden;
}

.game-container {
display: flex;
gap: 2rem;
max-width: 1200px;
width: 100%;
padding: 1rem;
align-items: flex-start;
}

.game-section {
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
padding: 2rem;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-game {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 1.5rem;
}

.instructions {
width: 700px;
min-height: 150px;
}

.game-header {
text-align: center;
margin-bottom: 1rem;
}

.game-title {
font-size: 3.5rem;
font-weight: bold;
color: #ed6a5a;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 0.5rem;
}

.game-subtitle {
font-size: 1rem;
color: #666;
margin-bottom: 1rem;
}

.score-container {
display: flex;
gap: 1rem;
justify-content: center;
margin-bottom: 1rem;
}

.score-box {
background: #ed6a5a;
color: white;
padding: 0.8rem 1.5rem;
border-radius: 12px;
text-align: center;
min-width: 100px;
box-shadow: 0 4px 8px rgba(237, 106, 90, 0.3);
}

.score-label {
font-size: 0.8rem;
opacity: 0.9;
margin-bottom: 0.2rem;
}

.score-value {
font-size: 1.5rem;
font-weight: bold;
}

.controls {
display: flex;
gap: 1rem;
margin-bottom: 1rem;
}

.btn {
padding: 0.8rem 1.5rem;
border: none;
border-radius: 12px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
background: #4ecdc4;
color: white;
}

.btn-primary:hover {
background: #45b7aa;
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(78, 205, 196, 0.4);
}

.btn-secondary {
background: #f7f7f7;
color: #333;
border: 2px solid #ddd;
}

.btn-secondary:hover {
background: #e9e9e9;
transform: translateY(-2px);
}

#board {
display: grid;
grid-template-columns: repeat(4, 80px);
grid-template-rows: repeat(4, 80px);
gap: 8px;
background: #bbada0;
border-radius: 16px;
padding: 12px;
position: relative;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.tile {
display: flex;
justify-content: center;
align-items: center;
border-radius: 8px;
font-size: 2rem;
font-weight: bold;
background: rgba(238, 228, 218, 0.35);
transition: all 0.15s ease-in-out;
user-select: none;
}

.tile.new-tile {
animation: appear 0.2s ease-in-out;
}

@keyframes appear {
0% { opacity: 0; transform: scale(0); }
100% { opacity: 1; transform: scale(1); }
}

.tile.merged {
animation: merge 0.15s ease-in-out;
}

@keyframes merge {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}

/* Tile colors */
.x2 { background: #eee4da; color: #727371; }
.x4 { background: #ece0ca; color: #727371; }
.x8 { background: #f4b17a; color: white; }
.x16 { background: #f59575; color: white; }
.x32 { background: #f57c5f; color: white; }
.x64 { background: #f65d3b; color: white; }
.x128 { background: #edce71; color: white; font-size: 1.8rem; }
.x256 { background: #edcc63; color: white; font-size: 1.8rem; }
.x512 { background: #edc651; color: white; font-size: 1.8rem; }
.x1024 { background: #eec744; color: white; font-size: 1.5rem; }
.x2048 { background: #ecc230; color: white; font-size: 1.5rem; box-shadow: 0 0 20px rgba(236, 194, 48, 0.5); }
.x4096 { background: #fe3d3d; color: white; font-size: 1.5rem; }
.x8192 { background: #ff2020; color: white; font-size: 1.5rem; }

/* Instructions panel */
.instructions h2 {
color: #ed6a5a;
font-size: 1.8rem;
margin-bottom: 1rem;
text-align: center;
}

.instructions h3 {
color: #4ecdc4;
font-size: 1.2rem;
margin: 1.5rem 0 0.5rem 0;
}

.instructions p, .instructions li {
line-height: 1.6;
margin-bottom: 0.8rem;
color: #555;
}

.instructions ul {
margin-left: 1.2rem;
}

.key-hint {
display: inline-flex;
align-items: center;
background: #f0f0f0;
border: 2px solid #ddd;
border-radius: 6px;
padding: 0.2rem 0.5rem;
font-family: monospace;
font-weight: bold;
margin: 0 0.2rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goal-highlight {
background: linear-gradient(90deg, #ecc230, #edce71);
color: white;
padding: 0.8rem;
border-radius: 12px;
text-align: center;
font-weight: bold;
margin: 1rem 0;
box-shadow: 0 4px 8px rgba(236, 194, 48, 0.3);
}

.game-over {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.8);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}

.game-over-content {
background: white;
padding: 2rem;
border-radius: 20px;
text-align: center;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.game-over h2 {
color: #ed6a5a;
font-size: 2rem;
margin-bottom: 1rem;
}

.game-over p {
font-size: 1.2rem;
margin-bottom: 1.5rem;
color: #666;
}

/* Mobile responsive */
@media (max-width: 768px) {
.game-container {
flex-direction: column;
align-items: center;
}

.instructions {
width: 100%;
max-width: 400px;
order: 2;
}

.main-game {
order: 1;
}

.game-title {
font-size: 2.5rem;
}

#board {
grid-template-columns: repeat(4, 70px);
grid-template-rows: repeat(4, 70px);
}

.tile {
font-size: 1.5rem;
}

.x128, .x256, .x512 {
font-size: 1.3rem;
}

.x1024, .x2048, .x4096, .x8192 {
font-size: 1.1rem;
}
}

@media (max-width: 480px) {
#board {
grid-template-columns: repeat(4, 60px);
grid-template-rows: repeat(4, 60px);
gap: 6px;
}

.tile {
font-size: 1.3rem;
}
}

Loading