<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background_color"
    tools:context=".MainActivity">

    <LinearLayout
        android:id="@+id/northPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginTop="32dp"
        android:padding="@dimen/padding_general"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/margin_between_elements"
            android:layout_weight="1">

            <TextView
                android:id="@+id/gameLabel"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:background="@color/game_label_background"
                android:fontFamily="sans-serif-medium"
                android:gravity="center"
                android:padding="@dimen/padding_general"
                android:text="@string/name_2048"
                android:textColor="@color/white"
                android:textSize="@dimen/text_size_game_label"
                android:textStyle="bold"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintDimensionRatio="1:1"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="@+id/gameLabel">

            <TextView
                android:id="@+id/scoreLabel"
                style="@style/ScoreLabelStyle"
                android:text="@string/score_placeholder" />

            <TextView
                android:id="@+id/highScoreLabel"
                style="@style/ScoreLabelStyle"
                android:layout_marginTop="@dimen/margin_between_elements"
                android:text="@string/high_score_placeholder" />

        </LinearLayout>

    </LinearLayout>

    <androidx.cardview.widget.CardView
        android:id="@+id/gameBoardContainer"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_margin="@dimen/padding_general"
        app:cardBackgroundColor="@android:color/transparent"
        app:cardCornerRadius="@dimen/corner_radius"
        app:cardElevation="0dp"
        app:layout_constraintBottom_toTopOf="@+id/multiplayerButton"
        app:layout_constraintDimensionRatio="1:1"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/northPanel">

        <androidx.gridlayout.widget.GridLayout
            android:id="@+id/gameBoard"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/game_board_background"
            android:padding="@dimen/padding_game_board"
            app:columnCount="4"
            app:rowCount="4" />

    </androidx.cardview.widget.CardView>

    <Button
        android:id="@+id/multiplayerButton"
        style="@style/LargeButtonStyle"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:text="@string/multiplayer"
        app:layout_constraintBottom_toTopOf="@+id/buttons_layout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/gameBoardContainer" />


    <include
        android:id="@+id/buttons_layout"
        layout="@layout/bottom_buttons_layout"
        android:layout_width="0dp"
        android:layout_marginBottom="32dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        />

    <ViewStub
        android:id="@+id/statsViewStub"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inflatedId="@+id/statistics_layout"
        android:layout="@layout/stats_layout" />

</androidx.constraintlayout.widget.ConstraintLayout>