body {
    font-family: 'Poppins', sans-serif;
    /* Prevents scrolling and pull-to-refresh on mobile while dragging */
    touch-action: none; 
}

.grid-container {
    display: grid;
    grid-template-rows: repeat(10, 1fr);
    grid-template-columns: repeat(8, 1fr);
}
.tile {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #5a3a22; /* Dark brown text for contrast */
    background-color: #fdf5e6; /* Creamy tile color */
    border: 2px solid #d4bda5; /* Softer border color */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 -2px 2px rgba(0,0,0,0.1);
    cursor: grab;
    user-select: none;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, top 0.2s ease-out, left 0.2s ease-out;
}
.tile.dragging {
    cursor: grabbing;
    z-index: 1000;
    transform: scale(1.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: none; /* Disable transition while dragging for instant feedback */
}
.tile.focus-tile {
    background-color: #e9d5ff; /* Light purple for focus tile */
    border-color: #c084fc;
    color: #5b21b6;
}
.tile-example.focus-tile,
.tile-example-h.focus-tile,
.tile-example-v.focus-tile {
    background-color: #e9d5ff;
    border-color: #c084fc;
    color: #5b21b6;
}
.grid-bg {
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px);
}
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}
.modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 95%;
}
.score-popup {
    position: absolute;
    padding: 4px 12px;
    background-color: rgba(245, 158, 11, 0.9); /* Amber color for score popups */
    color: white;
    border-radius: 9999px;
    font-weight: 600;
    animation: float-up 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 1500;
}
@keyframes float-up {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}
/* Styles for instruction tile examples */
.tile-example, .tile-example-h, .tile-example-v {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-weight: 700;                 /* Match game tile */
    border: 2px solid #d4bda5;        /* Match game tile */
    border-radius: 8px;               /* Match game tile */
    background-color: #fdf5e6;        /* Match game tile */
    color: #5a3a22;                   /* Match game tile */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 -2px 2px rgba(0,0,0,0.1); /* Match game tile */
    flex-shrink: 0;
}

.tile-example, .tile-example-h {
    width: 100%;
    /* Adjusted vw for better scaling to mimic in-game look */
    font-size: clamp(16px, 5.5vw, 24px); 
}

.tile-example {
    aspect-ratio: 1 / 1;
}

.tile-example-h {
    height: 100%;
}

.tile-example-h span { flex: 1; text-align: center; }
.tile-example-v {
    width: 40px;
    height: 80px;
    font-size: 24px;
    flex-direction: column;
}
.tile-example-v span { flex: 1; display:flex; align-items:center; justify-content:center; }

/* Tab Styles */
.post-game-tab {
    padding: 0.5rem 1rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    color: #64748b; /* slate-500 */
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.post-game-tab:hover {
    color: #1e293b; /* slate-800 */
}
.post-game-tab.active {
    color: #0d9488; /* teal-600 */
    border-bottom-color: #0d9488;
}

#plexicon-header {
    /* Counteract the modal's padding to go edge-to-edge */
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: 1.5rem; /* Maintain vertical spacing */

    /* Add a small amount of padding to mimic the game grid's outer border */
    padding: 0.25rem;

    /* Keep original background styles */
    background-size: 40px 40px;
    background-position: -1px -1px;
}

.header-grid {
    gap: 2px; /* Use a smaller gap to match the in-game tiles */
}

@media (max-height: 720px) {
  #found-words-list.h-64 {
    height: 8rem; /* Equivalent to Tailwind's h-32 */
  }
}
