FancyWordle/CSS/styles.css
2025-07-31 22:53:09 -04:00

401 lines
7.1 KiB
CSS

*, *::after, *::before {
box-sizing: border-box;
}
body {
background-color: #fafafa;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
padding: 16px;
text-align: center;
font-size: 16px;
}
/* Header Section */
.darkmode {
margin-bottom: 16px;
}
.icons {
display: flex;
justify-content: center;
align-items: center;
gap: 16px;
margin-bottom: 24px;
}
.icons__container {
display: flex;
align-items: center;
}
.theme-change,
.share-stats,
.setting-page {
display: flex;
color: #666;
font-size: 20px;
cursor: pointer;
padding: 8px;
border-radius: 4px;
transition: all 0.2s ease;
}
.theme-change:hover,
.share-stats:hover,
.setting-page:hover {
color: #333;
background-color: rgba(0, 0, 0, 0.05);
}
.img-banner {
width: auto;
max-width: 300px;
height: auto;
}
/* Game Grid - Simplified */
.guess-grid {
display: grid;
grid-template-columns: repeat(5, 60px);
grid-template-rows: repeat(6, 60px);
gap: 5px;
justify-content: center;
margin: 32px auto;
flex: 1;
align-content: start;
}
.tile {
width: 60px;
height: 60px;
border: 2px solid #d3d6da;
display: flex;
justify-content: center;
align-items: center;
font-size: 32px;
font-weight: bold;
text-transform: uppercase;
color: #333;
user-select: none;
transition: all 0.2s ease;
}
.tile[data-state="active"] {
border-color: #878a8c;
}
.tile[data-state="wrong"] {
background-color: #787c7e;
border-color: #787c7e;
color: white;
}
.tile[data-state="wrong-position"] {
background-color: #c9b458;
border-color: #c9b458;
color: white;
}
.tile[data-state="correct"] {
background-color: #6aaa64;
border-color: #6aaa64;
color: white;
}
.tile.shake {
animation: shake 0.6s ease-in-out;
}
.tile.dance {
animation: dance 1s ease-in-out;
}
.tile.flip {
transform: rotateX(90deg);
}
/* Keyboard - NY Times Style */
.keyboard {
display: grid;
grid-template-columns: repeat(20, minmax(auto, 1.25em));
grid-auto-rows: 3em;
gap: 0.25em;
justify-content: center;
margin-top: auto;
padding: 0 0.5em;
margin-bottom: 1em;
}
.key {
font-size: inherit;
grid-column: span 2;
border: none;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #d3d6da;
color: #333;
fill: currentColor;
text-transform: uppercase;
border-radius: 0.25em;
cursor: pointer;
user-select: none;
transition: background-color 0.1s ease;
touch-action: manipulation;
font-weight: bold;
}
.key.large {
grid-column: span 3;
}
.key:hover,
.key:focus {
background-color: #c0c4c7;
}
.key.wrong {
background-color: #787c7e;
color: white;
}
.key.wrong-position {
background-color: #c9b458;
color: white;
}
.key.correct {
background-color: #6aaa64;
color: white;
}
.key > svg {
width: 1.5em;
height: 1.5em;
fill: currentColor;
}
/* Animations */
@keyframes shake {
0%, 100% { transform: translateX(0); }
10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
20%, 40%, 60%, 80% { transform: translateX(10px); }
}
@keyframes dance {
0%, 100% { transform: translateY(0); }
20% { transform: translateY(-30px); }
40% { transform: translateY(5px); }
60% { transform: translateY(-15px); }
80% { transform: translateY(2px); }
}
/* Alerts */
.alert-container {
position: fixed;
top: 20%;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
max-width: 500px;
}
.alert {
background-color: #333;
color: white;
padding: 16px 24px;
border-radius: 8px;
margin-bottom: 8px;
opacity: 1;
transition: opacity 0.5s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
width: 100%;
text-align: center;
}
.alert.hide {
opacity: 0;
}
.definition-alert {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
border-radius: 12px;
cursor: pointer;
text-align: left;
line-height: 1.6;
position: relative;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
transition: transform 0.3s ease;
}
.definition-alert:hover {
transform: translateY(-2px);
}
.definition-alert strong {
display: block;
font-size: 18px;
margin-bottom: 8px;
}
.definition-alert::before {
content: "💡 Tap to dismiss";
position: absolute;
top: 8px;
right: 12px;
font-size: 12px;
opacity: 0.7;
}
.win-definition {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.lose-definition {
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
/* Dark Theme */
body.dark-theme {
background-color: #121213;
color: white;
}
.dark-theme .tile {
border-color: #3a3a3c;
color: white;
}
.dark-theme .tile[data-state="active"] {
border-color: #565758;
}
.dark-theme .key {
background-color: #818384;
color: white;
}
.dark-theme .key:hover,
.dark-theme .key:focus {
background-color: #6a6b6c;
}
.dark-theme .theme-change,
.dark-theme .share-stats,
.dark-theme .setting-page {
color: #ccc;
}
.dark-theme .theme-change:hover,
.dark-theme .share-stats:hover,
.dark-theme .setting-page:hover {
color: white;
background-color: rgba(255, 255, 255, 0.1);
}
/* Mobile Responsive - Single Breakpoint Approach */
@media (max-width: 600px) {
body {
padding: 12px;
font-size: 14px;
}
.img-banner {
max-width: 250px;
}
.icons {
gap: 12px;
margin-bottom: 16px;
}
.theme-change,
.share-stats,
.setting-page {
font-size: 18px;
padding: 6px;
}
.guess-grid {
grid-template-columns: repeat(5, 50px);
grid-template-rows: repeat(6, 50px);
gap: 4px;
margin: 24px auto;
}
.tile {
width: 50px;
height: 50px;
font-size: 26px;
}
.keyboard {
grid-template-columns: repeat(20, minmax(auto, 1em));
grid-auto-rows: 2.5em;
gap: 0.2em;
padding: 0 0.25em;
margin-bottom: 0.5em;
}
.key {
font-size: 0.7em;
}
.key > svg {
width: 1.2em;
height: 1.2em;
}
.alert {
padding: 12px 16px;
}
.definition-alert {
padding: 16px;
font-size: 14px;
}
.definition-alert strong {
font-size: 16px;
}
}
/* Very small screens */
@media (max-width: 400px) {
.guess-grid {
grid-template-columns: repeat(5, 45px);
grid-template-rows: repeat(6, 45px);
}
.tile {
width: 45px;
height: 45px;
font-size: 22px;
}
.keyboard {
grid-template-columns: repeat(20, minmax(auto, 0.8em));
grid-auto-rows: 2.2em;
gap: 0.15em;
}
.key {
font-size: 0.6em;
}
.key > svg {
width: 1em;
height: 1em;
}
}