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

html, body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

}

/* Header */
header {
    background-color: #ff6b6b;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 0;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-links a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Hero Section */
.hero {
    background-color: #ffeaa7;
    padding: 2rem 0;
    text-align: center;
    background-image: url(./eluosi.jpg);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 234, 167, 0.7); /* 半透明黄色遮罩 */
    backdrop-filter: blur(3px); /* 模糊效果 */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.hero-content p {
    font-size: 1.2rem;
    color: #636e72;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4), 0 3px 8px rgba(0,0,0,0.2);
    border-color: #ffd700;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #ee5a52, #ff6b6b);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6), 0 4px 12px rgba(0,0,0,0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.5), 0 2px 6px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: linear-gradient(145deg, #74b9ff, #0984e3);
    color: white;
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4), 0 3px 8px rgba(0,0,0,0.2);
    margin-left: 0;
    border-color: #ffd700;
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #0984e3, #74b9ff);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.6), 0 4px 12px rgba(0,0,0,0.3);
}

.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.5), 0 2px 6px rgba(0,0,0,0.2);
}

/* About Game Section */
.about-game {
    background-color: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin: 2rem 0;
}

.about-game h2 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.about-game p {
    font-size: 1.1rem;
    color: #636e72;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Benefits Section */
.benefits {
    background-color: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.benefits h2 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.benefit-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.benefit-item {
    background-color: #ffeaa7;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.benefit-item h3 {
    font-size: 1.3rem;
    color: #e17055;
    margin-bottom: 1rem;
}

.benefit-item p {
    color: #636e72;
}

/* How to Play Section */
.how-to-play {
    background-color: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    text-align: center;
}

.how-to-play h2 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
}

.how-to-play p {
    font-size: 1.1rem;
    color: #636e72;
    max-width: 800px;
    margin: 0 auto;
}

/* Footer */
footer {
    background-color: #636e72;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b6b;
}

/* Game Section */
.game-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 1rem;
}

.game-header {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 18px;
    margin-bottom: 1.2rem;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.score, .level, .lines {
    text-align: center;
    min-width: 80px;
}

.score h3, .level h3, .lines h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score p, .level p, .lines p {
    font-size: 2rem;
    font-weight: bold;
    color: #764ba2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-family: 'Courier New', monospace;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-area {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    align-items: flex-start;
    width: 100%;
    max-width: 400px;
}

#gameCanvas {
    border: 4px solid #ffd700;
    border-radius: 15px;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3), inset 0 0 20px rgba(0,0,0,0.2);
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
    padding: 5px;
    background-clip: content-box;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
    width: 200px;
}

.next-piece {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 2px solid #ffd700;
    display: flex;
    align-items: center;
}

.next-piece h3 {
    color: #667eea;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 1rem;
}

#nextCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    max-width: 100%;
    height: auto;
    padding: 3px;
    background-clip: content-box;
}

.game-controls {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 0.5rem;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.game-controls .btn {
    padding: 12px 20px;
    font-size: 1rem;
    flex: 1;
    max-width: 140px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Mobile Controls - Gamepad Style */
.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    width: 100%;
    max-width: 430px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.control-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* D-pad (Directional Pad) */
.d-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
    margin-right: 1rem;
}

/* Action buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.8rem;
    transform: rotate(-25deg);
}

/* Gamepad button styles */
.control-btn {
    width: 65px;
    height: 65px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    border: 3px solid #ffd700;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #333, #222);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.2);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* D-pad center - hidden button */
.d-pad .center {
    background: transparent;
    box-shadow: none;
    cursor: default;
    border-color: transparent;
}

/* D-pad directional buttons */
.d-pad .control-btn {
    background: linear-gradient(145deg, #667eea, #5a6fd8);
    border-color: #ffd700;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5), 0 4px 8px rgba(0,0,0,0.2);
}

/* Action buttons - different colors */
.action-buttons .control-btn {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border-color: #ffd700;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6), 0 4px 8px rgba(0,0,0,0.2);
    font-size: 1.1rem;
    font-weight: bold;
    transform: rotate(25deg);
}

.action-buttons .control-btn:nth-child(2) {
    background: linear-gradient(145deg, #4ecdc4, #3cb0ab);
    border-color: #ffd700;
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.6), 0 4px 8px rgba(0,0,0,0.2);
}

/* Button hover effect */
.control-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0,0,0,0.5), 0 6px 12px rgba(0,0,0,0.3);
}

.d-pad .control-btn:hover {
    background: linear-gradient(145deg, #5a6fd8, #667eea);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.7), 0 6px 12px rgba(0,0,0,0.3);
}

.action-buttons .control-btn:hover {
    background: linear-gradient(145deg, #ee5a52, #ff6b6b);
    transform: translateY(-3px) scale(1.05) rotate(25deg);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.8), 0 6px 12px rgba(0,0,0,0.3);
}

.action-buttons .control-btn:nth-child(2):hover {
    background: linear-gradient(145deg, #3cb0ab, #4ecdc4);
    transform: translateY(-3px) scale(1.05) rotate(25deg);
    box-shadow: 0 12px 25px rgba(78, 205, 196, 0.8), 0 6px 12px rgba(0,0,0,0.3);
}

/* Button active/pressed effect */
.control-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.1);
}

.action-buttons .control-btn:active {
    transform: translateY(1px) scale(0.98) rotate(25deg);
}

.d-pad .control-btn:active {
    background: linear-gradient(145deg, #5263c7, #5a6fd8);
}

.action-buttons .control-btn:active {
    background: linear-gradient(145deg, #d84f47, #ee5a52);
}

.action-buttons .control-btn:nth-child(2):active {
    background: linear-gradient(145deg, #369894, #3cb0ab);
}

/* About, Contact, Privacy, Terms Sections */
.about-section, .contact-section, .privacy-section, .terms-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin: 2rem 0;
}

.about-section h2, .contact-section h2, .privacy-section h2, .terms-section h2 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.about-content, .contact-content, .privacy-content, .terms-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h3, .privacy-content h3, .terms-content h3 {
    font-size: 1.5rem;
    color: #e17055;
    margin: 1.5rem 0 1rem;
}

.about-content h4, .privacy-content h4 {
    font-size: 1.2rem;
    color: #74b9ff;
    margin: 1.2rem 0 0.8rem;
}

.about-content ul, .privacy-content ul, .terms-content ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.about-content li, .privacy-content li, .terms-content li {
    margin-bottom: 0.5rem;
    color: #636e72;
}

/* Contact Info */
.contact-info {
    background-color: #ffeaa7;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.contact-info h3 {
    color: #e17055;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.email-display {
    font-size: 1.5rem;
    margin-top: 1rem;
}

.email-display a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.email-display a:hover {
    color: #ee5a52;
    text-decoration: underline;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.data-table th {
    background-color: #74b9ff;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    color: #636e72;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #ffeaa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* 标题文本 */
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    h4 {
        font-size: 1.2rem;
    }
    
    /* 正文文本 */
    p {
        font-size: 1rem;
    }
    
    li {
        font-size: 1rem;
    }
    
    /* Hero Section */
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    /* 游戏相关 */
    .game-header {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .game-area {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
    
    /* 导航和链接 */
    .nav-links a {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 0.95rem;
    }
    
    /* 表格 */
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th, .data-table td {
        padding: 10px;
    }
    
    /* 按钮 */
    .btn {
        font-size: 0.95rem;
        padding: 11px 22px;
    }
}

@media (max-width: 480px) {
    /* 标题文本 */
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* 正文文本 */
    p {
        font-size: 0.95rem;
    }
    
    li {
        font-size: 0.95rem;
    }
    
    /* Hero Section */
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    /* 按钮 */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* 游戏相关 */
    .game-section {
        padding: 1rem;
    }
    
    .game-header {
        padding: 0.5rem;
        gap: 0.8rem;
    }
    
    .score p, .level p, .lines p {
        font-size: 1.5rem;
    }
    
    .score h3, .level h3, .lines h3 {
        font-size: 0.85rem;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        margin-top: 1rem;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .control-row {
        gap: 0.5rem;
    }
    
    /* 导航和链接 */
    .nav-links a {
        font-size: 0.95rem;
        padding: 0.3rem 0.7rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    /* 页面内容 */
    .about-section, .contact-section, .privacy-section, .terms-section {
        padding: 1rem;
    }
    
    /* 表格 */
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th, .data-table td {
        padding: 8px;
    }
}

/* Game Instructions Section */
.game-instructions {
    margin-top: 2rem;
    padding: 2rem;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.game-instructions h2 {
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: bold;
}

.instructions-content h3 {
    color: #2d3436;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #f5f6fa;
    padding-bottom: 0.5rem;
}

.instructions-content h4 {
    color: #636e72;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.instructions-content p {
    color: #2d3436;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.instructions-content ul {
    color: #2d3436;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

.instructions-content li strong {
    color: #ff6b6b;
}

/* Shape List */
.shape-list {
    list-style-type: none;
    padding-left: 0;
}

.shape-list li {
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f5f6fa;
    border-radius: 8px;
    border-left: 4px solid #74b9ff;
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.controls-section > div {
    flex: 1;
    min-width: 250px;
}

/* Scoring Table */
.scoring-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.scoring-table th,
.scoring-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
}

.scoring-table th {
    background-color: #ff6b6b;
    color: white;
    font-weight: bold;
}

.scoring-table tr:nth-child(even) {
    background-color: #f5f6fa;
}

.scoring-table tr:hover {
    background-color: #e8f4f8;
}

/* Tips List */
.tips-list li {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    position: relative;
}

.tips-list li:before {
    content: "💡";
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Responsive styles for instructions */
@media (max-width: 768px) {
    .game-instructions {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .game-instructions h2 {
        font-size: 1.8rem;
    }
    
    .instructions-content h3 {
        font-size: 1.3rem;
    }
    
    .instructions-content h4 {
        font-size: 1.1rem;
    }
    
    .controls-section {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .game-instructions {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .scoring-table th,
    .scoring-table td {
        padding: 10px;
        font-size: 0.9rem;
    }
}