Refactor UI with design system, tablet optimization, and enhanced styling

This commit is contained in:
Cursor Agent
2025-06-24 12:02:35 +00:00
parent eb005b1c05
commit 6058de5103
6 changed files with 864 additions and 296 deletions

View File

@@ -11,91 +11,216 @@
user-select: none;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: Arial, sans-serif;
background-color: #1a1a1a;
color: white;
min-height: 100vh;
overscroll-behavior: none;
}
input, select {
min-height: 44px;
padding: 12px;
font-size: 1.2rem;
/* Design system tokens */
:root {
/* Colors */
--color-primary: #ff9800;
--color-primary-hover: #ffa726;
--color-primary-light: rgba(255, 152, 0, 0.1);
--color-secondary: #333;
--color-secondary-hover: #444;
--color-background: #1a1a1a;
--color-surface: #222;
--color-surface-hover: #2a2a2a;
--color-text: #fff;
--color-text-secondary: #ccc;
--color-text-muted: #999;
--color-border: #333;
--color-success: #4caf50;
--color-danger: #f44336;
--color-warning: #ff9800;
/* Spacing system - 8px base */
--space-xs: 0.25rem; /* 4px */
--space-sm: 0.5rem; /* 8px */
--space-md: 1rem; /* 16px */
--space-lg: 1.5rem; /* 24px */
--space-xl: 2rem; /* 32px */
--space-xxl: 3rem; /* 48px */
/* Typography */
--font-size-xs: 0.75rem; /* 12px */
--font-size-sm: 0.875rem; /* 14px */
--font-size-base: 1rem; /* 16px */
--font-size-lg: 1.125rem; /* 18px */
--font-size-xl: 1.25rem; /* 20px */
--font-size-xxl: 1.5rem; /* 24px */
--font-size-xxxl: 2rem; /* 32px */
/* Touch targets */
--touch-target-min: 44px;
--touch-target-comfortable: 48px;
/* Border radius */
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
/* Shadows */
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16);
--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.24);
/* Transitions */
--transition-fast: 0.15s ease;
--transition-base: 0.2s ease;
--transition-slow: 0.3s ease;
}
/* Responsive adjustments for fullscreen toggle button */
@media screen and (max-width: 480px) {
.fullscreenToggle {
bottom: 15px;
right: 15px;
width: 40px;
height: 40px;
/* Tablet-specific design tokens */
@media (min-width: 768px) and (max-width: 1024px) {
:root {
--touch-target-min: 48px;
--touch-target-comfortable: 56px;
--space-md: 1.25rem; /* 20px */
--space-lg: 2rem; /* 32px */
--space-xl: 2.5rem; /* 40px */
--font-size-base: 1.125rem; /* 18px */
--font-size-lg: 1.25rem; /* 20px */
--font-size-xl: 1.5rem; /* 24px */
--font-size-xxl: 1.75rem; /* 28px */
--font-size-xxxl: 2.25rem; /* 36px */
}
}
/* Utility button for new game (global, not component-specific) */
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: var(--color-background);
color: var(--color-text);
min-height: 100vh;
overscroll-behavior: none;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Improved input styling for better tablet experience */
input, select {
min-height: var(--touch-target-comfortable);
padding: var(--space-md);
font-size: var(--font-size-base);
border: 2px solid var(--color-border);
border-radius: var(--radius-md);
background: var(--color-surface);
color: var(--color-text);
transition: border-color var(--transition-base);
}
input:focus, select:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
/* Enhanced button styling */
.btn {
min-height: var(--touch-target-comfortable);
padding: var(--space-md) var(--space-lg);
color: var(--color-text);
background: var(--color-secondary);
border: none;
border-radius: var(--radius-md);
font-size: var(--font-size-base);
font-weight: 600;
cursor: pointer;
touch-action: manipulation;
transition: all var(--transition-base);
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-sm);
text-decoration: none;
user-select: none;
}
.btn:hover {
background: var(--color-secondary-hover);
transform: translateY(-1px);
}
.btn:active {
transform: translateY(0);
}
.btn-primary {
background: var(--color-primary);
color: white;
}
.btn-primary:hover {
background: var(--color-primary-hover);
}
/* Utility button for new game with better spacing */
.new-game-button {
width: 100%;
background: #ff9800;
color: #fff;
background: var(--color-primary);
color: white;
border: none;
border-radius: 12px;
font-size: 2rem;
border-radius: var(--radius-lg);
font-size: var(--font-size-xxl);
font-weight: 700;
padding: 28px 0;
margin-bottom: 24px;
padding: var(--space-xl) var(--space-lg);
margin-bottom: var(--space-lg);
cursor: pointer;
transition: background 0.2s, color 0.2s, box-shadow 0.2s;
transition: all var(--transition-base);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 24px rgba(255, 152, 0, 0.25), 0 1.5px 6px rgba(0,0,0,0.12);
box-shadow: var(--shadow-lg);
letter-spacing: 0.5px;
gap: 16px;
gap: var(--space-md);
min-height: var(--touch-target-comfortable);
}
.new-game-button::before {
content: '+';
font-size: 2.2rem;
font-weight: 900;
margin-right: 12px;
display: inline-block;
line-height: 1;
}
.new-game-button:hover {
background: #ffa726;
box-shadow: 0 6px 32px rgba(255, 152, 0, 0.35), 0 2px 8px rgba(0,0,0,0.16);
background: var(--color-primary-hover);
transform: translateY(-2px);
box-shadow: 0 8px 40px rgba(255, 152, 0, 0.4);
}
/* Shared utility classes for buttons and layout */
.btn {
flex: 1;
min-width: 100px;
padding: 18px;
color: white;
background: #333;
border: none;
border-radius: 6px;
font-size: 1.2rem;
font-weight: 600;
cursor: pointer;
touch-action: manipulation;
transition: background 0.2s, color 0.2s;
}
.btn:hover {
background: #444;
.new-game-button:active {
transform: translateY(-1px);
}
/* Navigation buttons with improved spacing */
.nav-buttons {
display: flex;
flex-direction: column;
gap: 12px;
margin: 16px 0 0 0;
gap: var(--space-md);
margin: var(--space-lg) 0 0 0;
}
/* Modal overlay (global, not component-specific) */
/* Tablet-specific improvements */
@media (min-width: 768px) and (max-width: 1024px) {
.nav-buttons {
flex-direction: row;
gap: var(--space-lg);
}
.btn {
flex: 1;
min-height: var(--touch-target-comfortable);
}
.new-game-button {
padding: var(--space-xxl) var(--space-xl);
font-size: var(--font-size-xxxl);
}
}
/* Enhanced modal styling */
.modal {
position: fixed;
top: 0;
@@ -103,12 +228,33 @@ input, select {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(4px);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
padding: var(--space-lg);
}
.modal.show {
display: flex;
}
/* Responsive fullscreen toggle */
@media screen and (max-width: 480px) {
.fullscreenToggle {
bottom: var(--space-md);
right: var(--space-md);
width: 40px;
height: 40px;
}
}
@media (min-width: 768px) and (max-width: 1024px) {
.fullscreenToggle {
bottom: var(--space-lg);
right: var(--space-lg);
width: 56px;
height: 56px;
}
}