* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
}

#root {
    width: 100%;
    min-height: 100vh;
    padding: 1rem;
    overflow: auto;
}

.container {
    max-width: 90rem;
    margin: 0 auto;
}

.header-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.info-text {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.tip-text {
    font-size: 0.75rem;
    color: #6b7280;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.25rem;
    color: #6b7280;
}

.game-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: inline-block;
    position: relative;
}

.hover-popup {
    position: fixed;
    top: 5rem;
    right: 2rem;
    background-color: #fef3c7;
    border: 4px solid #d97706;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 28rem;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hover-popup-header {
    font-weight: bold;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hover-popup-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: #111827;
}

.grid-container {
    display: grid;
    gap: 0;
    border: 2px solid #333;
}

.cell {
    position: relative;
    width: 45px;
    height: 45px;
    border: 1px solid #9ca3af;
}

.cell-black {
    background-color: #000;
}

.cell-white {
    background-color: #fff;
}

.cell-clue {
    background-color: #dbeafe;
}

.clue-box {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.125rem;
    transition: background-color 0.2s;
}

.clue-box:hover {
    background-color: #bfdbfe;
}

.clue-text {
    font-size: 5px;
    line-height: 6px;
    text-align: center;
    overflow: hidden;
    width: 100%;
}

.arrow-icon {
    position: absolute;
    bottom: 0.125rem;
    right: 0.125rem;
}

.arrow-right {
    width: 0;
    height: 0;
    border-left: 6px solid #2563eb;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.arrow-down {
    width: 0;
    height: 0;
    border-top: 6px solid #2563eb;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.letter-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: transparent;
    border: none;
    outline: none;
}

.letter-input:focus {
    background-color: #fef3c7;
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.letter-hint {
    background-color: #d1fae5;
    color: #065f46;
}

.letter-active-word {
    background-color: #fef3c7;
}

.letter-current {
    background-color: #fde68a;
}

.letter-wrong {
    background-color: #fecaca;
    color: #991b1b;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
}

.icon-refresh {
    animation: spin 1s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}