body {
    position: relative;
    min-height: 600px;
    font-family: Arial, sans-serif;
    padding: 0px;
    margin: 0 auto;
}

:root { 
    --cell-size: 50px; 
}


.divider {
    height: 2px;
    background-color: #ddd;
    margin: 20px auto;
    width: 100%;
    max-width: 420px; 
}


.instructions {
    margin: 0 auto 10px;
    color: #666;
    max-width: 600px;
    text-align: center;
}


.rotation-hint {
    margin: 10px auto;
    color: #333;
    font-style: italic;
    text-align: center;
}


.rotation-degree {
    color: #2196f3;
    font-weight: bold;
}


.site-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.header-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.logo-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.tagline {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.main-nav a:hover {
    color: #2196f3;
}


.game-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}


.about-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* How to Play Steps */
.how-to-play-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #2196f3;
    transition: all 0.3s ease;
}

.step-card:hover {
    background: #e3f2fd;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #2196f3;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}

.step-content h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.step-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Constraint Types */
.constraint-types {
    margin-top: 3rem;
}

.constraint-types h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.5em;
}

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

.constraint-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.constraint-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.constraint-example {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #2196f3;
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}

.constraint-item p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* Pips Facts */
.pips-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.fact-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2196f3, #e91e63);
}

.fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #2196f3;
}

.fact-icon {
    font-size: 2.5em;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fact-content h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
}

.fact-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Pips History */
.pips-history {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e91e63;
}

.pips-history h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.6em;
}

.pips-history p {
    margin: 0 0 2rem 0;
    color: #555;
    line-height: 1.6;
    font-size: 1.1em;
}

.game-comparison {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.game-comparison h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.game-comparison ul {
    margin: 0;
    padding-left: 1.5rem;
}

.game-comparison li {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.5;
}

.game-comparison strong {
    color: #2196f3;
    font-weight: 600;
}

/* FAQ Styles */
.faq-container {
    margin: 2rem 0;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.faq-question:hover {
    background: #e3f2fd;
}

.faq-question h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.faq-icon {
    font-size: 1.5em;
    color: #2196f3;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.privacy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.terms-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.effective-date {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.about-content {
    margin-top: 2rem;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2196f3;
    padding-bottom: 0.5rem;
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.feature-card h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    margin: 0;
}

/* How to Play Steps */
.how-to-play {
    margin: 2rem 0;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-number {
    background: #2196f3;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #666;
    margin: 0;
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin: 3rem 0;
}

.play-now-btn {
    display: inline-block;
    background: #2196f3;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease;
}

.play-now-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* Constraint Types */
.constraint-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.constraint-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.constraint-item h4 {
    color: #2196f3;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.constraint-item p {
    color: #666;
    margin: 0;
    font-size: 1rem;
}

/* Privacy Policy Specific Styles */
.privacy-content {
    margin-top: 2rem;
}

.privacy-section {
    margin-bottom: 3rem;
}

.privacy-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2196f3;
    padding-bottom: 0.5rem;
}

.privacy-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.privacy-section h4 {
    font-size: 1.1rem;
    color: #2196f3;
    margin-bottom: 0.5rem;
}

.privacy-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

/* Highlight Boxes */
.highlight-box {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.highlight-box h3 {
    color: #1976d2;
    margin-top: 0;
    margin-bottom: 1rem;
}

.security-highlight {
    background: #e8f5e8;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.security-highlight h3 {
    color: #2e7d32;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Privacy Lists */
.privacy-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.privacy-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
    line-height: 1.5;
}

.privacy-list li::before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Access Features */
.access-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.access-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.access-item:hover {
    transform: translateY(-2px);
}

.access-item h3 {
    color: #2196f3;
    margin-top: 0;
    margin-bottom: 1rem;
}

.access-item p {
    margin: 0;
    color: #666;
}

/* Security Features */
.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.security-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.security-item h4 {
    color: #4caf50;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.security-item p {
    margin: 0;
    color: #666;
}

/* Update Notice */
.update-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.update-notice h3 {
    color: #856404;
    margin-top: 0;
}

/* Contact Info */
.contact-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.contact-info p {
    margin: 0;
    font-style: italic;
    color: #666;
}

/* Terms of Use Specific Styles */
.terms-content {
    margin-top: 2rem;
}

.terms-section {
    margin-bottom: 3rem;
}

.terms-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2196f3;
    padding-bottom: 0.5rem;
}

.terms-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.terms-section h4 {
    font-size: 1.1rem;
    color: #2196f3;
    margin-bottom: 0.5rem;
}

.terms-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

/* Terms Lists */
.terms-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.terms-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
    line-height: 1.5;
}

.terms-list li::before {
    content: "•";
    color: #2196f3;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Prohibited Behaviors */
.prohibited-behaviors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.behavior-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.behavior-item h4 {
    color: #dc2626;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.behavior-item p {
    margin: 0;
    color: #666;
}

/* Penalty System */
.penalty-system {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.penalty-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.penalty-item h4 {
    color: #ea580c;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.penalty-item p {
    margin: 0;
    color: #666;
}

/* User Responsibilities */
.responsibilities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.responsibility-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.responsibility-item h4 {
    color: #059669;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.responsibility-item p {
    margin: 0;
    color: #666;
}

/* Privacy Highlight */
.privacy-highlight {
    background: #e8f5e8;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.privacy-highlight h4 {
    color: #2e7d32;
    margin-top: 0;
    margin-bottom: 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2196f3;
}

.games-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    display: block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.game-card-header {
    margin-bottom: 0;
}

.game-card-header .game-title {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
}

.site-footer {
    background: #343a40;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
}

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

.game-header {
    text-align: center;
    margin-bottom: 0px;
    padding: 20px 0;
}

.game-header h1 {
    margin: 0 0 0px 0;
    color: #333;
    font-size: 2.5em;
    font-weight: 700;
}

/* Hero Description */
.hero-description {
    margin: 20px 0 30px 0;
}

.hero-tagline {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.hero-subtitle {
    font-size: 1.1em;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Quick Guide */
.quick-guide {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0 30px 0;
    flex-wrap: wrap;
}

.guide-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    min-width: 140px;
}

.guide-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.guide-icon {
    font-size: 1.8em;
    line-height: 1;
}

.guide-text {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    text-align: center;
}

/* CTA Section */
.cta-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0 20px 0;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 140px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}

.cta-button.primary {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    font-size: 1.3em;
    padding: 16px 32px;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.cta-button.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button.primary:hover::before {
    left: 100%;
}

.cta-button.primary:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.cta-button.primary:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.cta-button.secondary {
    background: white;
    color: #2196f3;
    border-color: #2196f3;
}

.cta-button.secondary:hover {
    background: #2196f3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

/* Responsive Design for Game Header */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2em;
    }
    
    .hero-tagline {
        font-size: 1.1em;
    }
    
    .hero-subtitle {
        font-size: 1em;
    }
    
    .quick-guide {
        gap: 15px;
        margin: 20px 0 25px 0;
    }
    
    .guide-item {
        padding: 12px 15px;
        min-width: 120px;
    }
    
    .guide-icon {
        font-size: 1.5em;
    }
    
    .guide-text {
        font-size: 0.85em;
    }
    
    .cta-section {
        gap: 15px;
        margin: 25px 0 15px 0;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 1em;
        min-width: 120px;
    }
    
    .cta-button.primary {
        font-size: 1.1em;
        padding: 14px 28px;
        min-width: 180px;
    }
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0px auto;
    max-width: 980px;
}

.control-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    border-color: #2196f3;
    background: #f0f8ff;
    color: #2196f3;
}

.control-btn:active {
    transform: translateY(1px);
}


.result-banner {
    margin: 12px auto 0;
    font-size: 16px;
    font-weight: bold;
    max-width: 980px; 
    padding: 10px 12px;
    border-radius: 8px;
}

.result-success { 
    color: #166534; 
    background: #dcfce7; 
    border: 1px solid #16a34a; 
}

.result-failure { 
    color: #991b1b; 
    background: #fee2e2; 
    border: 1px solid #ef4444; 
}


.grid-container {
    display: grid;
    grid-template-columns: repeat(8, var(--cell-size));
    grid-template-rows: repeat(8, var(--cell-size));
    gap: 2px;
    margin: 20px;
    position: relative;
    border: 1px solid #999;
    padding: 2px;
    width: fit-content;
}

.grid-item {
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background-color: #fff;
    position: relative;
}

.grid-item.highlight {
    background-color: #e6f7ff;
}

.grid-item.filled {
    background-color: #f0fff4;
    border-color: #66bb6a;
}


.grid-item.inactive {
    opacity: 0;
    border-color: transparent;
    pointer-events: none;
}


.grid-item.constraint-blue { 
    background-color: #e8f0ff; 
    border-color: #3b82f6; 
}

.grid-item.constraint-green { 
    background-color: #e9fbe9; 
    border-color: #22c55e; 
}

.grid-item.constraint-red { 
    background-color: #ffeaea; 
    border-color: #ef4444; 
}

.grid-item.constraint-yellow { 
    background-color: #fff9e6; 
    border-color: #eab308; 
}

.grid-item.constraint-purple { 
    background-color: #f3e8ff; 
    border-color: #9333ea; 
}

.grid-item.constraint-orange { 
    background-color: #fff7ed; 
    border-color: #ea580c; 
}

.grid-item.constraint-pink { 
    background-color: #fdf2f8; 
    border-color: #ec4899; 
}

.grid-item.constraint-cyan { 
    background-color: #ecfeff; 
    border-color: #06b6d4; 
}

.grid-item.constraint-lime { 
    background-color: #f7fee7; 
    border-color: #65a30d; 
}

.grid-item.constraint-indigo { 
    background-color: #eef2ff; 
    border-color: #4f46e5; 
}

.grid-item.constraint-teal { 
    background-color: #f0fdfa; 
    border-color: #0d9488; 
}

.grid-item.constraint-amber { 
    background-color: #fffbeb; 
    border-color: #d97706; 
}


.constraint-badge { 
    display: none; 
}


.constraint-marker {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.9);
    z-index: 6;
    pointer-events: none; 
    color: #ffffff;
    font-weight: 700;
    line-height: 1;
}

.cm-blue { background:#2563eb; }
.cm-green { background:#16a34a; }
.cm-red { background:#ef4444; }
.cm-yellow { background:#eab308; color:#222222; }
.cm-purple { background:#9333ea; }
.cm-orange { background:#ea580c; }
.cm-pink { background:#ec4899; }
.cm-cyan { background:#06b6d4; }
.cm-lime { background:#65a30d; }
.cm-indigo { background:#4f46e5; }
.cm-teal { background:#0d9488; }
.cm-amber { background:#d97706; }


.draggable-container {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    touch-action: none; 
}


.draggable-container.selected {
    outline: none;
}


.ghost-container {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; 
}


.connected-squares {
    display: flex;
    transition: transform 0.3s ease;
}

.connected-square {
    width: var(--cell-size);
    height: var(--cell-size);
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background-color: #f0f0f0;
    position: relative;
}


.ghost-square {
    width: var(--cell-size);
    height: var(--cell-size);
    border: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background-color: #f0f0f0;
    opacity: 0.5;
}


.connected-square:first-child, .ghost-square:first-child {
    border-right: none;
}

.connected-square:last-child, .ghost-square:last-child {
    border-left: none;
}

.dragging {
    cursor: grabbing;
    opacity: 0.8;
}

.game-wrapper {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.side-panel {
    display: flex;
    flex-direction: column;
}

.side-top {
    position: relative;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fafafa;
    padding: 8px;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 20px;
}

.side-bottom {
    margin: 12px auto 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fffef6;
    padding: 10px 12px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    overflow: visible; 
    box-sizing: border-box;
    max-width: 980px; 
}

.rules-title {
    font-weight: bold;
    margin: 0 0 8px;
    color: #7c4a03;
}

.rule-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin: 6px 0; 
}

.rule-dot { 
    width: 14px; 
    height: 14px; 
    border-radius: 50%; 
    border: 2px solid #666; 
}

.dot-blue { background: #3b82f6; border-color: #1d4ed8; }
.dot-green { background: #22c55e; border-color: #16a34a; }
.dot-red { background: #ef4444; border-color: #b91c1c; }
.dot-yellow { background: #eab308; border-color: #ca8a04; }


@media (max-width: 768px) {
    :root { --cell-size: 36px; }
    .layout { 
        flex-direction: column; 
        align-items: center; 
    }
    .side-panel { 
        width: 100%; 
        max-width: 420px; 
        display: flex;
        justify-content: center; 
    }
    .side-top { 
        margin-top: 12px; 
    }
    .side-bottom { 
        width: 100%; 
        max-width: 100%; 
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav {
        justify-content: center;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .games-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-card {
        padding: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .constraint-types {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .access-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .security-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .privacy-section h2 {
        font-size: 1.5rem;
    }
    
    .highlight-box, .security-highlight {
        padding: 1rem;
    }
    
    .logo-image {
        width: 32px;
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    :root { --cell-size: 46px; }
}

@media (min-width: 1200px) {
    :root { --cell-size: 60px; }
}
